Skip to content

Commit c583a20

Browse files
authored
[SYCL] Remove deprecated intel::reqd_work_group_size attribute (#4433)
This patch removes deprecated [[intel::reqd_work_group_size()]] attribute in favor of SYCL 2020 attribute [[sycl::reqd_work_group_size()]]. Signed-off-by: Soumi Manna <[email protected]>
1 parent 8ab843b commit c583a20

9 files changed

+17
-37
lines changed

clang/include/clang/Basic/Attr.td

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2985,11 +2985,10 @@ def NoDeref : TypeAttr {
29852985
let Documentation = [NoDerefDocs];
29862986
}
29872987

2988-
// Default arguments can only be used with the intel::reqd_work_group_size or
2989-
// sycl::reqd_work_group_size spellings.
2988+
// Default arguments can only be used with the sycl::reqd_work_group_size
2989+
// spelling.
29902990
def ReqdWorkGroupSize : InheritableAttr {
29912991
let Spellings = [GNU<"reqd_work_group_size">,
2992-
CXX11<"intel", "reqd_work_group_size">,
29932992
CXX11<"cl", "reqd_work_group_size">,
29942993
CXX11<"sycl", "reqd_work_group_size">];
29952994
let Args = [ExprArgument<"XDim">,

clang/include/clang/Basic/AttrDocs.td

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2673,10 +2673,10 @@ allows the Y and Z arguments to be optional. If not provided by the user, the
26732673
value of Y and Z defaults to 1. See section 5.8.1 Kernel Attributes for more
26742674
details.
26752675

2676-
In SYCL 1.2.1 mode, the ``intel::reqd_work_group_size``,
2677-
``cl::reqd_work_group_size``, and ``sycl::reqd_work_group_size`` attributes are
2678-
propagated from the function they are applied to onto the kernel which calls the
2679-
function. In SYCL 2020 mode, the attributes are not propagated to the kernel.
2676+
In SYCL 1.2.1 mode, the ``cl::reqd_work_group_size`` and
2677+
``sycl::reqd_work_group_size`` attributes are propagated from the function they
2678+
are applied to onto the kernel which calls the function. In SYCL 2020 mode, the
2679+
attributes are not propagated to the kernel.
26802680

26812681
.. code-block:: c++
26822682

@@ -2700,14 +2700,6 @@ The ``[[cl::reqd_work_group_size(X, Y, Z)]]`` and
27002700
``__attribute__((reqd_work_group_size(X, Y, Z)))`` spellings are both
27012701
deprecated in SYCL 2020.
27022702

2703-
As an Intel extension, the ``[[intel::reqd_work_group_size(X, Y, Z)]]``
2704-
spelling is supported with the same semantics as the
2705-
``[[sycl::reqd_work_group_size(X, Y, Z)]]`` spelling.
2706-
2707-
The ``[[intel::reqd_work_group_size(X, Y, Z)]]`` attribute spelling
2708-
is deprecated in favor of the SYCL 2020 attribute spelling
2709-
``[[sycl::reqd_work_group_size]]``.
2710-
27112703
In OpenCL C, this attribute is available with the GNU spelling
27122704
(``__attribute__((reqd_work_group_size(X, Y, Z)))``), see section
27132705
6.7.2 Optional Attribute Qualifiers of OpenCL 1.2 specification for details.

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,6 @@ void Sema::CheckDeprecatedSYCLAttributeSpelling(const ParsedAttr &A,
338338
return;
339339
}
340340

341-
// Deprecate [[intel::reqd_work_group_size]] attribute spelling in favor
342-
// of the SYCL 2020 attribute spelling [[sycl::reqd_work_group_size]].
343-
if (A.getKind() == ParsedAttr::AT_ReqdWorkGroupSize && A.hasScope() &&
344-
A.getScopeName()->isStr("intel")) {
345-
DiagnoseDeprecatedAttribute(A, "sycl", NewName);
346-
return;
347-
}
348-
349341
// All GNU-style spellings are deprecated in favor of a C++-style spelling.
350342
if (A.getSyntax() == ParsedAttr::AS_GNU) {
351343
// Note: we cannot suggest an automatic fix-it because GNU-style

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,7 @@ struct TRIFuncObjBad5 {
166166
};
167167

168168
struct TRIFuncObjBad6 {
169-
[[intel::reqd_work_group_size(4)]] // expected-error{{all 'reqd_work_group_size' attribute arguments must be '1' when the 'max_global_work_dim' attribute argument is '0'}} \
170-
// expected-warning {{attribute 'intel::reqd_work_group_size' is deprecated}} \
171-
// expected-note {{did you mean to use 'sycl::reqd_work_group_size' instead?}}
169+
[[sycl::reqd_work_group_size(4)]] // expected-error{{all 'reqd_work_group_size' attribute arguments must be '1' when the 'max_global_work_dim' attribute argument is '0'}}
172170
[[intel::max_global_work_dim(0)]] void
173171
operator()() const {}
174172
};

clang/test/SemaSYCL/intel-reqd-work-group-size-device-direct-prop.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ class Functor64 {
5656

5757
class Functor16x16x16 {
5858
public:
59-
[[intel::reqd_work_group_size(16, 16, 16)]] void operator()() const {} // expected-warning {{attribute 'intel::reqd_work_group_size' is deprecated}} \
60-
// expected-note {{did you mean to use 'sycl::reqd_work_group_size' instead?}}
59+
[[sycl::reqd_work_group_size(16, 16, 16)]] void operator()() const {}
6160
};
6261

6362
class FunctorAttr {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ class Functor33 {
3838
[[sycl::reqd_work_group_size(32, -4)]] void operator()() const {}
3939
};
4040

41+
[[intel::reqd_work_group_size(4, 2, 9)]] void unknown() {} // expected-warning{{unknown attribute 'reqd_work_group_size' ignored}}
42+
4143
class Functor30 {
4244
public:
4345
// expected-warning@+1 2{{implicit conversion changes signedness: 'int' to 'unsigned long long'}}

clang/test/SemaSYCL/num_simd_work_items_device.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ struct FuncObj {
4242
};
4343

4444
#ifdef TRIGGER_ERROR
45-
// If the declaration has a [[intel::reqd_work_group_size]]
46-
// [[cl::reqd_work_group_size]] attribute, tests that check
45+
// If the declaration has a [[sycl::reqd_work_group_size]]
46+
// or [[cl::reqd_work_group_size]] attribute, tests that check
4747
// if the work group size attribute argument (the last argument)
4848
// can be evenly divided by the [[intel::num_simd_work_items()]] attribute.
4949
struct TRIFuncObjBad1 {
@@ -60,7 +60,7 @@ struct TRIFuncObjBad2 {
6060
operator()() const {}
6161
};
6262

63-
// Tests for the default values of [[intel::reqd_work_group_size()]].
63+
// Tests for the default values of [[sycl::reqd_work_group_size()]].
6464

6565
// FIXME: This should be accepted instead of error which turns out to be
6666
// an implementation bug that shouldn't be visible to the user as there
@@ -131,9 +131,7 @@ struct TRIFuncObjBad8 {
131131
[[intel::num_simd_work_items(2)]] // expected-error{{'num_simd_work_items' attribute must evenly divide the work-group size for the 'reqd_work_group_size' attribute}}
132132
[[sycl::reqd_work_group_size(4, 2, 3)]] void func1(); // expected-note{{conflicting attribute is here}}
133133

134-
[[intel::reqd_work_group_size(4, 2, 3)]] // expected-note{{conflicting attribute is here}} \
135-
// expected-warning {{attribute 'intel::reqd_work_group_size' is deprecated}} \
136-
// expected-note {{did you mean to use 'sycl::reqd_work_group_size' instead?}}
134+
[[sycl::reqd_work_group_size(4, 2, 3)]] // expected-note{{conflicting attribute is here}}
137135
[[intel::num_simd_work_items(2)]] void func2(); // expected-error{{'num_simd_work_items' attribute must evenly divide the work-group size for the 'reqd_work_group_size' attribute}}
138136

139137
[[intel::num_simd_work_items(2)]] // expected-error{{'num_simd_work_items' attribute must evenly divide the work-group size for the 'reqd_work_group_size' attribute}}
@@ -211,7 +209,7 @@ struct TRIFuncObjBad18 {
211209
};
212210

213211
#endif // TRIGGER_ERROR
214-
// If the declaration has a [[intel::reqd_work_group_size()]]
212+
// If the declaration has a [[sycl::reqd_work_group_size()]]
215213
// or [[cl::reqd_work_group_size()]] or
216214
// __attribute__((reqd_work_group_size)) attribute, check to see
217215
// if the last argument can be evenly divided by the

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
@@ -1,6 +1,6 @@
11
// RUN: %clang_cc1 -fsycl-is-device -fsyntax-only -ast-dump -verify -pedantic %s | FileCheck %s
22

3-
// Test that checks template parameter support for 'intel::reqd_work_group_size' attribute on sycl device.
3+
// Test that checks template parameter support for 'sycl::reqd_work_group_size' attribute on sycl device.
44

55
// Test that checks wrong function template instantiation and ensures that the type
66
// is checked properly when instantiating from the template definition.

sycl/test/kernel_param/attr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ int main() {
1212
queue myQueue;
1313
myQueue.submit([&](handler &cgh) {
1414
cgh.parallel_for<class C>(Size, [=](item<1> ITEM)
15-
[[intel::reqd_work_group_size(4)]]{});
15+
[[sycl::reqd_work_group_size(4)]]{});
1616
});
1717
}
1818

0 commit comments

Comments
 (0)