Peterp

Read and write into output scatter stream allowed?

Discussion created by Peterp on Apr 6, 2009
Latest reply on Apr 10, 2009 by arros123

Hi,

i've the following code thet does work but is it ok to read from the outputstream ?

 

kernel void interlinkNet(int array_width, int array_heigth, float fuLat, 

 out float b[][])

{

int2 index = instance().xy;

int i = 0;

if(index.x==0)

{

for(i=0;i<array_width-1;i++)

{

float point1 = b[index.y];

float point2 = b[index.y][i+1];

float fr = fuLat * (point2-point1);

b[index.y] = point1+fr;

b[index.y][i+1] = point2-fr;

}

}

}

Outcomes