OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1719 Discussions

Compatibility between Windows and Linux OpenCL kernel binaries?

allanmac1
Beginner
432 Views

I'm curious if the Linux kernel binaries can be loaded by the Windows runtime?

I only ask because the feature set of the Linux OpenCL 2.0 driver appears to be ahead of the latest Windows driver.

I understand that SPIR and other portable IR's would likely be cross-platform compatible but I'm entirely focused on using the Intel OpenCL extensions that aren't (yet?) expressible in non-native IRs.

Also, I think I've asked before, but how would you suggest I build binary kernels for multiple target architectures?  It would be _very_ cool to have the ability to download one "IOC" compiler and a number of architectural backends and batch build multiple targets on one workstation.

I'm more concerned about having end-users possibly having to wait for a long compile to complete (for a large OpenCL project) than I am about shipping kernel sources.  

Here are the Intel OpenCL Driver for Linux extensions:

intel_ocl_2.0_linux.png

0 Kudos
1 Reply
Jeffrey_M_Intel1
Employee
432 Views

For standard OpenCL and Khronos extensions SPIR and SPIR-V are excellent solutions for portable intermediate representations.  However, for now at least, our binary IR is probably the best option when using Intel-specific extensions.  We try hard not to introduce barriers to portability across OS for the IR, but for reasons like you've indicated full portability can't be guaranteed for all cases.  

While adding cross-compiling capabilities is an excellent idea, with what we have today this could be an approach:

  1. Compile to IR and test in all the environments you want to target (there is a good chance it will work, but we can't promise.)
  2. If there is a compatibility problem, try running an IR binary compiled in that environment.  If multiple IRs are needed choose which one to load at runtime based on system queries.

However, if the reason for the incompatibility is that an extension isn't available for your target OS there is a good chance you will need different kernel and/or host code for that path too.

Please watch for more information and improvement on this topic as SPIR-V evolves. This will be a better answer for portable future proofed IR.

0 Kudos
Reply