From 7db8df5d186d2beea0dfe89b1188721d4f21dd76 Mon Sep 17 00:00:00 2001 From: Yixing Zhang Date: Thu, 20 Nov 2025 13:34:27 -0800 Subject: [PATCH 1/6] enable image compression test for new offload model --- clang/include/clang/Driver/Driver.h | 7 ++ clang/lib/Driver/Driver.cpp | 37 ++++++-- clang/lib/Driver/ToolChains/Clang.cpp | 4 +- .../compression_separate_compile.cpp | 4 +- .../NewOffloadDriver/image_compression.cpp | 84 +++++++++++++++++++ 5 files changed, 128 insertions(+), 8 deletions(-) create mode 100644 sycl/test-e2e/NewOffloadDriver/image_compression.cpp diff --git a/clang/include/clang/Driver/Driver.h b/clang/include/clang/Driver/Driver.h index 3dd8822c4844b..126f127de8674 100644 --- a/clang/include/clang/Driver/Driver.h +++ b/clang/include/clang/Driver/Driver.h @@ -626,6 +626,13 @@ class Driver { /// @name Helper Methods /// @{ + /// Utility function to parse all devices passed via -fsycl-targets. + /// Return 'true' for JIT, AOT Intel CPU/GPUs and NVidia/AMD targets. + /// Otherwise return 'false'. + bool + GetUseNewOffloadDriverForSYCLOffload(Compilation &C, + const llvm::opt::ArgList &Args) const; + /// getSYCLDeviceTriple - Returns the SYCL device triple for the /// specified subarch // TODO: Additional Arg input parameter is for diagnostic output information diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 475c1fddb0363..fe302e7b05fe7 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -1565,6 +1565,32 @@ static void appendOneArg(InputArgList &Args, const Arg *Opt) { } } +// Utility function to parse all devices passed via -fsycl-targets. +// Return 'true' for JIT, AOT Intel CPU/GPUs and NVidia/AMD targets. +// Otherwise return 'false'. +bool Driver::GetUseNewOffloadDriverForSYCLOffload(Compilation &C, + const ArgList &Args) const { + // Check only if enabled with -fsycl + if (!Args.hasFlag(options::OPT_fsycl, options::OPT_fno_sycl, false)) + return false; + + if (Args.hasFlag(options::OPT_no_offload_new_driver, + options::OPT_offload_new_driver, false)) + return false; + + if (Args.hasArg(options::OPT_fintelfpga)) + return false; + + if (const Arg *A = Args.getLastArg(options::OPT_fsycl_targets_EQ)) { + for (const char *Val : A->getValues()) { + llvm::Triple TT(C.getDriver().getSYCLDeviceTriple(Val)); + if ((!TT.isSPIROrSPIRV()) || TT.isSPIRAOT()) + return false; + } + } + return true; +} + bool Driver::readConfigFile(StringRef FileName, llvm::cl::ExpansionContext &ExpCtx) { // Try opening the given file. @@ -2195,12 +2221,12 @@ Compilation *Driver::BuildCompilation(ArrayRef ArgList) { // Use new offloading path for OpenMP. This is disabled as the SYCL // offloading path is not properly setup to use the updated device linking // scheme. - if ((C->isOffloadingHostKind(Action::OFK_OpenMP) && - TranslatedArgs->hasFlag(options::OPT_fopenmp_new_driver, - options::OPT_no_offload_new_driver, true)) || + if (C->isOffloadingHostKind(Action::OFK_OpenMP) || TranslatedArgs->hasFlag(options::OPT_offload_new_driver, - options::OPT_no_offload_new_driver, false)) + options::OPT_no_offload_new_driver, false) || + GetUseNewOffloadDriverForSYCLOffload(*C, *TranslatedArgs)) { setUseNewOffloadingDriver(); + } // Construct the list of abstract actions to perform for this compilation. On // MachO targets this uses the driver-driver and universal actions. @@ -7095,7 +7121,8 @@ void Driver::BuildDefaultActions(Compilation &C, DerivedArgList &Args, options::OPT_fno_offload_via_llvm, false) || Args.hasFlag(options::OPT_offload_new_driver, options::OPT_no_offload_new_driver, - C.isOffloadingHostKind(Action::OFK_Cuda)); + C.isOffloadingHostKind(Action::OFK_Cuda)) || + GetUseNewOffloadDriverForSYCLOffload(C, Args); bool HIPNoRDC = C.isOffloadingHostKind(Action::OFK_HIP) && diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index 92d8139822489..ee70693217a62 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -5232,7 +5232,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, (JA.isHostOffloading(C.getActiveOffloadKinds()) && Args.hasFlag(options::OPT_offload_new_driver, options::OPT_no_offload_new_driver, - C.isOffloadingHostKind(Action::OFK_Cuda))); + C.isOffloadingHostKind(Action::OFK_Cuda))) || + (JA.isHostOffloading(Action::OFK_SYCL) && + C.getDriver().GetUseNewOffloadDriverForSYCLOffload(C, Args)); bool IsRDCMode = Args.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc, IsSYCL); diff --git a/sycl/test-e2e/Compression/compression_separate_compile.cpp b/sycl/test-e2e/Compression/compression_separate_compile.cpp index 210d0372b41e0..b63e9b0a0052a 100644 --- a/sycl/test-e2e/Compression/compression_separate_compile.cpp +++ b/sycl/test-e2e/Compression/compression_separate_compile.cpp @@ -17,9 +17,9 @@ ////////////////////// Link device images // RUN: %{run-aux} %clangxx --offload-compress -fsycl -fsycl-link -fsycl-targets=spir64_x86_64 -fPIC %t_kernel1_aot.o %t_kernel2_aot.o -o %t_compressed_image.o -v -// Make sure the clang-offload-wrapper is called with the --offload-compress +// Make sure the clang-offload-wrapper is called with the --offload-compress when using the old offloading model // option. -// RUN: %{run-aux} %clangxx --offload-compress -fsycl -fsycl-link -fsycl-targets=spir64_x86_64 -fPIC %t_kernel1_aot.o %t_kernel2_aot.o -o %t_compressed_image.o -### &> %t_driver_opts.txt +// RUN: %{run-aux} %clangxx --no-offload-new-driver --offload-compress -fsycl -fsycl-link -fsycl-targets=spir64_x86_64 -fPIC %t_kernel1_aot.o %t_kernel2_aot.o -o %t_compressed_image.o -### &> %t_driver_opts.txt // RUN: %{run-aux} FileCheck -input-file=%t_driver_opts.txt %s --check-prefix=CHECK-DRIVER-OPTS // CHECK-DRIVER-OPTS: clang-offload-wrapper{{.*}} "-offload-compress" diff --git a/sycl/test-e2e/NewOffloadDriver/image_compression.cpp b/sycl/test-e2e/NewOffloadDriver/image_compression.cpp new file mode 100644 index 0000000000000..0672f990b6ca9 --- /dev/null +++ b/sycl/test-e2e/NewOffloadDriver/image_compression.cpp @@ -0,0 +1,84 @@ +// End-to-End test for testing device image compression when we +// separately compile and link device images for New Offloading Model. + +// REQUIRES: zstd, opencl-aot, cpu, linux + +// XFAIL: run-mode && preview-mode +// XFAIL-TRACKER: https://github.com/intel/llvm/issues/20397 + +// XFAIL: target-native_cpu +// XFAIL-TRACKER: https://github.com/intel/llvm/issues/20397 + +// CPU AOT targets host isa, so we compile everything on the run system instead. +////////////////////// Compile device images +// RUN: %clangxx --offload-new-driver -fsycl -fsycl-targets=spir64_x86_64 -fsycl-host-compiler=clang++ -fsycl-host-compiler-options='-std=c++17 -Wno-attributes -Wno-deprecated-declarations -fPIC -DENABLE_KERNEL1' -DENABLE_KERNEL1 -c %s -o %t_kernel1_aot.o +// RUN: %clangxx --offload-new-driver -fsycl -fsycl-targets=spir64_x86_64 -fsycl-host-compiler=clang++ -fsycl-host-compiler-options='-std=c++17 -Wno-attributes -Wno-deprecated-declarations -fPIC -DENABLE_KERNEL2' -DENABLE_KERNEL2 -c %s -o %t_kernel2_aot.o + +////////////////////// Link device images +// RUN: %clangxx --offload-new-driver --offload-compress -fsycl -fsycl-link -fsycl-targets=spir64_x86_64 -fPIC %t_kernel1_aot.o %t_kernel2_aot.o -o %t_compressed_image.o -v + +// Make sure the clang-linker-wrapper is called with the --compress when using the new offloading model +// option. +// RUN: %clangxx --offload-new-driver --offload-compress -fsycl -fsycl-link -fsycl-targets=spir64_x86_64 -fPIC %t_kernel1_aot.o %t_kernel2_aot.o -o %t_compressed_image.o -### &> %t_driver_opts.txt +// RUN: FileCheck -input-file=%t_driver_opts.txt %s --check-prefix=CHECK-DRIVER-OPTS + +// CHECK-DRIVER-OPTS: clang-linker-wrapper{{.*}} "--compress" + +////////////////////// Compile the host program +// RUN: %clangxx --offload-new-driver -fsycl -std=c++17 -Wno-attributes -Wno-deprecated-declarations -fPIC -c %s -o %t_main.o + +////////////////////// Link the host program and compressed device images +// RUN: %clangxx --offload-new-driver -fsycl %t_main.o %t_kernel1_aot.o %t_kernel2_aot.o %t_compressed_image.o -o %t_compress.out + +// RUN: %{run} %t_compress.out + +#include + +using namespace sycl; + +// Kernel 1 +#ifdef ENABLE_KERNEL1 +class test_kernel1; +void run_kernel1(int *a, queue q) { + q.single_task([=]() { *a *= 3; }).wait(); +} +#endif + +// Kernel 2 +#ifdef ENABLE_KERNEL2 +class test_kernel2; +void run_kernel2(int *a, queue q) { + q.single_task([=]() { *a += 42; }).wait(); +} +#endif + +// Main application. +#if not defined(ENABLE_KERNEL1) && not defined(ENABLE_KERNEL2) +#include +#include + +#include + +class kernel_init; +void run_kernel1(int *a, queue q); +void run_kernel2(int *a, queue q); +int main() { + int retCode = 0; + queue q; + + if (!q.get_device().get_info()) + return 0; + + int *p = malloc_shared(1, q); + *p = 42; + + run_kernel1(p, q); + run_kernel2(p, q); + q.wait(); + + retCode = *p != (42 * 3 + 42); + + free(p, q); + return retCode; +} +#endif From 8175ae14f5d3f3443ae35ddf21c4e77fabcaed0a Mon Sep 17 00:00:00 2001 From: Yixing Zhang Date: Fri, 21 Nov 2025 09:05:41 -0800 Subject: [PATCH 2/6] run the image compression test again to see if it is still failing in CI --- .../Compression/compression_separate_compile.cpp | 14 ++++++++------ .../NewOffloadDriver/image_compression.cpp | 16 +++++++++------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/sycl/test-e2e/Compression/compression_separate_compile.cpp b/sycl/test-e2e/Compression/compression_separate_compile.cpp index b63e9b0a0052a..6f05d986752da 100644 --- a/sycl/test-e2e/Compression/compression_separate_compile.cpp +++ b/sycl/test-e2e/Compression/compression_separate_compile.cpp @@ -1,5 +1,7 @@ // End-to-End test for testing device image compression when we -// seperatly compile and link device images. +// separately compile and link device images. +// This test is tested with the old offloading model and the image +// compression test for the new offloading model is in NewOffloadDriver/image_compression.cpp // REQUIRES: zstd, opencl-aot, cpu, linux @@ -11,11 +13,11 @@ // CPU AOT targets host isa, so we compile everything on the run system instead. ////////////////////// Compile device images -// RUN: %{run-aux} %clangxx -fsycl -fsycl-targets=spir64_x86_64 -fsycl-host-compiler=clang++ -fsycl-host-compiler-options='-std=c++17 -Wno-attributes -Wno-deprecated-declarations -fPIC -DENABLE_KERNEL1' -DENABLE_KERNEL1 -c %s -o %t_kernel1_aot.o -// RUN: %{run-aux} %clangxx -fsycl -fsycl-targets=spir64_x86_64 -fsycl-host-compiler=clang++ -fsycl-host-compiler-options='-std=c++17 -Wno-attributes -Wno-deprecated-declarations -fPIC -DENABLE_KERNEL2' -DENABLE_KERNEL2 -c %s -o %t_kernel2_aot.o +// RUN: %{run-aux} %clangxx --no-offload-new-driver -fsycl -fsycl-targets=spir64_x86_64 -fsycl-host-compiler=clang++ -fsycl-host-compiler-options='-std=c++17 -Wno-attributes -Wno-deprecated-declarations -fPIC -DENABLE_KERNEL1' -DENABLE_KERNEL1 -c %s -o %t_kernel1_aot.o +// RUN: %{run-aux} %clangxx --no-offload-new-driver -fsycl -fsycl-targets=spir64_x86_64 -fsycl-host-compiler=clang++ -fsycl-host-compiler-options='-std=c++17 -Wno-attributes -Wno-deprecated-declarations -fPIC -DENABLE_KERNEL2' -DENABLE_KERNEL2 -c %s -o %t_kernel2_aot.o ////////////////////// Link device images -// RUN: %{run-aux} %clangxx --offload-compress -fsycl -fsycl-link -fsycl-targets=spir64_x86_64 -fPIC %t_kernel1_aot.o %t_kernel2_aot.o -o %t_compressed_image.o -v +// RUN: %{run-aux} %clangxx --no-offload-new-driver --offload-compress -fsycl -fsycl-link -fsycl-targets=spir64_x86_64 -fPIC %t_kernel1_aot.o %t_kernel2_aot.o -o %t_compressed_image.o -v // Make sure the clang-offload-wrapper is called with the --offload-compress when using the old offloading model // option. @@ -25,10 +27,10 @@ // CHECK-DRIVER-OPTS: clang-offload-wrapper{{.*}} "-offload-compress" ////////////////////// Compile the host program -// RUN: %{run-aux} %clangxx -fsycl -std=c++17 -Wno-attributes -Wno-deprecated-declarations -fPIC -c %s -o %t_main.o +// RUN: %{run-aux} %clangxx --no-offload-new-driver -fsycl -std=c++17 -Wno-attributes -Wno-deprecated-declarations -fPIC -c %s -o %t_main.o ////////////////////// Link the host program and compressed device images -// RUN: %{run-aux} %clangxx -fsycl %t_main.o %t_kernel1_aot.o %t_kernel2_aot.o %t_compressed_image.o -o %t_compress.out +// RUN: %{run-aux} %clangxx --no-offload-new-driver -fsycl %t_main.o %t_kernel1_aot.o %t_kernel2_aot.o %t_compressed_image.o -o %t_compress.out // RUN: %{run} %t_compress.out diff --git a/sycl/test-e2e/NewOffloadDriver/image_compression.cpp b/sycl/test-e2e/NewOffloadDriver/image_compression.cpp index 0672f990b6ca9..6564636870be6 100644 --- a/sycl/test-e2e/NewOffloadDriver/image_compression.cpp +++ b/sycl/test-e2e/NewOffloadDriver/image_compression.cpp @@ -1,5 +1,7 @@ // End-to-End test for testing device image compression when we -// separately compile and link device images for New Offloading Model. +// separately compile and link device images. +// This test is copied from Compression/compression_separate_compile.cpp +// and modified to test with the New Offloading Model. // REQUIRES: zstd, opencl-aot, cpu, linux @@ -11,24 +13,24 @@ // CPU AOT targets host isa, so we compile everything on the run system instead. ////////////////////// Compile device images -// RUN: %clangxx --offload-new-driver -fsycl -fsycl-targets=spir64_x86_64 -fsycl-host-compiler=clang++ -fsycl-host-compiler-options='-std=c++17 -Wno-attributes -Wno-deprecated-declarations -fPIC -DENABLE_KERNEL1' -DENABLE_KERNEL1 -c %s -o %t_kernel1_aot.o -// RUN: %clangxx --offload-new-driver -fsycl -fsycl-targets=spir64_x86_64 -fsycl-host-compiler=clang++ -fsycl-host-compiler-options='-std=c++17 -Wno-attributes -Wno-deprecated-declarations -fPIC -DENABLE_KERNEL2' -DENABLE_KERNEL2 -c %s -o %t_kernel2_aot.o +// RUN: %{run-aux} %clangxx --offload-new-driver -fsycl -fsycl-targets=spir64_x86_64 -fsycl-host-compiler=clang++ -fsycl-host-compiler-options='-std=c++17 -Wno-attributes -Wno-deprecated-declarations -fPIC -DENABLE_KERNEL1' -DENABLE_KERNEL1 -c %s -o %t_kernel1_aot.o +// RUN: %{run-aux} %clangxx --offload-new-driver -fsycl -fsycl-targets=spir64_x86_64 -fsycl-host-compiler=clang++ -fsycl-host-compiler-options='-std=c++17 -Wno-attributes -Wno-deprecated-declarations -fPIC -DENABLE_KERNEL2' -DENABLE_KERNEL2 -c %s -o %t_kernel2_aot.o ////////////////////// Link device images -// RUN: %clangxx --offload-new-driver --offload-compress -fsycl -fsycl-link -fsycl-targets=spir64_x86_64 -fPIC %t_kernel1_aot.o %t_kernel2_aot.o -o %t_compressed_image.o -v +// RUN: %{run-aux} %clangxx --offload-new-driver --offload-compress -fsycl -fsycl-link -fsycl-targets=spir64_x86_64 -fPIC %t_kernel1_aot.o %t_kernel2_aot.o -o %t_compressed_image.o -v // Make sure the clang-linker-wrapper is called with the --compress when using the new offloading model // option. -// RUN: %clangxx --offload-new-driver --offload-compress -fsycl -fsycl-link -fsycl-targets=spir64_x86_64 -fPIC %t_kernel1_aot.o %t_kernel2_aot.o -o %t_compressed_image.o -### &> %t_driver_opts.txt +// RUN: %{run-aux} %clangxx --offload-new-driver --offload-compress -fsycl -fsycl-link -fsycl-targets=spir64_x86_64 -fPIC %t_kernel1_aot.o %t_kernel2_aot.o -o %t_compressed_image.o -### &> %t_driver_opts.txt // RUN: FileCheck -input-file=%t_driver_opts.txt %s --check-prefix=CHECK-DRIVER-OPTS // CHECK-DRIVER-OPTS: clang-linker-wrapper{{.*}} "--compress" ////////////////////// Compile the host program -// RUN: %clangxx --offload-new-driver -fsycl -std=c++17 -Wno-attributes -Wno-deprecated-declarations -fPIC -c %s -o %t_main.o +// RUN: %{run-aux} %clangxx --offload-new-driver -fsycl -std=c++17 -Wno-attributes -Wno-deprecated-declarations -fPIC -c %s -o %t_main.o ////////////////////// Link the host program and compressed device images -// RUN: %clangxx --offload-new-driver -fsycl %t_main.o %t_kernel1_aot.o %t_kernel2_aot.o %t_compressed_image.o -o %t_compress.out +// RUN: %{run-aux} %clangxx --offload-new-driver -fsycl %t_main.o %t_kernel1_aot.o %t_kernel2_aot.o %t_compressed_image.o -o %t_compress.out // RUN: %{run} %t_compress.out From 85827999663a9695ccb18383f264ca703f62ed28 Mon Sep 17 00:00:00 2001 From: Yixing Zhang Date: Mon, 24 Nov 2025 12:55:05 -0800 Subject: [PATCH 3/6] remove changes for enabling new offloading by default --- clang/include/clang/Driver/Driver.h | 7 ---- clang/lib/Driver/Driver.cpp | 37 +++---------------- clang/lib/Driver/ToolChains/Clang.cpp | 4 +- .../compression_separate_compile.cpp | 9 +++-- .../NewOffloadDriver/image_compression.cpp | 4 +- 5 files changed, 13 insertions(+), 48 deletions(-) diff --git a/clang/include/clang/Driver/Driver.h b/clang/include/clang/Driver/Driver.h index 126f127de8674..3dd8822c4844b 100644 --- a/clang/include/clang/Driver/Driver.h +++ b/clang/include/clang/Driver/Driver.h @@ -626,13 +626,6 @@ class Driver { /// @name Helper Methods /// @{ - /// Utility function to parse all devices passed via -fsycl-targets. - /// Return 'true' for JIT, AOT Intel CPU/GPUs and NVidia/AMD targets. - /// Otherwise return 'false'. - bool - GetUseNewOffloadDriverForSYCLOffload(Compilation &C, - const llvm::opt::ArgList &Args) const; - /// getSYCLDeviceTriple - Returns the SYCL device triple for the /// specified subarch // TODO: Additional Arg input parameter is for diagnostic output information diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index fe302e7b05fe7..475c1fddb0363 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -1565,32 +1565,6 @@ static void appendOneArg(InputArgList &Args, const Arg *Opt) { } } -// Utility function to parse all devices passed via -fsycl-targets. -// Return 'true' for JIT, AOT Intel CPU/GPUs and NVidia/AMD targets. -// Otherwise return 'false'. -bool Driver::GetUseNewOffloadDriverForSYCLOffload(Compilation &C, - const ArgList &Args) const { - // Check only if enabled with -fsycl - if (!Args.hasFlag(options::OPT_fsycl, options::OPT_fno_sycl, false)) - return false; - - if (Args.hasFlag(options::OPT_no_offload_new_driver, - options::OPT_offload_new_driver, false)) - return false; - - if (Args.hasArg(options::OPT_fintelfpga)) - return false; - - if (const Arg *A = Args.getLastArg(options::OPT_fsycl_targets_EQ)) { - for (const char *Val : A->getValues()) { - llvm::Triple TT(C.getDriver().getSYCLDeviceTriple(Val)); - if ((!TT.isSPIROrSPIRV()) || TT.isSPIRAOT()) - return false; - } - } - return true; -} - bool Driver::readConfigFile(StringRef FileName, llvm::cl::ExpansionContext &ExpCtx) { // Try opening the given file. @@ -2221,12 +2195,12 @@ Compilation *Driver::BuildCompilation(ArrayRef ArgList) { // Use new offloading path for OpenMP. This is disabled as the SYCL // offloading path is not properly setup to use the updated device linking // scheme. - if (C->isOffloadingHostKind(Action::OFK_OpenMP) || + if ((C->isOffloadingHostKind(Action::OFK_OpenMP) && + TranslatedArgs->hasFlag(options::OPT_fopenmp_new_driver, + options::OPT_no_offload_new_driver, true)) || TranslatedArgs->hasFlag(options::OPT_offload_new_driver, - options::OPT_no_offload_new_driver, false) || - GetUseNewOffloadDriverForSYCLOffload(*C, *TranslatedArgs)) { + options::OPT_no_offload_new_driver, false)) setUseNewOffloadingDriver(); - } // Construct the list of abstract actions to perform for this compilation. On // MachO targets this uses the driver-driver and universal actions. @@ -7121,8 +7095,7 @@ void Driver::BuildDefaultActions(Compilation &C, DerivedArgList &Args, options::OPT_fno_offload_via_llvm, false) || Args.hasFlag(options::OPT_offload_new_driver, options::OPT_no_offload_new_driver, - C.isOffloadingHostKind(Action::OFK_Cuda)) || - GetUseNewOffloadDriverForSYCLOffload(C, Args); + C.isOffloadingHostKind(Action::OFK_Cuda)); bool HIPNoRDC = C.isOffloadingHostKind(Action::OFK_HIP) && diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index ee70693217a62..92d8139822489 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -5232,9 +5232,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, (JA.isHostOffloading(C.getActiveOffloadKinds()) && Args.hasFlag(options::OPT_offload_new_driver, options::OPT_no_offload_new_driver, - C.isOffloadingHostKind(Action::OFK_Cuda))) || - (JA.isHostOffloading(Action::OFK_SYCL) && - C.getDriver().GetUseNewOffloadDriverForSYCLOffload(C, Args)); + C.isOffloadingHostKind(Action::OFK_Cuda))); bool IsRDCMode = Args.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc, IsSYCL); diff --git a/sycl/test-e2e/Compression/compression_separate_compile.cpp b/sycl/test-e2e/Compression/compression_separate_compile.cpp index 6f05d986752da..225b40d0eb922 100644 --- a/sycl/test-e2e/Compression/compression_separate_compile.cpp +++ b/sycl/test-e2e/Compression/compression_separate_compile.cpp @@ -1,7 +1,8 @@ // End-to-End test for testing device image compression when we // separately compile and link device images. -// This test is tested with the old offloading model and the image -// compression test for the new offloading model is in NewOffloadDriver/image_compression.cpp +// This test validates the old offloading model. +// The corresponding image compression test for the new offloading +// model can be found in NewOffloadDriver/image_compression.cpp // REQUIRES: zstd, opencl-aot, cpu, linux @@ -19,8 +20,8 @@ ////////////////////// Link device images // RUN: %{run-aux} %clangxx --no-offload-new-driver --offload-compress -fsycl -fsycl-link -fsycl-targets=spir64_x86_64 -fPIC %t_kernel1_aot.o %t_kernel2_aot.o -o %t_compressed_image.o -v -// Make sure the clang-offload-wrapper is called with the --offload-compress when using the old offloading model -// option. +// Make sure the clang-offload-wrapper is called with the --offload-compress +// option when using the old offloading model. // RUN: %{run-aux} %clangxx --no-offload-new-driver --offload-compress -fsycl -fsycl-link -fsycl-targets=spir64_x86_64 -fPIC %t_kernel1_aot.o %t_kernel2_aot.o -o %t_compressed_image.o -### &> %t_driver_opts.txt // RUN: %{run-aux} FileCheck -input-file=%t_driver_opts.txt %s --check-prefix=CHECK-DRIVER-OPTS diff --git a/sycl/test-e2e/NewOffloadDriver/image_compression.cpp b/sycl/test-e2e/NewOffloadDriver/image_compression.cpp index 6564636870be6..cedc05fc07a74 100644 --- a/sycl/test-e2e/NewOffloadDriver/image_compression.cpp +++ b/sycl/test-e2e/NewOffloadDriver/image_compression.cpp @@ -19,8 +19,8 @@ ////////////////////// Link device images // RUN: %{run-aux} %clangxx --offload-new-driver --offload-compress -fsycl -fsycl-link -fsycl-targets=spir64_x86_64 -fPIC %t_kernel1_aot.o %t_kernel2_aot.o -o %t_compressed_image.o -v -// Make sure the clang-linker-wrapper is called with the --compress when using the new offloading model -// option. +// Make sure the clang-linker-wrapper is called with the --compress +// option when using the new offloading model. // RUN: %{run-aux} %clangxx --offload-new-driver --offload-compress -fsycl -fsycl-link -fsycl-targets=spir64_x86_64 -fPIC %t_kernel1_aot.o %t_kernel2_aot.o -o %t_compressed_image.o -### &> %t_driver_opts.txt // RUN: FileCheck -input-file=%t_driver_opts.txt %s --check-prefix=CHECK-DRIVER-OPTS From 1c10a6143e850966a785565f9acd2aefbbb36e16 Mon Sep 17 00:00:00 2001 From: Yixing Zhang Date: Mon, 24 Nov 2025 13:02:21 -0800 Subject: [PATCH 4/6] code clean up --- sycl/test-e2e/Compression/compression_separate_compile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test-e2e/Compression/compression_separate_compile.cpp b/sycl/test-e2e/Compression/compression_separate_compile.cpp index 225b40d0eb922..4c8fdd8359f50 100644 --- a/sycl/test-e2e/Compression/compression_separate_compile.cpp +++ b/sycl/test-e2e/Compression/compression_separate_compile.cpp @@ -1,6 +1,6 @@ // End-to-End test for testing device image compression when we // separately compile and link device images. -// This test validates the old offloading model. +// This test validates the old offloading model. // The corresponding image compression test for the new offloading // model can be found in NewOffloadDriver/image_compression.cpp From 135dd988d23a5a548efc535dccc714217e849ec4 Mon Sep 17 00:00:00 2001 From: Yixing Zhang Date: Mon, 24 Nov 2025 13:23:10 -0800 Subject: [PATCH 5/6] code clean up --- sycl/test-e2e/NewOffloadDriver/image_compression.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/test-e2e/NewOffloadDriver/image_compression.cpp b/sycl/test-e2e/NewOffloadDriver/image_compression.cpp index cedc05fc07a74..7c7d0cd908329 100644 --- a/sycl/test-e2e/NewOffloadDriver/image_compression.cpp +++ b/sycl/test-e2e/NewOffloadDriver/image_compression.cpp @@ -22,7 +22,7 @@ // Make sure the clang-linker-wrapper is called with the --compress // option when using the new offloading model. // RUN: %{run-aux} %clangxx --offload-new-driver --offload-compress -fsycl -fsycl-link -fsycl-targets=spir64_x86_64 -fPIC %t_kernel1_aot.o %t_kernel2_aot.o -o %t_compressed_image.o -### &> %t_driver_opts.txt -// RUN: FileCheck -input-file=%t_driver_opts.txt %s --check-prefix=CHECK-DRIVER-OPTS +// RUN: %{run-aux} FileCheck -input-file=%t_driver_opts.txt %s --check-prefix=CHECK-DRIVER-OPTS // CHECK-DRIVER-OPTS: clang-linker-wrapper{{.*}} "--compress" From 2dda451c2508c770ee7ed59d4e18c3a0e9216516 Mon Sep 17 00:00:00 2001 From: Yixing Zhang Date: Mon, 24 Nov 2025 17:16:36 -0800 Subject: [PATCH 6/6] remove xfail for preview-mode --- sycl/test-e2e/NewOffloadDriver/image_compression.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/sycl/test-e2e/NewOffloadDriver/image_compression.cpp b/sycl/test-e2e/NewOffloadDriver/image_compression.cpp index 7c7d0cd908329..f2242c6f65895 100644 --- a/sycl/test-e2e/NewOffloadDriver/image_compression.cpp +++ b/sycl/test-e2e/NewOffloadDriver/image_compression.cpp @@ -5,9 +5,6 @@ // REQUIRES: zstd, opencl-aot, cpu, linux -// XFAIL: run-mode && preview-mode -// XFAIL-TRACKER: https://github.com/intel/llvm/issues/20397 - // XFAIL: target-native_cpu // XFAIL-TRACKER: https://github.com/intel/llvm/issues/20397