-
Notifications
You must be signed in to change notification settings - Fork 802
[SYCL][CUDA] Initial CUDA backend support #1091
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
Changes from 6 commits
12f4abe
979b448
b937adf
4f2e019
b63f78a
fc60859
17c8ccf
680f890
5e71823
b01ff28
abee4f9
cfd1266
61a206b
c2168af
c7e2846
23b179e
52736fd
62afe84
5f5e017
54678ab
fb4521e
ab9f4be
cdab838
5b1ff35
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -80,6 +80,9 @@ | |||||
| #cmakedefine01 CLANG_ENABLE_OBJC_REWRITER | ||||||
| #cmakedefine01 CLANG_ENABLE_STATIC_ANALYZER | ||||||
|
|
||||||
| /* Define if we have SYCL PI CUDA support */ | ||||||
| #cmakedefine SYCL_HAVE_PI_CUDA ${SYCL_HAVE_PI_CUDA} | ||||||
|
||||||
| #cmakedefine SYCL_HAVE_PI_CUDA ${SYCL_HAVE_PI_CUDA} | |
| #cmakedefine01 SYCL_HAVE_PI_CUDA |
According to the docs it should do the same
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.
Do we really need this define? Can we have "SYCL PI CUDA support" unconditionally?
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.
If we were to have PI CUDA support unconditionally the cuda toolchain will always be required for compilation. We decided to make it optional to allow people who only use the OpenCL plugin to compile the project without a cuda toolchain on their system.
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.
If we were to have PI CUDA support unconditionally the cuda toolchain will always be required for compilation. We decided to make it optional to allow people who only use the OpenCL plugin to compile the project without a cuda toolchain on their system.
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.
According to my understanding we need CUDA toolchain to build CUDA plugin only.
Could you clarify why we should require CUDA toolchain to build the driver?
https://llvm.org/docs/CompileCudaWithLLVM.html - doesn't seem to require some custom driver.
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.
You are correct, we only need CUDA toolchain for building of the plugin, but we limit the valid SYCL triples in the clang driver based if PI CUDA support is available or not.
static bool isValidSYCLTriple(llvm::Triple T) {
#ifdef SYCL_HAVE_PI_CUDA
// NVPTX is valid for SYCL.
if (T.isNVPTX())
return true;
#endif
// Check for invalid SYCL device triple values.
// Non-SPIR arch.
if (!T.isSPIR())
return false;
// SPIR arch, but has invalid SubArch for AOT.
StringRef A(T.getArchName());
if (T.getSubArch() == llvm::Triple::NoSubArch &&
((T.getArch() == llvm::Triple::spir && !A.equals("spir")) ||
(T.getArch() == llvm::Triple::spir64 && !A.equals("spir64"))))
return false;
return true;
}We can remove this limitation though and always allow nvptx triples for compilation, regardless of it the CUDA plugin is available.
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.
+1 for removing.
Uh oh!
There was an error while loading. Please reload this page.