OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1663 Discussions

Asynchronous kernel launch

Ehsan_Totoni
Beginner
135 Views

Hi,

We need to use both the CPU and GPU of our Ivy Bridge processor at the same time. However, in Intel OpenCL SDK, the kernel launch call is not asynchronous. In other words, clEnqueueNDRangeKernel waits for the GPU execution to be completed, which is against the OpenCL standard. We have tried the latest Intel OpenCL SDKs (2012 and 2013). Is there a workaround?

Best regards,

-Ehsan

0 Kudos
3 Replies
Yuri_K_Intel
Employee
135 Views
Hi, Could you please provide a minimal code that reproduces this behavior? Thanks, Yuri
Ehsan_Totoni
Beginner
135 Views

Hi,

It is easy to see for any code. For instance, if you comment out clFinish call after the kernel launch in one of the Intel opencl samples (e.g. BitonicSort.cpp:286), the timer shows the same time and the results are still correct. This means that the kernel launch had not been asynchronous.

Bests,

-Ehsan

Ehsan_Totoni
Beginner
135 Views

I think I found the problem of my code. The NDRange kernel launch was inside a loop so the runtime had to flush the queue eventually. I need to reorganize the code. Sorry for taking your time.

-Ehsan

Reply