Skip to content

Commit cdafff4

Browse files
committed
Merge branch 'sycl' into fabio/binary_update_fix
2 parents d571333 + 2172d9e commit cdafff4

File tree

133 files changed

+424
-239
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+424
-239
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/lib/Sema/SemaSYCL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3167,7 +3167,7 @@ class SyclKernelDeclCreator : public SyclKernelFieldHandler {
31673167
// // code
31683168
// }
31693169
//
3170-
// [[intel::reqd_sub_group_size(4)]] void operator()(sycl::id<1> id) const
3170+
// [[sycl::reqd_sub_group_size(4)]] void operator()(sycl::id<1> id) const
31713171
// {
31723172
// // code
31733173
// }

clang/lib/Sema/SemaSYCLDeclAttr.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,13 @@ void SemaSYCL::checkDeprecatedSYCLAttributeSpelling(const ParsedAttr &A,
132132
return;
133133
}
134134

135+
// Additionally, diagnose deprecated [[intel::reqd_sub_group_size]] spelling
136+
if (A.getKind() == ParsedAttr::AT_IntelReqdSubGroupSize && A.getScopeName() &&
137+
A.getScopeName()->isStr("intel")) {
138+
diagnoseDeprecatedAttribute(A, "sycl", "reqd_sub_group_size");
139+
return;
140+
}
141+
135142
// Diagnose SYCL 2020 spellings in later SYCL modes.
136143
if (getLangOpts().getSYCLVersion() >= LangOptions::SYCL_2020) {
137144
// All attributes in the cl vendor namespace are deprecated in favor of a

clang/test/CodeGenSYCL/kernel-op-calls.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Functor1 {
1111
public:
1212
Functor1(){}
1313

14-
[[intel::reqd_sub_group_size(4)]] void operator()(sycl::id<1> id) const {}
14+
[[sycl::reqd_sub_group_size(4)]] void operator()(sycl::id<1> id) const {}
1515

1616
[[sycl::work_group_size_hint(1, 2, 3)]] void operator()(sycl::id<2> id) const {}
1717

clang/test/CodeGenSYCL/reqd-sub-group-size.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@ queue q;
77

88
class Functor16 {
99
public:
10-
[[intel::reqd_sub_group_size(16)]] void operator()() const {}
10+
[[sycl::reqd_sub_group_size(16)]] void operator()() const {}
1111
};
1212

1313
template <int SIZE>
1414
class Functor2 {
1515
public:
16-
[[intel::reqd_sub_group_size(SIZE)]] void operator()() const {}
16+
[[sycl::reqd_sub_group_size(SIZE)]] void operator()() const {}
1717
};
1818

1919
template <int N>
20-
[[intel::reqd_sub_group_size(N)]] void func() {}
20+
[[sycl::reqd_sub_group_size(N)]] void func() {}
2121

2222
int main() {
2323
q.submit([&](handler &h) {
2424
Functor16 f16;
2525
h.single_task<class kernel_name1>(f16);
2626

2727
h.single_task<class kernel_name3>(
28-
[]() [[intel::reqd_sub_group_size(4)]]{});
28+
[]() [[sycl::reqd_sub_group_size(4)]]{});
2929

3030
Functor2<2> f2;
3131
h.single_task<class kernel_name4>(f2);

clang/test/CodeGenSYCL/sycl-multi-kernel-attr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ queue q;
77

88
class Functor {
99
public:
10-
[[intel::reqd_sub_group_size(4), cl::reqd_work_group_size(32, 16, 16)]] void operator()() const {}
10+
[[sycl::reqd_sub_group_size(4), cl::reqd_work_group_size(32, 16, 16)]] void operator()() const {}
1111
};
1212

1313
class Functor1 {
1414
public:
15-
[[intel::reqd_sub_group_size(2), sycl::reqd_work_group_size(64, 32, 32)]] void operator()() const {}
15+
[[sycl::reqd_sub_group_size(2), sycl::reqd_work_group_size(64, 32, 32)]] void operator()() const {}
1616
};
1717

1818
template <int SIZE, int SIZE1, int SIZE2>

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"{{.*}}

clang/test/SemaSYCL/parallel_for_wrapper_attr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ template <typename T> class Fobj {
66
public:
77
Fobj() {}
88
void operator()() const {
9-
auto L0 = []() [[intel::reqd_sub_group_size(4)]]{};
9+
auto L0 = []() [[sycl::reqd_sub_group_size(4)]]{};
1010
L0();
1111
}
1212
};

clang/test/SemaSYCL/reqd-sub-group-size-ast.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ queue q;
99

1010
class Functor16 {
1111
public:
12-
[[intel::reqd_sub_group_size(16)]] void operator()() const {}
12+
[[sycl::reqd_sub_group_size(16)]] void operator()() const {}
1313
};
1414

1515
// Test that checks template parameter support on member function of class template.
1616
template <int SIZE>
1717
class KernelFunctor {
1818
public:
19-
[[intel::reqd_sub_group_size(SIZE)]] void operator()() const {}
19+
[[sycl::reqd_sub_group_size(SIZE)]] void operator()() const {}
2020
};
2121

2222
// Test that checks template parameter support on function.
@@ -35,7 +35,7 @@ class KernelFunctor {
3535
// CHECK-NEXT: NonTypeTemplateParmDecl
3636
// CHECK-NEXT: IntegerLiteral {{.*}} 'int' 12
3737
template <int N>
38-
[[intel::reqd_sub_group_size(N)]] void func() {}
38+
[[sycl::reqd_sub_group_size(N)]] void func() {}
3939

4040
int main() {
4141
q.submit([&](handler &h) {
@@ -52,14 +52,14 @@ int main() {
5252
// CHECK-NEXT: ConstantExpr {{.*}} 'int'
5353
// CHECK-NEXT: value: Int 2
5454
// CHECK-NEXT: IntegerLiteral{{.*}}2{{$}}
55-
h.single_task<class kernel_name3>([]() [[intel::reqd_sub_group_size(2)]] {});
55+
h.single_task<class kernel_name3>([]() [[sycl::reqd_sub_group_size(2)]] {});
5656

5757
// CHECK: FunctionDecl {{.*}} {{.*}}kernel_name5
5858
// CHECK: IntelReqdSubGroupSizeAttr {{.*}} reqd_sub_group_size
5959
// CHECK-NEXT: ConstantExpr {{.*}} 'int'
6060
// CHECK-NEXT: value: Int 6
6161
// CHECK-NEXT: IntegerLiteral{{.*}}6{{$}}
62-
h.single_task<class kernel_name5>([]() [[intel::reqd_sub_group_size(6)]] {});
62+
h.single_task<class kernel_name5>([]() [[sycl::reqd_sub_group_size(6)]] {});
6363

6464
// CHECK: FunctionDecl {{.*}}kernel_name_6
6565
// CHECK: IntelReqdSubGroupSizeAttr {{.*}} reqd_sub_group_size
@@ -79,8 +79,8 @@ int main() {
7979
// CHECK-NEXT: value: Int 8
8080
// CHECK-NEXT: IntegerLiteral{{.*}}8{{$}}
8181
// CHECK-NOT: IntelReqdSubGroupSizeAttr
82-
[]() [[intel::reqd_sub_group_size(8),
83-
intel::reqd_sub_group_size(8)]] {});
82+
[]() [[sycl::reqd_sub_group_size(8),
83+
sycl::reqd_sub_group_size(8)]] {});
8484
});
8585
func<12>();
8686
return 0;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// RUN: %clang_cc1 -fsycl-is-host -fsyntax-only -verify %s
22
// expected-no-diagnostics
33

4-
[[intel::reqd_sub_group_size(8)]] void fun() {}
4+
[[sycl::reqd_sub_group_size(8)]] void fun() {}
55

66
class Functor {
77
public:
8-
[[intel::reqd_sub_group_size(16)]] void operator()() {}
8+
[[sycl::reqd_sub_group_size(16)]] void operator()() {}
99
};

0 commit comments

Comments
 (0)