From 0b0d61101fa0648a09ebc1dc7a26ee9a89e91be8 Mon Sep 17 00:00:00 2001 From: Michael Toguchi Date: Fri, 15 Nov 2024 05:14:21 -0700 Subject: [Driver][SYCL] Add initial SYCL offload compilation support (#107493) 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 --- clang/lib/Driver/Compilation.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'clang/lib/Driver/Compilation.cpp') diff --git a/clang/lib/Driver/Compilation.cpp b/clang/lib/Driver/Compilation.cpp index ad077d5..5731549 100644 --- a/clang/lib/Driver/Compilation.cpp +++ b/clang/lib/Driver/Compilation.cpp @@ -217,10 +217,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) -- cgit v1.1