Can I compile OpenCL code for all current video cards?

I need to distribute my program that uses opencl code without opencl sources. Therefore, I need to compile it into a binary and boot program from binary. It’s simple, but each video card combines a binary file for itself. How can I avoid this, and compile my source code for different video cards, without these video cards. Maybe some kind of compiler exists, where can I install a special video card and get binary code for it? Thank!

+4
source share
2 answers

SPIR is for this http://www.khronos.org/registry/spir/

At least AMD cards support it. But you cannot use it as a whole right now.

Right now there is no other way than to provide the kernel in the form of the text of your program if you want to distribute it as a whole to consumers. I would not worry too much about the visible cores. Without calls and documentation of the OpenCL API, they are simply useless. It takes more time for someone to redesign them than to do the same from scratch. This is similar to OpenGL shaders in games, which are also in raw text format.

+4
source

SPIR is the solution

just to work around the next solution

, . .

0

Source: https://habr.com/ru/post/1533119/


All Articles