Skip to content

Commit 5831eb4

Browse files
committed
[SYCL] reqd_work_group_size attribute is reversed (fix intel#13)
Signed-off-by: Aleksander Fadeev <aleksander.fadeev@intel.com>
1 parent 43f265f commit 5831eb4

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

clang/lib/Sema/SemaDeclAttr.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2914,7 +2914,7 @@ static bool checkWorkGroupSizeValues(Sema &S, Decl *D, const ParsedAttr &Attr,
29142914
}
29152915
}
29162916
if (const auto *A = D->getAttr<ReqdWorkGroupSizeAttr>()) {
2917-
2917+
29182918
if (S.getLangOpts().SYCLIsDevice &&
29192919
!(WGSize[2] >= A->getXDim() && WGSize[1] >= A->getYDim() &&
29202920
WGSize[0] >= A->getZDim())) {

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Functor32 {
4040
//expected-warning@+2{{attribute 'reqd_work_group_size' is already applied with different parameters}}
4141
// expected-error@+1{{'reqd_work_group_size' attribute conflicts with 'reqd_work_group_size' attribute}}
4242
[[cl::reqd_work_group_size(32, 1, 1)]] [[cl::reqd_work_group_size(1, 1, 32)]] void operator()() {}
43-
};
43+
};
4444
#endif
4545
class Functor16x16x16 {
4646
public:
@@ -74,7 +74,7 @@ __attribute__((sycl_kernel)) void kernel(Func kernelFunc) {
7474
void bar() {
7575
Functor16 f16;
7676
kernel<class kernel_name1>(f16);
77-
77+
7878
Functor f;
7979
kernel<class kernel_name2>(f);
8080

@@ -96,7 +96,6 @@ void bar() {
9696
kernel<class kernel_name1>(f32);
9797

9898
kernel<class kernel_name7>([]() { // expected-error {{conflicting attributes applied to a SYCL kernel}}
99-
10099
f4x1x1();
101100
f32x1x1();
102101
});

0 commit comments

Comments
 (0)