Low-Level Abstraction of Memory Access
llama::mapping::SoA< TArrayExtents, TRecordDim, TBlobs, TSubArrayAlignment, TLinearizeArrayIndexFunctor, PermuteFieldsSingleBlob > Struct Template Reference

#include <SoA.hpp>

+ Inheritance diagram for llama::mapping::SoA< TArrayExtents, TRecordDim, TBlobs, TSubArrayAlignment, TLinearizeArrayIndexFunctor, PermuteFieldsSingleBlob >:
+ Collaboration diagram for llama::mapping::SoA< TArrayExtents, TRecordDim, TBlobs, TSubArrayAlignment, TLinearizeArrayIndexFunctor, PermuteFieldsSingleBlob >:

Public Types

using LinearizeArrayIndexFunctor = TLinearizeArrayIndexFunctor
 
using Permuter = PermuteFieldsSingleBlob< FlatRecordDim< TRecordDim > >
 
- Public Types inherited from llama::mapping::MappingBase< TArrayExtents, TRecordDim >
using ArrayExtents = TArrayExtents
 
using RecordDim = TRecordDim
 

Public Member Functions

constexpr SoA ()=default
 
constexpr SoA (TArrayExtents extents, TRecordDim={})
 
constexpr auto blobSize ([[maybe_unused]] size_type blobIndex) const -> size_type
 
template<std::size_t... RecordCoords>
constexpr auto blobNrAndOffset (typename Base::ArrayIndex ai, RecordCoord< RecordCoords... > rc={}) const -> NrAndOffset< size_type >
 
template<std::size_t... RecordCoords>
constexpr auto blobNrAndOffset (size_type flatArrayIndex, RecordCoord< RecordCoords... >={}) const -> NrAndOffset< size_type >
 
- Public Member Functions inherited from llama::mapping::MappingBase< TArrayExtents, TRecordDim >
constexpr MappingBase ()=default
 
constexpr MappingBase (ArrayExtents extents, RecordDim={})
 
constexpr auto extents () const -> ArrayExtents
 

Static Public Attributes

static constexpr Blobs blobs = TBlobs
 
static constexpr SubArrayAlignment subArrayAlignment = TSubArrayAlignment
 
static constexpr std::size_t blobCount = blobs == Blobs::OnePerField ? mp_size<FlatRecordDim<TRecordDim>>::value : 1
 

Additional Inherited Members

- Protected Types inherited from llama::mapping::MappingBase< TArrayExtents, TRecordDim >
using ArrayIndex = typename ArrayExtents::Index
 
using size_type = typename ArrayExtents::value_type
 

Detailed Description

template<typename TArrayExtents, typename TRecordDim, Blobs TBlobs = Blobs::OnePerField, SubArrayAlignment TSubArrayAlignment = TBlobs == Blobs::Single ? SubArrayAlignment::Align : SubArrayAlignment::Pack, typename TLinearizeArrayIndexFunctor = LinearizeArrayIndexRight, template< typename > typename PermuteFieldsSingleBlob = PermuteFieldsInOrder>
struct llama::mapping::SoA< TArrayExtents, TRecordDim, TBlobs, TSubArrayAlignment, TLinearizeArrayIndexFunctor, PermuteFieldsSingleBlob >

Struct of array mapping. Used to create a View via allocView. We recommend to use multiple blobs when the array extents are dynamic and an aligned single blob version when they are static.

Template Parameters
TBlobsIf OnePerField, every element of the record dimension is mapped to its own blob.
TSubArrayAlignmentOnly relevant when TBlobs == Single, ignored otherwise. If Align, aligns the sub arrays created within the single blob by inserting padding. If the array extents are dynamic, this may add some overhead to the mapping logic.
TLinearizeArrayIndexFunctorDefines how the array dimensions should be mapped into linear numbers and how big the linear domain gets.
PermuteFieldsSingleBlobDefines how the record dimension's fields should be permuted if Blobs is Single. See PermuteFieldsInOrder, PermuteFieldsIncreasingAlignment, PermuteFieldsDecreasingAlignment and PermuteFieldsMinimizePadding.

Definition at line 46 of file SoA.hpp.

Member Typedef Documentation

◆ LinearizeArrayIndexFunctor

