Mundy: Multibody Nonlocal Dynamics Version of the Day
Loading...
Searching...
No Matches
ForEach.hpp File Reference

Parallel iteration and reduction entry points over neighbor pairs and per-target neighbor ranges. More...

Namespaces

namespace  mundy
namespace  mundy::search

Functions

template<NeighborListType ListType, typename Functor>
void mundy::search::for_each_neighbor_pair (const ListType &list, const Functor &functor)
 Run a callback for every stored neighbor pair using the list's default execution space.
template<NeighborListType ListType, typename ExecutionSpace, typename Functor>
void mundy::search::for_each_neighbor_pair (const ExecutionSpace &exec_space, const ListType &list, const Functor &functor)
 Run a callback for every stored neighbor pair using a provided execution space.
template<NeighborListType ListType, typename Functor>
void mundy::search::for_each_target_with_neighbors (const ListType &list, const Functor &functor)
 Run a callback for every target and its neighbors using the list's default execution space.
template<NeighborListType ListType, typename ExecutionSpace, typename Functor>
void mundy::search::for_each_target_with_neighbors (const ExecutionSpace &exec_space, const ListType &list, const Functor &functor)
 Run a callback for every target and its neighbors using a provided execution space.
template<NeighborListType ListType, typename Functor, typename ReducerType>
void mundy::search::for_each_neighbor_pair_reduce (const ListType &list, const Functor &functor, ReducerType &reducer)
 Run a Kokkos reduction over every stored neighbor pair using the list's default execution space.
template<NeighborListType ListType, typename ExecutionSpace, typename Functor, typename ReducerType>
void mundy::search::for_each_neighbor_pair_reduce (const ExecutionSpace &exec_space, const ListType &list, const Functor &functor, ReducerType &reducer)
 Run a Kokkos reduction over every stored neighbor pair using a provided execution space.
template<NeighborListType ListType, typename Functor, typename ReducerType>
void mundy::search::for_each_target_with_neighbors_reduce (const ListType &list, const Functor &functor, ReducerType &reducer)
 Run a Kokkos reduction over every target and its neighbors using the list's default execution space.
template<NeighborListType ListType, typename ExecutionSpace, typename Functor, typename ReducerType>
void mundy::search::for_each_target_with_neighbors_reduce (const ExecutionSpace &exec_space, const ListType &list, const Functor &functor, ReducerType &reducer)
 Run a Kokkos reduction over every target and its neighbors using a provided execution space.

Detailed Description

functions

for_each_neighbor_pair_reduce and for_each_target_with_neighbors_reduce mirror STK's for_each_entity_reduce pattern: the caller passes a Kokkos built-in reducer (e.g. Kokkos::Sum<double>, Kokkos::Min<int>) together with a functor whose second argument is value_type&. Example usage:

size_t pair_count = 0;
Kokkos::Sum<size_t> reducer(pair_count);
exec, list,
KOKKOS_LAMBDA(const mundy::search::NeighborPair<List1d>& /*p*/, size_t& n) { ++n; },
reducer);
Lightweight neighbor-pair view.
Definition Neighbors.hpp:159
void for_each_neighbor_pair_reduce(const ListType &list, const Functor &functor, ReducerType &reducer)
Run a Kokkos reduction over every stored neighbor pair using the list's default execution space.
Definition ForEach.hpp:98