Low-Level Abstraction of Memory Access
llama Namespace Reference

Namespaces

 accessor
 
 bloballoc
 
 internal
 
 literals
 
 mapping
 

Classes

struct  Array
 
struct  Array< T, 0 >
 
struct  ArrayIndex
 
struct  ArrayExtents
 
struct  ArrayExtents< T >
 
struct  ArrayIndexIterator
 Iterator supporting ArrayIndexRange. More...
 
struct  ArrayIndexRange
 Range allowing to iterate over all indices in an ArrayExtents. More...
 
struct  Copy
 Generic implementation of copy defaulting to fieldWiseCopy. LLAMA provides several specializations of this construct for specific mappings. Users are encouraged to also specialize this template with better copy algorithms for further combinations of mappings, if they can and want to provide a better implementation. More...
 
struct  Copy< Mapping, Mapping >
 
struct  Copy< mapping::AoSoA< ArrayExtents, RecordDim, LanesSrc, AlignSrc, LinearizeArrayIndex, PermuteFields >, mapping::AoSoA< ArrayExtents, RecordDim, LanesDst, AlignDst, LinearizeArrayIndex, PermuteFields >, std::enable_if_t< LanesSrc !=LanesDst > >
 
struct  Copy< mapping::AoSoA< ArrayExtents, RecordDim, LanesSrc, AlignSrc, LinearizeArrayIndex, PermuteFields >, mapping::SoA< ArrayExtents, RecordDim, DstBlobs, DstSubArrayAlignment, LinearizeArrayIndex, PermuteFields > >
 
struct  Copy< mapping::SoA< ArrayExtents, RecordDim, SrcBlobs, SrcSubArrayAlignment, LinearizeArrayIndex, PermuteFields >, mapping::AoSoA< ArrayExtents, RecordDim, LanesDst, AlignDst, LinearizeArrayIndex, PermuteFields > >
 
struct  Copy< mapping::SoA< ArrayExtents, RecordDim, SrcBlobs, SrcSubArrayAlignment, LinearizeArrayIndex, PermuteFields >, mapping::SoA< ArrayExtents, RecordDim, DstBlobs, DstSubArrayAlignment, LinearizeArrayIndex, PermuteFields >, std::enable_if_t< SrcBlobs !=DstBlobs||SrcSubArrayAlignment !=DstSubArrayAlignment > >
 
struct  NoName
 Anonymous naming for a Field. More...
 
struct  Field
 
struct  Record
 A type list of Fields which may be used to define a record dimension. More...
 
struct  NrAndOffset
 
struct  PrettySize
 
struct  ProxyRefOpMixin
 CRTP mixin for proxy reference types to support all compound assignment and increment/decrement operators. More...
 
struct  RecordCoord
 
struct  RecordCoord<>
 
struct  RecordRef
 
struct  ScopedUpdate
 
struct  ScopedUpdate< Reference, std::enable_if_t< std::is_fundamental_v< typename internal::ValueOf< Reference >::type > > >
 
struct  SimdTraits
 
struct  SimdTraits< T, std::enable_if_t< std::is_arithmetic_v< T > > >
 
struct  Tuple
 
struct  Tuple< TFirstElement, RestElements... >
 Tuple class like std::tuple but suitable for use with offloading devices like GPUs. More...
 
struct  Vector
 
struct  View
 
struct  Iterator
 
struct  SubView
 

Typedefs

template<typename SizeType , std::size_t N, SizeType Extent>
using ArrayExtentsNCube = decltype(internal::makeArrayExtents< SizeType, Extent >(std::make_index_sequence< N >{}))
 N-dimensional ArrayExtents where all N extents are Extent. More...
 
template<typename SizeType , std::size_t N>
using ArrayExtentsDynamic = ArrayExtentsNCube< SizeType, N, dyn >
 N-dimensional ArrayExtents where all values are dynamic. More...
 
template<typename Field >
using GetFieldTag = mp_first< Field >
 Get the tag from a Field. More...
 
template<typename Field >
using GetFieldType = mp_second< Field >
 Get the type from a Field. More...
 
template<typename RecordDim , typename RecordCoord >
using GetTags = typename internal::GetTagsImpl< RecordDim, RecordCoord >::type
 
template<typename RecordDim , typename RecordCoord >
using GetTag = typename internal::GetTagImpl< RecordDim, RecordCoord >::type
 Get the tag of the Field at a RecordCoord inside the record dimension tree. More...
 
template<typename RecordDim , typename... TagsOrTagList>
using GetCoordFromTags = typename internal::GetCoordFromTagsImpl< RecordDim, RecordCoord<>, TagsOrTagList... >::type
 
template<typename RecordDim , typename... RecordCoordOrTags>
using GetType = typename internal::GetTypeImpl< RecordDim, RecordCoordOrTags... >::type
 
template<typename RecordDim >
using LeafRecordCoords = typename internal::LeafRecordCoordsImpl< RecordDim, RecordCoord<> >::type
 Returns a flat type list containing all record coordinates to all leaves of the given record dimension. More...
 
template<typename RecordDim >
using FlatRecordDim = typename internal::FlattenRecordDimImpl< RecordDim >::type
 Returns a flat type list containing all leaf field types of the given record dimension. More...
 
template<typename RecordDim , template< typename, typename > typename FieldTypeFunctor>
using TransformLeavesWithCoord = typename internal::TransformLeavesWithCoordImpl< RecordCoord<>, RecordDim, FieldTypeFunctor >::type
 
template<typename RecordDim , template< typename > typename FieldTypeFunctor>
using TransformLeaves = TransformLeavesWithCoord< RecordDim, internal::MakePassSecond< FieldTypeFunctor >::template fn >
 
template<typename RecordDimA , typename RecordDimB >
using MergedRecordDims = typename decltype(internal::mergeRecordDimsImpl(mp_identity< RecordDimA >{}, mp_identity< RecordDimB >{}))::type
 Creates a merged record dimension, where duplicated, nested fields are unified. More...
 
template<typename FromT , typename ToT >
using CopyConst = std::conditional_t< std::is_const_v< FromT >, const ToT, ToT >
 Alias for ToT, adding const if FromT is const qualified. More...
 
template<auto V>
using Constant = std::integral_constant< decltype(V), V >
 Used as template argument to specify a constant/compile-time value. More...
 
template<typename Expression , typename... Args>
using ReplacePlaceholders = typename internal::ReplacePlaceholdersImpl< Expression, Args... >::type
 
template<typename L >
using RecordCoordFromList = internal::mp_unwrap_values_into< L, RecordCoord >
 Converts a type list of integral constants into a RecordCoord. More...
 
template<typename... RecordCoords>
using Cat = RecordCoordFromList< mp_append< typename RecordCoords::List... > >
 Concatenate a set of RecordCoords. More...
 
template<typename RecordCoord >
using PopFront = RecordCoordFromList< mp_pop_front< typename RecordCoord::List > >
 RecordCoord without first coordinate component. More...
 
template<typename RecordDim , std::size_t N, template< typename, auto > typename MakeSizedSimd>
using SimdizeN = typename internal::SimdizeNImpl< RecordDim, N, MakeSizedSimd >::type
 
template<typename RecordDim , template< typename > typename MakeSimd>
using Simdize = TransformLeaves< RecordDim, MakeSimd >
 
template<typename T , std::size_t N, template< typename, auto > typename MakeSizedSimd>
using SimdN = typename std::conditional_t< isRecordDim< T >, std::conditional_t< N==1, mp_identity< One< T > >, mp_identity< One< SimdizeN< T, N, MakeSizedSimd > >> >, std::conditional_t< N==1, mp_identity< T >, mp_identity< SimdizeN< T, N, MakeSizedSimd > >> >::type
 
template<typename T , template< typename > typename MakeSimd>
using Simd = typename std::conditional_t< isRecordDim< T >, mp_identity< One< Simdize< T, MakeSimd > >>, mp_identity< Simdize< T, MakeSimd > >>::type
 
template<typename RecordDim >
using One = RecordRef< decltype(allocScalarView< 0, RecordDim >()), RecordCoord<>, true >
 A RecordRef that owns and holds a single value. More...
 

Functions

template<typename First , typename... Args>
 Array (First, Args... args) -> Array< First, sizeof...(Args)+1 >
 
template<typename T , std::size_t N>
auto operator<< (std::ostream &os, const Array< T, N > &a) -> std::ostream &
 
template<typename T , std::size_t N>
constexpr auto pushFront ([[maybe_unused]] Array< T, N > a, T v) -> Array< T, N+1 >
 
template<typename T , std::size_t N>
constexpr auto pushBack ([[maybe_unused]] Array< T, N > a, T v) -> Array< T, N+1 >
 
template<typename T , std::size_t N>
constexpr auto popBack ([[maybe_unused]] Array< T, N > a)
 
template<typename T , std::size_t N>
constexpr auto popFront ([[maybe_unused]] Array< T, N > a)
 
template<typename T , std::size_t N>
constexpr auto product (Array< T, N > a) -> T
 
template<typename T , std::size_t N>
constexpr auto dot ([[maybe_unused]] Array< T, N > a, [[maybe_unused]] Array< T, N > b) -> T
 
