DDC 0.0.0

a discrete domain computation library

ddc::ddc_detail Namespace Reference

Classes

struct  Selection
 
struct  Selection< ddc_detail::TypeSeq< QueryDDims... > >
 
class  gpu_proxy
 
class  ForEachKokkosLambdaAdapter
 
struct  ddc_to_kokkos_reducer
 
struct  ddc_to_kokkos_reducer< reducer::sum< T > >
 
struct  ddc_to_kokkos_reducer< reducer::prod< T > >
 
struct  ddc_to_kokkos_reducer< reducer::land >
 
struct  ddc_to_kokkos_reducer< reducer::lor >
 
struct  ddc_to_kokkos_reducer< reducer::band< T > >
 
struct  ddc_to_kokkos_reducer< reducer::bor< T > >
 
struct  ddc_to_kokkos_reducer< reducer::bxor< T > >
 
struct  ddc_to_kokkos_reducer< reducer::min< T > >
 
struct  ddc_to_kokkos_reducer< reducer::max< T > >
 
struct  ddc_to_kokkos_reducer< reducer::minmax< T > >
 
class  TransformReducerKokkosLambdaAdapter
 

Typedefs

template<class DDim , class MemorySpace >
using ddim_impl_t = typename DDim::template Impl< MemorySpace >
 
template<class Reducer >
using ddc_to_kokkos_reducer_t = typename ddc_to_kokkos_reducer< Reducer >::type
 Alias template to transform a DDC reducer type to a Kokkos reducer type. More...
 

Functions

template<class... Tags>
constexpr std::array< DiscreteElementType, sizeof...(Tags)> & array (DiscreteElement< Tags... > &v) noexcept
 Returns a reference to the underlying std::array More...
 
template<class... Tags>
constexpr std::array< DiscreteElementType, sizeof...(Tags)> const & array (DiscreteElement< Tags... > const &v) noexcept
 Returns a reference to the underlying std::array More...
 
void display_discretization_store (std::ostream &os)
 
template<class Tuple , std::size_t... Ids>
auto extract_after (Tuple &&t, std::index_sequence< Ids... >)
 
template<class... Tags>
constexpr std::array< DiscreteVectorElement, sizeof...(Tags)> & array (DiscreteVector< Tags... > &v) noexcept
 Returns a reference to the underlying std::array More...
 
template<class... Tags>
constexpr std::array< DiscreteVectorElement, sizeof...(Tags)> const & array (DiscreteVector< Tags... > const &v) noexcept
 Returns a reference to the underlying std::array More...
 
template<class ExecSpace , class Functor , class DDim0 >
void for_each_kokkos (DiscreteDomain< DDim0 > const &domain, Functor const &f) noexcept
 
template<class ExecSpace , class Functor , class DDim0 , class DDim1 , class... DDims>
void for_each_kokkos (DiscreteDomain< DDim0, DDim1, DDims... > const &domain, Functor &&f) noexcept
 
template<class RetType , class Element , std::size_t N, class Functor , class... Is>
void for_each_serial (std::array< Element, N > const &begin, std::array< Element, N > const &end, Functor const &f, Is const &... is) noexcept
 
template<class... DDims, class T , class BinaryReductionOp , class UnaryTransformOp , class... DCoords>
transform_reduce_serial (DiscreteDomain< DDims... > const &domain, [[maybe_unused]] T const neutral, BinaryReductionOp const &reduce, UnaryTransformOp const &transform, DCoords const &... dcoords) noexcept
 A serial reduction over a nD domain. More...
 
template<class ExecSpace , class DDim0 , class T , class BinaryReductionOp , class UnaryTransformOp >
transform_reduce_kokkos (DiscreteDomain< DDim0 > const &domain, T neutral, BinaryReductionOp const &reduce, UnaryTransformOp const &transform) noexcept
 A parallel reduction over a nD domain using the default Kokkos execution space. More...
 
