Is the funtion cl::Event.wait() busy waiting

I use an Intel Xeon E5 1620 v2 CPU and a Nvidia Tesla GPU as devices.
I use the “intel sdk for opencl 2016 ubuntu 6.0.0.1049” to use the CPU as OpenCL device and “cuda_7.5.18_linux” to use the GPU as OpenCL device.

The host program runs on the CPU.

I created an event and use it to check if the enqueueReadBuffer has finished.


cl::Event readResult;

_command_queue.enqueueReadBuffer( _DevBufOut, CL_FALSE,  0, CHUNK_SIZE_1 * sizeof( float ), _cDataOut,  NULL,  &readResult);

readResult.wait();

I would like to know if the function cl::Event.wait() uses busy waiting.

They most likely use an OS semaphor or a combination of both, but the spec does not specify this. You can achieve busy waiting using this:

while (clGetEventInfo(event, CL_EVENT_COMMAND_EXECUTION_STATUS != CL_COMPLETE)
{;}
clWait(event);//Enforce synchronization point