View Full Version : Store programs or kernels?

01-29-2013, 04:04 AM
Hi gals/guys,

I've an application where I basically apply some image processing algorithms on each image of the database. So far, I compile the OpenCL programs when I start the application and store them in some cl_program instance variables. When I consider a new image, I create the kernels, set the parameters, enqueue the kernel, etc. I was thinking that maybe it would be more efficient to store the kernels instead of the program? What do you think?


01-29-2013, 06:20 AM
Yes, you should re-use your kernel instead of re-creating it all the time. It's hard to tell what goes on behind the scenes when one creates a new kernel (maybe most structures are cached, maybe not), so better use only one instance.

01-29-2013, 06:49 AM
I'm going to follow your advice.
Thank you!