Hi,
I tried to use gpu and cpu parallel.
I created two differente queues in two contexts:
queueCPU = cl::CommandQueue(Context, deviceCPU[0]);
queueGPU = cl::CommandQueue(Context, deviceGPU[0]);
I want to execute both queues parallel.
so I do:
queueCPU.enqueueNDRangeKernel(this->Kernel
and
queueGPU.enqueueNDRangeKernel(this->Kernel
and after enqueueing I want to read the data back to host:
queueCPU.enqueueReadBuffer(this->qBuffer
queueGPU.enqueueReadBuffer(this->qBuffer
If I do it that way, the queues don't run parallel. I think one queue is blocked, so the other can't enqueue, right?
and if I do this (non blocking):
queueCPU.enqueueReadBuffer(this->qBuffer
queueGPU.enqueueReadBuffer(this->qBuffer
they run parallel, but I don't get the right result.
How can I block the memory, and execute the queues parallel?
Sheeep
P.S. sorry for not posting complete code, but is in different classes, so I thinks it's to much. If needed I can make an simple example...
Take a look at SimpleMultiDevice sample where all combinations explained.
Thank you for your answer,
I'm not familar with the sdk-environment, but if i am right, i have to create some threads with an multithreading framework. like openmp?
I will try to use sdk-environment instead of khronos opencl binding.
EDIT:
I tried with openmp, works wonderfull (if i don't need any synchronization).
is there a multithreading extension in opencl for the host?