Skip to content

Commit f11d097

Browse files
committed
Address review comments
Signed-off-by: Soumi Manna <[email protected]>
1 parent 23f5cf4 commit f11d097

7 files changed

+10
-10
lines changed

clang/include/clang/Sema/Sema.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12967,14 +12967,14 @@ void Sema::addIntelSYCLSingleArgFunctionAttr(Decl *D,
1296712967
CI.getParsedKind() == ParsedAttr::AT_IntelReqdSubGroupSize) {
1296812968
if (ArgInt <= 0) {
1296912969
Diag(E->getExprLoc(), diag::err_attribute_requires_positive_integer)
12970-
<< CI.getAttrName() << /*non-negative*/ 1;
12970+
<< CI.getAttrName() << /*positive*/ 0;
1297112971
return;
1297212972
}
1297312973
}
1297412974
if (CI.getParsedKind() == ParsedAttr::AT_SYCLIntelMaxGlobalWorkDim) {
1297512975
if (ArgInt < 0) {
1297612976
Diag(E->getExprLoc(), diag::err_attribute_requires_positive_integer)
12977-
<< CI.getAttrName() << /*positive*/ 0;
12977+
<< CI.getAttrName() << /*non-negative*/ 1;
1297812978
return;
1297912979
}
1298012980
if (ArgInt > 3) {

clang/test/SemaOpenCL/invalid-kernel-attrs.cl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ kernel __attribute__((reqd_work_group_size(1,0,2))) void kernel12(){} // expecte
3535
kernel __attribute__((reqd_work_group_size(0,1,2))) void kernel13(){} // expected-error {{'reqd_work_group_size' attribute must be greater than 0}}
3636

3737
__attribute__((intel_reqd_sub_group_size(8))) void kernel14(){} // expected-error {{attribute 'intel_reqd_sub_group_size' can only be applied to an OpenCL kernel}}
38-
kernel __attribute__((intel_reqd_sub_group_size(0))) void kernel15() {} // expected-error {{'intel_reqd_sub_group_size' attribute requires a non-negative integral compile time constant expression}}
38+
kernel __attribute__((intel_reqd_sub_group_size(0))) void kernel15() {} // expected-error {{'intel_reqd_sub_group_size' attribute requires a positive integral compile time constant expression}}
3939

40-
kernel __attribute__((intel_reqd_sub_group_size(-1))) void kernel16() {} // expected-error {{'intel_reqd_sub_group_size' attribute requires a non-negative integral compile time constant expression}}
40+
kernel __attribute__((intel_reqd_sub_group_size(-1))) void kernel16() {} // expected-error {{'intel_reqd_sub_group_size' attribute requires a positive integral compile time constant expression}}
4141

4242
kernel __attribute__((intel_reqd_sub_group_size(8))) __attribute__((intel_reqd_sub_group_size(16))) void kernel17() {} //expected-warning{{attribute 'intel_reqd_sub_group_size' is already applied with different parameters}}
4343

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ int main() {
9595
[[intel::max_global_work_dim(1)]] int Var = 0; // expected-error{{'max_global_work_dim' attribute only applies to functions}}
9696

9797
h.single_task<class test_kernel6>(
98-
[]() [[intel::max_global_work_dim(-8)]]{}); // expected-error{{'max_global_work_dim' attribute requires a positive integral compile time constant expression}}
98+
[]() [[intel::max_global_work_dim(-8)]]{}); // expected-error{{'max_global_work_dim' attribute requires a non-negative integral compile time constant expression}}
9999

100100
h.single_task<class test_kernel7>(
101101
[]() [[intel::max_global_work_dim(3),

clang/test/SemaSYCL/num_simd_work_items_device.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ int main() {
5858
[[intel::num_simd_work_items(0)]] int Var = 0; // expected-error{{'num_simd_work_items' attribute only applies to functions}}
5959

6060
h.single_task<class test_kernel4>(
61-
[]() [[intel::num_simd_work_items(0)]]{}); // expected-error{{'num_simd_work_items' attribute requires a non-negative integral compile time constant expression}}
61+
[]() [[intel::num_simd_work_items(0)]]{}); // expected-error{{'num_simd_work_items' attribute requires a positive integral compile time constant expression}}
6262

6363
h.single_task<class test_kernel5>(
64-
[]() [[intel::num_simd_work_items(-42)]]{}); // expected-error{{'num_simd_work_items' attribute requires a non-negative integral compile time constant expression}}
64+
[]() [[intel::num_simd_work_items(-42)]]{}); // expected-error{{'num_simd_work_items' attribute requires a positive integral compile time constant expression}}
6565

6666
h.single_task<class test_kernel6>(
6767
[]() [[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}}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
template <int SIZE>
66
class KernelFunctor {
77
public:
8-
// expected-error@+1{{'max_global_work_dim' attribute requires a positive integral compile time constant expression}}
8+
// expected-error@+1{{'max_global_work_dim' attribute requires a non-negative integral compile time constant expression}}
99
[[intel::max_global_work_dim(SIZE)]] void operator()() {}
1010
};
1111

clang/test/SemaSYCL/sycl-device-num_simd_work_items-template.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
template <int SIZE>
66
class KernelFunctor {
77
public:
8-
// expected-error@+1{{'num_simd_work_items' attribute requires a non-negative integral compile time constant expression}}
8+
// expected-error@+1{{'num_simd_work_items' attribute requires a positive integral compile time constant expression}}
99
[[intel::num_simd_work_items(SIZE)]] void operator()() {}
1010
};
1111

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
template <int SIZE>
66
class KernelFunctor {
77
public:
8-
// expected-error@+1{{'reqd_sub_group_size' attribute requires a non-negative integral compile time constant expression}}
8+
// expected-error@+1{{'reqd_sub_group_size' attribute requires a positive integral compile time constant expression}}
99
[[intel::reqd_sub_group_size(SIZE)]] void operator()() {}
1010
};
1111

0 commit comments

Comments
 (0)