Forum Discussion
Altera_Forum
Honored Contributor
8 years agoCL_FLUSH is acting as Blocking call.
Hi All, I'm using non-blocking data transfer in my program to transfer 4K resolution(3840x2160) frame data. If clEnqueueWriteBuffer is blocking(CL_TRUE), it is consuming close to 3.5 millise...
Altera_Forum
Honored Contributor
8 years agoclFlush() blocks the host until all commands in the queue are issued (but not necessarily finished). Since you are issuing both the clEnqueueWriteBuffer command and the clEnqueueTask command into the same queue, and hence, the clEnqueueTask command CANNOT be issued before clEnqueueWriteBuffer has been COMPLETED, clFlush() effectively blocks the host until clEnqueueWriteBuffer has completed and clEnqueueTask has been issued which will take at least as much time as the blocking clEnqueueWriteBuffer call.
What are you trying to achieve by using a non-blocking clEnqueueWriteBuffer call? The kernel will never start before this call has finished anyway.