Skip to content

Commit cd1fe71

Browse files
committed
Merge branch 'sycl' into review/yang/fix_kernel_filter
2 parents fd4feac + b7ef830 commit cd1fe71

File tree

7 files changed

+31
-12
lines changed

7 files changed

+31
-12
lines changed

clang/lib/Driver/ToolChains/HIPUtility.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,10 @@ void HIP::constructHIPFatbinCommand(Compilation &C, const JobAction &JA,
324324
Args.MakeArgString(std::string("-output=").append(Output));
325325
BundlerArgs.push_back(BundlerOutputArg);
326326

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

329332
const char *Bundler = Args.MakeArgString(
330333
T.getToolChain().GetProgramPath("clang-offload-bundler"));

clang/test/Driver/sycl-offload-wrapper-compression.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,11 @@
1010
// RUN: %clangxx -### -fsycl %s 2>&1 | FileCheck %s --check-prefix=CHECK-NO-COMPRESS
1111
// RUN: %clangxx -### -fsycl --offload-compression-level=3 %s 2>&1 | FileCheck %s --check-prefix=CHECK-NO-COMPRESS
1212

13+
// For SYCL offloading to HIP, make sure we don't pass '--compress' to offload-bundler.
14+
// RUN: %clangxx -### -fsycl --offload-compress -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx1031 -fsycl-targets=amdgcn-amd-amdhsa -fno-sycl-libspirv -nogpulib %s &> %t.driver
15+
// RUN: FileCheck %s --check-prefix=CHECK-NO-COMPRESS-BUNDLER --input-file=%t.driver
16+
1317
// CHECK-NO-COMPRESS-NOT: {{.*}}clang-offload-wrapper{{.*}}"-offload-compress"{{.*}}
1418
// CHECK-NO-COMPRESS-NOT: {{.*}}clang-offload-wrapper{{.*}}"-offload-compression-level=3"{{.*}}
19+
20+
// CHECK-NO-COMPRESS-BUNDLER-NOT: {{.*}}clang-offload-bundler{{.*}}"-compress"{{.*}}

libdevice/cmake/modules/SYCLLibdevice.cmake

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,29 @@ function(compile_lib filename)
112112
"FILETYPE"
113113
"SRC;EXTRA_OPTS;DEPENDENCIES"
114114
${ARGN})
115+
set(compile_opt_list ${compile_opts}
116+
${${ARG_FILETYPE}_device_compile_opts}
117+
${ARG_EXTRA_OPTS})
118+
compile_lib_ext(${filename}
119+
FILETYPE ${ARG_FILETYPE}
120+
SRC ${ARG_SRC}
121+
DEPENDENCIES ${ARG_DEPENDENCIES}
122+
OPTS ${compile_opt_list})
123+
endfunction()
124+
125+
function(compile_lib_ext filename)
126+
cmake_parse_arguments(ARG
127+
""
128+
"FILETYPE"
129+
"SRC;OPTS;DEPENDENCIES"
130+
${ARGN})
115131

116132
set(devicelib-file
117133
${${ARG_FILETYPE}_binary_dir}/${filename}.${${ARG_FILETYPE}-suffix})
118134

119135
add_custom_command(
120136
OUTPUT ${devicelib-file}
121-
COMMAND ${clang} ${compile_opts} ${ARG_EXTRA_OPTS}
137+
COMMAND ${clang} ${ARG_OPTS}
122138
${CMAKE_CURRENT_SOURCE_DIR}/${ARG_SRC} -o ${devicelib-file}
123139
MAIN_DEPENDENCY ${ARG_SRC}
124140
DEPENDS ${ARG_DEPENDENCIES}

sycl/include/sycl/ext/oneapi/experimental/prefetch.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ enum class cache_level { L1 = 0, L2 = 1, L3 = 2, L4 = 3 };
2020

2121
struct nontemporal;
2222

23-
struct prefetch_hint_key {
23+
struct prefetch_hint_key
24+
: detail::compile_time_property_key<detail::PropKind::Prefetch> {
2425
template <cache_level Level, typename Hint>
2526
using value_t =
2627
property_value<prefetch_hint_key,
@@ -51,8 +52,6 @@ inline constexpr prefetch_hint_key::value_t<cache_level::L4, nontemporal>
5152
namespace detail {
5253
using namespace sycl::detail;
5354

54-
template <> struct IsCompileTimeProperty<prefetch_hint_key> : std::true_type {};
55-
5655
template <cache_level Level, typename Hint>
5756
struct PropertyMetaInfo<prefetch_hint_key::value_t<Level, Hint>> {
5857
static constexpr const char *name = std::is_same_v<Hint, nontemporal>

sycl/include/sycl/ext/oneapi/properties/property.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,9 @@ enum PropKind : uint32_t {
214214
ResponseCapacity = 73,
215215
MaxWorkGroupSize = 74,
216216
MaxLinearWorkGroupSize = 75,
217+
Prefetch = 76,
217218
// PropKindSize must always be the last value.
218-
PropKindSize = 76,
219+
PropKindSize = 77,
219220
};
220221

221222
struct property_key_base_tag {};

sycl/test-e2e/Compression/compression.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// End-to-End test for testing device image compression.
22
// REQUIRES: zstd
33

4-
// XFAIL: hip_amd
5-
// XFAIL-TRACKER: https://github.com/intel/llvm/issues/15829
6-
74
// RUN: %{build} -O0 -g %S/Inputs/single_kernel.cpp -o %t_not_compress.out
85
// RUN: %{build} -O0 -g --offload-compress --offload-compression-level=3 %S/Inputs/single_kernel.cpp -o %t_compress.out
96
// RUN: %{run} %t_not_compress.out

sycl/test-e2e/Compression/compression_multiple_tu.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// translation units, one compressed and one not compressed.
33
// REQUIRES: zstd, linux
44

5-
// XFAIL: hip_amd
6-
// XFAIL-TRACKER: https://github.com/intel/llvm/issues/15829
7-
85
// RUN: %{build} --offload-compress -DENABLE_KERNEL1 -shared -fPIC -o %T/kernel1.so
96
// RUN: %{build} -DENABLE_KERNEL2 -shared -fPIC -o %T/kernel2.so
107

0 commit comments

Comments
 (0)