jean-claude

minor bug reported in Brook compiler

Discussion created by jean-claude on Sep 18, 2008
Latest reply on Sep 18, 2008 by MicahVillmow

Hi,

I would like to point out a minor bug in Brook Compiler related to
brace parsing.
Apparently the parsing of a = {b,c} is not performed correctly.

As an example, have a look at :


kernel void test (out float oo<>, float3 ii[][])
{
 const float2 si = indexof(oo); // position dans l'image
 float val = 0.0f;

 float2 index; // declared ahead of use
 float i,j;
 for (i=-1.0f;i<1.0f;i++) {
  for (j=-1.0f;j<1.0f;j++) {
   index = {i, j};  // Brook compiler doesn't like this !!!
   val += ii[si+index];
  }
 }
 oo = val;
}


kernel void test (out float oo<>, float3 ii[][])
{
 const float2 si = indexof(oo); // position dans l'image
 float val = 0.0f;

 float i,j;
 for (i=-1.0f;i<1.0f;i++) {
  for (j=-1.0f;j<1.0f;j++) {
   float2 index = {i, j}; // Brook compiler is fine
   val += ii[si+index];
  }
 }
 oo = val;
}


Jean-Claude

Outcomes