@@ -2895,35 +2895,39 @@ static bool checkWorkGroupSizeValues(Sema &S, Decl *D, const ParsedAttr &Attr,
2895
2895
if (const auto *A = D->getAttr <SYCLIntelMaxGlobalWorkDimAttr>())
2896
2896
if (A->getNumber () == 0 )
2897
2897
Result &= checkZeroDim (A, WGSize[0 ], WGSize[1 ], WGSize[2 ],
2898
- /* ReverseAttrs=*/ true );
2898
+ /* ReverseAttrs=*/ true );
2899
2899
2900
2900
if (const auto *A = D->getAttr <SYCLIntelMaxWorkGroupSizeAttr>()) {
2901
- if (S.getLangOpts ().SYCLIsDevice && !(WGSize[2 ] <= A->getXDim () && WGSize[1 ] <= A->getYDim () &&
2901
+ if (S.getLangOpts ().SYCLIsDevice &&
2902
+ !(WGSize[2 ] <= A->getXDim () && WGSize[1 ] <= A->getYDim () &&
2902
2903
WGSize[0 ] <= A->getZDim ())) {
2903
2904
S.Diag (Attr.getLoc (), diag::err_conflicting_sycl_function_attributes)
2904
2905
<< Attr << A->getSpelling ();
2905
2906
Result &= false ;
2906
2907
}
2907
- if (!S.getLangOpts ().SYCLIsDevice && !(WGSize[0 ] <= A->getXDim () && WGSize[1 ] <= A->getYDim () &&
2908
+ if (!S.getLangOpts ().SYCLIsDevice &&
2909
+ !(WGSize[0 ] <= A->getXDim () && WGSize[1 ] <= A->getYDim () &&
2908
2910
WGSize[2 ] <= A->getZDim ())) {
2909
2911
S.Diag (Attr.getLoc (), diag::err_conflicting_sycl_function_attributes)
2910
2912
<< Attr << A->getSpelling ();
2911
2913
Result &= false ;
2912
2914
}
2913
2915
}
2914
2916
if (const auto *A = D->getAttr <ReqdWorkGroupSizeAttr>()) {
2915
- if (S.getLangOpts ().SYCLIsDevice && !(WGSize[2 ] >= A->getXDim () && WGSize[1 ] >= A->getYDim () &&
2916
- WGSize[0 ] >= A->getZDim ())) {
2917
- S.Diag (Attr.getLoc (), diag::err_conflicting_sycl_function_attributes)
2918
- << Attr << A->getSpelling ();
2919
- Result &= false ;
2920
- }
2921
- if (!S.getLangOpts ().SYCLIsDevice && !(WGSize[0 ] >= A->getXDim () && WGSize[1 ] >= A->getYDim () &&
2922
- WGSize[2 ] >= A->getZDim ())) {
2923
- S.Diag (Attr.getLoc (), diag::err_conflicting_sycl_function_attributes)
2924
- << Attr << A->getSpelling ();
2925
- Result &= false ;
2926
- }
2917
+ if (S.getLangOpts ().SYCLIsDevice &&
2918
+ !(WGSize[2 ] >= A->getXDim () && WGSize[1 ] >= A->getYDim () &&
2919
+ WGSize[0 ] >= A->getZDim ())) {
2920
+ S.Diag (Attr.getLoc (), diag::err_conflicting_sycl_function_attributes)
2921
+ << Attr << A->getSpelling ();
2922
+ Result &= false ;
2923
+ }
2924
+ if (!S.getLangOpts ().SYCLIsDevice &&
2925
+ !(WGSize[0 ] >= A->getXDim () && WGSize[1 ] >= A->getYDim () &&
2926
+ WGSize[2 ] >= A->getZDim ())) {
2927
+ S.Diag (Attr.getLoc (), diag::err_conflicting_sycl_function_attributes)
2928
+ << Attr << A->getSpelling ();
2929
+ Result &= false ;
2930
+ }
2927
2931
}
2928
2932
return Result;
2929
2933
}
@@ -2951,13 +2955,13 @@ static void handleWorkGroupSize(Sema &S, Decl *D, const ParsedAttr &AL) {
2951
2955
return ;
2952
2956
2953
2957
WorkGroupAttr *Existing = D->getAttr <WorkGroupAttr>();
2954
- if (S.getLangOpts ().SYCLIsDevice && Existing && !(Existing-> getXDim () == WGSize[ 2 ] &&
2955
- Existing->getYDim () == WGSize[1 ] &&
2956
- Existing->getZDim () == WGSize[0 ]))
2958
+ if (S.getLangOpts ().SYCLIsDevice && Existing &&
2959
+ !(Existing-> getXDim () == WGSize[ 2 ] && Existing->getYDim () == WGSize[1 ] &&
2960
+ Existing->getZDim () == WGSize[0 ]))
2957
2961
S.Diag (AL.getLoc (), diag::warn_duplicate_attribute) << AL;
2958
- if (!S.getLangOpts ().SYCLIsDevice && Existing && !(Existing-> getXDim () == WGSize[ 0 ] &&
2959
- Existing->getYDim () == WGSize[1 ] &&
2960
- Existing->getZDim () == WGSize[2 ]))
2962
+ if (!S.getLangOpts ().SYCLIsDevice && Existing &&
2963
+ !(Existing-> getXDim () == WGSize[ 0 ] && Existing->getYDim () == WGSize[1 ] &&
2964
+ Existing->getZDim () == WGSize[2 ]))
2961
2965
S.Diag (AL.getLoc (), diag::warn_duplicate_attribute) << AL;
2962
2966
2963
2967
if (S.getLangOpts ().SYCLIsDevice )
0 commit comments