what CPU will be doing while GPU is on its assigned task by cpu


I have a doubt , please help me in understanding that, when cpu assigns tasks to gpu using opencl, gpu start working on that, what cpu will be doing? i mean in which state the cpu will be?

and how can i observe the performance difference while running some code using cpu and gpu.


The API is designed to be async – all of the clEnqueue calls are designed to return quickly. The OpenCL driver uses a separate thread to push work to the GPU. So once you’ve queued up work to the GPU your CPU code continues on its way. If you use a blocking flag (e.g., with clEnqueueReadBuffer) or a blocking API (e.g., clFinish) then the CPU thread blocks until the GPU is done.

You can observe what CPU and GPU are doing with tools like NVIDIA’s Nsight or AMD’s CodeXL.


I am running performance test for opencv with opencl, its taking more time to run on GPU than on CPU, can you tell me the reason why its behaving like that.

device name: odroid-xu
code version: opencv-4.2.9

Probably your GPU does not have big performance, maybe does not have many cores? What is your card and what is your GPU?


I am running the code on odroid-xu board with android platform, the GPU present on that board is PowerVR series5XT SGX544 MP3.

According this http://blog.imgtec.com/powervr/the-powervr-sgx544mp-a-modern-gpu-for-todays-leading-platforms your GPU has 16 cores which should be sufficient to reach good performance. Are you sure your program is designed in the fashion of parallel programming? I mean, are you sure your program uses all 16 cores effectively? Be sure to check this website/ to learn good programing in OpenCL