You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
0 commit comments