template<std::size_t Dim, typename TA , typename TB >
constexpr auto operator== (ArrayIndex< TA, Dim > a, ArrayIndex< TB, Dim > b) -> bool
 
template<std::size_t Dim, typename TA , typename TB >
constexpr auto operator!= (ArrayIndex< TA, Dim > a, ArrayIndex< TB, Dim > b) -> bool
 
template<typename... Args>
 ArrayIndex (Args...) -> ArrayIndex< typename internal::IndexTypeFromArgs< std::size_t, Args... >::type, sizeof...(Args)>
 
template<typename... Args>
 ArrayExtents (Args...) -> ArrayExtents< typename internal::IndexTypeFromArgs< std::size_t, Args... >::type,(Args{}, dyn)... >
 
template<typename SizeTypeA , SizeTypeA... SizesA, typename SizeTypeB , SizeTypeB... SizesB>
constexpr auto operator== (ArrayExtents< SizeTypeA, SizesA... > a, ArrayExtents< SizeTypeB, SizesB... > b) -> bool
 
template<typename SizeTypeA , SizeTypeA... SizesA, typename SizeTypeB , SizeTypeB... SizesB>
constexpr auto operator!= (ArrayExtents< SizeTypeA, SizesA... > a, ArrayExtents< SizeTypeB, SizesB... > b) -> bool
 
template<typename SizeType , SizeType... Sizes>
constexpr auto product (ArrayExtents< SizeType, Sizes... > e) -> SizeType
 
template<typename SizeType , std::size_t Dim, typename Func , typename... OuterIndices>
void forEachArrayIndex ([[maybe_unused]] const ArrayIndex< SizeType, Dim > &extents, Func &&func, OuterIndices... outerIndices)
 
template<typename SizeType , SizeType... Sizes, typename Func >
void forEachArrayIndex (ArrayExtents< SizeType, Sizes... > extents, Func &&func)
 
template<typename Mapping , typename SrcBlob , typename DstBlob , typename MemcpyFunc = decltype(internal::memcpy)>
void memcpyBlobs (const View< Mapping, SrcBlob > &srcView, View< Mapping, DstBlob > &dstView, std::size_t threadId=0, std::size_t threadCount=1, MemcpyFunc singleThreadMemcpy=internal::memcpy)
 
template<typename Mapping , typename SrcBlob , typename DstBlob , typename BlobCopyFunc = decltype(internal::copyBlobWithMemcpy)>
void copyBlobs (const View< Mapping, SrcBlob > &srcView, View< Mapping, DstBlob > &dstView, BlobCopyFunc copyBlob=internal::copyBlobWithMemcpy)
 
template<typename SrcMapping , typename SrcBlob , typename DstMapping , typename DstBlob >
void fieldWiseCopy (const View< SrcMapping, SrcBlob > &srcView, View< DstMapping, DstBlob > &dstView, std::size_t threadId=0, std::size_t threadCount=1)
 
template<typename SrcMapping , typename SrcBlob , typename DstMapping , typename DstBlob >
void aosoaCommonBlockCopy (const View< SrcMapping, SrcBlob > &srcView, View< DstMapping, DstBlob > &dstView, std::size_t threadId=0, std::size_t threadCount=1)
 
template<typename SrcMapping , typename SrcBlob , typename DstMapping , typename DstBlob >
void copy (const View< SrcMapping, SrcBlob > &srcView, View< DstMapping, DstBlob > &dstView, std::size_t threadId=0, std::size_t threadCount=1)
 
template<typename Int >
 NrAndOffset (Int, Int) -> NrAndOffset< Int >
 
template<typename TA , typename TB >
auto operator== (const NrAndOffset< TA > &a, const NrAndOffset< TB > &b) -> bool
 
template<typename TA , typename TB >
auto operator!= (const NrAndOffset< TA > &a, const NrAndOffset< TB > &b) -> bool
 
template<typename RecordDim , typename Functor , std::size_t... Coords>
constexpr void forEachLeafCoord (Functor &&functor, RecordCoord< Coords... > baseCoord)
 
template<typename RecordDim , typename Functor , typename... Tags>
constexpr void forEachLeafCoord (Functor &&functor, Tags...)
 
template<typename Integral >
constexpr auto divCeil (Integral a, Integral b) -> Integral
 Returns the ceiling of a / b. More...
 
template<typename Integral >
constexpr auto roundUpToMultiple (Integral n, Integral mult) -> Integral
 Returns the integral n rounded up to be a multiple of mult. More...
 
auto prettySize (double size) -> PrettySize
 
template<typename L , typename F >
constexpr void mp_for_each_inline (F &&f)
 Like boost::mp11::mp_for_each, but marked with LLAMA_FN_HOST_ACC_INLINE. More...
 
template<std::size_t PieceLength, typename Mapping >
constexpr auto mapsPiecewiseContiguous (const Mapping &m) -> bool
 
template<std::size_t... CoordsA, std::size_t... CoordsB>
constexpr auto operator== (RecordCoord< CoordsA... >, RecordCoord< CoordsB... >)
 
template<std::size_t... Coords>
constexpr auto operator== (RecordCoord< Coords... >, RecordCoord< Coords... >)
 
template<std::size_t... CoordsA, std::size_t... CoordsB>
constexpr auto operator!= (RecordCoord< CoordsA... > a, RecordCoord< CoordsB... > b)
 
template<std::size_t... RCs>
auto operator<< (std::ostream &os, RecordCoord< RCs... >) -> std::ostream &
 
template<char... Digits>
constexpr auto operator""_RC ()
 Literal operator for converting a numeric literal into a RecordCoord. More...
 
template<typename... RecordCoords>
constexpr auto cat (RecordCoords...)
 Concatenate a set of RecordCoords instances. More...
 
template<typename View , typename BoundRecordCoord , bool OwnView>
auto copyRecord (const RecordRef< View, BoundRecordCoord, OwnView > &rr)
 Returns a One with the same record dimension as the given record ref, with values copyied from rr. More...
 
template<typename ViewA , typename BoundRecordDimA , bool OwnViewA, typename ViewB , typename BoundRecordDimB , bool OwnViewB>
auto swap (RecordRef< ViewA, BoundRecordDimA, OwnViewA > &a, RecordRef< ViewB, BoundRecordDimB, OwnViewB > &b) noexcept -> std::enable_if_t< std::is_same_v< typename RecordRef< ViewA, BoundRecordDimA, OwnViewA >::AccessibleRecordDim, typename RecordRef< ViewB, BoundRecordDimB, OwnViewB >::AccessibleRecordDim >>
 
template<typename View , typename BoundRecordCoord , bool OwnView>
auto operator<< (std::ostream &os, const RecordRef< View, BoundRecordCoord, OwnView > &vr) -> std::ostream &
 
template<typename RecordRefFwd , typename Functor >
constexpr void forEachLeaf (RecordRefFwd &&vr, Functor &&functor)
 
template<typename T >
auto decayCopy (T &&valueOrRef) -> typename internal::ValueOf< T >::type
 Pulls a copy of the given value or reference. Proxy references are resolved to their value types. More...
 
template<typename T >
 ScopedUpdate (T) -> ScopedUpdate< typename internal::ReferenceTo< std::remove_reference_t< T >>::type >
 
template<typename RecordDim , template< typename > typename MakeSimd, typename BinaryReductionFunction >
constexpr auto chooseSimdLanes (BinaryReductionFunction reduce) -> std::size_t
 
template<typename T , typename Simd >
void loadSimd (const T &srcRef, Simd &dstSimd)
 
template<typename Simd , typename TFwd >
void storeSimd (const Simd &srcSimd, TFwd &&dstRef)
 
template<std::size_t N, template< typename, auto > typename MakeSizedSimd, typename View , typename UnarySimdFunction >
void simdForEachN (View &view, UnarySimdFunction f)
 
template<template< typename > typename MakeSimd, template< typename, auto > typename MakeSizedSimd, typename View , typename UnarySimdFunction >
void simdForEach (View &view, UnarySimdFunction f)
 
template<typename T >
constexpr auto structName (T={}) -> std::string_view
 
template<typename RecordDim , std::size_t... Coords>
constexpr auto prettyRecordCoord (RecordCoord< Coords... >={}) -> std::string_view
 
template<typename RecordDim >
constexpr auto prettyRecordCoord (RecordCoord<>) -> std::string_view
 
template<typename... Elements>
 Tuple (Elements...) -> Tuple< std::remove_cv_t< std::remove_reference_t< Elements >>... >
 
template<std::size_t I, typename... Elements>
constexpr auto get (Tuple< Elements... > &tuple) -> auto &
 
template<std::size_t I, typename... Elements>
constexpr auto get (const Tuple< Elements... > &tuple) -> const auto &
 
template<typename... ElementsA, typename... ElementsB>
constexpr auto operator== (const Tuple< ElementsA... > &a, const Tuple< ElementsB... > &b) -> bool
 
template<typename... ElementsA, typename... ElementsB>
constexpr auto operator!= (const Tuple< ElementsA... > &a, const Tuple< ElementsB... > &b) -> bool
 
template<typename Tuple1 , typename Tuple2 >
constexpr auto tupleCat (const Tuple1 &t1, const Tuple2 &t2)
 
