Skip to content

Commit 75d1a51

Browse files
committed
[SYCL] Remove deprecated spelling of IntelReqdSubGroupSize attribute
Commit b2da2c8 added support for new spelling [[intel::reqd_sub_group_size()]] and deprecated previous spelling [[cl::intel_reqd_sub_group_size()]] of the IntelReqdSubGroupSize attribute. This patch removes that deprecated spelling and updates several tests of IntelReqdSubGroupSize attribute. Signed-off-by: Soumi Manna <[email protected]>
1 parent 1202ccd commit 75d1a51

File tree

8 files changed

+12
-43
lines changed

8 files changed

+12
-43
lines changed

clang/include/clang/Basic/Attr.td

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,6 @@ def LoopUnrollHint : InheritableAttr {
12991299

13001300
def IntelReqdSubGroupSize: InheritableAttr {
13011301
let Spellings = [GNU<"intel_reqd_sub_group_size">,
1302-
CXX11<"cl", "intel_reqd_sub_group_size">,
13031302
CXX11<"intel", "reqd_sub_group_size">];
13041303
let Args = [ExprArgument<"SubGroupSize">];
13051304
let Subjects = SubjectList<[Function, CXXMethod], ErrorDiag>;

clang/include/clang/Basic/AttrDocs.td

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3476,30 +3476,16 @@ code. See `cl_intel_required_subgroup_size
34763476
for details.
34773477

34783478
SYCL documentation:
3479-
The [[cl::intel_reqd_sub_group_size(n)]] and [[intel::reqd_sub_group_size(n)]]
3480-
attribute indicates that the kernel must be compiled and executed with a
3481-
sub-group of size n. The value of n must be set to a sub-group size supported
3482-
by the device, or device compilation will fail.
3479+
The [[intel::reqd_sub_group_size(n)]] attribute indicates that the kernel must
3480+
be compiled and executed with a sub-group of size n. The value of n must be set
3481+
to a sub-group size supported by the device, or device compilation will fail.
34833482

34843483
In addition to device functions, the required sub-group size attribute may also
34853484
be specified in the definition of a named functor object and lambda functions,
34863485
as in the examples below:
34873486

34883487
.. code-block:: c++
34893488

3490-
class Functor
3491-
{
3492-
void operator()(item<1> item) [[cl::intel_reqd_sub_group_size(16)]]
3493-
{
3494-
/* kernel code */
3495-
}
3496-
}
3497-
3498-
kernel<class kernel_name>(
3499-
[]() [[cl::intel_reqd_sub_group_size(n)]] {
3500-
/* kernel code */
3501-
});
3502-
35033489
class Functor
35043490
{
35053491
[[intel::reqd_sub_group_size(16)]] void operator()(item<1> item)

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11063,11 +11063,6 @@ def err_ivdep_declrefexpr_arg : Error<
1106311063
def warn_ivdep_redundant : Warning <"ignoring redundant Intel FPGA loop "
1106411064
"attribute 'ivdep': safelen %select{INF|%1}0 >= safelen %select{INF|%3}2">,
1106511065
InGroup<IgnoredAttributes>;
11066-
def warn_attribute_spelling_deprecated : Warning<
11067-
"attribute %0 is deprecated">,
11068-
InGroup<DeprecatedAttributes>;
11069-
def note_spelling_suggestion : Note<
11070-
"did you mean to use %0 instead?">;
1107111066

1107211067
// errors of expect.with.probability
1107311068
def err_probability_not_constant_float : Error<

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3013,13 +3013,6 @@ static void handleSubGroupSize(Sema &S, Decl *D, const ParsedAttr &AL) {
30133013
if (D->getAttr<IntelReqdSubGroupSizeAttr>())
30143014
S.Diag(AL.getLoc(), diag::warn_duplicate_attribute) << AL;
30153015

3016-
if (AL.getAttributeSpellingListIndex() ==
3017-
IntelReqdSubGroupSizeAttr::CXX11_cl_intel_reqd_sub_group_size) {
3018-
S.Diag(AL.getLoc(), diag::warn_attribute_spelling_deprecated) << AL;
3019-
S.Diag(AL.getLoc(), diag::note_spelling_suggestion)
3020-
<< "'intel::reqd_sub_group_size'";
3021-
}
3022-
30233016
S.addIntelReqdSubGroupSizeAttr(D, AL, E);
30243017
}
30253018

clang/test/CodeGenSYCL/reqd-sub-group-size.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
class Functor16 {
44
public:
5-
[[cl::intel_reqd_sub_group_size(16)]] void operator()() const {}
5+
[[intel::reqd_sub_group_size(16)]] void operator()() const {}
66
};
77

8-
[[cl::intel_reqd_sub_group_size(8)]] void foo() {}
8+
[[intel::reqd_sub_group_size(8)]] void foo() {}
99

1010
class Functor {
1111
public:
@@ -17,7 +17,7 @@ class Functor {
1717
template <int SIZE>
1818
class Functor5 {
1919
public:
20-
[[cl::intel_reqd_sub_group_size(SIZE)]] void operator()() const {}
20+
[[intel::reqd_sub_group_size(SIZE)]] void operator()() const {}
2121
};
2222

2323
template <typename name, typename Func>
@@ -33,7 +33,7 @@ void bar() {
3333
kernel<class kernel_name2>(f);
3434

3535
kernel<class kernel_name3>(
36-
[]() [[cl::intel_reqd_sub_group_size(4)]] {});
36+
[]() [[intel::reqd_sub_group_size(4)]] {});
3737

3838
Functor5<2> f5;
3939
kernel<class kernel_name4>(f5);

clang/test/CodeGenSYCL/sycl-multi-kernel-attr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
class Functor {
44
public:
5-
[[cl::intel_reqd_sub_group_size(4), cl::reqd_work_group_size(32, 16, 16)]] void operator()() const {}
5+
[[intel::reqd_sub_group_size(4), cl::reqd_work_group_size(32, 16, 16)]] void operator()() const {}
66
};
77

88
template <typename Name, typename Func>

clang/test/SemaSYCL/reqd-sub-group-size-device.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77

88
class Functor16 {
99
public:
10-
// expected-warning@+2 {{attribute 'intel_reqd_sub_group_size' is deprecated}}
11-
// expected-note@+1 {{did you mean to use 'intel::reqd_sub_group_size' instead?}}
12-
[[cl::intel_reqd_sub_group_size(16)]] void operator()() const {}
10+
[[intel::reqd_sub_group_size(16)]] void operator()() const {}
1311
};
1412

1513
class Functor8 { // expected-error {{conflicting attributes applied to a SYCL kernel}}
@@ -55,9 +53,7 @@ void bar() {
5553

5654
kernel<class kernel_name5>([]() [[intel::reqd_sub_group_size(2)]]{});
5755
kernel<class kernel_name6>([]() [[intel::reqd_sub_group_size(4)]] { foo(); });
58-
// expected-warning@+2 {{attribute 'intel_reqd_sub_group_size' is deprecated}}
59-
// expected-note@+1 {{did you mean to use 'intel::reqd_sub_group_size' instead?}}
60-
kernel<class kernel_name7>([]() [[cl::intel_reqd_sub_group_size(6)]]{});
56+
kernel<class kernel_name7>([]() [[intel::reqd_sub_group_size(6)]]{});
6157

6258
Functor4 f4;
6359
kernel<class kernel_name8>(f4);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// RUN: %clang_cc1 -fsycl -fsycl-is-host -fsyntax-only -verify %s
22
// expected-no-diagnostics
33

4-
[[cl::intel_reqd_sub_group_size(8)]] void fun() {}
4+
[[intel::reqd_sub_group_size(8)]] void fun() {}
55

66
class Functor {
77
public:
8-
[[cl::intel_reqd_sub_group_size(16)]] void operator()() {}
8+
[[intel::reqd_sub_group_size(16)]] void operator()() {}
99
};

0 commit comments

Comments
 (0)