Skip to content

Commit 92678f0

Browse files
[NFCI][SYCL] Refactor reduction implementation (#6445)
The core part of it is adding the user's reduction variable type as an explicit template parameter and modifying reduction to store just that, instead of having three members (RWAcc/DWAcc/UsmPtr) of which only one is used to store it. That, in turn, made the whole default_reduction_algorithm redundant as all it was used for was to propagate that exact information in an obscure way. Once done, it enabled some further simplifications: Simplifying some methods to use compile-time "if constexpr" instead of checking the type of the user reduction variable in runtime (i.e., previous "if (MRWAcc)" check). Making reduction_impl_algo::reduction_impl_algo ctor generic and having a single instance of it, eliminating three version for different types of user's reduction variable. Unify reduction_impl::reduction_impl ctors accessing RW/DW accessor eliminating code duplication create make_reduction helper function to make creation of reduction_impl require less boilerplate code by using template type parameters deduction (couldn't use CTAD as some of the params can't be deduced and there is no such thing as partial CTAD). Simplify reduction_impl creation further by benefiting from accessor's CTAD.
1 parent dd17a33 commit 92678f0

File tree

3 files changed

+320
-509
lines changed

3 files changed

+320
-509
lines changed

0 commit comments

Comments
 (0)