Nvidia-drivers apparently does not support clCreateProgramWithIL from the OpenCL-API.
This leaves me searching for other solutions to compiling my C++ for OpenCL kernels, which are compiled to LLVM-IR and transpiled to SPIR-V with the following clang-command:

clang -c -target spirv64 -cl-std=clc++2021 kernel.clcpp -o kernel.spv

I’m not restriced to SPIR-V, but I really do want to use C++ for OpenCL.
Does CUDA provide any way of compiling any of the intermediate representations (kernel.spv or kernel.bc/.ll) into a loadable format supported by the Nvidia OpenCL-drivers?

No. CUDA and OpenCL are largely separate entities as far as tools provided by NVIDIA. There is no overlap, not even in binary formats.

Then I assume that the only option is to change the loading interface in the host code.
By instead compiling C++ for OpenCL-kernels to LLVM-IR, would CUDA NVVM be able to compile it to an executable format?

I’m not going to be able to give you a recipe.

1 Like