Forum Discussion
Altera_Forum
Honored Contributor
7 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.