Skip to content

Commit c5394c4

Browse files
author
iclsrc
committed
Merge from 'sycl' to 'sycl-web'
2 parents 6b85739 + 3582cb0 commit c5394c4

33 files changed

+543
-182
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ llvm/**/file-table-tform/ @kbobrovs @AlexeySachkov
9999
llvm/**/llvm-foreach/ @AlexeySachkov @Fznamznon
100100
llvm/**/llvm-no-spir-kernel/ @AGindinson @AlexeySachkov
101101
llvm/**/sycl-post-link/ @kbobrovs @AlexeySachkov
102+
llvm/include/llvm/Support/PropertySetIO.h @kbobrovs @AlexeySachkov
103+
llvm/lib/Support/PropertySetIO.cpp @kbobrovs @AlexeySachkov
104+
llvm/unittests/Support/PropertySetIOTest.cpp @kbobrovs @AlexeySachkov
105+
llvm/lib/Support/Base64.cpp @kbobrovs @AlexeySachkov
102106

103107
# Clang offload tools
104108
clang/tools/clang-offload-bundler/ @kbobrovs @sndmitriev

buildbot/dependency.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ ocl_cpu_rt_ver=2020.11.11.0.04
44
# https://github.com/intel/llvm/releases/download/2020-WW45/win-oclcpuexp-2020.11.11.0.04_rel.zip
55
ocl_cpu_rt_ver_win=2020.11.11.0.04
66
# Same GPU driver supports Level Zero and OpenCL
7-
# https://github.com/intel/compute-runtime/releases/tag/21.02.18820
8-
ocl_gpu_rt_ver=21.02.18820
7+
# https://github.com/intel/compute-runtime/releases/tag/21.03.18857
8+
ocl_gpu_rt_ver=21.03.18857
99
# Same GPU driver supports Level Zero and OpenCL
1010
# https://downloadmirror.intel.com/30066/a08/igfx_win10_100.9030.zip
1111
ocl_gpu_rt_ver_win=27.20.100.9030
@@ -30,7 +30,7 @@ ocloc_ver_win=27.20.100.8935
3030
[DRIVER VERSIONS]
3131
cpu_driver_lin=2020.11.11.0.04
3232
cpu_driver_win=2020.11.11.0.04
33-
gpu_driver_lin=21.02.18820
33+
gpu_driver_lin=21.03.18857
3434
gpu_driver_win=27.20.100.9030
3535
fpga_driver_lin=2020.11.11.0.04
3636
fpga_driver_win=2020.11.11.0.04

clang/include/clang/Basic/AttrDocs.td

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,7 +2199,7 @@ attribute was applied. This effect is equivalent to annotating restrict on
21992199
**all** kernel pointer arguments in an OpenCL or SPIR-V kernel.
22002200

22012201
If ``intel::kernel_args_restrict`` is applied to a function called from a device
2202-
kernel, the attribute is ignored and it is not propagated to a kernel.
2202+
kernel, the attribute is not ignored and it is propagated to the kernel.
22032203

22042204
The attribute forms an unchecked assertion, in that implementations
22052205
do not need to check/confirm the pre-condition in any way. If a user applies
@@ -2229,7 +2229,7 @@ def SYCLIntelNumSimdWorkItemsAttrDocs : Documentation {
22292229
Applies to a device function/lambda function. Indicates the number of work
22302230
items that should be processed in parallel. Valid values are positive integers.
22312231
If ``intel::num_simd_work_items`` is applied to a function called from a
2232-
device kernel, the attribute is ignored and it is not propagated to a kernel.
2232+
device kernel, the attribute is not ignored and it is propagated to the kernel.
22332233
}];
22342234
}
22352235

@@ -2243,7 +2243,7 @@ clusters handle stalls using a stall-enable signal to freeze computation
22432243
within the cluster. This attribute is ignored on the host.
22442244

22452245
If ``intel::use_stall_enable_clusters`` is applied to a function called from a device
2246-
kernel, the attribute is ignored and it is not propagated to a kernel.
2246+
kernel, the attribute is ignored and it is not propagated to the kernel.
22472247

