I am wondering that whether nvidia supports spir backend or not? if yes, i couldn\'t find any document and sample example about that. but if not, is there a any way to work
Since SPIR builds on top of OpenCL version 1.2, and so far Nvidia has not made any OpenCL 1.2 drivers available, it is not possible to use SPIR with Nvidia GPUs. As mentioned in the comments, Nvidia has made PTX available as intermediate language (also based on LLVM IR). One could consider translating SPIR into PTX but I don't know how realistic that would be.
Other vendors such as AMD and Intel are already showing support for SPIR. This can be verified by querying the CL_DEVICE_EXTENSIONS
with the clGetDeviceInfo
OpenCL API. If the result string contains cl_khr_spir
, the driver supports SPIR.