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
Copy file name to clipboardExpand all lines: clang/test/SemaSYCL/check-work-group-size-hint-device.cpp
+3-38Lines changed: 3 additions & 38 deletions
Original file line number
Diff line number
Diff line change
@@ -17,8 +17,7 @@
17
17
18
18
// Produce a conflicting attribute warning when the args are different.
19
19
[[sycl::work_group_size_hint(4, 1, 1)]] voidf3(); // expected-note {{previous attribute is here}}
20
-
[[sycl::work_group_size_hint(1, 1, 32)]] voidf3() {} // expected-warning {{attribute 'work_group_size_hint' is already applied with different arguments}} \
21
-
// expected-warning {{'work_group_size_hint' attribute can only be applied to a SYCL kernel function}}
20
+
[[sycl::work_group_size_hint(1, 1, 32)]] voidf3(); // expected-warning {{attribute 'work_group_size_hint' is already applied with different arguments}}
// Show that the attribute works on member functions.
@@ -101,20 +84,7 @@ class Functor16x2x1 {
101
84
102
85
classFunctor4x4x4 {
103
86
public:
104
-
[[sycl::work_group_size_hint(4, 4, 4)]] voidoperator()() const {}; // expected-warning {{'work_group_size_hint' attribute can only be applied to a SYCL kernel function}}
105
-
};
106
-
107
-
// Checking whether propagation of the attribute happens or not, according to the SYCL version.
108
-
#if defined(EXPECT_PROP) // if attribute is propagated, then we expect errors here
109
-
voidf8x8x8(){};
110
-
#else// otherwise no error
111
-
[[sycl::work_group_size_hint(8, 8, 8)]] voidf8x8x8(){}; // expected-warning {{'work_group_size_hint' attribute can only be applied to a SYCL kernel function}}
Copy file name to clipboardExpand all lines: clang/test/SemaSYCL/intel-max-work-group-size.cpp
+5-6Lines changed: 5 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -70,15 +70,14 @@ void instantiate() {
70
70
// a declaration along with [[sycl::reqd_work_group_size(X1, Y1, Z1)]]
71
71
// attribute, check to see if values of reqd_work_group_size arguments are
72
72
// equal or less than values coming from max_work_group_size attribute.
73
-
[[sycl::reqd_work_group_size(64, 64, 64)]] // expected-note {{conflicting attribute is here}} // expected-warning {{'reqd_work_group_size' attribute can only be applied to a SYCL kernel function}}
73
+
[[sycl::reqd_work_group_size(64, 64, 64)]] // expected-note {{conflicting attribute is here}}
[[sycl::reqd_work_group_size(2, 2, 2)]] voidf10(); // OK
80
80
81
-
[[sycl::reqd_work_group_size(2, 2, 2)]] [[intel::max_work_group_size(4, 4, 4)]] voidf11() {} // expected-warning {{'reqd_work_group_size' attribute can only be applied to a SYCL kernel function}}
82
81
83
82
[[sycl::reqd_work_group_size(64, 64, 64)]] voidf12(); // expected-note {{conflicting attribute is here}}
[[cl::reqd_work_group_size(1, 2, 3)]] // expected-warning {{attribute 'cl::reqd_work_group_size' is deprecated}} \
94
-
// expected-note {{did you mean to use 'sycl::reqd_work_group_size' instead?}} // expected-warning {{'reqd_work_group_size' attribute can only be applied to a SYCL kernel function}}
93
+
// expected-note {{did you mean to use 'sycl::reqd_work_group_size' instead?}}
95
94
[[intel::max_work_group_size(1, 2, 3)]] void
96
-
f15() {}// OK
95
+
f15();// OK
97
96
98
97
[[intel::max_work_group_size(2, 3, 7)]] voidf16(); // expected-note {{conflicting attribute is here}}
[[intel::max_work_group_size(1, 2, 3)]] [[sycl::reqd_work_group_size(1, 2, 3)]] voidf17(){}; // expected-warning {{'reqd_work_group_size' attribute can only be applied to a SYCL kernel function}}
[[intel::reqd_sub_group_size(16)]] voidA() // expected-warning {{'reqd_sub_group_size' attribute can only be applied to a SYCL kernel function}}
37
-
{
38
-
}
39
36
40
-
[[intel::reqd_sub_group_size(16)]] SYCL_EXTERNAL voidB() { // expected-warning {{'reqd_sub_group_size' attribute can only be applied to a SYCL kernel function}}
41
-
A();
42
-
}
43
-
// expected-note@+1 {{conflicting attribute is here}}
44
-
[[intel::reqd_sub_group_size(2)]] voidsg_size2() {} // expected-warning {{'reqd_sub_group_size' attribute can only be applied to a SYCL kernel function}}
45
-
46
-
// expected-note@+3 {{conflicting attribute is here}}
47
-
// expected-error@+2 {{conflicting attributes applied to a SYCL kernel}}
48
-
// expected-warning@+1 {{'reqd_sub_group_size' attribute can only be applied to a SYCL kernel function}}
[[sycl::reqd_work_group_size(32, 32, 32)]] voidf3(); // OK
31
30
32
31
// Produce a conflicting attribute warning when the args are different.
33
-
[[sycl::reqd_work_group_size(6, 6, 6)]] // expected-note {{previous attribute is here}} // expected-warning {{'reqd_work_group_size' attribute can only be applied to a SYCL kernel function}}
32
+
[[sycl::reqd_work_group_size(6, 6, 6)]] // expected-note {{previous attribute is here}}
34
33
[[sycl::reqd_work_group_size(16, 16, 16)]] void// expected-error {{attribute 'reqd_work_group_size' is already applied with different arguments}}
35
-
f4() {}
34
+
f4();
36
35
37
36
// Catch the easy case where the attributes are all specified at once with
38
37
// different arguments.
39
38
structTRIFuncObjGood1 {
40
-
// expected-note@+3 {{previous attribute is here}}
41
-
// expected-error@+2 {{attribute 'reqd_work_group_size' is already applied with different arguments}}
42
-
// expected-warning@+1 {{'reqd_work_group_size' attribute can only be applied to a SYCL kernel function}}
[[sycl::reqd_work_group_size(8, 8)]] void// expected-note {{previous attribute is here}}
55
-
operator()() const;
56
-
};
57
-
58
-
[[sycl::reqd_work_group_size(4, 4)]] // expected-error {{attribute 'reqd_work_group_size' is already applied with different arguments}} \
59
-
// expected-warning {{'reqd_work_group_size' attribute can only be applied to a SYCL kernel function}}
60
-
void
61
-
TRIFuncObjGood3::operator()() const {}
62
-
63
50
// Show that the attribute works on member functions.
64
51
classFunctor {
65
52
public:
@@ -77,9 +64,9 @@ class FunctorC {
77
64
78
65
classFunctor32 {
79
66
public:
80
-
[[sycl::reqd_work_group_size(32, 1, 1)]] // expected-note {{previous attribute is here}} // expected-warning {{'reqd_work_group_size' attribute can only be applied to a SYCL kernel function}}
67
+
[[sycl::reqd_work_group_size(32, 1, 1)]] // expected-note {{previous attribute is here}}
81
68
[[sycl::reqd_work_group_size(1, 1, 32)]] void// expected-error{{attribute 'reqd_work_group_size' is already applied with different arguments}}
82
-
operator()() const {}
69
+
operator()() const;
83
70
};
84
71
85
72
// Ensure that template arguments behave appropriately based on instantiations.
// Tests for 'reqd_work_group_size' attribute duplication.
118
103
119
-
[[sycl::reqd_work_group_size(8)]] // expected-note {{previous attribute is here}} // expected-warning {{'reqd_work_group_size' attribute can only be applied to a SYCL kernel function}}
104
+
[[sycl::reqd_work_group_size(8)]] // expected-note {{previous attribute is here}}
120
105
[[sycl::reqd_work_group_size(1, 1, 8)]] void// expected-error {{attribute 'reqd_work_group_size' is already applied with different arguments}}
121
-
f8(){};
106
+
f8();
122
107
123
-
[[sycl::reqd_work_group_size(32, 32, 1)]] // expected-note {{previous attribute is here}} // expected-warning {{'reqd_work_group_size' attribute can only be applied to a SYCL kernel function}}
124
-
[[sycl::reqd_work_group_size(32, 32)]] voidf9() {}// expected-error {{attribute 'reqd_work_group_size' is already applied with different arguments}}
108
+
[[sycl::reqd_work_group_size(32, 32, 1)]] // expected-note {{previous attribute is here}}
109
+
[[sycl::reqd_work_group_size(32, 32)]] voidf9();// expected-error {{attribute 'reqd_work_group_size' is already applied with different arguments}}
125
110
126
111
// Test that template redeclarations also get diagnosed properly.
0 commit comments