103 if (cells.size() > 1) {
104 auto reducer = Reduction::make_kokkos_reducer<ResultType>(
105 [&cells, add_partial](std::size_t
const c_index, ResultType &res) {
106 for (
auto const &p : cells[c_index]->particles()) {
111 Kokkos::parallel_reduce(
112 "reduce_on_local_particle", cells.size(), reducer, result);
116 auto const &particles = cells.front()->particles();
117 auto reducer = Reduction::make_kokkos_reducer<ResultType>(
118 [&particles, add_partial](std::size_t
const p_index, ResultType &res) {
119 add_partial(res, std::as_const(*(particles.begin() + p_index)));
122 Kokkos::parallel_reduce(
123 "reduce_on_local_particle", particles.
size(), reducer, result);
virtual std::span< Cell *const > local_cells() const =0
Get pointer to local cells.
base_type::size_type size() const
ResultType reduce_over_local_particles(CellStructure const &cs, Reduction::AddPartialResultKernel< ResultType > add_partial, Reduction::ReductionOp< ResultType > reduce_op)
performs a reduction over all particles
Struct holding all information for one particle.