Skip to content

Commit 245f323

Browse files
committed
[SYCL] reqd_work_group_size attribute is reversed (fix intel#6)
Signed-off-by: Aleksander Fadeev <[email protected]>
1 parent ff6746a commit 245f323

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

clang/lib/Sema/SemaDeclAttr.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -2898,16 +2898,16 @@ static bool checkWorkGroupSizeValues(Sema &S, Decl *D, const ParsedAttr &Attr,
28982898
/*ReverseAttrs=*/ true);
28992899

29002900
if (const auto *A = D->getAttr<SYCLIntelMaxWorkGroupSizeAttr>()) {
2901-
if (!(WGSize[0] <= A->getXDim() && WGSize[1] <= A->getYDim() &&
2902-
WGSize[2] <= A->getZDim())) {
2901+
if (!(WGSize[2] <= A->getXDim() && WGSize[1] <= A->getYDim() &&
2902+
WGSize[0] <= A->getZDim())) {
29032903
S.Diag(Attr.getLoc(), diag::err_conflicting_sycl_function_attributes)
29042904
<< Attr << A->getSpelling();
29052905
Result &= false;
29062906
}
29072907
}
29082908
if (const auto *A = D->getAttr<ReqdWorkGroupSizeAttr>()) {
2909-
if (!(WGSize[0] >= A->getXDim() && WGSize[1] >= A->getYDim() &&
2910-
WGSize[2] >= A->getZDim())) {
2909+
if (!(WGSize[2] >= A->getXDim() && WGSize[1] >= A->getYDim() &&
2910+
WGSize[0] >= A->getZDim())) {
29112911
S.Diag(Attr.getLoc(), diag::err_conflicting_sycl_function_attributes)
29122912
<< Attr << A->getSpelling();
29132913
Result &= false;

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ int main() {
8282
kernel<class test_kernel5>(
8383
TRIFuncObjGood2());
8484
// CHECK-LABEL: FunctionDecl {{.*}} _ZTSZ4mainE12test_kernel5
85-
// CHECK: ReqdWorkGroupSizeAttr {{.*}} 4 1 1
86-
// CHECK: SYCLIntelMaxWorkGroupSizeAttr {{.*}} 8 1 1
85+
// CHECK: ReqdWorkGroupSizeAttr {{.*}} 1 1 4
86+
// CHECK: SYCLIntelMaxWorkGroupSizeAttr {{.*}} 1 1 8
8787
// CHECK: SYCLIntelMaxGlobalWorkDimAttr {{.*}} 3
8888

8989
#ifdef TRIGGER_ERROR

0 commit comments

Comments
 (0)