cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Steven_Makoviac
Journeyman III

Unable to parse Kernel

Hi,

i'm trying to compile this kernel but i get the error: Error (syntax error) before 'int' int i = index.y+1;

kernel void funk(int array_heigth, float fu, float a[][], out float b[][])
{
 int2 index = instance().xy;

 if(index.x!=9)
 {
      float point1 = a[index.y][index.x];
     float point2 = a[index.y][index.x+1];
     float fr = fu * (point2-point1);
     b[index.y][index.x] = point1+fr;
     b[index.y][index.x+1] = point1-fr;
    }
 int i = index.y+1;
 float pCoor;
 if(index.y==array_heigth)
 {
  i=0;
  pCoor = 2.1f*3.1457f;
 }
  



0 Likes
2 Replies
gaurav_garg
Adept I

Brook+ is derived from C, i.e. your kernel has to be C compilant. You need to declare all variables at top.

0 Likes

thx, i forgot that.

0 Likes