template<std::size_t Pos, typename Tuple , typename Replacement >
constexpr auto tupleReplace (Tuple &&tuple, Replacement &&replacement)
 Creates a copy of a tuple with the element at position Pos replaced by replacement. More...
 
template<typename... Elements, typename Functor >
constexpr auto tupleTransform (const Tuple< Elements... > &tuple, const Functor &functor)
 
template<typename... Elements>
constexpr auto popFront (const Tuple< Elements... > &tuple)
 Returns a copy of the tuple without the first element. More...
 
template<typename Mapping , typename Allocator = bloballoc::Vector, typename Accessor = accessor::Default>
auto allocViewUninitialized (Mapping mapping={}, const Allocator &alloc={}, Accessor accessor={})
 Same as allocView but does not run field constructors. More...
 
template<typename Mapping , typename BlobType , typename Accessor , std::size_t... RCs>
void constructField (View< Mapping, BlobType, Accessor > &view, typename Mapping::ArrayExtents::Index ai, RecordCoord< RCs... > rc)
 
template<typename Mapping , typename BlobType , typename Accessor >
void constructFields (View< Mapping, BlobType, Accessor > &view)
 
template<typename Mapping , typename Allocator = bloballoc::Vector, typename Accessor = accessor::Default>
auto allocView (Mapping mapping={}, const Allocator &alloc={}, Accessor accessor={}) -> View< Mapping, internal::AllocatorBlobType< Allocator, typename Mapping::RecordDim >, Accessor >
 
template<std::size_t Dim, typename RecordDim >
auto allocScalarViewUninitialized () -> decltype(auto)
 Same as allocScalarView but does not run field constructors. More...
 
template<std::size_t Dim, typename RecordDim >
auto allocScalarView () -> decltype(auto)
 
template<typename Mapping , typename RecordCoord , typename Blobs >
auto mapToMemory (Mapping &mapping, typename Mapping::ArrayExtents::Index ai, RecordCoord rc, Blobs &blobs) -> decltype(auto)
 
template<typename ViewFwd , typename TransformBlobFunc , typename = std::enable_if_t<isView<std::decay_t<ViewFwd>>>>
auto transformBlobs (ViewFwd &&view, const TransformBlobFunc &transformBlob)
 
template<typename View , typename NewBlobType = CopyConst<std::remove_reference_t<View>, std::byte>*, typename = std::enable_if_t<isView<std::decay_t<View>>>>
auto shallowCopy (View &&view)
 
template<typename NewAccessor , typename ViewFwd , typename = std::enable_if_t<isView<std::decay_t<ViewFwd>>>>
auto withAccessor (ViewFwd &&view, NewAccessor newAccessor={})
 
template<typename NewMapping , typename ViewFwd , typename = std::enable_if_t<isView<std::decay_t<ViewFwd>>>>
auto withMapping (ViewFwd &&view, NewMapping newMapping={})
 
template<typename TStoredParentView >
 SubView (TStoredParentView &&, typename std::remove_reference_t< TStoredParentView >::Mapping::ArrayExtents::Index) -> SubView< TStoredParentView >
 

Variables

constexpr auto dyn = internal::Dyn{}
 Used as a template argument to ArrayExtents to mark a dynamic extent. More...
 
template<typename R >
constexpr bool isProxyReference = internal::IsProxyReferenceImpl<R>::value
 
template<typename T >
constexpr bool isAllowedFieldType = std::is_trivially_destructible_v<T>
 Tells whether the given type is allowed as a field type in LLAMA. Such types need to be trivially constructible and trivially destructible. More...
 
template<typename T >
constexpr bool isField = false
 
template<typename Tag , typename Type >
constexpr bool isField< Field< Tag, Type > > = true
 
template<typename T >
constexpr auto isRecord = false
 
template<typename... Fields>
constexpr auto isRecord< Record< Fields... > > = true
 
template<typename RecordDimA , typename RecordCoordA , typename RecordDimB , typename RecordCoordB >
constexpr auto hasSameTags
 
template<typename RecordDim >
constexpr std::size_t flatFieldCount = 1
 The total number of fields in the recursively expanded record dimension. More...
 
template<typename... Children>
constexpr std::size_t flatFieldCount< Record< Children... > > = (flatFieldCount<GetFieldType<Children>> + ... + 0)
 
template<typename Child , std::size_t N>
constexpr std::size_t flatFieldCount< Child[N]> = flatFieldCount<Child> * N
 
template<typename RecordDim , typename RecordCoord >
constexpr std::size_t flatRecordCoord = 0
 
template<typename T >
constexpr std::size_t flatRecordCoord< T, RecordCoord<> > = 0
 
template<typename... Children, std::size_t I, std::size_t... Is>
constexpr std::size_t flatRecordCoord< Record< Children... >, RecordCoord< I, Is... > >
 
template<typename Child , std::size_t N, std::size_t I, std::size_t... Is>
constexpr std::size_t flatRecordCoord< Child[N], RecordCoord< I, Is... > > = flatFieldCount<Child> * I + flatRecordCoord<Child, RecordCoord<Is...>>
 
template<typename TypeList >
constexpr std::size_t flatAlignOf = internal::flatAlignOfImpl<TypeList>()
 
template<typename T >
constexpr std::size_t alignOf = alignof(T)
 The alignment of a type T. More...
 
template<typename... Fields>
constexpr std::size_t alignOf< Record< Fields... > > = flatAlignOf<FlatRecordDim<Record<Fields...>>>
 
template<typename TypeList , bool Align, bool IncludeTailPadding = true>
constexpr std::size_t flatSizeOf = internal::sizeOfImpl<TypeList, Align, IncludeTailPadding>()
 The size of a type list if its elements would be in a normal struct. More...
 
template<typename T , bool Align = false, bool IncludeTailPadding = true>
constexpr std::size_t sizeOf = sizeof(T)
 The size of a type T. More...
 
template<typename... Fields, bool Align, bool IncludeTailPadding>
constexpr std::size_t sizeOf< Record< Fields... >, Align, IncludeTailPadding > = flatSizeOf<FlatRecordDim<Record<Fields...>>, Align, IncludeTailPadding>
 The size of a record dimension if its fields would be in a normal struct. More...
 
template<typename TypeList , std::size_t I, bool Align>
constexpr std::size_t flatOffsetOf = internal::offsetOfImplWorkaround<TypeList, I, Align>()
 The byte offset of an element in a type list ifs elements would be in a normal struct. More...
 
template<typename RecordDim , typename RecordCoord , bool Align = false>
constexpr std::size_t offsetOf = flatOffsetOf<FlatRecordDim<RecordDim>, flatRecordCoord<RecordDim, RecordCoord>, Align>
 
template<typename T >
constexpr bool isRecordDim = isRecord<T> || internal::IsBoundedArray<T>::value
 True if the T is a record dimension. That is, T is either a llama::Record or a bounded array. More...
 
template<typename T >
constexpr bool isConstant = internal::IsConstant<T>::value
 
template<typename T >
constexpr bool isRecordCoord = false
 
template<std::size_t... Coords>
constexpr bool isRecordCoord< RecordCoord< Coords... > > = true
 
template<typename First , typename Second >
constexpr auto recordCoordCommonPrefixIsBigger = internal::recordCoordCommonPrefixIsBiggerImpl(First{}, Second{})
 Checks wether the first RecordCoord is bigger than the second. More...
 
template<typename First , typename Second >
constexpr auto recordCoordCommonPrefixIsSame = internal::recordCoordCommonPrefixIsSameImpl(First{}, Second{})
 Checks whether two RecordCoords are the same or one is the prefix of the other. More...
 
template<typename View >
constexpr auto isRecordRef = false
 
template<typename View , typename BoundRecordCoord , bool OwnView>
constexpr auto isRecordRef< RecordRef< View, BoundRecordCoord, OwnView > > = true
 
template<typename Simd , typename SFINAE = void>
constexpr auto simdLanes = SimdTraits<Simd>::lanes
 
template<typename RecordDim , template< typename > typename MakeSimd>
constexpr std::size_t simdLanesWithFullVectorsFor
 
template<typename RecordDim , template< typename > typename MakeSimd>
constexpr std::size_t simdLanesWithLeastRegistersFor
 
template<typename T >
constexpr auto qualifiedTypeName
 
template<typename Mapping , typename RecordCoord >
constexpr bool isComputed = internal::IsComputed<Mapping, RecordCoord>::value
 Returns true if the field accessed via the given mapping and record coordinate is a computed value. More...
 
template<typename Mapping >
constexpr bool hasAnyComputedField
 Returns true if any field accessed via the given mapping is a computed value. More...
 
template<typename T >
constexpr bool isOne = false
 Is true, if T is an instance of One. More...
 
template<typename View , typename BoundRecordCoord >
constexpr bool isOne< RecordRef< View, BoundRecordCoord, true > > = true
 
template<typename View >
constexpr auto isView = false
 
template<typename Mapping , typename BlobType , typename Accessor >
constexpr auto isView< View< Mapping, BlobType, Accessor > > = true
 

Typedef Documentation

◆ ArrayExtentsDynamic