22482248
The ``intel::use_stall_enable_clusters`` attribute takes no argument and has an effect
22492249
when applied to a function, and no effect otherwise.
@@ -2305,7 +2305,7 @@ of a work group. Values must be positive integers. This is similar to
23052305
reqd_work_group_size, but allows work groups that are smaller or equal to the
23062306
specified sizes.
23072307
If ``intel::max_work_group_size`` is applied to a function called from a
2308-
device kernel, the attribute is ignored and it is not propagated to a kernel.
2308+
device kernel, the attribute is not ignored and it is propagated to the kernel.
23092309
}];
23102310
}
23112311

@@ -2321,7 +2321,7 @@ range of [0, 3]. A kernel with max_global_work_dim(0) must be invoked with a
23212321
``cl::reqd_work_group_size`` are applied to the kernel as well - they shall
23222322
have arguments of (1, 1, 1).
23232323
If ``intel::max_global_work_dim`` is applied to a function called from a
2324-
device kernel, the attribute is ignored and it is not propagated to a kernel.
2324+
device kernel, the attribute is not ignored and it is propagated to the kernel.
23252325
}];
23262326
}
23272327

clang/test/CodeGenSYCL/intel-max-global-work-dim.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ class Functor {
1616
[[intel::max_global_work_dim(SIZE)]] void operator()() const {}
1717
};
1818