template<typename TArrayExtents , typename TRecordDim , Blobs TBlobs = Blobs::OnePerField, SubArrayAlignment TSubArrayAlignment = TBlobs == Blobs::Single ? SubArrayAlignment::Align : SubArrayAlignment::Pack, typename TLinearizeArrayIndexFunctor = LinearizeArrayIndexRight, template< typename > typename PermuteFieldsSingleBlob = PermuteFieldsInOrder>
using llama::mapping::SoA< TArrayExtents, TRecordDim, TBlobs, TSubArrayAlignment, TLinearizeArrayIndexFunctor, PermuteFieldsSingleBlob >::LinearizeArrayIndexFunctor = TLinearizeArrayIndexFunctor

Definition at line 55 of file SoA.hpp.

◆ Permuter

template<typename TArrayExtents , typename TRecordDim , Blobs TBlobs = Blobs::OnePerField, SubArrayAlignment TSubArrayAlignment = TBlobs == Blobs::Single ? SubArrayAlignment::Align : SubArrayAlignment::Pack, typename TLinearizeArrayIndexFunctor = LinearizeArrayIndexRight, template< typename > typename PermuteFieldsSingleBlob = PermuteFieldsInOrder>
using llama::mapping::SoA< TArrayExtents, TRecordDim, TBlobs, TSubArrayAlignment, TLinearizeArrayIndexFunctor, PermuteFieldsSingleBlob >::Permuter = PermuteFieldsSingleBlob<FlatRecordDim<TRecordDim> >

Definition at line 56 of file SoA.hpp.

Constructor & Destructor Documentation

◆ SoA() [1/2]

template<typename TArrayExtents , typename TRecordDim , Blobs TBlobs = Blobs::OnePerField, SubArrayAlignment TSubArrayAlignment = TBlobs == Blobs::Single ? SubArrayAlignment::Align : SubArrayAlignment::Pack, typename TLinearizeArrayIndexFunctor = LinearizeArrayIndexRight, template< typename > typename PermuteFieldsSingleBlob = PermuteFieldsInOrder>
constexpr llama::mapping::SoA< TArrayExtents, TRecordDim, TBlobs, TSubArrayAlignment, TLinearizeArrayIndexFunctor, PermuteFieldsSingleBlob >::SoA ( )
constexprdefault

◆ SoA() [2/2]

template<typename TArrayExtents , typename TRecordDim , Blobs TBlobs = Blobs::OnePerField, SubArrayAlignment TSubArrayAlignment = TBlobs == Blobs::Single ? SubArrayAlignment::Align : SubArrayAlignment::Pack, typename TLinearizeArrayIndexFunctor = LinearizeArrayIndexRight, template< typename > typename PermuteFieldsSingleBlob = PermuteFieldsInOrder>
constexpr llama::mapping::SoA< TArrayExtents, TRecordDim, TBlobs, TSubArrayAlignment, TLinearizeArrayIndexFunctor, PermuteFieldsSingleBlob >::SoA ( TArrayExtents  extents,
TRecordDim  = {} 
)
inlineexplicitconstexpr

Definition at line 65 of file SoA.hpp.

Member Function Documentation

◆ blobNrAndOffset() [1/2]

template<typename TArrayExtents , typename TRecordDim , Blobs TBlobs = Blobs::OnePerField, SubArrayAlignment TSubArrayAlignment = TBlobs == Blobs::Single ? SubArrayAlignment::Align : SubArrayAlignment::Pack, typename TLinearizeArrayIndexFunctor = LinearizeArrayIndexRight, template< typename > typename PermuteFieldsSingleBlob = PermuteFieldsInOrder>
template<std::size_t... RecordCoords>
constexpr auto llama::mapping::SoA< TArrayExtents, TRecordDim, TBlobs, TSubArrayAlignment, TLinearizeArrayIndexFunctor, PermuteFieldsSingleBlob >::blobNrAndOffset ( size_type  flatArrayIndex,
RecordCoord< RecordCoords... >  = {} 
) const -> NrAndOffset<size_type>
inlineconstexpr

Definition at line 136 of file SoA.hpp.

◆ blobNrAndOffset() [2/2]