template<class ExecSpace , class DDim0 , class DDim1 , class... DDims, class T , class BinaryReductionOp , class UnaryTransformOp >
transform_reduce_kokkos (DiscreteDomain< DDim0, DDim1, DDims... > const &domain, T neutral, BinaryReductionOp const &reduce, UnaryTransformOp const &transform) noexcept
 A parallel reduction over a nD domain using the default Kokkos execution space. More...
 

Variables

std::optional< std::map< std::string, std::function< void()> > > g_discretization_store
 
template<class DDim >
std::optional< DualDiscretization< DDim > > g_discrete_space_dual
 

Class Documentation

◆ ddc::ddc_detail::Selection

struct ddc::ddc_detail::Selection

template<class QueryDDimSeq>
struct ddc::ddc_detail::Selection< QueryDDimSeq >

◆ ddc::ddc_detail::ddc_to_kokkos_reducer

struct ddc::ddc_detail::ddc_to_kokkos_reducer

template<class Reducer>
struct ddc::ddc_detail::ddc_to_kokkos_reducer< Reducer >

◆ ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::sum< T > >

struct ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::sum< T > >

template<class T>
struct ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::sum< T > >

Class Members
typedef Sum< T > type

◆ ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::prod< T > >

struct ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::prod< T > >

template<class T>
struct ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::prod< T > >

Class Members
typedef Prod< T > type

◆ ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::land >

struct ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::land >
Class Members
typedef LAnd< void > type

◆ ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::lor >

struct ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::lor >
Class Members
typedef LOr< void > type

◆ ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::band< T > >

struct ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::band< T > >

template<class T>
struct ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::band< T > >

Class Members
typedef BAnd< T > type

◆ ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::bor< T > >

struct ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::bor< T > >

template<class T>
struct ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::bor< T > >

Class Members
typedef BOr< T > type

◆ ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::bxor< T > >

struct ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::bxor< T > >

template<class T>
struct ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::bxor< T > >

◆ ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::min< T > >

struct ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::min< T > >

template<class T>
struct ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::min< T > >

Class Members
typedef Min< T > type

◆ ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::max< T > >

struct ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::max< T > >

template<class T>
struct ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::max< T > >

Class Members
typedef Max< T > type

◆ ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::minmax< T > >

struct ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::minmax< T > >

template<class T>
struct ddc::ddc_detail::ddc_to_kokkos_reducer< reducer::minmax< T > >

Class Members
typedef MinMax< T > type

Typedef Documentation

◆ ddim_impl_t

template<class DDim , class MemorySpace >
using ddc::ddc_detail::ddim_impl_t = typedef typename DDim::template Impl<MemorySpace>

◆ ddc_to_kokkos_reducer_t

template<class Reducer >
using ddc::ddc_detail::ddc_to_kokkos_reducer_t = typedef typename ddc_to_kokkos_reducer<Reducer>::type

Alias template to transform a DDC reducer type to a Kokkos reducer type.

Function Documentation

◆ array() [1/4]

template<class... Tags>
constexpr std::array<DiscreteElementType, sizeof...(Tags)>& ddc::ddc_detail::array ( DiscreteElement< Tags... > &  v)
inlineconstexprnoexcept

Returns a reference to the underlying std::array

◆ array() [2/4]

template<class... Tags>
constexpr std::array<DiscreteElementType, sizeof...(Tags)> const& ddc::ddc_detail::array ( DiscreteElement< Tags... > const &  v)
inlineconstexprnoexcept

Returns a reference to the underlying std::array

◆ display_discretization_store()

void ddc::ddc_detail::display_discretization_store ( std::ostream &  os)
inline

◆ extract_after()

template<class Tuple , std::size_t... Ids>
auto ddc::ddc_detail::extract_after ( Tuple &&  t,
std::index_sequence< Ids... >   
)

◆ array() [3/4]

template<class... Tags>
constexpr std::array<DiscreteVectorElement, sizeof...(Tags)>& ddc::ddc_detail::array ( DiscreteVector< Tags... > &  v)
inlineconstexprnoexcept

Returns a reference to the underlying std::array

◆ array() [4/4]