19+
template <int N>
20+
[[intel::max_global_work_dim(N)]] void func() {}
21+
1922
int main() {
2023
q.submit([&](handler &h) {
2124
Foo boo;
@@ -26,12 +29,17 @@ int main() {
2629

2730
Functor<2> f;
2831
h.single_task<class kernel_name3>(f);
32+
33+
h.single_task<class kernel_name4>([]() {
34+
func<2>();
35+
});
2936
});
3037
return 0;
3138
}
3239

3340
// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name1"() #0 {{.*}} !max_global_work_dim ![[NUM1:[0-9]+]]
3441
// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name2"() #0 {{.*}} !max_global_work_dim ![[NUM2:[0-9]+]]
3542
// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name3"() #0 {{.*}} !max_global_work_dim ![[NUM2]]
43+
// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name4"() #0 {{.*}} !max_global_work_dim ![[NUM2]]
3644
// CHECK: ![[NUM1]] = !{i32 1}
3745
// CHECK: ![[NUM2]] = !{i32 2}

clang/test/CodeGenSYCL/num-simd-work-items.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ class Functor {
1616
[[intel::num_simd_work_items(SIZE)]] void operator()() const {}
1717
};
1818

19+
template <int N>
20+
[[intel::num_simd_work_items(N)]] void func() {}
21+
1922
int main() {
2023
q.submit([&](handler &h) {
2124
Foo boo;
@@ -26,13 +29,19 @@ int main() {
2629

2730
Functor<2> f;
2831
h.single_task<class kernel_name3>(f);
32+
33+
h.single_task<class kernel_name4>([]() {
34+
func<4>();
35+
});
2936
});
3037
return 0;
3138
}
3239

3340
// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name1"() #0 {{.*}} !num_simd_work_items ![[NUM1:[0-9]+]]
3441
// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name2"() #0 {{.*}} !num_simd_work_items ![[NUM42:[0-9]+]]
3542
// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name3"() #0 {{.*}} !num_simd_work_items ![[NUM2:[0-9]+]]
43+
// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name4"() #0 {{.*}} !num_simd_work_items ![[NUM4:[0-9]+]]
3644
// CHECK: ![[NUM1]] = !{i32 1}
3745
// CHECK: ![[NUM42]] = !{i32 42}
3846
// CHECK: ![[NUM2]] = !{i32 2}
47+
// CHECK: ![[NUM4]] = !{i32 4}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ class Functor2 {
2525
[[intel::reqd_sub_group_size(SIZE)]] void operator()() const {}
2626
};
2727

28+
template <int N>
29+
[[intel::reqd_sub_group_size(N)]] void func() {}
30+
2831
int main() {
2932
q.submit([&](handler &h) {
3033
Functor16 f16;
@@ -38,6 +41,10 @@ int main() {
3841

3942
Functor2<2> f2;
4043
h.single_task<class kernel_name4>(f2);
44+
45+
h.single_task<class kernel_name5>([]() {
46+
func<2>();
47+
});
4148
});
4249
return 0;
4350
}
@@ -46,6 +53,7 @@ int main() {
4653
// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name2"() #0 {{.*}} !intel_reqd_sub_group_size ![[SGSIZE8:[0-9]+]]
4754
// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name3"() #0 {{.*}} !intel_reqd_sub_group_size ![[SGSIZE4:[0-9]+]]
4855
// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name4"() #0 {{.*}} !intel_reqd_sub_group_size ![[SGSIZE2:[0-9]+]]
56+
// CHECK: define {{.*}}spir_kernel void @{{.*}}kernel_name5"() #0 {{.*}} !intel_reqd_sub_group_size ![[SGSIZE2]]
4957
// CHECK: ![[SGSIZE16]] = !{i32 16}
5058
// CHECK: ![[SGSIZE8]] = !{i32 8}
5159
// CHECK: ![[SGSIZE4]] = !{i32 4}

clang/test/SemaSYCL/sycl-device-intel-max-global-work-dim-template.cpp

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,32 @@
22

33
// Test that checkes template parameter support for 'max_global_work_dim' attribute on sycl device.
44

5+
// Test that checks wrong function template instantiation and ensures that the type
6+
// is checked properly when instantiating from the template definition.
7+
template <typename Ty>
8+
// expected-error@+1 2{{'max_global_work_dim' attribute requires an integer constant}}
9+
[[intel::max_global_work_dim(Ty{})]] void func() {}
10+
11+
struct S {};
12+
void test() {
13+
//expected-note@+1{{in instantiation of function template specialization 'func<S>' requested here}}
14+
func<S>();
15+
//expected-note@+1{{in instantiation of function template specialization 'func<float>' requested here}}
16+
func<float>();
17+
// no error expected
18+
func<int>(); // OK
19+
}
20+
21+
// Test that checks expression is not a constant expression.
22+
int foo();
23+
// expected-error@+1{{'max_global_work_dim' attribute requires an integer constant}}
24+
[[intel::max_global_work_dim(foo() + 1)]] void func1();
25+
26+
// Test that checks expression is a constant expression.
27+
constexpr int bar() { return 0; }
28+
[[intel::max_global_work_dim(bar() + 2)]] void func2(); // OK
29+
30+
// Test that checks template parameter support on member function of class template.
531
template <int SIZE>
632
class KernelFunctor {
733
public:
@@ -23,3 +49,24 @@ int main() {
2349
// CHECK: SubstNonTypeTemplateParmExpr {{.*}}
2450
// CHECK-NEXT: NonTypeTemplateParmDecl {{.*}}
2551
// CHECK-NEXT: IntegerLiteral{{.*}}2{{$}}
52+
53+
// Test that checks template parameter support on function.
54+
template <int N>
55+
// expected-error@+1{{'max_global_work_dim' attribute requires a non-negative integral compile time constant expression}}
56+
[[intel::max_global_work_dim(N)]] void func3() {}
57+
58+
int check() {
59+
// no error expected
60+
func3<2>();
61+
//expected-note@+1{{in instantiation of function template specialization 'func3<-1>' requested here}}
62+
func3<-1>();
63+
return 0;
64+
}
65+
66+
// CHECK: FunctionTemplateDecl {{.*}} {{.*}} func3
67+
// CHECK: NonTypeTemplateParmDecl {{.*}} {{.*}} referenced 'int' depth 0 index 0 N
68+
// CHECK: FunctionDecl {{.*}} {{.*}} func3 'void ()'
69+
// CHECK: SYCLIntelMaxGlobalWorkDimAttr {{.*}}
70+
// CHECK: SubstNonTypeTemplateParmExpr {{.*}}
71+
// CHECK-NEXT: NonTypeTemplateParmDecl {{.*}}
72+
// CHECK-NEXT: IntegerLiteral{{.*}}2{{$}}

clang/test/SemaSYCL/sycl-device-intel-max-work-group-size-template.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ int foo();
2424
constexpr int bar() { return 0; }
2525
[[intel::max_work_group_size(bar() + 12, bar() + 12, bar() + 12)]] void func2(); // OK
2626

27-
// Test that checks template parameter suppport on member function of class template.
27+
// Test that checks template parameter support on member function of class template.
2828
template <int SIZE, int SIZE1, int SIZE2>
2929
class KernelFunctor {
3030
public:

clang/test/SemaSYCL/sycl-device-intel-reqd-work-group-size-template.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ int foo();
2424
constexpr int bar() { return 0; }
2525
[[intel::reqd_work_group_size(bar() + 12, bar() + 12, bar() + 12)]] void func2(); // OK
2626

27-
// Test that checks template parameter suppport on member function of class template.
27+
// Test that checks template parameter support on member function of class template.
2828
template <int SIZE, int SIZE1, int SIZE2>
2929
class KernelFunctor {
3030
public:

clang/test/SemaSYCL/sycl-device-num_simd_work_items-template.cpp

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,33 @@
22

33
// Test that checkes template parameter support for 'num_simd_work_items' attribute on sycl device.
44

5+
// Test that checks wrong function template instantiation and ensures that the type
6+
// is checked properly when instantiating from the template definition.
7+
template <typename Ty>
8+
// expected-error@+2{{'num_simd_work_items' attribute requires a positive integral compile time constant expression}}
9+
// expected-error@+1 2{{'num_simd_work_items' attribute requires an integer constant}}
10+
[[intel::num_simd_work_items(Ty{})]] void func() {}
11+
12+
struct S {};
13+
void test() {
14+
//expected-note@+1{{in instantiation of function template specialization 'func<S>' requested here}}
15+
func<S>();
16+
//expected-note@+1{{in instantiation of function template specialization 'func<float>' requested here}}
17+
func<float>();
18+
//expected-note@+1{{in instantiation of function template specialization 'func<int>' requested here}}
19+
func<int>();
20+
}
21+
22+
// Test that checks expression is not a constant expression.
23+
int foo();
24+
// expected-error@+1{{'num_simd_work_items' attribute requires an integer constant}}
25+
[[intel::num_simd_work_items(foo() + 12)]] void func1();
26+
27+
// Test that checks expression is a constant expression.
28+
constexpr int bar() { return 0; }
29+
[[intel::num_simd_work_items(bar() + 12)]] void func2(); // OK
30+
31+
// Test that checks template parameter support on member function of class template.
532
template <int SIZE>
633
class KernelFunctor {
734
public:
@@ -14,6 +41,7 @@ int main() {
1441
KernelFunctor<-1>();
1542
// no error expected
1643
KernelFunctor<10>();
44+
return 0;
1745
}
1846

1947
// CHECK: ClassTemplateDecl {{.*}} {{.*}} KernelFunctor
@@ -23,3 +51,24 @@ int main() {
2351
// CHECK: SubstNonTypeTemplateParmExpr {{.*}}
2452
// CHECK-NEXT: NonTypeTemplateParmDecl {{.*}}
2553
// CHECK-NEXT: IntegerLiteral{{.*}}10{{$}}
54+
55+
// Test that checks template parameter support on function.
56+
template <int N>
57+
// expected-error@+1{{'num_simd_work_items' attribute requires a positive integral compile time constant expression}}
58+
[[intel::num_simd_work_items(N)]] void func3() {}
59+
60+
int check() {
61+
// no error expected
62+
func3<8>();
63+
//expected-note@+1{{in instantiation of function template specialization 'func3<-1>' requested here}}
64+
func3<-1>();
65+
return 0;
66+
}
67+
68+
// CHECK: FunctionTemplateDecl {{.*}} {{.*}} func3
69+
// CHECK: NonTypeTemplateParmDecl {{.*}} {{.*}} referenced 'int' depth 0 index 0 N
70+
// CHECK: FunctionDecl {{.*}} {{.*}} func3 'void ()'
71+
// CHECK: SYCLIntelNumSimdWorkItemsAttr {{.*}}
72+
// CHECK: SubstNonTypeTemplateParmExpr {{.*}}
73+
// CHECK-NEXT: NonTypeTemplateParmDecl {{.*}}
74+
// CHECK-NEXT: IntegerLiteral{{.*}}8{{$}}

clang/test/SemaSYCL/sycl-device-reqd-sub-group-size-template.cpp

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,33 @@
22

33
// Test that checkes template parameter support for 'reqd_sub_group_size' attribute on sycl device.
44

5+
// Test that checks wrong function template instantiation and ensures that the type
6+
// is checked properly when instantiating from the template definition.
7+
template <typename Ty>
8+
// expected-error@+2{{'reqd_sub_group_size' attribute requires a positive integral compile time constant expression}}
9+
// expected-error@+1 2{{'reqd_sub_group_size' attribute requires an integer constant}}
10+
[[intel::reqd_sub_group_size(Ty{})]] void func() {}
11+
12+
struct S {};
13+
void test() {
14+
//expected-note@+1{{in instantiation of function template specialization 'func<S>' requested here}}
15+
func<S>();
16+
//expected-note@+1{{in instantiation of function template specialization 'func<float>' requested here}}
17+
func<float>();
18+
//expected-note@+1{{in instantiation of function template specialization 'func<int>' requested here}}
19+
func<int>();
20+
}
21+
22+
// Test that checks expression is not a constant expression.
23+
int foo();
24+
// expected-error@+1{{'reqd_sub_group_size' attribute requires an integer constant}}
25+
[[intel::reqd_sub_group_size(foo() + 12)]] void func1();
26+
27+
// Test that checks expression is a constant expression.
28+
constexpr int bar() { return 0; }
29+
[[intel::reqd_sub_group_size(bar() + 12)]] void func2(); // OK
30+
31+
// Test that checks template parameter support on member function of class template.
532
template <int SIZE>
633
class KernelFunctor {
734
public:
@@ -14,6 +41,7 @@ int main() {
1441
KernelFunctor<-1>();
1542
// no error expected
1643
KernelFunctor<10>();
44+
return 0;
1745
}
1846

1947
// CHECK: ClassTemplateDecl {{.*}} {{.*}} KernelFunctor
@@ -23,3 +51,24 @@ int main() {
2351
// CHECK: SubstNonTypeTemplateParmExpr {{.*}}
2452
// CHECK-NEXT: NonTypeTemplateParmDecl {{.*}}
2553
// CHECK-NEXT: IntegerLiteral{{.*}}10{{$}}
54+
55+
// Test that checks template parameter support on function.
56+
template <int N>
57+
// expected-error@+1{{'reqd_sub_group_size' attribute requires a positive integral compile time constant expression}}
58+
[[intel::reqd_sub_group_size(N)]] void func3() {}
59+
60+
int check() {
61+
// no error expected
62+
func3<12>();
63+
//expected-note@+1{{in instantiation of function template specialization 'func3<-1>' requested here}}
64+
func3<-1>();
65+
return 0;
66+
}
67+
68+
// CHECK: FunctionTemplateDecl {{.*}} {{.*}} func3
69+
// CHECK: NonTypeTemplateParmDecl {{.*}} {{.*}} referenced 'int' depth 0 index 0 N
70+
// CHECK: FunctionDecl {{.*}} {{.*}} func3 'void ()'
71+
// CHECK: IntelReqdSubGroupSizeAttr {{.*}}
72+
// CHECK: SubstNonTypeTemplateParmExpr {{.*}}
73+
// CHECK-NEXT: NonTypeTemplateParmDecl {{.*}}
74+
// CHECK-NEXT: IntegerLiteral{{.*}}12{{$}}

clang/test/SemaSYCL/sycl-device-reqd-work-group-size-template.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ int foo();
2424
constexpr int bar() { return 0; }
2525
[[cl::reqd_work_group_size(bar() + 12, bar() + 12, bar() + 12)]] void func2(); // OK
2626

27-
// Test that checks template parameter suppport on member function of class template.
27+
// Test that checks template parameter support on member function of class template.
2828
template <int SIZE, int SIZE1, int SIZE2>
2929
class KernelFunctor {
3030
public:

0 commit comments

Comments
 (0)