You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SYCL][NFC] Fix num_simd_work_items and reqd_work_group_size argument check
This patch fixes#3252.
According to https://www.intel.com/content/www/us/en/programmable/documentation/mwh1391807965224.html#mwh1391807939093 (section : 5.2.13. Specifying Number of SIMD Work-Items):
Important: Introduce the num_simd_work_items attribute in conjunction with the reqd_work_group_size attribute. The num_simd_work_items attribute you specify must evenly divide the work-group size you specify for the reqd_work_group_size attribute.
Based on discussion, the requirement applies only for X argument of reqd_work_group_size attribute.
Signed-off-by: Soumi Manna <[email protected]>
Copy file name to clipboardExpand all lines: clang/test/SemaSYCL/num_simd_work_items_device.cpp
+21-12Lines changed: 21 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -41,29 +41,29 @@ struct FuncObj {
41
41
42
42
#ifdef TRIGGER_ERROR
43
43
structTRIFuncObjBad1 {
44
-
[[intel::num_simd_work_items(3)]] // expected-error{{'num_simd_work_items' attribute must evenly divide the work-group size for the 'reqd_work_group_size' attribute}}
44
+
[[intel::num_simd_work_items(3)]] // expected-error{{'num_simd_work_items' attribute must evenly divide X argument of 'reqd_work_group_size' attribute}}
45
45
[[intel::reqd_work_group_size(5, 5, 5)]] //expected-note{{conflicting attribute is here}}
46
46
void
47
47
operator()() const {}
48
48
};
49
49
50
50
structTRIFuncObjBad2 {
51
51
[[intel::reqd_work_group_size(5, 5, 5)]] // expected-note{{conflicting attribute is here}}
52
-
[[intel::num_simd_work_items(3)]] // expected-error{{'num_simd_work_items' attribute must evenly divide the work-group size for the 'reqd_work_group_size' attribute}}
52
+
[[intel::num_simd_work_items(3)]] // expected-error{{'num_simd_work_items' attribute must evenly divide X argument of 'reqd_work_group_size' attribute}}
53
53
void
54
54
operator()() const {}
55
55
};
56
56
57
57
structTRIFuncObjBad3 {
58
-
[[intel::num_simd_work_items(3)]] // expected-error{{'num_simd_work_items' attribute must evenly divide the work-group size for the 'reqd_work_group_size' attribute}}
59
-
[[cl::reqd_work_group_size(5, 5, 5)]] //expected-note{{conflicting attribute is here}}
58
+
[[intel::num_simd_work_items(3)]] // expected-error{{'num_simd_work_items' attribute must evenly divide X argument of 'reqd_work_group_size' attribute}}
59
+
[[cl::reqd_work_group_size(5, 5, 5)]] //expected-note{{conflicting attribute is here}}
60
60
void
61
61
operator()() const {}
62
62
};
63
63
64
64
structTRIFuncObjBad4 {
65
65
[[cl::reqd_work_group_size(5, 5, 5)]] // expected-note{{conflicting attribute is here}}
66
-
[[intel::num_simd_work_items(3)]] // expected-error{{'num_simd_work_items' attribute must evenly divide the work-group size for the 'reqd_work_group_size' attribute}}
66
+
[[intel::num_simd_work_items(3)]] // expected-error{{'num_simd_work_items' attribute must evenly divide X argument of 'reqd_work_group_size' attribute}}
67
67
void
68
68
operator()() const {}
69
69
};
@@ -75,29 +75,29 @@ struct TRIFuncObjBad5 {
75
75
};
76
76
77
77
structTRIFuncObjBad6 {
78
-
[[intel::num_simd_work_items(3)]] // expected-error{{'num_simd_work_items' attribute must evenly divide the work-group size for the 'reqd_work_group_size' attribute}}
78
+
[[intel::num_simd_work_items(3)]] // expected-error{{'num_simd_work_items' attribute must evenly divide X argument of 'reqd_work_group_size' attribute}}
79
79
[[intel::reqd_work_group_size(5)]] //expected-note{{conflicting attribute is here}}
80
80
void
81
81
operator()() const {}
82
82
};
83
83
84
84
structTRIFuncObjBad7 {
85
85
[[intel::reqd_work_group_size(5)]] // expected-note{{conflicting attribute is here}}
86
-
[[intel::num_simd_work_items(3)]] // expected-error{{'num_simd_work_items' attribute must evenly divide the work-group size for the 'reqd_work_group_size' attribute}}
86
+
[[intel::num_simd_work_items(3)]] // expected-error{{'num_simd_work_items' attribute must evenly divide X argument of 'reqd_work_group_size' attribute}}
87
87
void
88
88
operator()() const {}
89
89
};
90
90
91
91
structTRIFuncObjBad8 {
92
-
[[intel::num_simd_work_items(3)]] // expected-error{{'num_simd_work_items' attribute must evenly divide the work-group size for the 'reqd_work_group_size' attribute}}
93
-
[[intel::reqd_work_group_size(5, 5)]] // expected-note{{conflicting attribute is here}}
92
+
[[intel::num_simd_work_items(4)]] // expected-error{{'num_simd_work_items' attribute must evenly divide X argument of 'reqd_work_group_size' attribute}}
93
+
[[intel::reqd_work_group_size(3, 64)]] // expected-note{{conflicting attribute is here}}
94
94
void
95
95
operator()() const {}
96
96
};
97
97
98
98
structTRIFuncObjBad9 {
99
-
[[intel::reqd_work_group_size(5, 5)]] // expected-note{{conflicting attribute is here}}
100
-
[[intel::num_simd_work_items(3)]] // expected-error{{'num_simd_work_items' attribute must evenly divide the work-group size for the 'reqd_work_group_size' attribute}}
99
+
[[intel::reqd_work_group_size(3, 64)]] // expected-note{{conflicting attribute is here}}
100
+
[[intel::num_simd_work_items(4)]] // expected-error{{'num_simd_work_items' attribute must evenly divide X argument of 'reqd_work_group_size' attribute}}
101
101
void
102
102
operator()() const {}
103
103
};
@@ -155,6 +155,13 @@ struct TRIFuncObjBad18 {
155
155
[[intel::reqd_work_group_size(-1)]] // expected-warning{{implicit conversion changes signedness: 'int' to 'unsigned long long'}}
156
156
voidoperator()() const {}
157
157
};
158
+
159
+
structTRIFuncObjBad19 {
160
+
[[intel::reqd_work_group_size(5, 64, 64)]] // expected-note{{conflicting attribute is here}}
161
+
[[intel::num_simd_work_items(4)]] // expected-error{{'num_simd_work_items' attribute must evenly divide X argument of 'reqd_work_group_size' attribute}}
[]() [[intel::num_simd_work_items(1), intel::num_simd_work_items(2)]]{}); // expected-warning{{attribute 'num_simd_work_items' is already applied with different parameters}} \
0 commit comments