template<typename SizeType , std::size_t N>
using llama::ArrayExtentsDynamic = typedef ArrayExtentsNCube<SizeType, N, dyn>

N-dimensional ArrayExtents where all values are dynamic.

Definition at line 246 of file ArrayExtents.hpp.

◆ ArrayExtentsNCube

template<typename SizeType , std::size_t N, SizeType Extent>
using llama::ArrayExtentsNCube = typedef decltype(internal::makeArrayExtents<SizeType, Extent>(std::make_index_sequence<N>{}))

N-dimensional ArrayExtents where all N extents are Extent.

Definition at line 241 of file ArrayExtents.hpp.

◆ Cat

template<typename... RecordCoords>
using llama::Cat = typedef RecordCoordFromList<mp_append<typename RecordCoords::List...> >

Concatenate a set of RecordCoords.

Definition at line 116 of file RecordCoord.hpp.

◆ Constant

template<auto V>
using llama::Constant = typedef std::integral_constant<decltype(V), V>

Used as template argument to specify a constant/compile-time value.

Definition at line 829 of file Core.hpp.

◆ CopyConst

template<typename FromT , typename ToT >
using llama::CopyConst = typedef std::conditional_t<std::is_const_v<FromT>, const ToT, ToT>

Alias for ToT, adding const if FromT is const qualified.

Definition at line 824 of file Core.hpp.

◆ FlatRecordDim

template<typename RecordDim >
using llama::FlatRecordDim = typedef typename internal::FlattenRecordDimImpl<RecordDim>::type

Returns a flat type list containing all leaf field types of the given record dimension.

Definition at line 481 of file Core.hpp.

◆ GetCoordFromTags

template<typename RecordDim , typename... TagsOrTagList>
using llama::GetCoordFromTags = typedef typename internal::GetCoordFromTagsImpl<RecordDim, RecordCoord<>, TagsOrTagList...>::type

Converts a series of tags, or a list of tags, navigating down a record dimension into a RecordCoord. A RecordCoord will be passed through unmodified.

Definition at line 353 of file Core.hpp.

◆ GetFieldTag

template<typename Field >
using llama::GetFieldTag = typedef mp_first<Field>

Get the tag from a Field.

Definition at line 186 of file Core.hpp.

◆ GetFieldType

template<typename Field >
using llama::GetFieldType = typedef mp_second<Field>

Get the type from a Field.

Definition at line 191 of file Core.hpp.

◆ GetTag

template<typename RecordDim , typename RecordCoord >
using llama::GetTag = typedef typename internal::GetTagImpl<RecordDim, RecordCoord>::type

Get the tag of the Field at a RecordCoord inside the record dimension tree.

Definition at line 253 of file Core.hpp.

◆ GetTags

template<typename RecordDim , typename RecordCoord >
using llama::GetTags = typedef typename internal::GetTagsImpl<RecordDim, RecordCoord>::type

Get the tags of all Fields from the root of the record dimension tree until to the node identified by RecordCoord.

Definition at line 233 of file Core.hpp.

◆ GetType

template<typename RecordDim , typename... RecordCoordOrTags>
using llama::GetType = typedef typename internal::GetTypeImpl<RecordDim, RecordCoordOrTags...>::type

Returns the type of a node in a record dimension tree identified by a given RecordCoord or a series of tags.

Definition at line 388 of file Core.hpp.

◆ LeafRecordCoords

template<typename RecordDim >
using llama::LeafRecordCoords = typedef typename internal::LeafRecordCoordsImpl<RecordDim, RecordCoord<> >::type

Returns a flat type list containing all record coordinates to all leaves of the given record dimension.

Definition at line 428 of file Core.hpp.

◆ MergedRecordDims

template<typename RecordDimA , typename RecordDimB >
using llama::MergedRecordDims = typedef typename decltype(internal::mergeRecordDimsImpl(mp_identity<RecordDimA>{}, mp_identity<RecordDimB>{}))::type

Creates a merged record dimension, where duplicated, nested fields are unified.

Definition at line 818 of file Core.hpp.

◆ One

template<typename RecordDim >
using llama::One = typedef RecordRef<decltype(allocScalarView<0, RecordDim>()), RecordCoord<>, true>

A RecordRef that owns and holds a single value.

Definition at line 188 of file View.hpp.

◆ PopFront

template<typename RecordCoord >
using llama::PopFront = typedef RecordCoordFromList<mp_pop_front<typename RecordCoord::List> >

RecordCoord without first coordinate component.

Definition at line 129 of file RecordCoord.hpp.

◆ RecordCoordFromList

template<typename L >
using llama::RecordCoordFromList = typedef internal::mp_unwrap_values_into<L, RecordCoord>

Converts a type list of integral constants into a RecordCoord.

Definition at line 111 of file RecordCoord.hpp.

◆ ReplacePlaceholders

template<typename Expression , typename... Args>
using llama::ReplacePlaceholders = typedef typename internal::ReplacePlaceholdersImpl<Expression, Args...>::type

Definition at line 66 of file Meta.hpp.

◆ Simd

template<typename T , template< typename > typename MakeSimd>
using llama::Simd = typedef typename std:: conditional_t<isRecordDim<T>, mp_identity<One<Simdize<T, MakeSimd> >>, mp_identity<Simdize<T, MakeSimd> >>::type

Creates a SIMD version of the given type. Of T is a record dimension, creates a One where each field is a SIMD type of the original field type.

Definition at line 168 of file Simd.hpp.

◆ Simdize

template<typename RecordDim , template< typename > typename MakeSimd>
using llama::Simdize = typedef TransformLeaves<RecordDim, MakeSimd>

Transforms the given record dimension into a SIMD version of it. Each leaf field type will be replaced by a SIMD vector, as determined by MakeSimd.

Definition at line 151 of file Simd.hpp.

◆ SimdizeN

template<typename RecordDim , std::size_t N, template< typename, auto > typename MakeSizedSimd>
using llama::SimdizeN = typedef typename internal::SimdizeNImpl<RecordDim, N, MakeSizedSimd>::type

Transforms the given record dimension into a SIMD version of it. Each leaf field type will be replaced by a sized SIMD vector with length N, as determined by MakeSizedSimd. If N is 1, SimdizeN<T, 1, ...> is an alias for T.

Definition at line 145 of file Simd.hpp.

◆ SimdN

template<typename T , std::size_t N, template< typename, auto > typename MakeSizedSimd>
using llama::SimdN = typedef typename std::conditional_t< isRecordDim<T>, std::conditional_t<N == 1, mp_identity<One<T> >, mp_identity<One<SimdizeN<T, N, MakeSizedSimd> >> >, std::conditional_t<N == 1, mp_identity<T>, mp_identity<SimdizeN<T, N, MakeSizedSimd> >> >::type

Creates a SIMD version of the given type. Of T is a record dimension, creates a One where each field is a SIMD type of the original field type. The SIMD vectors have length N. If N is 1, an ordinary One of the record dimension T is created. If T is not a record dimension, a SIMD vector with value T and length N is created. If N is 1 (and T is not a record dimension), then T is produced.

Definition at line 159 of file Simd.hpp.

◆ TransformLeaves

template<typename RecordDim , template< typename > typename FieldTypeFunctor>
using llama::TransformLeaves = typedef TransformLeavesWithCoord<RecordDim, internal::MakePassSecond<FieldTypeFunctor>::template fn>

Creates a new record dimension where each new leaf field's type is the result of applying FieldTypeFunctor to the original leaf field's type.

Definition at line 757 of file Core.hpp.

◆ TransformLeavesWithCoord

template<typename RecordDim , template< typename, typename > typename FieldTypeFunctor>
using llama::TransformLeavesWithCoord = typedef typename internal::TransformLeavesWithCoordImpl<RecordCoord<>, RecordDim, FieldTypeFunctor>::type

Creates a new record dimension where each new leaf field's type is the result of applying FieldTypeFunctor to the original leaf's RecordCoord and field's type.

Definition at line 750 of file Core.hpp.

Function Documentation

◆ allocScalarView()

template<std::size_t Dim, typename RecordDim >
auto llama::allocScalarView ( ) -> decltype(auto)
inline

Allocates a View holding a single record backed by a byte array (bloballoc::Array).

Template Parameters
DimDimension of the ArrayExtents of the View.

Definition at line 174 of file View.hpp.

◆ allocScalarViewUninitialized()

template<std::size_t Dim, typename RecordDim >
auto llama::allocScalarViewUninitialized ( ) -> decltype(auto)
inline

Same as allocScalarView but does not run field constructors.

Definition at line 164 of file View.hpp.

◆ allocView()

template<typename Mapping , typename Allocator = bloballoc::Vector, typename Accessor = accessor::Default>
auto llama::allocView ( Mapping  mapping = {},
const Allocator &  alloc = {},
Accessor  accessor = {} 
) -> View<Mapping, internal::AllocatorBlobType<Allocator, typename Mapping::RecordDim>, Accessor>
inline

Creates a view based on the given mapping, e.g. mapping::AoS or mapping::SoA. For allocating the view's underlying memory, the specified allocator callable is used (or the default one, which is bloballoc::Vector). The allocator callable is called with the alignment and size of bytes to allocate for each blob of the mapping. Value-initialization is performed for all fields by calling constructFields. This function is the preferred way to create a View. See also allocViewUninitialized.

