About OpenCL portability

Hello all!

I’m interested in developing an application to be run on several machines. I’d like to be able to ship just the executable and the opencl driver. The thing is, can this be done? I have no idea how opencl compiles and/or uses other C/G++ compilers…

One other thing, is that I want to generate the kernel at runtime in order for it to be modified for different scenarios. Again, is this possible while just shipping the application executable?

Yes this is possible and is the entire point of OpenCL. Basically OpenCL allows you to query the different devices in your machine whether it’s an x86 cpu, Nvidia GPU, ATI GPU, IBM Cell Processor etc. Once you have these queries written you can have different kernels for different architectures. Also because OpenCL kernels are compiled on the fly and our basically just strings, you can put together a dynamic kernel for different scenarios by concatenating strings together. Hopefully this answers your question.

  • Eddie