Thursday 15 September 2011

c - opencl iterating over array in kernel -


I have a difficult problem to solve. I have two arrays, each one has a fixed size for a kernel call and a regular 3D grid map for the 1D array. This array contains values ​​of X, Y, Z coordinates and those points in the second array for calling MeshData, which are not alliances with the Mashadata array. This point allows to call data.

Now I need to run on Meshadata array using OpenCL and I pass the number of points stored in the poinadata array along with both arrays in the kernel. Inside the kernel, without any problem, I calculate the current element in Meshadata X, Y, Z and then using those coordinates, I am using loops to find all the points in poinadata array. I have a statement inside the loop for

  (L = 0; L  = dotdata [l * Index offset + 1] & amp; amp; z1Cell & lt; = point data [L * index offset + 2] and z2Cell> = dotdata [l * indexOffset + 2]) {}}   

The problem is that if I assume the hardcode for x1cell, X2Cell and so on the code if the statement gets inside, but if i have x1cell Using the calculated values ​​for the hereby situation is never less than y1cell.

I have a fully functional non-OpenCL, so I know that it works, what is something in OpenCL which I have been missed in above?

The problem described above did not exist if-statement, but in the 1D array X, Y and J Rotate a square of code that calculates the offset so that I can relate it to the original 3D coordinates. It pays to check your variable count completely!

I had to calculate x, y and z from get_global_id () to measure and I simply stuffed the conditions to check and received those offsets that were not actually existed and hence The above mentioned statement can never be true!

No comments:

Post a Comment