Definition at line 153 of file View.hpp.

◆ allocViewUninitialized()

template<typename Mapping , typename Allocator = bloballoc::Vector, typename Accessor = accessor::Default>
auto llama::allocViewUninitialized ( Mapping  mapping = {},
const Allocator &  alloc = {},
Accessor  accessor = {} 
)
inline

Same as allocView but does not run field constructors.

Definition at line 55 of file View.hpp.

◆ aosoaCommonBlockCopy()

template<typename SrcMapping , typename SrcBlob , typename DstMapping , typename DstBlob >
void llama::aosoaCommonBlockCopy ( const View< SrcMapping, SrcBlob > &  srcView,
View< DstMapping, DstBlob > &  dstView,
std::size_t  threadId = 0,
std::size_t  threadCount = 1 
)

AoSoA copy strategy which transfers data in common blocks. SoA mappings are also allowed for at most 1 argument.

Parameters
threadIdOptional. Zero-based id of calling thread for multi-threaded invocations.
threadCountOptional. Thread count in case of multi-threaded invocation.

Definition at line 190 of file Copy.hpp.

◆ Array()

template<typename First , typename... Args>
llama::Array ( First  ,
Args...  args 
) -> Array< First, sizeof...(Args)+1 >

◆ ArrayExtents()

template<typename... Args>
llama::ArrayExtents ( Args...  ) -> ArrayExtents< typename internal::IndexTypeFromArgs< std::size_t, Args... >::type,(Args{}, dyn)... >

◆ ArrayIndex()

template<typename... Args>
llama::ArrayIndex ( Args...  ) -> ArrayIndex< typename internal::IndexTypeFromArgs< std::size_t, Args... >::type, sizeof...(Args)>

◆ cat()

template<typename... RecordCoords>
constexpr auto llama::cat ( RecordCoords...  )
inlineconstexpr

Concatenate a set of RecordCoords instances.

Definition at line 121 of file RecordCoord.hpp.

◆ chooseSimdLanes()

template<typename RecordDim , template< typename > typename MakeSimd, typename BinaryReductionFunction >
constexpr auto llama::chooseSimdLanes ( BinaryReductionFunction  reduce) -> std::size_t
constexpr

Chooses the number of SIMD lanes for the given record dimension by mapping each field type to a SIMD type and then reducing their sizes.

Template Parameters
MakeSimdType function creating a SIMD type given a field type from the record dimension.
Parameters
reduceBinary reduction function to reduce the SIMD lanes.

Definition at line 78 of file Simd.hpp.

◆ constructField()

template<typename Mapping , typename BlobType , typename Accessor , std::size_t... RCs>
void llama::constructField ( View< Mapping, BlobType, Accessor > &  view,
typename Mapping::ArrayExtents::Index  ai,
RecordCoord< RCs... >  rc 
)
inline

Definition at line 96 of file View.hpp.

◆ constructFields()

template<typename Mapping , typename BlobType , typename Accessor >
void llama::constructFields ( View< Mapping, BlobType, Accessor > &  view)
inline

Value-initializes all fields reachable through the given view. That is, constructors are run and fundamental types are zero-initialized. Computed fields are constructed if they return l-value references and assigned a default constructed value if they return a proxy reference.

Definition at line 132 of file View.hpp.

◆ copy()

template<typename SrcMapping , typename SrcBlob , typename DstMapping , typename DstBlob >
void llama::copy ( const View< SrcMapping, SrcBlob > &  srcView,
View< DstMapping, DstBlob > &  dstView,
std::size_t  threadId = 0,
std::size_t  threadCount = 1 
)

Copy data from source to destination view. Both views need to have the same array and record dimensions, but may have different mappings. The blobs need to be read- and writeable. Delegates to Copy to choose an implementation.

Parameters
threadIdOptional. Zero-based id of calling thread for multi-threaded invocations.
threadCountOptional. Thread count in case of multi-threaded invocation.

Definition at line 491 of file Copy.hpp.

◆ copyBlobs()

template<typename Mapping , typename SrcBlob , typename DstBlob , typename BlobCopyFunc = decltype(internal::copyBlobWithMemcpy)>
void llama::copyBlobs ( const View< Mapping, SrcBlob > &  srcView,
View< Mapping, DstBlob > &  dstView,
BlobCopyFunc  copyBlob = internal::copyBlobWithMemcpy 
)

Copy the blobs' content from the source view to the destination view. Both views need to have the same mapping, and thus the same blob count and blob sizes. The copy is performed blob by blob.

Parameters
copyBlobThe function to use for copying blobs. Default is internal::copyBlobWithMemcpy, which uses std::memcpy.

Definition at line 101 of file Copy.hpp.

◆ copyRecord()

template<typename View , typename BoundRecordCoord , bool OwnView>
auto llama::copyRecord ( const RecordRef< View, BoundRecordCoord, OwnView > &  rr)
inline

Returns a One with the same record dimension as the given record ref, with values copyied from rr.

Definition at line 33 of file RecordRef.hpp.

◆ decayCopy()

template<typename T >
auto llama::decayCopy ( T &&  valueOrRef) -> typename internal::ValueOf<T>::type
inline

Pulls a copy of the given value or reference. Proxy references are resolved to their value types.

Definition at line 877 of file RecordRef.hpp.

◆ divCeil()

template<typename Integral >
constexpr auto llama::divCeil ( Integral  a,
Integral  b 
) -> Integral
inlineconstexpr

Returns the ceiling of a / b.

Definition at line 570 of file Core.hpp.

◆ dot()

template<typename T , std::size_t N>
constexpr auto llama::dot ( [[maybe_unused] ] Array< T, N >  a,
[[maybe_unused] ] Array< T, N >  b 
) -> T
inlineconstexpr

Definition at line 325 of file Array.hpp.

◆ fieldWiseCopy()

template<typename SrcMapping , typename SrcBlob , typename DstMapping , typename DstBlob >
void llama::fieldWiseCopy ( const View< SrcMapping, SrcBlob > &  srcView,
View< DstMapping, DstBlob > &  dstView,
std::size_t  threadId = 0,
std::size_t  threadCount = 1 
)

Field-wise copy from source to destination view. Both views need to have the same array and record dimensions.

Parameters
threadIdOptional. Thread id in case of multi-threaded copy.
threadCountOptional. Thread count in case of multi-threaded copy.

Definition at line 118 of file Copy.hpp.

◆ forEachArrayIndex() [1/2]

template<typename SizeType , std::size_t Dim, typename Func , typename... OuterIndices>
void llama::forEachArrayIndex ( [[maybe_unused] ] const ArrayIndex< SizeType, Dim > &  extents,
Func &&  func,
OuterIndices...  outerIndices 
)
inline

Definition at line 250 of file ArrayExtents.hpp.

◆ forEachArrayIndex() [2/2]

template<typename SizeType , SizeType... Sizes, typename Func >
void llama::forEachArrayIndex ( ArrayExtents< SizeType, Sizes... >  extents,
Func &&  func 
)
inline

Definition at line 271 of file ArrayExtents.hpp.

◆ forEachLeaf()

template<typename RecordRefFwd , typename Functor >
constexpr void llama::forEachLeaf ( RecordRefFwd &&  vr,
Functor &&  functor 
)
inlineconstexpr

Definition at line 833 of file RecordRef.hpp.

◆ forEachLeafCoord() [1/2]

template<typename RecordDim , typename Functor , std::size_t... Coords>
constexpr void llama::forEachLeafCoord ( Functor &&  functor,
RecordCoord< Coords... >  baseCoord 
)
inlineconstexpr

Iterates over the record dimension tree and calls a functor on each element.

Parameters
functorFunctor to execute at each element of. Needs to have operator() with a template parameter for the RecordCoord in the record dimension tree.
baseCoordRecordCoord at which the iteration should be started. The functor is called on elements beneath this coordinate.

Definition at line 437 of file Core.hpp.

◆ forEachLeafCoord() [2/2]

template<typename RecordDim , typename Functor , typename... Tags>
constexpr void llama::forEachLeafCoord ( Functor &&  functor,
Tags...   
)
inlineconstexpr

Iterates over the record dimension tree and calls a functor on each element.

Parameters
functorFunctor to execute at each element of. Needs to have operator() with a template parameter for the RecordCoord in the record dimension tree.
baseTagsTags used to define where the iteration should be started. The functor is called on elements beneath this coordinate.

Definition at line 453 of file Core.hpp.

◆ get() [1/2]

template<std::size_t I, typename... Elements>
constexpr auto llama::get ( const Tuple< Elements... > &  tuple) -> const auto&
inlineconstexpr

Definition at line 130 of file Tuple.hpp.

◆ get() [2/2]

template<std::size_t I, typename... Elements>
constexpr auto llama::get ( Tuple< Elements... > &  tuple) -> auto&
inlineconstexpr

Definition at line 121 of file Tuple.hpp.

◆ loadSimd()

template<typename T , typename Simd >
void llama::loadSimd ( const T &  srcRef,
Simd dstSimd 
)
inline

