-
Notifications
You must be signed in to change notification settings - Fork 798
[NFCI][SYCL] Refactor reduction implementation #6445
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
Conversation
85acb74
to
3ea7ca7
Compare
9d2af67
to
8d527c8
Compare
It isn't used for anything and the reducer is really lower level entity than the reduction algorithm.
In other words, remove separate MRWAcc/MDWAcc/MUSMPointer.
I hoped that I'll be able to deduce it from arguments, but partial CTAD doesn't exist, unfortunately.
8d527c8
to
156f9ee
Compare
Failures are unrelated, I believe: Failed Tests (4): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment, but otherwise LGTM.
The failures are unrelated to this PR, I believe: Failed Tests (4): Hence, @intel/llvm-gatekeepers this PR is ready. |
Fails are getting addressed at intel/llvm-test-suite#1115 and intel/llvm-test-suite#1117 |
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.