Skip to content

[SYCL][NFC] Fix compilation of reduction.hpp with gcc 8.4 #7484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions sycl/include/sycl/reduction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2314,16 +2314,15 @@ void reduction_parallel_for(handler &CGH, range<Dims> Range,

// Before running the kernels, check that device has enough local memory
// to hold local arrays required for the tree-reduction algorithm.
size_t OneElemSize = [&]() {
if constexpr (NumArgs == 2) {
using Reduction = std::tuple_element_t<0, decltype(ReduTuple)>;
constexpr bool IsTreeReduction =
!Reduction::has_fast_reduce && !Reduction::has_fast_atomics;
return IsTreeReduction ? sizeof(typename Reduction::result_type) : 0;
} else {
return reduGetMemPerWorkItem(ReduTuple, ReduIndices);
}
}();
size_t OneElemSize;
if constexpr (NumArgs == 2) {
using Reduction = std::tuple_element_t<0, decltype(ReduTuple)>;
constexpr bool IsTreeReduction =
!Reduction::has_fast_reduce && !Reduction::has_fast_atomics;
OneElemSize = IsTreeReduction ? sizeof(typename Reduction::result_type) : 0;
} else {
OneElemSize = reduGetMemPerWorkItem(ReduTuple, ReduIndices);
}

uint32_t NumConcurrentWorkGroups =
#ifdef __SYCL_REDUCTION_NUM_CONCURRENT_WORKGROUPS
Expand Down