Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion clang/lib/Driver/ToolChains/HIPUtility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,10 @@ void HIP::constructHIPFatbinCommand(Compilation &C, const JobAction &JA,
Args.MakeArgString(std::string("-output=").append(Output));
BundlerArgs.push_back(BundlerOutputArg);

addOffloadCompressArgs(Args, BundlerArgs);
// For SYCL, the compression is occurring during the wrapping step, so we do
// not want to do additional compression here.
if (!JA.isDeviceOffloading(Action::OFK_SYCL))
addOffloadCompressArgs(Args, BundlerArgs);

const char *Bundler = Args.MakeArgString(
T.getToolChain().GetProgramPath("clang-offload-bundler"));
Expand Down
9 changes: 9 additions & 0 deletions clang/test/Driver/sycl-offload-wrapper-compression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,14 @@
// RUN: %clangxx -### -fsycl %s 2>&1 | FileCheck %s --check-prefix=CHECK-NO-COMPRESS
// RUN: %clangxx -### -fsycl --offload-compression-level=3 %s 2>&1 | FileCheck %s --check-prefix=CHECK-NO-COMPRESS

// For SYCL offloading to HIP, make sure we don't pass '--compress' to offload-bundler.
// Clang throws an error in the following command "cannot find 'remangled-l64-signed_char.libspirv-amdgcn-amd-amdhsa.bc'" on some machine,
// that's why appending '|| true'. This error should not affect the driver invocation, which this test intends to verify.

// RUN: (%clangxx -### -fsycl --offload-compress -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx1031 -fsycl-targets=amdgcn-amd-amdhsa %s > %t.driver 2>&1) || true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using || true here, add the -fno-sycl-libspirv -nogpulib options to the command line to limit library requirements.

// RUN: FileCheck %s --check-prefix=CHECK-NO-COMPRESS-BUNDLER --input-file=%t.driver

// CHECK-NO-COMPRESS-NOT: {{.*}}clang-offload-wrapper{{.*}}"-offload-compress"{{.*}}
// CHECK-NO-COMPRESS-NOT: {{.*}}clang-offload-wrapper{{.*}}"-offload-compression-level=3"{{.*}}

// CHECK-NO-COMPRESS-BUNDLER-NOT: {{.*}}clang-offload-bundler{{.*}}"-compress"{{.*}}
3 changes: 0 additions & 3 deletions sycl/test-e2e/Compression/compression.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// End-to-End test for testing device image compression.
// REQUIRES: zstd

// XFAIL: hip_amd
// XFAIL-TRACKER: https://github.com/intel/llvm/issues/15829

// RUN: %{build} -O0 -g %S/Inputs/single_kernel.cpp -o %t_not_compress.out
// RUN: %{build} -O0 -g --offload-compress --offload-compression-level=3 %S/Inputs/single_kernel.cpp -o %t_compress.out
// RUN: %{run} %t_not_compress.out
Expand Down
3 changes: 0 additions & 3 deletions sycl/test-e2e/Compression/compression_multiple_tu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
// translation units, one compressed and one not compressed.
// REQUIRES: zstd, linux

// XFAIL: hip_amd
// XFAIL-TRACKER: https://github.com/intel/llvm/issues/15829

// RUN: %{build} --offload-compress -DENABLE_KERNEL1 -shared -fPIC -o %T/kernel1.so
// RUN: %{build} -DENABLE_KERNEL2 -shared -fPIC -o %T/kernel2.so

Expand Down
Loading