7
7
class Functor {
8
8
public:
9
9
[[cl::reqd_work_group_size(4 , 1 , 1 )]] void operator ()() {}
10
-
11
10
};
12
11
13
12
template <typename name, typename Func>
@@ -24,25 +23,33 @@ void bar() {
24
23
// expected-note@-1 {{conflicting attribute is here}}
25
24
[[cl::reqd_work_group_size(32 , 1 , 1 )]] void f32x1x1 () {} // expected-note {{conflicting attribute is here}}
26
25
27
- [[cl::reqd_work_group_size(16 , 1 , 1 )]] void f16x1x1 () {} // expected-note {{conflicting attribute is here}}
26
+ [[cl::reqd_work_group_size(16 , 1 , 1 )]] void f16x1x1 () {} // expected-note {{conflicting attribute is here}}
28
27
[[cl::reqd_work_group_size(16 , 16 , 1 )]] void f16x16x1 () {} // expected-note {{conflicting attribute is here}}
29
28
30
- [[cl::reqd_work_group_size(32 , 32 , 1 )]] void f32x32x1 () {} // expected-note {{conflicting attribute is here}}
29
+ [[cl::reqd_work_group_size(32 , 32 , 1 )]] void f32x32x1 () {} // expected-note {{conflicting attribute is here}}
31
30
[[cl::reqd_work_group_size(32 , 32 , 32 )]] void f32x32x32 () {} // expected-note {{conflicting attribute is here}}
32
31
33
32
class Functor16 {
34
33
public:
35
- [[cl::reqd_work_group_size(16 , 1 , 1 )]] void operator ()() {}
34
+ [[cl::reqd_work_group_size(16 , 1 , 1 )]] [[cl::reqd_work_group_size( 16 , 1 , 1 )]] void operator ()() {}
36
35
};
37
36
37
+ #ifdef TRIGGER_ERROR
38
+ class Functor32 {
39
+ public:
40
+ // expected-warning@+2{{attribute 'reqd_work_group_size' is already applied with different parameters}}
41
+ // expected-error@+1{{'reqd_work_group_size' attribute conflicts with 'reqd_work_group_size' attribute}}
42
+ [[cl::reqd_work_group_size(32 , 1 , 1 )]] [[cl::reqd_work_group_size(1 , 1 , 32 )]] void operator ()() {}
43
+ };
44
+ #endif
38
45
class Functor16x16x16 {
39
46
public:
40
47
[[cl::reqd_work_group_size(16 , 16 , 16 )]] void operator ()() {}
41
48
};
42
49
43
50
class Functor8 { // expected-error {{conflicting attributes applied to a SYCL kernel}}
44
51
public:
45
- [[cl::reqd_work_group_size(8 , 1 , 1 )]] void operator ()() { // expected-note {{conflicting attribute is here}}
52
+ [[cl::reqd_work_group_size(1 , 1 , 8 )]] void operator ()() { // expected-note {{conflicting attribute is here}}
46
53
f4x1x1 ();
47
54
}
48
55
};
@@ -77,15 +84,17 @@ void bar() {
77
84
FunctorAttr fattr;
78
85
kernel<class kernel_name4 >(fattr);
79
86
80
- kernel<class kernel_name5 >([]() [[cl::reqd_work_group_size (32 , 32 , 32 )]] {
81
- f32x32x32 ();
87
+ kernel<class kernel_name5 >([]() [[cl::reqd_work_group_size (32 , 32 , 32 ), cl::reqd_work_group_size ( 32 , 32 , 32 ) ]] {
88
+ f32x32x32 ();
82
89
});
83
90
84
-
85
91
#ifdef TRIGGER_ERROR
86
92
Functor8 f8 ;
87
93
kernel<class kernel_name6 >(f8 );
88
94
95
+ Functor32 f32 ;
96
+ kernel<class kernel_name1 >(f32 );
97
+
89
98
kernel<class kernel_name7 >([]() { // expected-error {{conflicting attributes applied to a SYCL kernel}}
90
99
f4x1x1 ();
91
100
f32x1x1 ();
@@ -102,17 +111,17 @@ void bar() {
102
111
});
103
112
104
113
// expected-error@+1 {{expected variable name or 'this' in lambda capture list}}
105
- kernel<class kernel_name10 >([[cl::reqd_work_group_size (32 , 32 , 32 )]] []() {
114
+ kernel<class kernel_name10 >([[cl::reqd_work_group_size (32 , 32 , 32 )]][]() {
106
115
f32x32x32 ();
107
116
});
108
117
109
118
#endif
110
119
}
111
120
112
121
// CHECK: FunctionDecl {{.*}} {{.*}}kernel_name1
113
- // CHECK: ReqdWorkGroupSizeAttr {{.*}} 16 1 1
122
+ // CHECK: ReqdWorkGroupSizeAttr {{.*}} 1 1 16
114
123
// CHECK: FunctionDecl {{.*}} {{.*}}kernel_name2
115
- // CHECK: ReqdWorkGroupSizeAttr {{.*}} 4 1 1
124
+ // CHECK: ReqdWorkGroupSizeAttr {{.*}} 1 1 4
116
125
// CHECK: FunctionDecl {{.*}} {{.*}}kernel_name3
117
126
// CHECK: ReqdWorkGroupSizeAttr {{.*}} 16 16 16
118
127
// CHECK: FunctionDecl {{.*}} {{.*}}kernel_name4
0 commit comments