Peterp

brook::Stream::domain how to use?

Discussion created by Peterp on Apr 8, 2009
Latest reply on Apr 9, 2009 by gaurav.garg

Hi,

how do i use the domain function correct? I want to call the kernel for every first element in the rows. This is my kernel:

kernel void callKernel(float a[][], out float b[][])

{

int2 index = instance().xy;

b[index.y][index.x] = b[index.y][index.x];

 

}

And this the c++ code, i'm using s1.domain(int2(0,0),int2(0,MAX) to set the domain but in the end the values are not correct.

 

 

float *zahlen = new float[MAX*MAX];
 float *ausgabe = new float[MAX*MAX];
 for(int i=0;i  for(int j=0;j   zahlen[(i*MAX)+j] = 1.0f;

 unsigned int dim[] = { MAX, MAX };
 ::brook::Streams1(2,dim);
 s1.read(zahlen);
 ::brook::Streamsout(2,dim);
 sout.read(ausgabe);
 callKernel(s1.domain(int2(0,0),int2(0,MAX)),sout);
 sout.write(ausgabe);





Outcomes