File tree Expand file tree Collapse file tree 3 files changed +14
-11
lines changed Expand file tree Collapse file tree 3 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,14 @@ class AttributeCommonInfo {
152
152
// FIXME: Eventually we want to do a list here populated via tablegen. But
153
153
// we want C++ attributes to be permissible on Lambdas, and get propagated
154
154
// to the call operator declaration.
155
- return getParsedKind () == AT_SYCLIntelKernelArgsRestrict;
155
+ // FIXME: Attribute lambda capturing is not a part of SYCL 1.2.1. We shall
156
+ // check if a program is being compiled with -sycl-ext option.
157
+ auto ParsedAttr = getParsedKind ();
158
+ if (ParsedAttr == AT_SYCLIntelKernelArgsRestrict ||
159
+ (ParsedAttr == AT_ReqdWorkGroupSize && isCXX11Attribute ()))
160
+ return true ;
161
+
162
+ return false ;
156
163
}
157
164
158
165
bool isC2xAttribute () const { return SyntaxUsed == AS_C2x; }
Original file line number Diff line number Diff line change @@ -25,10 +25,15 @@ void bar() {
25
25
26
26
Functor f;
27
27
kernel<class kernel_name2 >(f);
28
+
29
+ kernel<class kernel_name3 >(
30
+ []() [[cl::reqd_work_group_size (8 , 8 , 8 )]] {});
28
31
}
29
32
30
33
// CHECK: define spir_kernel void @{{.*}}kernel_name1() {{.*}} !reqd_work_group_size ![[WGSIZE32:[0-9]+]]
31
34
// CHECK: define spir_kernel void @{{.*}}kernel_name2() {{.*}} !reqd_work_group_size ![[WGSIZE8:[0-9]+]]
35
+ // CHECK: define spir_kernel void @{{.*}}kernel_name3() {{.*}} !reqd_work_group_size ![[WGSIZE88:[0-9]+]]
32
36
// CHECK: ![[WGSIZE32]] = !{i32 32, i32 16, i32 16}
33
37
// CHECK: ![[WGSIZE8]] = !{i32 8, i32 1, i32 1}
38
+ // CHECK: ![[WGSIZE88]] = !{i32 8, i32 8, i32 8}
34
39
Original file line number Diff line number Diff line change @@ -96,17 +96,8 @@ void bar() {
96
96
f32x32x1 ();
97
97
});
98
98
99
- // Support for reqd_work_group_size (and other SYCL attributes) that apply to
100
- // lambda expressions is not implemented in clang yet.
101
- // When it lands, the following code is expected to compile successfully.
102
- //
103
- // expected-error@+1 {{'reqd_work_group_size' attribute cannot be applied to types}}
104
- kernel<class kernel_name9 >([]() [[cl::reqd_work_group_size (32 , 32 , 32 )]] {
105
- f32x32x32 ();
106
- });
107
- // While this case is not going to work (wrong syntax):
108
99
// expected-error@+1 {{expected variable name or 'this' in lambda capture list}}
109
- kernel<class kernel_name10 >([[cl::reqd_work_group_size (32 , 32 , 32 )]] []() {
100
+ kernel<class kernel_name9 >([[cl::reqd_work_group_size (32 , 32 , 32 )]] []() {
110
101
f32x32x32 ();
111
102
});
112
103
You can’t perform that action at this time.
0 commit comments