1 Reply Latest reply on Dec 16, 2008 4:06 AM by gaurav.garg

    is this a bug or bad coding on my behalf?

    dukeleto
        • is this a bug or bad coding on my behalf?
          gaurav.garg

          Hi dukeleto,

           

          Its a bug in compiler with double literal constants code generation. As a workaround you can fisrt declare double literals and use them later in an expression-

           

          kernel void sensor( double p_in[][], out double2 sigma<> )
          {

          double temp;
          int4 outpos = instance();
          int ipos = outpos.x ; // has slip in it
          int jpos = outpos.y ; // has slip in it

          double two = 2.0;
          double one = 1.0;

          temp = (-p_in[jpos+1][ipos] );
          temp = temp +
          two*p_in[jpos][ipos];



          sigma.x = temp;
          sigma.y = one - temp;
          }