Loads SIMD vectors of data starting from the given record reference to dstSimd. Only field tags occurring in RecordRef are loaded. If Simd contains multiple fields of SIMD types, a SIMD vector will be fetched for each of the fields. The number of elements fetched per SIMD vector depends on the SIMD width of the vector. Simd is allowed to have different vector lengths per element.

Definition at line 310 of file Simd.hpp.

◆ mapsPiecewiseContiguous()

template<std::size_t PieceLength, typename Mapping >
constexpr auto llama::mapsPiecewiseContiguous ( const Mapping &  m) -> bool
constexpr

Proofs by exhaustion of the array and record dimensions, that at least PieceLength elements are always stored contiguously.

Definition at line 93 of file Proofs.hpp.

◆ mapToMemory()

template<typename Mapping , typename RecordCoord , typename Blobs >
auto llama::mapToMemory ( Mapping &  mapping,
typename Mapping::ArrayExtents::Index  ai,
RecordCoord  rc,
Blobs &  blobs 
) -> decltype(auto)
inline

Using a mapping, maps the given array index and record coordinate to a memory reference onto the given blobs.

Returns
Either an l-value reference if the record coord maps to a physical field or a proxy reference if mapped to a computed field.

Definition at line 359 of file View.hpp.

◆ memcpyBlobs()

template<typename Mapping , typename SrcBlob , typename DstBlob , typename MemcpyFunc = decltype(internal::memcpy)>
void llama::memcpyBlobs ( const View< Mapping, SrcBlob > &  srcView,
View< Mapping, DstBlob > &  dstView,
std::size_t  threadId = 0,
std::size_t  threadCount = 1,
MemcpyFunc  singleThreadMemcpy = internal::memcpy 
)

Copy the blobs' content from the source view to the destination view in parallel with the given thread configuration. Both views need to have the same mappings with the same array extents.

Parameters
threadIdZero-based id of calling thread for multi-threaded invocations.
threadCountThread count in case of multi-threaded invocation.
singleThreadMemcpyThe implementation of memcpy. By default: std::memcpy.

Definition at line 57 of file Copy.hpp.

◆ mp_for_each_inline()

template<typename L , typename F >
constexpr void llama::mp_for_each_inline ( F &&  f)
inlineconstexpr

Like boost::mp11::mp_for_each, but marked with LLAMA_FN_HOST_ACC_INLINE.

Definition at line 59 of file Meta.hpp.

◆ NrAndOffset()

template<typename Int >
llama::NrAndOffset ( Int  ,
Int   
) -> NrAndOffset< Int >

◆ operator!=() [1/5]

template<typename SizeTypeA , SizeTypeA... SizesA, typename SizeTypeB , SizeTypeB... SizesB>
constexpr auto llama::operator!= ( ArrayExtents< SizeTypeA, SizesA... >  a,
ArrayExtents< SizeTypeB, SizesB... >  b 
) -> bool
inlineconstexpr

Definition at line 215 of file ArrayExtents.hpp.

◆ operator!=() [2/5]

template<std::size_t Dim, typename TA , typename TB >
constexpr auto llama::operator!= ( ArrayIndex< TA, Dim >  a,
ArrayIndex< TB, Dim >  b 
) -> bool
inlineconstexpr

Definition at line 37 of file ArrayExtents.hpp.

◆ operator!=() [3/5]

template<typename TA , typename TB >
auto llama::operator!= ( const NrAndOffset< TA > &  a,
const NrAndOffset< TB > &  b 
) -> bool

Definition at line 178 of file Core.hpp.

◆ operator!=() [4/5]

template<typename... ElementsA, typename... ElementsB>
constexpr auto llama::operator!= ( const Tuple< ElementsA... > &  a,
const Tuple< ElementsB... > &  b 
) -> bool
inlineconstexpr

Definition at line 180 of file Tuple.hpp.

◆ operator!=() [5/5]

template<std::size_t... CoordsA, std::size_t... CoordsB>
constexpr auto llama::operator!= ( RecordCoord< CoordsA... >  a,
RecordCoord< CoordsB... >  b 
)
inlineconstexpr

Definition at line 54 of file RecordCoord.hpp.

◆ operator<<() [1/3]

template<typename T , std::size_t N>
auto llama::operator<< ( std::ostream &  os,
const Array< T, N > &  a 
) -> std::ostream&

Definition at line 249 of file Array.hpp.

◆ operator<<() [2/3]

template<typename View , typename BoundRecordCoord , bool OwnView>
auto llama::operator<< ( std::ostream &  os,
const RecordRef< View, BoundRecordCoord, OwnView > &  vr 
) -> std::ostream&

Definition at line 800 of file RecordRef.hpp.

◆ operator<<() [3/3]

template<std::size_t... RCs>
auto llama::operator<< ( std::ostream &  os,
RecordCoord< RCs... >   
) -> std::ostream&

Definition at line 69 of file RecordCoord.hpp.

◆ operator==() [1/6]

template<typename SizeTypeA , SizeTypeA... SizesA, typename SizeTypeB , SizeTypeB... SizesB>
constexpr auto llama::operator== ( ArrayExtents< SizeTypeA, SizesA... >  a,
ArrayExtents< SizeTypeB, SizesB... >  b 
) -> bool
inlineconstexpr

Definition at line 206 of file ArrayExtents.hpp.

◆ operator==() [2/6]

template<std::size_t Dim, typename TA , typename TB >
constexpr auto llama::operator== ( ArrayIndex< TA, Dim >  a,
ArrayIndex< TB, Dim >  b 
) -> bool
inlineconstexpr

Definition at line 27 of file ArrayExtents.hpp.

◆ operator==() [3/6]

template<typename TA , typename TB >
auto llama::operator== ( const NrAndOffset< TA > &  a,
const NrAndOffset< TB > &  b 
) -> bool

Definition at line 171 of file Core.hpp.

◆ operator==() [4/6]

template<typename... ElementsA, typename... ElementsB>
constexpr auto llama::operator== ( const Tuple< ElementsA... > &  a,
const Tuple< ElementsB... > &  b 
) -> bool
inlineconstexpr

Definition at line 168 of file Tuple.hpp.

◆ operator==() [5/6]

template<std::size_t... Coords>
constexpr auto llama::operator== ( RecordCoord< Coords... >  ,
RecordCoord< Coords... >   
)
inlineconstexpr

Definition at line 47 of file RecordCoord.hpp.

◆ operator==() [6/6]

template<std::size_t... CoordsA, std::size_t... CoordsB>
constexpr auto llama::operator== ( RecordCoord< CoordsA... >  ,
RecordCoord< CoordsB... >   
)
inlineconstexpr

Definition at line 40 of file RecordCoord.hpp.

◆ popBack()

template<typename T , std::size_t N>
constexpr auto llama::popBack ( [[maybe_unused] ] Array< T, N >  a)
inlineconstexpr

Definition at line 291 of file Array.hpp.

◆ popFront() [1/2]

template<typename T , std::size_t N>
constexpr auto llama::popFront ( [[maybe_unused] ] Array< T, N >  a)
inlineconstexpr

Definition at line 303 of file Array.hpp.

◆ popFront() [2/2]

template<typename... Elements>
constexpr auto llama::popFront ( const Tuple< Elements... > &  tuple)
inlineconstexpr

Returns a copy of the tuple without the first element.

Definition at line 268 of file Tuple.hpp.

◆ prettyRecordCoord() [1/2]

template<typename RecordDim , std::size_t... Coords>
constexpr auto llama::prettyRecordCoord ( RecordCoord< Coords... >  = {}) -> std::string_view
constexpr

Returns a pretty representation of the record coordinate inside the given record dimension. Tags are interspersed by '.' and arrays are represented using subscript notation ("[123]").

Definition at line 372 of file StructName.hpp.

◆ prettyRecordCoord() [2/2]

template<typename RecordDim >
constexpr auto llama::prettyRecordCoord ( RecordCoord<>  ) -> std::string_view
constexpr

Definition at line 380 of file StructName.hpp.

◆ prettySize()

auto llama::prettySize ( double  size) -> PrettySize
inline

Repeatedly divides the given size (in bytes) until it fits below 1000. Returns the new size and a string literal with the corresponding unit.

Definition at line 901 of file Core.hpp.

◆ product() [1/2]

template<typename T , std::size_t N>
constexpr auto llama::product ( Array< T, N >  a) -> T
inlineconstexpr

Definition at line 315 of file Array.hpp.

◆ product() [2/2]

template<typename SizeType , SizeType... Sizes>
constexpr auto llama::product ( ArrayExtents< SizeType, Sizes... >  e) -> SizeType
inlineconstexpr

Definition at line 224 of file ArrayExtents.hpp.

◆ pushBack()

template<typename T , std::size_t N>
constexpr auto llama::pushBack ( [[maybe_unused] ] Array< T, N >  a,
v 
) -> Array<T, N + 1>
inlineconstexpr

Definition at line 279 of file Array.hpp.

◆ pushFront()

template<typename T , std::size_t N>
constexpr auto llama::pushFront ( [[maybe_unused] ] Array< T, N >  a,
v 
) -> Array<T, N + 1>
inlineconstexpr

Definition at line 267 of file Array.hpp.

