__kernel void testing(
__global double4* dstA, // host set as CL_MEM_WRITE_ONLY
__global double4* dstB, // host set as CL_MEM_WRITE_ONLY
__global const double4* rnd, // host set as CL_MEM_READ_ONLY
int iNumElements,
double angleInRad
)
{
int iGID = get_global_id(0);
if (iGID >= iNumElements){
return;
}
double4 rnd = rnd[iGID];
//double4 org = (double4)(0,0,0,0); // this works
double4 org = (double4)(sin(angleInRad), 0,0,0); // this doesn't work
//double4 org = (double4)(sqrt(angleInRad), 0,0,0); // but this work
dstA[iGID] = org;
dstB[iGID] = rnd;
}
If I enable this line and rem out the line after...
double4 org = (double4)(0,0,0,0);
//double4 org = (double4)(sin(angleInRad), 0,0,0);
the kernel return the original array of random mnumbers. But if I do the inverse, the array returned is all zero!!??
Any ideas as to what I'm doing wrong because I can't see how the sin() function (which works) is causing everything to be zero!