template<class... Tags>
constexpr std::array<DiscreteVectorElement, sizeof...(Tags)> const& ddc::ddc_detail::array ( DiscreteVector< Tags... > const &  v)
inlineconstexprnoexcept

Returns a reference to the underlying std::array

◆ for_each_kokkos() [1/2]

template<class ExecSpace , class Functor , class DDim0 >
void ddc::ddc_detail::for_each_kokkos ( DiscreteDomain< DDim0 > const &  domain,
Functor const &  f 
)
inlinenoexcept

◆ for_each_kokkos() [2/2]

template<class ExecSpace , class Functor , class DDim0 , class DDim1 , class... DDims>
void ddc::ddc_detail::for_each_kokkos ( DiscreteDomain< DDim0, DDim1, DDims... > const &  domain,
Functor &&  f 
)
inlinenoexcept

◆ for_each_serial()

template<class RetType , class Element , std::size_t N, class Functor , class... Is>
void ddc::ddc_detail::for_each_serial ( std::array< Element, N > const &  begin,
std::array< Element, N > const &  end,
Functor const &  f,
Is const &...  is 
)
inlinenoexcept

◆ transform_reduce_serial()

template<class... DDims, class T , class BinaryReductionOp , class UnaryTransformOp , class... DCoords>
T ddc::ddc_detail::transform_reduce_serial ( DiscreteDomain< DDims... > const &  domain,
[[maybe_unused] ] T const  neutral,
BinaryReductionOp const &  reduce,
UnaryTransformOp const &  transform,
DCoords const &...  dcoords 
)
inlinenoexcept

A serial reduction over a nD domain.

Parameters
[in]domainthe range over which to apply the algorithm
[in]neutralthe neutral element of the reduction operation
[in]reducea binary FunctionObject that will be applied in unspecified order to the results of transform, the results of other reduce and neutral.
[in]transforma unary FunctionObject that will be applied to each element of the input range. The return type must be acceptable as input to reduce
[in]dcoordsdiscrete elements from dimensions already in a loop

◆ transform_reduce_kokkos() [1/2]

template<class ExecSpace , class DDim0 , class T , class BinaryReductionOp , class UnaryTransformOp >
T ddc::ddc_detail::transform_reduce_kokkos ( DiscreteDomain< DDim0 > const &  domain,
neutral,
BinaryReductionOp const &  reduce,
UnaryTransformOp const &  transform 
)
inlinenoexcept

A parallel reduction over a nD domain using the default Kokkos execution space.

Parameters
[in]domainthe range over which to apply the algorithm
[in]neutralthe neutral element of the reduction operation
[in]reducea binary FunctionObject that will be applied in unspecified order to the results of transform, the results of other reduce and neutral.
[in]transforma unary FunctionObject that will be applied to each element of the input range. The return type must be acceptable as input to reduce

◆ transform_reduce_kokkos() [2/2]

template<class ExecSpace , class DDim0 , class DDim1 , class... DDims, class T , class BinaryReductionOp , class UnaryTransformOp >
T ddc::ddc_detail::transform_reduce_kokkos ( DiscreteDomain< DDim0, DDim1, DDims... > const &  domain,
neutral,
BinaryReductionOp const &  reduce,
UnaryTransformOp const &  transform 
)
inlinenoexcept

A parallel reduction over a nD domain using the default Kokkos execution space.

Parameters
[in]domainthe range over which to apply the algorithm
[in]neutralthe neutral element of the reduction operation
[in]reducea binary FunctionObject that will be applied in unspecified order to the results of transform, the results of other reduce and neutral.
[in]transforma unary FunctionObject that will be applied to each element of the input range. The return type must be acceptable as input to reduce

Variable Documentation

◆ g_discretization_store

std::optional<std::map<std::string, std::function<void()> > > ddc::ddc_detail::g_discretization_store
inline

◆ g_discrete_space_dual

template<class DDim >
std::optional<DualDiscretization<DDim> > ddc::ddc_detail::g_discrete_space_dual
inline