Altera_Forum
Honored Contributor
7 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 millisec and if make it as non-blocking(CL_FALSE), it is just taking neglible(~104 micro seconds) time. But the time of CL_FLUSH is increasing from 4 micro seconds to 3.3 milli seconds. Below is the snippet of my code: err = clEnqueueWriteBuffer(commandQueue[0], srcBuffer, CL_FALSE, 0, 3840 * 2160 , inputBuffer, 0, NULL, NULL); if (CL_SUCCESS != err) { printf("Error in clEnqueueWriteBuffer srcBuffer %d\n", err); exit(-1); } /* setKernelArg */ ... err = clEnqueueTask(commandQueue[0], kernel, 0, NULL, &kernel_event[0]); if (CL_SUCCESS != err) { printf("Error in clEnqueueTask kernel %d\n\n", err); exit(-1); } clFlush(commandQueue[0]); I am not able to understabd why CL_FLUSH is blocking for 3.5 millisec. Thanks in advance