Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nmm0 committed Jan 24, 2024
1 parent 648aaaa commit 9e3e860
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
16 changes: 12 additions & 4 deletions core/src/Kokkos_Parallel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,9 @@ inline void parallel_scan(const std::string& str, const ExecutionPolicy& policy,
const FunctorType& functor) {
uint64_t kpID = 0;
ExecutionPolicy inner_policy = policy;
Kokkos::Tools::Impl::ParallelScanToolsHook< FunctorType, ExecutionPolicy >::begin_parallel_scan(inner_policy, functor, str, kpID);
Kokkos::Tools::Impl::ParallelScanToolsHook<
FunctorType, ExecutionPolicy>::begin_parallel_scan(inner_policy, functor,
str, kpID);

Kokkos::Impl::shared_allocation_tracking_disable();
Impl::ParallelScan<FunctorType, ExecutionPolicy> closure(functor,
Expand All @@ -363,7 +365,9 @@ inline void parallel_scan(const std::string& str, const ExecutionPolicy& policy,

closure.execute();

Kokkos::Tools::Impl::ParallelScanToolsHook< FunctorType, ExecutionPolicy >::end_parallel_scan(inner_policy, functor, str, kpID);
Kokkos::Tools::Impl::ParallelScanToolsHook<
FunctorType, ExecutionPolicy>::end_parallel_scan(inner_policy, functor,
str, kpID);
}

template <class ExecutionPolicy, class FunctorType>
Expand Down Expand Up @@ -399,7 +403,9 @@ inline void parallel_scan(const std::string& str, const ExecutionPolicy& policy,
ReturnType& return_value) {
uint64_t kpID = 0;
ExecutionPolicy inner_policy = policy;
Kokkos::Tools::Impl::ParallelScanToolsHook< FunctorType, ExecutionPolicy >::begin_parallel_scan(inner_policy, functor, str, kpID);
Kokkos::Tools::Impl::ParallelScanToolsHook<
FunctorType, ExecutionPolicy>::begin_parallel_scan(inner_policy, functor,
str, kpID);

if constexpr (Kokkos::is_view<ReturnType>::value) {
Kokkos::Impl::shared_allocation_tracking_disable();
Expand All @@ -417,7 +423,9 @@ inline void parallel_scan(const std::string& str, const ExecutionPolicy& policy,
closure.execute();
}

Kokkos::Tools::Impl::ParallelScanToolsHook< FunctorType, ExecutionPolicy >::end_parallel_scan(inner_policy, functor, str, kpID);
Kokkos::Tools::Impl::ParallelScanToolsHook<
FunctorType, ExecutionPolicy>::end_parallel_scan(inner_policy, functor,
str, kpID);

if (!Kokkos::is_view<ReturnType>::value)
policy.space().fence(
Expand Down
8 changes: 3 additions & 5 deletions core/src/Kokkos_Parallel_Reduce.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1503,11 +1503,10 @@ struct ParallelReduceAdaptor {
PolicyType,
typename Impl::FunctorPolicyExecutionSpace<
FunctorType, PolicyType>::execution_space>;
uint64_t kpID = 0;
uint64_t kpID = 0;

PolicyType inner_policy = policy;
ToolsHookType::begin_parallel_reduce(
inner_policy, functor, label, kpID);
ToolsHookType::begin_parallel_reduce(inner_policy, functor, label, kpID);
Kokkos::Impl::shared_allocation_tracking_disable();
CombinedFunctorReducer functor_reducer(
functor, typename Analysis::Reducer(
Expand All @@ -1522,8 +1521,7 @@ struct ParallelReduceAdaptor {
Kokkos::Impl::shared_allocation_tracking_enable();
closure.execute();

ToolsHookType::end_parallel_reduce(
inner_policy, functor, label, kpID);
ToolsHookType::end_parallel_reduce(inner_policy, functor, label, kpID);
}

static constexpr bool is_array_reduction =
Expand Down

0 comments on commit 9e3e860

Please sign in to comment.