-
Notifications
You must be signed in to change notification settings - Fork 103
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
Draft: Valloc Interface for New Reducer #1690
Conversation
using REF_INT_SUM = RAJA::expt::ValOp<int, RAJA::operators::plus>; | ||
using REF_INT_MIN = RAJA::expt::ValOp<int, RAJA::operators::minimum>; | ||
using REF_INT_MAX = RAJA::expt::ValOp<int, RAJA::operators::maximum>; | ||
using REFLOC_INT_MIN = RAJA::expt::ValLocOp<int, RAJA::operators::minimum>; |
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.
Do we have an option to change the loc type?
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.
Do you mean you want something like ValLocOp<double, int, minimum>
, where int
represents the loc type? I don't think we've had that in the past.
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.
yep, and we always should have had it.
|
||
value_type *target = nullptr; | ||
value_type val = op::identity(); | ||
//value_op *vop = nullptr; | ||
|
||
#if defined(RAJA_CUDA_ACTIVE) || defined(RAJA_HIP_ACTIVE) || defined(RAJA_SYCL_ACTIVE) |
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.
This reminds me that we should specialize SoAPtr on ValLoc, etc.
template<typename EXEC_POL, template <typename, typename, typename> class OP, typename T> | ||
camp::concepts::enable_if< std::is_same< EXEC_POL, RAJA::seq_exec> > | ||
init(Reducer<OP<ValOp<ValLoc<T>,OP>, ValOp<ValLoc<T>,OP>, ValOp<ValLoc<T>,OP>>, ValOp<ValLoc<T>,OP>>& red) { | ||
red.val = OP<ValOp<ValLoc<T>,OP>, ValOp<ValLoc<T>,OP>, ValOp<ValLoc<T>,OP>>::identity(); |
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.
We should figure out why using Op<ValOp<ValLoc<T>,OP>, ...>::identity()
works here but Op<ValOp<T,OP>, ...>::identity()
doesn't work below.
After some discussion with @MrBurmark, we've both concluded that the GPU backends for a valloc interface have enough complications that will require a re-design of valloc. The problem lies in the fact that the GPU backend implementation of Original Valloc Design -
New Valloc Design -
Notes on new design - |
@rchen20 @MrBurmark Will we update all the other reducers as well? |
No, I'm fairly certain this interface change can be contained to the new reductions. Although, later on when we unify the old and new reducers, we can consider how that interface will look, and how we want to implement it. For this implementation, I will probably use some of the principles from @MrBurmark's multi-reducer design. |
Right that is what I meant, like the SumReducer etc... |
Closing in favor of the more updated version here #1732. |
Summary
This PR is a refactoring
It does the following:
sequential
CUDA
HIP
SYCL
OpenMP