clEnqueueWriteBuffer is blocking, even with blocking_write set to CL_FALSE?


#1

In my Windows c++ application, I am executing the following lines of code:


clEnqueueWriteBuffer(OpenCLMaster::commandQueues[0], constraintsBuffer, CL_FALSE, 0, constraintsSize, &constraintsArr[0], 0, NULL, NULL);

constraintsArr is a float8 array with approximately 1 million values. Even though blocking_write is set to CL_FALSE, the call to “clEnqueueWriteBuffer” takes approximately 11ms to complete.

If I change blocking_write to CL_TRUE, the call still takes 11ms to complete. It seems that the value I’m passing to blocking_write is being ignored. Is blocking_write a platform-specific argument? Why is the function call not returning immediately?


#2

With CL_TRUE it must block; with CL_FALSE it is allowed to not block. But it might still block. It depends on your platform and device, which you did not mention.