-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL][CUDA] Add a CUDA compatibilty mode #12757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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__. Signed-off-by: Victor Lomuller <[email protected]>
Users may call CUDA kernels in a SYCL program. Is that right ? Thanks |
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 |
Okay. Would the compiler allow a SYCL program to mix CUDA and SYCL APIs ? Some CUDA APIs have no SYCL equivalents. |
When both SYCL and CUDA are enabled, we need to favor SYCL checks in order to avoid false positive. Signed-off-by: Victor Lomuller <[email protected]>
This pull request is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be automatically closed in 30 days. |
This pull request was closed because it has been stalled for 30 days with no activity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completed code review. I haven't looked at the last few tests that exercise overload resolution. I'll look at those early tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've completed review. Just waiting to resolve open comments before approving.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thank you for sticking with me through all the comments and helping me to understand the changes!
@mdtoguchi more comment or is it good for you ? @elizabethandrews @premanandrao Can you approve ? Tom doesn't have the actual power yet :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@intel/llvm-gatekeepers this is ready to be merged, Jenkins jobs failure is unrelated to the patch (it can't create a node ...) |
This patch enables CUDA mode at the same time as the SYCL mode. This allows SYCL code to interact with CUDA code more closely:
__CUDA_ARCH__
, enabling functions to assume NVPTX is the targetTo 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 functionalities, especially fast paths that are guarded by
__CUDA_ARCH__
.