Skip to content

Commit

Permalink
[SYCL] reqd_work_group_size attribute is reversed (fix intel#6)
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksander Fadeev <[email protected]>
  • Loading branch information
fadeeval committed Mar 3, 2020
1 parent ff6746a commit 245f323
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions clang/lib/Sema/SemaDeclAttr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2898,16 +2898,16 @@ static bool checkWorkGroupSizeValues(Sema &S, Decl *D, const ParsedAttr &Attr,
/*ReverseAttrs=*/ true);

if (const auto *A = D->getAttr<SYCLIntelMaxWorkGroupSizeAttr>()) {
if (!(WGSize[0] <= A->getXDim() && WGSize[1] <= A->getYDim() &&
WGSize[2] <= A->getZDim())) {
if (!(WGSize[2] <= A->getXDim() && WGSize[1] <= A->getYDim() &&
WGSize[0] <= A->getZDim())) {
S.Diag(Attr.getLoc(), diag::err_conflicting_sycl_function_attributes)
<< Attr << A->getSpelling();
Result &= false;
}
}
if (const auto *A = D->getAttr<ReqdWorkGroupSizeAttr>()) {
if (!(WGSize[0] >= A->getXDim() && WGSize[1] >= A->getYDim() &&
WGSize[2] >= A->getZDim())) {
if (!(WGSize[2] >= A->getXDim() && WGSize[1] >= A->getYDim() &&
WGSize[0] >= A->getZDim())) {
S.Diag(Attr.getLoc(), diag::err_conflicting_sycl_function_attributes)
<< Attr << A->getSpelling();
Result &= false;
Expand Down
4 changes: 2 additions & 2 deletions clang/test/SemaSYCL/intel-max-global-work-dim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ int main() {
kernel<class test_kernel5>(
TRIFuncObjGood2());
// CHECK-LABEL: FunctionDecl {{.*}} _ZTSZ4mainE12test_kernel5
// CHECK: ReqdWorkGroupSizeAttr {{.*}} 4 1 1
// CHECK: SYCLIntelMaxWorkGroupSizeAttr {{.*}} 8 1 1
// CHECK: ReqdWorkGroupSizeAttr {{.*}} 1 1 4
// CHECK: SYCLIntelMaxWorkGroupSizeAttr {{.*}} 1 1 8
// CHECK: SYCLIntelMaxGlobalWorkDimAttr {{.*}} 3

#ifdef TRIGGER_ERROR
Expand Down

0 comments on commit 245f323

Please sign in to comment.