c++ - OpenCL get_global_id probably return -
i have suspiciton of multiple calls of opencl kernel same get_global_id(0)
return value.
calling host:
err = commandqueue.enqueuendrangekernel(my_kernel, cl::nullrange, cl::ndrange(1024), cl::ndrange(256), null, null);
and kernel:
typedef struct { float x, y; } point3; __kernel void update_position ( __global point3* pts, __global point3* speed, const unsigned int count, const float t) { unsigned long = get_global_id(0); if (i < count) { pts[i].x += speed[i].x * t; pts[i].y += speed[i].y * t; } }
what want update every item of 1024 pts
once , once. problem running program multiple times various non-valid results. guess get_global_id(0)
not return unique number between 0 , 1023 (inclusive) body of kernel executed more once.
unfortunatelly official web api of khronos being down , haven't found suitable answer/solution.
should use other function determine core/thread code runs on? or ndrange
s called wrong?
thanks :)
Comments
Post a Comment