◆ roundUpToMultiple()

template<typename Integral >
constexpr auto llama::roundUpToMultiple ( Integral  n,
Integral  mult 
) -> Integral
inlineconstexpr

Returns the integral n rounded up to be a multiple of mult.

Definition at line 578 of file Core.hpp.

◆ ScopedUpdate()

template<typename T >
llama::ScopedUpdate ( ) -> ScopedUpdate< typename internal::ReferenceTo< std::remove_reference_t< T >>::type >

◆ shallowCopy()

template<typename View , typename NewBlobType = CopyConst<std::remove_reference_t<View>, std::byte>*, typename = std::enable_if_t<isView<std::decay_t<View>>>>
auto llama::shallowCopy ( View &&  view)
inline

Creates a shallow copy of a view. This copy must not outlive the view, since it references its blob array.

Template Parameters
NewBlobTypeThe blob type of the shallow copy. Must be a non owning pointer like type.
Returns
A new view with the same mapping as view, where each blob refers to the blob in view.

Definition at line 670 of file View.hpp.

◆ simdForEach()

template<template< typename > typename MakeSimd, template< typename, auto > typename MakeSizedSimd, typename View , typename UnarySimdFunction >
void llama::simdForEach ( View view,
UnarySimdFunction  f 
)

Definition at line 461 of file Simd.hpp.

◆ simdForEachN()

template<std::size_t N, template< typename, auto > typename MakeSizedSimd, typename View , typename UnarySimdFunction >
void llama::simdForEachN ( View view,
UnarySimdFunction  f 
)

Definition at line 422 of file Simd.hpp.

◆ storeSimd()

template<typename Simd , typename TFwd >
void llama::storeSimd ( const Simd srcSimd,
TFwd &&  dstRef 
)
inline

Stores SIMD vectors of element data from the given srcSimd into memory starting at the provided record reference. Only field tags occurring in RecordRef are stored. If Simd contains multiple fields of SIMD types, a SIMD vector will be stored for each of the fields. The number of elements stored per SIMD vector depends on the SIMD width of the vector. Simd is allowed to have different vector lengths per element.

Definition at line 365 of file Simd.hpp.

◆ structName()

template<typename T >
constexpr auto llama::structName ( = {}) -> std::string_view
constexpr

Definition at line 277 of file StructName.hpp.

◆ SubView()

template<typename TStoredParentView >
llama::SubView ( TStoredParentView &&  ,
typename std::remove_reference_t< TStoredParentView >::Mapping::ArrayExtents::Index   
) -> SubView< TStoredParentView >

SubView vview(view); will store a reference to view. SubView vview(std::move(view)); will store the view.

◆ swap()

template<typename ViewA , typename BoundRecordDimA , bool OwnViewA, typename ViewB , typename BoundRecordDimB , bool OwnViewB>
auto llama::swap ( RecordRef< ViewA, BoundRecordDimA, OwnViewA > &  a,
RecordRef< ViewB, BoundRecordDimB, OwnViewB > &  b 
) -> std::enable_if_t<std::is_same_v< typename RecordRef<ViewA, BoundRecordDimA, OwnViewA>::AccessibleRecordDim, typename RecordRef<ViewB, BoundRecordDimB, OwnViewB>::AccessibleRecordDim>>
inlinenoexcept

Definition at line 782 of file RecordRef.hpp.

◆ transformBlobs()

template<typename ViewFwd , typename TransformBlobFunc , typename = std::enable_if_t<isView<std::decay_t<ViewFwd>>>>
auto llama::transformBlobs ( ViewFwd &&  view,
const TransformBlobFunc &  transformBlob 
)
inline

Applies the given transformation to the blobs of a view and creates a new view with the transformed blobs and the same mapping and accessor as the old view.

Definition at line 647 of file View.hpp.

◆ Tuple()

template<typename... Elements>
llama::Tuple ( Elements...  ) -> Tuple< std::remove_cv_t< std::remove_reference_t< Elements >>... >

◆ tupleCat()

template<typename Tuple1 , typename Tuple2 >
constexpr auto llama::tupleCat ( const Tuple1 &  t1,
const Tuple2 &  t2 
)
inlineconstexpr

Definition at line 201 of file Tuple.hpp.

◆ tupleReplace()

template<std::size_t Pos, typename Tuple , typename Replacement >
constexpr auto llama::tupleReplace ( Tuple &&  tuple,
Replacement &&  replacement 
)
inlineconstexpr

Creates a copy of a tuple with the element at position Pos replaced by replacement.

Definition at line 234 of file Tuple.hpp.

◆ tupleTransform()

template<typename... Elements, typename Functor >
constexpr auto llama::tupleTransform ( const Tuple< Elements... > &  tuple,
const Functor &  functor 
)
inlineconstexpr

Applies a functor to every element of a tuple, creating a new tuple with the result of the element transformations. The functor needs to implement a template operator() to which all tuple elements are passed.

Definition at line 259 of file Tuple.hpp.

◆ withAccessor()

template<typename NewAccessor , typename ViewFwd , typename = std::enable_if_t<isView<std::decay_t<ViewFwd>>>>
auto llama::withAccessor ( ViewFwd &&  view,
NewAccessor  newAccessor = {} 
)
inline

Definition at line 689 of file View.hpp.

◆ withMapping()

template<typename NewMapping , typename ViewFwd , typename = std::enable_if_t<isView<std::decay_t<ViewFwd>>>>
auto llama::withMapping ( ViewFwd &&  view,
NewMapping  newMapping = {} 
)
inline

Definition at line 702 of file View.hpp.

Variable Documentation

◆ alignOf

template<typename T >
constexpr std::size_t llama::alignOf = alignof(T)
inlineconstexpr

The alignment of a type T.

Definition at line 559 of file Core.hpp.

◆ alignOf< Record< Fields... > >

template<typename... Fields>
constexpr std::size_t llama::alignOf< Record< Fields... > > = flatAlignOf<FlatRecordDim<Record<Fields...>>>
inlineconstexpr

The alignment of a record dimension if its fields would be in a normal struct. Effectively returns the maximum alignment value in the type list.

Definition at line 565 of file Core.hpp.

◆ dyn

constexpr auto llama::dyn = internal::Dyn{}
inlineconstexpr

Used as a template argument to ArrayExtents to mark a dynamic extent.

Definition at line 127 of file ArrayExtents.hpp.

◆ flatAlignOf

template<typename TypeList >
constexpr std::size_t llama::flatAlignOf = internal::flatAlignOfImpl<TypeList>()
inlineconstexpr

The alignment of a type list if its elements would be in a normal struct. Effectively returns the maximum alignment value in the type list.

Definition at line 554 of file Core.hpp.

◆ flatFieldCount

template<typename RecordDim >
constexpr std::size_t llama::flatFieldCount = 1
inlineconstexpr

The total number of fields in the recursively expanded record dimension.

Definition at line 486 of file Core.hpp.

◆ flatFieldCount< Child[N]>

template<typename Child , std::size_t N>
constexpr std::size_t llama::flatFieldCount< Child[N]> = flatFieldCount<Child> * N
inlineconstexpr

Definition at line 495 of file Core.hpp.

◆ flatFieldCount< Record< Children... > >

template<typename... Children>
constexpr std::size_t llama::flatFieldCount< Record< Children... > > = (flatFieldCount<GetFieldType<Children>> + ... + 0)
inlineconstexpr

Definition at line 490 of file Core.hpp.

◆ flatOffsetOf

template<typename TypeList , std::size_t I, bool Align>
constexpr std::size_t llama::flatOffsetOf = internal::offsetOfImplWorkaround<TypeList, I, Align>()
inlineconstexpr

The byte offset of an element in a type list ifs elements would be in a normal struct.

Definition at line 634 of file Core.hpp.

◆ flatRecordCoord

template<typename RecordDim , typename RecordCoord >
constexpr std::size_t llama::flatRecordCoord = 0
inlineconstexpr

The equivalent zero based index into a flat record dimension (FlatRecordDim) of the given hierarchical record coordinate.

Definition at line 517 of file Core.hpp.

◆ flatRecordCoord< Child[N], RecordCoord< I, Is... > >

template<typename Child , std::size_t N, std::size_t I, std::size_t... Is>
constexpr std::size_t llama::flatRecordCoord< Child[N], RecordCoord< I, Is... > > = flatFieldCount<Child> * I + flatRecordCoord<Child, RecordCoord<Is...>>
inlineconstexpr

Definition at line 531 of file Core.hpp.

◆ flatRecordCoord< Record< Children... >, RecordCoord< I, Is... > >

template<typename... Children, std::size_t I, std::size_t... Is>
constexpr std::size_t llama::flatRecordCoord< Record< Children... >, RecordCoord< I, Is... > >
inlineconstexpr
Initial value:
= internal::flatFieldCountBefore<I, Record<Children...>>
+ flatRecordCoord<GetFieldType<mp_at_c<Record<Children...>, I>>, RecordCoord<Is...>>
constexpr std::size_t flatFieldCountBefore
Definition: Core.hpp:500
constexpr std::size_t flatRecordCoord
Definition: Core.hpp:517
mp_second< Field > GetFieldType
Get the type from a Field.
Definition: Core.hpp:191

