I have a bit of a difficult problem to solve. I have two arrays, one is a fixed size for every kernel call and is a regular 3D grid mapped to a 1D array. lets call this array meshData the second array holds x,y,z coordinates and values of those points, which are not aligned with the meshData array. lets call this pointData.
now I need run over the meshData array using OpenCL and I pass both arrays to the kernel as well as the number of points stored in the pointData array. inside the kernel I have calculate the x,y,z coordinates of the current element in the meshData without any issues and then I use those coordinates to find all points in the pointData array by using a for loop. inside the for loop I have an if-statement saying that
for (l = 0; l < points; l++) {
if(x1Cell <=pointdata[l*indexOffset] && x2Cell >= pointData[l*indexOffset &&
y1Cell <=pointdata[l*indexOffset + 1] && y2Cell >=pointdata[l*indexOffset + 1] &&
z1Cell <=pointdata[l*indexOffset + 2] && z2Cell >=pointdata[l*indexOffset + 2]){
}
}
the problem is that if I hardcode values for x1Cell, x2Cell and so on then the code gets inside the if statement, but if I use calculated values for x1Cell etc then the condition never gets past y1Cell.
i have the entire code fully functional as non-OpenCL, so I know it works. Is there something in OpenCL that I have missed in the above?