cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

dukeleto
Adept I

is this a bug or bad coding on my behalf?

0 Likes
1 Reply
gaurav_garg
Adept I

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;
}

0 Likes