Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple Programs (vs. Kernels) in an OpenCL application

Tags:

opencl

One program can contain multiple kernels. Does it make any difference if I break my kernels across multiple programs? Can they all use the same context and run on the same devices and queues?

I'm playing around with OpenCL, and happen to be working in PyOpenCL. The structure is such that the command queue is owned by a class which compiles several kernels into a program. I am implementing a few subclasses that implement some kernels that I'll run on the base class' queue. Do I need to inject those kernels back into the base class and compile it into one program, or can I compile separate programs for each subclass that all rely on the context in the base class?

like image 646
Omegaman Avatar asked Nov 15 '25 10:11

Omegaman


1 Answers

An OpenCL context can have multiple programs associated with it, so you can split your kernels across several programs and everything will still work.

like image 79
jprice Avatar answered Nov 18 '25 01:11

jprice



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!