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

Using CPU OpenCL backend without OpenCL runtime in SYCL programs

blinkfrog
New Contributor I
1,091 Views

Hello,

I have a question regarding the use of the CPU OpenCL backend in SYCL programs and whether it's possible to eliminate the requirement for the OpenCL runtime when running the program.

My understanding is that by compiling a SYCL program with AOT (Ahead-of-Time) compilation of kernels, it should not require the presence of the OpenCL runtime, as the device code is already compiled. However, I've encountered an issue where even after specifying the compilation option `/fsycl-targets=spir64_x86_64`, my program still appears to require the OpenCL runtime.

Is there a specific configuration or approach I should follow to ensure that my SYCL program, when using the CPU OpenCL backend, does not rely on the OpenCL runtime during execution? Any insights or guidance would be greatly appreciated.

Thank you in advance for your assistance.

0 Kudos
1 Solution
cw_intel
Moderator
1,027 Views

Hi,

OpenCL CPU RT is still required when executing your code.


​Using AOT compilation can avoid the overhead of JIT compilation at runtime. With AOT compilation, the binary will contain the actual assembly code of the platform that was selected at compile time instead of the SPIR-V intermediate code. The advantage is that we do not need to JIT compile the code from SPIR-V to assembly during execution, which makes the code run faster. The disadvantage is that the code cannot run anywhere other than the platform for which it was compiled.


Thanks.


View solution in original post

0 Kudos
3 Replies
cw_intel
Moderator
1,028 Views

Hi,

OpenCL CPU RT is still required when executing your code.


​Using AOT compilation can avoid the overhead of JIT compilation at runtime. With AOT compilation, the binary will contain the actual assembly code of the platform that was selected at compile time instead of the SPIR-V intermediate code. The advantage is that we do not need to JIT compile the code from SPIR-V to assembly during execution, which makes the code run faster. The disadvantage is that the code cannot run anywhere other than the platform for which it was compiled.


Thanks.


0 Kudos
blinkfrog
New Contributor I
1,011 Views

Thank you for your answer. I am accepting it as a solution.

Still, it is sad that there is no possibility to AOT-compile all the SYCL-device code for required targets so the application would not require that huge OpenCL for CPU runtime. This would greatly helped easier deploy the application on another computers. Usually the set of target architectures is well-known, so there is nothing bad to compile the code only for these targets and to not support others.

 

0 Kudos
cw_intel
Moderator
1,000 Views

Hi,


Thanks for accepting our solution. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Thanks.


0 Kudos
Reply