ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
for_each_3d.hpp File Reference
#include <config/config.hpp>
#include <utils/index.hpp>
#include <Kokkos_Core.hpp>
#include <concepts>
#include <cstddef>
#include <type_traits>
+ Include dependency graph for for_each_3d.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

template<Utils::MemoryOrder Order>
using LayoutIterate = std::conditional_t< Order==Utils::MemoryOrder::COLUMN_MAJOR, std::integral_constant< Kokkos::Iterate, Kokkos::Iterate::Left >, std::integral_constant< Kokkos::Iterate, Kokkos::Iterate::Right > >
 Mapping between ESPResSo and Kokkos tags for memory order.
 

Functions

template<class Kernel , class Projector = decltype(detail::noop_projector)>
requires std::invocable<Kernel>
and std::invocable< Projector, unsigned, int > void for_each_3d (detail::IndexVectorConcept auto &&start, detail::IndexVectorConcept auto &&stop, detail::IndexVectorConcept auto &&counters, Kernel &&kernel, Projector &&projector=detail::noop_projector)
 Repeat an operation on every element of a 3D grid.
 
template<Utils::MemoryOrder Order, class Kernel , class Projector = decltype(detail::noop_projector)>
requires std::invocable<Kernel>
and std::invocable< Projector, unsigned, int > void for_each_3d_order (detail::IndexVectorConcept auto &&start, detail::IndexVectorConcept auto &&stop, detail::IndexVectorConcept auto &&counters, Kernel &&kernel, Projector &&projector=detail::noop_projector)
 Repeat an operation on every element of a 3D grid.
 
template<Utils::MemoryOrder memory_order, class Kernel >
void for_each_3d_lin (detail::IndexVectorConcept auto &&start, detail::IndexVectorConcept auto &&stop, Kernel &&kernel)
 Run a kernel(index_3d, linear_index) over the given 3d range with given memory order.
 

Typedef Documentation

◆ LayoutIterate

template<Utils::MemoryOrder Order>
using LayoutIterate = std::conditional_t< Order == Utils::MemoryOrder::COLUMN_MAJOR, std::integral_constant<Kokkos::Iterate, Kokkos::Iterate::Left>, std::integral_constant<Kokkos::Iterate, Kokkos::Iterate::Right> >

Mapping between ESPResSo and Kokkos tags for memory order.

Definition at line 129 of file for_each_3d.hpp.

Function Documentation

◆ for_each_3d()

template<class Kernel , class Projector = decltype(detail::noop_projector)>
requires std::invocable<Kernel>
and std::invocable< Projector, unsigned, int > void for_each_3d ( detail::IndexVectorConcept auto &&  start,
detail::IndexVectorConcept auto &&  stop,
detail::IndexVectorConcept auto &&  counters,
Kernel &&  kernel,
Projector &&  projector = detail::noop_projector 
)

Repeat an operation on every element of a 3D grid.

Intermediate values that depend on the iterated coordinates are calculated and stored once per iteration. This is useful when the operation is costly.

Parameters
startInitial values for the loop counters.
stopFinal values (one-past-the-end) for the loop counters.
countersLoop counters.
kernelFunctor to execute.
projectorProjection of the current loop counter.
Template Parameters
KernelNullary function.
ProjectorBinary function that takes a nesting depth and a loop counter as arguments and projects a value.

Definition at line 63 of file for_each_3d.hpp.

References stream.

Referenced by dp3m_k_space_error(), dp3m_tune_aliasing_sums(), G_opt(), G_opt_dipolar(), G_opt_dipolar_self_energy(), grid_influence_function(), grid_influence_function_dipolar(), grid_influence_function_self_energy(), DipolarP3MHeffte< FloatType, Architecture, FFTConfig >::long_range_kernel(), p3m_k_space_error(), and p3m_tune_aliasing_sums().

◆ for_each_3d_lin()

template<Utils::MemoryOrder memory_order, class Kernel >
void for_each_3d_lin ( detail::IndexVectorConcept auto &&  start,
detail::IndexVectorConcept auto &&  stop,
Kernel &&  kernel 
)

Run a kernel(index_3d, linear_index) over the given 3d range with given memory order.

Definition at line 140 of file for_each_3d.hpp.

References Utils::ROW_MAJOR, and stream.

◆ for_each_3d_order()

template<Utils::MemoryOrder Order, class Kernel , class Projector = decltype(detail::noop_projector)>
requires std::invocable<Kernel>
and std::invocable< Projector, unsigned, int > void for_each_3d_order ( detail::IndexVectorConcept auto &&  start,
detail::IndexVectorConcept auto &&  stop,
detail::IndexVectorConcept auto &&  counters,
Kernel &&  kernel,
Projector &&  projector = detail::noop_projector 
)

Repeat an operation on every element of a 3D grid.

Intermediate values that depend on the iterated coordinates are calculated and stored once per iteration. This is useful when the operation is costly.

Parameters
startInitial values for the loop counters.
stopFinal values (one-past-the-end) for the loop counters.
countersLoop counters.
kernelFunctor to execute.
projectorProjection of the current loop counter.
Template Parameters
OrderData layout.
KernelNullary function.
ProjectorBinary function that takes a nesting depth and a loop counter as arguments and projects a value.

Definition at line 102 of file for_each_3d.hpp.

References Utils::ROW_MAJOR, and stream.