Does DPC++ expose driver level api? #8936
Replies: 2 comments
-
Hi @horrorChen, thanks for the question. So the SYCL API doesn't map specifically to the CUDA runtime or driver APIs, it can be implemented on top of either, for example hipSYCL uses the runtime API whereas DPC++ uses the driver API. Saying that you are correct there is not a direct mapping for the Another option could be CUDA backend interoperability, where you could retrieve a If what you're looking to do is call a CUDA function in a different translation unit from a SYCL kernel, this is possible in DPC++ with the CUDA backend. The way to do this is mark the I hope this help. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply @AerialMantis! Actually, the key code I want to substitute is below: string module_file = path + "/" + kernel_name + ".cubin";
CUDA_DRIVER_CALL(cuModuleLoad(&module, module_file.c_str()));
CUDA_DRIVER_CALL(cuModuleGetFunction(&function, module, kernel_name.c_str()));
return function; In this case, the first and third method you mentioned might not work in my program, since a I will pay attention to the progress of CUDA backend interoperability, and I am glad to find any else methods to resolve the question. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Hello, I am trying to migrate a program from cuda to sycl, while it takes advantage of some cuda driver apis like
cuModuleGetFunction
. It seems that sycl only exposes runtime level api and I wonder if sycl provides similar api to read afunction
object from a external file.I have tried Dynamic linking of device code, but the feature only works on intel devices. Also, the feature provides the ability to call a external function rather than read a
function
object.I also tried to use internal function of
kernel
andkernel_bundle
classes in DPC++. There does exist aget
function which returns a OpenCL kernel handle, but it calls for the definition of__SYCL_INTERNAL_API
macro. If I want to use it, I need to simulate my program as intraware of DPC++ and it might cause other problem.Thanks.
Beta Was this translation helpful? Give feedback.
All reactions