IPPL API Reference
Independent Parallel Particle Layer C++ API
Loading...
Searching...
No Matches
ippl::detail::MultispaceContainer< Type, Spaces > Class Template Reference

#include <TypeUtils.h>

Public Member Functions

template<typename DataType , typename Filter = std::nullptr_t>
 MultispaceContainer (const DataType &data, Filter &&predicate=nullptr)
 
template<typename Space , typename Filter = std::nullptr_t>
void copyToOtherSpaces (Filter &&predicate=nullptr)
 
template<typename Space >
const Type< Space > & get () const
 
template<typename Space >
Type< Space > & get ()
 
template<typename Functor >
void forAll (Functor &&f) const
 
template<typename Functor >
void forAll (Functor &&f)
 

Detailed Description

template<template< typename > class Type, typename... Spaces>
class ippl::detail::MultispaceContainer< Type, Spaces >

A container indexed by type instead of by numerical indices; designed for storing elements associated with Kokkos memory spaces

Template Parameters
Typethe element type
Spaces...the memory spaces of interest

Constructor & Destructor Documentation

◆ MultispaceContainer()

template<template< typename > class Type, typename... Spaces>
template<typename DataType , typename Filter = std::nullptr_t>
ippl::detail::MultispaceContainer< Type, Spaces >::MultispaceContainer ( const DataType &  data,
Filter &&  predicate = nullptr 
)
inline

Constructs a container where all spaces have a mirror with the same data as the provided data structure; a predicate functor can be provided to skip any undesired memory spaces

Template Parameters
DataTypethe type of the provided element
Filterthe predicate type, or nullptr_t if there is no predicate
Parameters
datathe original data
predicatean optional functor that determines which memory spaces need a copy of the data

Member Function Documentation

◆ copyToOtherSpaces()

template<template< typename > class Type, typename... Spaces>
template<typename Space , typename Filter = std::nullptr_t>
void ippl::detail::MultispaceContainer< Type, Spaces >::copyToOtherSpaces ( Filter &&  predicate = nullptr)
inline

Copies the data from one memory space to all other memory spaces

Template Parameters
Spacethe source space
Filterthe predicate type
Parameters
predicatean optional functor that determines which memory spaces need a copy of the data

◆ forAll()

template<template< typename > class Type, typename... Spaces>
template<typename Functor >
void ippl::detail::MultispaceContainer< Type, Spaces >::forAll ( Functor &&  f) const
inline

Performs an action for each element

Template Parameters
Functorthe functor type
Parameters
fa functor taking an element for a given space

◆ get()

template<template< typename > class Type, typename... Spaces>
template<typename Space >
const Type< Space > & ippl::detail::MultispaceContainer< Type, Spaces >::get ( ) const
inline

Accessor for a space's element

Template Parameters
Spacethe memory space
Returns
The element associated with that space

The documentation for this class was generated from the following file: