diff --git a/sycl/include/sycl/reduction.hpp b/sycl/include/sycl/reduction.hpp index 1734220a1fd00..b478710c2be3d 100644 --- a/sycl/include/sycl/reduction.hpp +++ b/sycl/include/sycl/reduction.hpp @@ -1133,12 +1133,12 @@ bool reduCGFuncForRange(handler &CGH, KernelType KernelFunc, size_t NDRItems = NWorkGroups * WGSize; nd_range<1> NDRange{range<1>{NDRItems}, range<1>{WGSize}}; - if constexpr (Reduction::has_fast_atomics) - return reduCGFuncForRangeFastAtomics(CGH, KernelFunc, Range, - NDRange, Redu); - else if constexpr (Reduction::has_fast_reduce) + if constexpr (Reduction::has_fast_reduce) return reduCGFuncForRangeFastReduce(CGH, KernelFunc, Range, NDRange, Redu); + else if constexpr (Reduction::has_fast_atomics) + return reduCGFuncForRangeFastAtomics(CGH, KernelFunc, Range, + NDRange, Redu); else return reduCGFuncForRangeBasic(CGH, KernelFunc, Range, NDRange, Redu);