CPU usage of runtime OpenCL

CPU usage of runtime OpenCL

christolb29's picture

Hello, I am wondering if the runtime OpenCL consumes a significant CPU time? I mean, I am using the HD4000 to free the CPU of some computation which represents only 1-2% of the CPU usage of my process. But in the end, the performance is worst. And I measure almost the same when I just call my setup_openCL() function and do not process this small computation at all. Does it mean there is some kind of treshold in term of computation, below which one it's not efficient to use the GPU with OpenCL? (Memory transfert is not the problem here). Is there any way to fix this? (Besides doing more computation on the GPU). Thank you, Chris.

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Jim Vaughn's picture

"Does it mean there is some kind of treshold in term of computation, below which one it's not efficient to use the GPU with OpenCL?" Yes but there is often much more you can do to get things to run faster such as, reorder and rework your code and/or algorithm. You also have to remember that the HD4000 isn't an amazing GPU and will be faster for some things and not faster for others. The same thing is true for descreate GPUs however they are much higher performing cards. Also you only want to setup opencl once and then run your kernel as many times as you need to. It is likely your setup is taking so long that you are not able to notice the execution of your kernel.

christolb29's picture
Thank you.

I make sure to setup OpenCL only once. I am aware that this GPU is not that powerful but it is not a problem, as all the computation I can run on it, instead of the CPU would be CPU timed gained. The idea is to demonstrate it with an example, but so far the result is worst ^^'. I will try to highlight this effect which is not insignificant for me, and transfert more computation on the GPU.

Login to leave a comment.