Skip to content

Commit

Permalink
Use Kokkos::fence with 0 arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
gojakuch committed Apr 15, 2024
1 parent 7a273f9 commit 8fef51b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions unittests/Kokkos/ParallelAdd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ struct ViewAdd<Viewtype, Layout, 3, iType> {
template <class DT, class... DP>
void parallel_sum(typename Kokkos::ViewTraits<DT, DP...>::value_type &sum, const Kokkos::View<DT, DP...> A) {
using ViewtypeA = Kokkos::View<DT, DP...>;
Kokkos::fence("parallel_sum: pre sum fence");
Kokkos::fence();
if (A.span_is_contiguous()) {

using ViewTypeFlat = Kokkos::View<
Expand All @@ -260,13 +260,13 @@ void parallel_sum(typename Kokkos::ViewTraits<DT, DP...>::value_type &sum, const
else {
ViewSum<ViewtypeA, typename ViewtypeA::array_layout, ViewtypeA::rank, int>::template execute<typename ViewtypeA::execution_space>(sum, A);
}
Kokkos::fence("parallel_sum: post sum fence");
Kokkos::fence();
}

template <class ExecSpace, class DT, class... DP>
void parallel_sum(const ExecSpace& space, typename Kokkos::ViewTraits<DT, DP...>::value_type &sum, const Kokkos::View<DT, DP...> A) {
using ViewtypeA = Kokkos::View<DT, DP...>;
space.fence("parallel_sum: pre sum fence");
space.fence();
if (A.span_is_contiguous()) {

using ViewTypeFlat = Kokkos::View<
Expand All @@ -283,13 +283,13 @@ void parallel_sum(const ExecSpace& space, typename Kokkos::ViewTraits<DT, DP...>
else {
ViewSum<ViewtypeA, typename ViewtypeA::array_layout, ViewtypeA::rank, int>::template execute<ExecSpace>(sum, A, space);
}
space.fence("parallel_sum: post sum fence");
space.fence();
}

template <class DT, class... DP>
void parallel_add(Kokkos::View<DT, DP...> A, typename Kokkos::ViewTraits<DT, DP...>::const_value_type b) {
using ViewtypeA = Kokkos::View<DT, DP...>;
Kokkos::fence("parallel_add: pre add fence");
Kokkos::fence();
if (A.span_is_contiguous()) {

using ViewTypeFlat = Kokkos::View<
Expand All @@ -306,13 +306,13 @@ void parallel_add(Kokkos::View<DT, DP...> A, typename Kokkos::ViewTraits<DT, DP.
else {
ViewAdd<ViewtypeA, typename ViewtypeA::array_layout, ViewtypeA::rank, int>::template execute<typename ViewtypeA::execution_space>(A, b);
}
Kokkos::fence("parallel_add: post add fence");
Kokkos::fence();
}

template <class ExecSpace, class DT, class... DP>
void parallel_add(const ExecSpace& space, Kokkos::View<DT, DP...> A, typename Kokkos::ViewTraits<DT, DP...>::const_value_type b) {
using ViewtypeA = Kokkos::View<DT, DP...>;
space.fence("parallel_add: pre add fence");
space.fence();
if (A.span_is_contiguous()) {

using ViewTypeFlat = Kokkos::View<
Expand All @@ -329,18 +329,18 @@ void parallel_add(const ExecSpace& space, Kokkos::View<DT, DP...> A, typename Ko
else {
ViewAdd<ViewtypeA, typename ViewtypeA::array_layout, ViewtypeA::rank, int>::template execute<ExecSpace>(A, b, space);
}
space.fence("parallel_add: post add fence");
space.fence();
}

template <class DT, class... DP, class ST, class... SP>
void parallel_add(Kokkos::View<DT, DP...> A, const Kokkos::View<ST, SP...> B) {
using ViewtypeA = Kokkos::View<DT, DP...>;
using ViewtypeA = Kokkos::View<ST, SP...>;
Kokkos::fence("parallel_add: pre add fence");
Kokkos::fence();

ViewAdd<ViewtypeA, typename ViewtypeA::array_layout, ViewtypeA::rank, int>::template executeView<typename ViewtypeA::execution_space>(A, B);

Kokkos::fence("parallel_add: post add fence");
Kokkos::fence();
}

}
Expand Down

0 comments on commit 8fef51b

Please sign in to comment.