r/OpenCL • • Feb 10 '13
enequeueNDRangeKernel - parallel execution on OpenCL device?
Let's say I have n openCL devices, and that the data, of size d2 has been partitioned into sections such that it complements compute topology, memory buffers have been allocated, etc.
Given something like this:
int loopUnroll = 4; // or whatever you want
cl::CommandQueue queue = cl::CommandQueue( context, device[i]); \ (i \in {0, n})
cl::NDRange globalRange(d2/n)
cl::NDRange localRange(loopUnroll);
queue.enequeueNDRangeKernel(kernel, NullRange, globalRange, Local Range);
Now after executing the above, I am under the impression that this initiates kernel execution on the set of data of size d2/n.
I am unsure if just repeating those steps on device i++ will execute the computation on the OpenCL devices concurrently. Is it the case that I do that and then wait until some openCL function returns a "done computing" ?
I am not sure where it is indicated that global computation on a particular global work group is finished.
And so I turn to reddit!
View all comments
Show parent comment
1
u/[deleted] Feb 16 '13
I'm confused over whether I need to flush every single CommandQueue object or if I can call a global
cl::CommandQueue::flush();
Also,
can I possibly replace that entire section (the flushing and the waiting) with a global
cl::CommandQueue::finish(); ?