Definition at line 525 of file Core.hpp.

◆ flatRecordCoord< T, RecordCoord<> >

template<typename T >
constexpr std::size_t llama::flatRecordCoord< T, RecordCoord<> > = 0
inlineconstexpr

Definition at line 521 of file Core.hpp.

◆ flatSizeOf

template<typename TypeList , bool Align, bool IncludeTailPadding = true>
constexpr std::size_t llama::flatSizeOf = internal::sizeOfImpl<TypeList, Align, IncludeTailPadding>()
inlineconstexpr

The size of a type list if its elements would be in a normal struct.

Definition at line 618 of file Core.hpp.

◆ hasAnyComputedField

template<typename Mapping >
constexpr bool llama::hasAnyComputedField
inlineconstexpr
Initial value:
= mp_any_of<
LeafRecordCoords<typename Mapping::RecordDim>,
mp_bind_front<internal::IsComputed, Mapping>::template fn>::value

Returns true if any field accessed via the given mapping is a computed value.

Definition at line 90 of file View.hpp.

◆ hasSameTags

template<typename RecordDimA , typename RecordCoordA , typename RecordDimB , typename RecordCoordB >
constexpr auto llama::hasSameTags
inlineconstexpr

Is true if, starting at two coordinates in two record dimensions, all subsequent nodes in the record dimension tree have the same tag.

Template Parameters
RecordDimAFirst record dimension.
RecordCoordARecordCoord based on RecordDimA along which the tags are compared.
RecordDimBsecond record dimension.
RecordCoordBRecordCoord based on RecordDimB along which the tags are compared.

Definition at line 264 of file Core.hpp.

◆ isAllowedFieldType

template<typename T >
constexpr bool llama::isAllowedFieldType = std::is_trivially_destructible_v<T>
inlineconstexpr

Tells whether the given type is allowed as a field type in LLAMA. Such types need to be trivially constructible and trivially destructible.

Definition at line 28 of file Core.hpp.

◆ isComputed

template<typename Mapping , typename RecordCoord >
constexpr bool llama::isComputed = internal::IsComputed<Mapping, RecordCoord>::value
inlineconstexpr

Returns true if the field accessed via the given mapping and record coordinate is a computed value.

Definition at line 84 of file View.hpp.

◆ isConstant

template<typename T >
constexpr bool llama::isConstant = internal::IsConstant<T>::value
inlineconstexpr

Definition at line 846 of file Core.hpp.

◆ isField

template<typename T >
constexpr bool llama::isField = false
inlineconstexpr

Definition at line 46 of file Core.hpp.

◆ isField< Field< Tag, Type > >

template<typename Tag , typename Type >
constexpr bool llama::isField< Field< Tag, Type > > = true
inlineconstexpr

Definition at line 50 of file Core.hpp.

◆ isOne

template<typename T >
constexpr bool llama::isOne = false
inlineconstexpr

Is true, if T is an instance of One.

Definition at line 193 of file View.hpp.

◆ isOne< RecordRef< View, BoundRecordCoord, true > >

template<typename View , typename BoundRecordCoord >
constexpr bool llama::isOne< RecordRef< View, BoundRecordCoord, true > > = true
inlineconstexpr

Definition at line 197 of file View.hpp.

◆ isProxyReference

template<typename R >
constexpr bool llama::isProxyReference = internal::IsProxyReferenceImpl<R>::value
inlineconstexpr

Definition at line 242 of file Concepts.hpp.

◆ isRecord

template<typename T >
constexpr auto llama::isRecord = false
inlineconstexpr

Definition at line 195 of file Core.hpp.

◆ isRecord< Record< Fields... > >

template<typename... Fields>
constexpr auto llama::isRecord< Record< Fields... > > = true
inlineconstexpr

Definition at line 199 of file Core.hpp.

◆ isRecordCoord

template<typename T >
constexpr bool llama::isRecordCoord = false
inlineconstexpr

Definition at line 61 of file RecordCoord.hpp.

◆ isRecordCoord< RecordCoord< Coords... > >

template<std::size_t... Coords>
constexpr bool llama::isRecordCoord< RecordCoord< Coords... > > = true
inlineconstexpr

Definition at line 65 of file RecordCoord.hpp.

◆ isRecordDim

template<typename T >
constexpr bool llama::isRecordDim = isRecord<T> || internal::IsBoundedArray<T>::value
inlineconstexpr

True if the T is a record dimension. That is, T is either a llama::Record or a bounded array.

Definition at line 698 of file Core.hpp.

◆ isRecordRef

template<typename View >
constexpr auto llama::isRecordRef = false
inlineconstexpr

Definition at line 24 of file RecordRef.hpp.

◆ isRecordRef< RecordRef< View, BoundRecordCoord, OwnView > >

template<typename View , typename BoundRecordCoord , bool OwnView>
constexpr auto llama::isRecordRef< RecordRef< View, BoundRecordCoord, OwnView > > = true
inlineconstexpr

Definition at line 28 of file RecordRef.hpp.

◆ isView

template<typename View >
constexpr auto llama::isView = false
inlineconstexpr

Definition at line 600 of file View.hpp.

◆ isView< View< Mapping, BlobType, Accessor > >

template<typename Mapping , typename BlobType , typename Accessor >
constexpr auto llama::isView< View< Mapping, BlobType, Accessor > > = true
inlineconstexpr

Definition at line 605 of file View.hpp.

◆ offsetOf

template<typename RecordDim , typename RecordCoord , bool Align = false>
constexpr std::size_t llama::offsetOf = flatOffsetOf<FlatRecordDim<RecordDim>, flatRecordCoord<RecordDim, RecordCoord>, Align>
inlineconstexpr

The byte offset of an element in a record dimension if it would be a normal struct.

Template Parameters
RecordDimRecord dimension tree.
RecordCoordRecord coordinate of an element inrecord dimension tree.

Definition at line 661 of file Core.hpp.

◆ qualifiedTypeName

template<typename T >
constexpr auto llama::qualifiedTypeName
inlineconstexpr
Initial value:
= []
{
constexpr auto& value = internal::typeNameStorage<T>;
return std::string_view{value.data(), value.size()};
}()

Definition at line 198 of file StructName.hpp.

◆ recordCoordCommonPrefixIsBigger

template<typename First , typename Second >
constexpr auto llama::recordCoordCommonPrefixIsBigger = internal::recordCoordCommonPrefixIsBiggerImpl(First{}, Second{})
inlineconstexpr

Checks wether the first RecordCoord is bigger than the second.

Definition at line 153 of file RecordCoord.hpp.

◆ recordCoordCommonPrefixIsSame

template<typename First , typename Second >
constexpr auto llama::recordCoordCommonPrefixIsSame = internal::recordCoordCommonPrefixIsSameImpl(First{}, Second{})
inlineconstexpr

Checks whether two RecordCoords are the same or one is the prefix of the other.

Definition at line 174 of file RecordCoord.hpp.

◆ simdLanes

template<typename Simd , typename SFINAE = void>
constexpr auto llama::simdLanes = SimdTraits<Simd>::lanes
inlineconstexpr

The number of SIMD simdLanes the given SIMD vector or Simd<T> has. If Simd is not a structural Simd or SimdN, this is a shortcut for SimdTraits<Simd>::lanes.

Definition at line 70 of file Simd.hpp.

◆ simdLanesWithFullVectorsFor

template<typename RecordDim , template< typename > typename MakeSimd>
constexpr std::size_t llama::simdLanesWithFullVectorsFor
inlineconstexpr

Determines the number of simd lanes suitable to process all types occurring in the given record dimension. The algorithm ensures that even SIMD vectors for the smallest field type are filled completely and may thus require multiple SIMD vectors for some field types.

Template Parameters
RecordDimThe record dimension to simdize
MakeSimdType function creating a SIMD type given a field type from the record dimension.

Definition at line 100 of file Simd.hpp.

◆ simdLanesWithLeastRegistersFor

template<typename RecordDim , template< typename > typename MakeSimd>
constexpr std::size_t llama::simdLanesWithLeastRegistersFor
inlineconstexpr

Determines the number of simd lanes suitable to process all types occurring in the given record dimension. The algorithm ensures that the smallest number of SIMD registers is needed and may thus only partially fill registers for some data types.

Template Parameters
RecordDimThe record dimension to simdize
MakeSimdType function creating a SIMD type given a field type from the record dimension.

Definition at line 111 of file Simd.hpp.

◆ sizeOf

template<typename T , bool Align = false, bool IncludeTailPadding = true>
constexpr std::size_t llama::sizeOf = sizeof(T)
inlineconstexpr

The size of a type T.

Definition at line 623 of file Core.hpp.

◆ sizeOf< Record< Fields... >, Align, IncludeTailPadding >

template<typename... Fields, bool Align, bool IncludeTailPadding>
constexpr std::size_t llama::sizeOf< Record< Fields... >, Align, IncludeTailPadding > = flatSizeOf<FlatRecordDim<Record<Fields...>>, Align, IncludeTailPadding>
inlineconstexpr

The size of a record dimension if its fields would be in a normal struct.

Definition at line 628 of file Core.hpp.