llvm icon indicating copy to clipboard operation
llvm copied to clipboard

[SYCL] Add a CUDA compatibilty mode

Open Naghasan opened this issue 1 year ago • 3 comments

This patch enables CUDA mode at the same time as the SYCL mode. This allows the compiler to define CUDA macros and add implicit defines.

To enable the mode the user adds -fsycl-cuda-compat to the command line. By default this mode is set to off. The flag is only used for the NVPTX backend.

The intent is to help to transition from CUDA to SYCL. Using this mode enable a SYCL application to reuse CUDA functionnalities, especially fast paths that are guarded by CUDA_ARCH.

Naghasan avatar Feb 19 '24 11:02 Naghasan

Users may call CUDA kernels in a SYCL program. Is that right ? Thanks

jinz2014 avatar Feb 19 '24 21:02 jinz2014

Part of the idea is to allow user to call CUDA device functions from a SYCL kernel. The underlying motivation is actually to have a mode that would support the definition of __CUDA_ARCH__.

Naghasan avatar Feb 19 '24 21:02 Naghasan

Okay. Would the compiler allow a SYCL program to mix CUDA and SYCL APIs ? Some CUDA APIs have no SYCL equivalents.

jinz2014 avatar Feb 20 '24 01:02 jinz2014