diff options
author | Michael Toguchi <michael.d.toguchi@intel.com> | 2025-01-06 08:52:46 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-06 11:52:46 -0500 |
commit | d00f65c6acd9f0e1ddae83391f55eb9d232d2f9e (patch) | |
tree | 6e00ecc91872af7e36d3ed3f2a480375ad812982 /clang/lib/Driver/Compilation.cpp | |
parent | 98b3191a340b03051281e1dc3655a7ffa9ab2311 (diff) | |
download | llvm-d00f65c6acd9f0e1ddae83391f55eb9d232d2f9e.zip llvm-d00f65c6acd9f0e1ddae83391f55eb9d232d2f9e.tar.gz llvm-d00f65c6acd9f0e1ddae83391f55eb9d232d2f9e.tar.bz2 |
[Driver][SYCL] Add initial SYCL offload compilation support (#117268)
Introduces the SYCL based toolchain and initial toolchain construction
when using the '-fsycl' option. This option will enable SYCL based
offloading, creating a SPIR-V based IR file packaged into the compiled
host object.
This includes early support for creating the host/device object using
the new offloading model. The device object is created using the
spir64-unknown-unknown target triple.
New/Updated Options:
-fsycl Enables SYCL offloading for host and device
-fsycl-device-only
Enables device only compilation for SYCL
-fsycl-host-only
Enables host only compilation for SYCL
RFC Reference:
https://discourse.llvm.org/t/rfc-sycl-driver-enhancements/74092
This is a reland of: https://github.com/llvm/llvm-project/pull/107493
Diffstat (limited to 'clang/lib/Driver/Compilation.cpp')
-rw-r--r-- | clang/lib/Driver/Compilation.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Driver/Compilation.cpp b/clang/lib/Driver/Compilation.cpp index 4d40805..a39952e 100644 --- a/clang/lib/Driver/Compilation.cpp +++ b/clang/lib/Driver/Compilation.cpp @@ -214,10 +214,11 @@ static bool ActionFailed(const Action *A, if (FailingCommands.empty()) return false; - // CUDA/HIP can have the same input source code compiled multiple times so do - // not compiled again if there are already failures. It is OK to abort the - // CUDA pipeline on errors. - if (A->isOffloading(Action::OFK_Cuda) || A->isOffloading(Action::OFK_HIP)) + // CUDA/HIP/SYCL can have the same input source code compiled multiple times + // so do not compile again if there are already failures. It is OK to abort + // the CUDA/HIP/SYCL pipeline on errors. + if (A->isOffloading(Action::OFK_Cuda) || A->isOffloading(Action::OFK_HIP) || + A->isOffloading(Action::OFK_SYCL)) return true; for (const auto &CI : FailingCommands) |