- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to run an OpenCL kernel on a node with multiple CPU and GPU devices. As part of the scheduling, I use an event callback to notify when a kernel has finished, and a new kernel should be sent to the device.
{
events[queue_num] = cl::Event();
error = queues_all_[queue_num]->enqueueNDRangeKernel(*(stereoMatchKernels_all_[queue_num]), cl::NDRange(0), cl::NDRange(global_sizes[queue_num]), cl::NDRange(wkgrp_sizes[queue_num]), NULL, events+queue_num);
events[queue_num].setCallback(CL_COMPLETE, &signal_complete, (void *)(available_devices + queue_num));
}
...
void CL_CALLBACK OpenCLPreparation::signal_complete(cl_event event, cl_int status, void* data)
{
/*Do something */
}
This works without a problem on the GPU devices, but the callback is only reached for a kernel sent to the CPU after a queue.finish() has been called. Until then, the CPU sits unused. This has been tested with both an i7 930, and dual Xeon 5600 under 64 bit Linux.
Is there some problem with either the event callbacks, or the command queues in the Intel OpenCL SDK?
{
events[queue_num] = cl::Event();
error = queues_all_[queue_num]->enqueueNDRangeKernel(*(stereoMatchKernels_all_[queue_num]), cl::NDRange(0), cl::NDRange(global_sizes[queue_num]), cl::NDRange(wkgrp_sizes[queue_num]), NULL, events+queue_num);
events[queue_num].setCallback(CL_COMPLETE, &signal_complete, (void *)(available_devices + queue_num));
}
...
void CL_CALLBACK OpenCLPreparation::signal_complete(cl_event event, cl_int status, void* data)
{
/*Do something */
}
This works without a problem on the GPU devices, but the callback is only reached for a kernel sent to the CPU after a queue.finish() has been called. Until then, the CPU sits unused. This has been tested with both an i7 930, and dual Xeon 5600 under 64 bit Linux.
Is there some problem with either the event callbacks, or the command queues in the Intel OpenCL SDK?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thank you for your feedback.
This behaviour is expected.
According to OpenCL spec. (5.13) you are expected to call clFlush() in order to insure command execution on a device.
Regards,
Evgeny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you. This has indeed solved the problem.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page