Forum Discussion
Altera_Forum
Honored Contributor
9 years agoUnexplained performance difference for same kernels
I have develop two identical kernels, with a single difference where the size of the for loop in one of them is higher than the other. Here are my two kernels, Kernel# 1 and Kernel# 2. First Ke...
Altera_Forum
Honored Contributor
9 years agoHere is the part of the code where deploys the opencl kernel onto the device:
Event evKernel (alg.name);
err = clEnqueueNDRangeKernel (queue, kernel, 1, NULL,
globalWorkSize, localWorkSize,
0, NULL, &evKernel.CLEvent());
CL_CHECK_ERROR (err);
err = clWaitForEvents (1, &evKernel.CLEvent());
CL_CHECK_ERROR (err); I feel like I already wait for the kernel to finish. So, do I still need clFlush and clFinish? BTW, I have fixed the issue you have mentioned earlier, and I've seen the effect on the GPU at least. The performance has dropped which seems to be reasonable. I will go on and try them on the FPGA too and see how it'll behave.