template<typename TArrayExtents , typename TRecordDim , Blobs TBlobs = Blobs::OnePerField, SubArrayAlignment TSubArrayAlignment = TBlobs == Blobs::Single ? SubArrayAlignment::Align : SubArrayAlignment::Pack, typename TLinearizeArrayIndexFunctor = LinearizeArrayIndexRight, template< typename > typename PermuteFieldsSingleBlob = PermuteFieldsInOrder>
template<std::size_t... RecordCoords>
constexpr auto llama::mapping::SoA< TArrayExtents, TRecordDim, TBlobs, TSubArrayAlignment, TLinearizeArrayIndexFunctor, PermuteFieldsSingleBlob >::blobNrAndOffset ( typename Base::ArrayIndex  ai,
RecordCoord< RecordCoords... >  rc = {} 
) const -> NrAndOffset<size_type>
inlineconstexpr

Definition at line 127 of file SoA.hpp.

◆ blobSize()

template<typename TArrayExtents , typename TRecordDim , Blobs TBlobs = Blobs::OnePerField, SubArrayAlignment TSubArrayAlignment = TBlobs == Blobs::Single ? SubArrayAlignment::Align : SubArrayAlignment::Pack, typename TLinearizeArrayIndexFunctor = LinearizeArrayIndexRight, template< typename > typename PermuteFieldsSingleBlob = PermuteFieldsInOrder>
constexpr auto llama::mapping::SoA< TArrayExtents, TRecordDim, TBlobs, TSubArrayAlignment, TLinearizeArrayIndexFunctor, PermuteFieldsSingleBlob >::blobSize ( [[maybe_unused] ] size_type  blobIndex) const -> size_type
inlineconstexpr

Definition at line 71 of file SoA.hpp.

Member Data Documentation

◆ blobCount

template<typename TArrayExtents , typename TRecordDim , Blobs TBlobs = Blobs::OnePerField, SubArrayAlignment TSubArrayAlignment = TBlobs == Blobs::Single ? SubArrayAlignment::Align : SubArrayAlignment::Pack, typename TLinearizeArrayIndexFunctor = LinearizeArrayIndexRight, template< typename > typename PermuteFieldsSingleBlob = PermuteFieldsInOrder>
constexpr std::size_t llama::mapping::SoA< TArrayExtents, TRecordDim, TBlobs, TSubArrayAlignment, TLinearizeArrayIndexFunctor, PermuteFieldsSingleBlob >::blobCount = blobs == Blobs::OnePerField ? mp_size<FlatRecordDim<TRecordDim>>::value : 1
inlinestaticconstexpr

Definition at line 57 of file SoA.hpp.

◆ blobs

template<typename TArrayExtents , typename TRecordDim , Blobs TBlobs = Blobs::OnePerField, SubArrayAlignment TSubArrayAlignment = TBlobs == Blobs::Single ? SubArrayAlignment::Align : SubArrayAlignment::Pack, typename TLinearizeArrayIndexFunctor = LinearizeArrayIndexRight, template< typename > typename PermuteFieldsSingleBlob = PermuteFieldsInOrder>
constexpr Blobs llama::mapping::SoA< TArrayExtents, TRecordDim, TBlobs, TSubArrayAlignment, TLinearizeArrayIndexFunctor, PermuteFieldsSingleBlob >::blobs = TBlobs
inlinestaticconstexpr

Definition at line 53 of file SoA.hpp.

◆ subArrayAlignment

template<typename TArrayExtents , typename TRecordDim , Blobs TBlobs = Blobs::OnePerField, SubArrayAlignment TSubArrayAlignment = TBlobs == Blobs::Single ? SubArrayAlignment::Align : SubArrayAlignment::Pack, typename TLinearizeArrayIndexFunctor = LinearizeArrayIndexRight, template< typename > typename PermuteFieldsSingleBlob = PermuteFieldsInOrder>
constexpr SubArrayAlignment llama::mapping::SoA< TArrayExtents, TRecordDim, TBlobs, TSubArrayAlignment, TLinearizeArrayIndexFunctor, PermuteFieldsSingleBlob >::subArrayAlignment = TSubArrayAlignment
inlinestaticconstexpr

Definition at line 54 of file SoA.hpp.


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