-
Notifications
You must be signed in to change notification settings - Fork 407
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
#5385 Add necessary fence() calls in sorting routines that were missing them #5389
Conversation
This is based on #5388, so that should be merged first |
…than BinSort constructors
a8f24f8
to
4689208
Compare
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.
Looks good to me.
The preceding PR was merged, so this is good to review now. |
typename ViewType::execution_space exec; | ||
sort(exec, view); | ||
exec.fence("Kokkos::Sort: fence after sorting"); | ||
exec.fence("Kokkos::sort: fence after sorting"); |
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.
exec.fence("Kokkos::sort: fence after sorting"); | |
exec.fence("Kokkos::sort: after"); |
@@ -638,6 +649,7 @@ std::enable_if_t<Kokkos::is_execution_space<ExecutionSpace>::value> sort( | |||
|
|||
template <class ViewType> | |||
void sort(ViewType view, size_t const begin, size_t const end) { | |||
Kokkos::fence("Kokkos::sort: before"); | |||
typename ViewType::execution_space exec; | |||
sort(exec, view, begin, end); | |||
exec.fence("Kokkos::Sort: fence after sorting"); |
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.
exec.fence("Kokkos::Sort: fence after sorting"); | |
exec.fence("Kokkos::sort: after"); |
Sorting routines that don't take an execution space parameter need to globally fence before calling any kernels on a default-constructed execution space instance, to ensure that input data is stable.
Fixes #5385