Low-Level Abstraction of Memory Access
llama::mapping::BitPackedFloatSoA< TArrayExtents, TRecordDim, ExponentBits, MantissaBits, TLinearizeArrayIndexFunctor, TStoredIntegral > Struct Template Reference

#include <BitPackedFloat.hpp>

+ Inheritance diagram for llama::mapping::BitPackedFloatSoA< TArrayExtents, TRecordDim, ExponentBits, MantissaBits, TLinearizeArrayIndexFunctor, TStoredIntegral >:
+ Collaboration diagram for llama::mapping::BitPackedFloatSoA< TArrayExtents, TRecordDim, ExponentBits, MantissaBits, TLinearizeArrayIndexFunctor, TStoredIntegral >:

Public Types

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

Public Member Functions

constexpr auto exponentBits () const -> size_type
 
constexpr auto mantissaBits () const -> size_type
 
constexpr BitPackedFloatSoA (TArrayExtents extents={}, ExponentBits exponentBits={}, MantissaBits mantissaBits={}, TRecordDim={})
 
constexpr auto blobSize (size_type) const -> size_type
 
template<std::size_t... RecordCoords, typename Blobs >
constexpr auto compute (typename Base::ArrayIndex ai, RecordCoord< RecordCoords... >, Blobs &blobs) const
 
- Public Member Functions inherited from llama::mapping::MappingBase< TArrayExtents, TRecordDim >
constexpr MappingBase ()=default
 
constexpr MappingBase (ArrayExtents extents, RecordDim={})
 
constexpr auto extents () const -> ArrayExtents
 
- Public Member Functions inherited from llama::internal::BoxedValue< typename TArrayExtents::value_type, 0 >
 BoxedValue ()=default
 
 BoxedValue (typename TArrayExtents::value_type value)
 
constexpr auto value () const
 
- Public Member Functions inherited from llama::internal::BoxedValue< typename TArrayExtents::value_type, 1 >
 BoxedValue ()=default
 
 BoxedValue (typename TArrayExtents::value_type value)
 
constexpr auto value () const
 

Static Public Member Functions

template<std::size_t... RecordCoords>
static constexpr auto isComputed (RecordCoord< RecordCoords... >)
 

Static Public Attributes

static constexpr std::size_t blobCount = mp_size<FlatRecordDim<TRecordDim>>::value
 

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, typename ExponentBits = typename TArrayExtents::value_type, typename MantissaBits = ExponentBits, typename TLinearizeArrayIndexFunctor = LinearizeArrayIndexRight, typename TStoredIntegral = internal::StoredIntegralFor<TRecordDim>>
struct llama::mapping::BitPackedFloatSoA< TArrayExtents, TRecordDim, ExponentBits, MantissaBits, TLinearizeArrayIndexFunctor, TStoredIntegral >

Struct of array mapping using bit packing to reduce size/precision of floating-point data types. The bit layout is [1 sign bit, exponentBits bits from the exponent, mantissaBits bits from the mantissa]+ and tries to follow IEEE 754. Infinity and NAN are supported. If the packed exponent bits are not big enough to hold a number, it will be set to infinity (preserving the sign). If your record dimension contains non-floating-point types, split them off using the Split mapping first.

Template Parameters
ExponentBitsIf ExponentBits is llama::Constant<N>, the compile-time N specifies the number of bits to use to store the exponent. If ExponentBits is llama::Value<T>, the number of bits is specified at runtime, passed to the constructor and stored as type T. Must not be zero.
MantissaBitsLike ExponentBits but for the mantissa bits. Must not be zero (otherwise values turn INF).
TLinearizeArrayIndexFunctorDefines how the array dimensions should be mapped into linear numbers and how big the linear domain gets.
TStoredIntegralIntegral type used as storage of reduced precision floating-point values.

Definition at line 207 of file BitPackedFloat.hpp.

Member Typedef Documentation

◆ LinearizeArrayIndexFunctor

template<typename TArrayExtents , typename TRecordDim , typename ExponentBits = typename TArrayExtents::value_type, typename MantissaBits = ExponentBits, typename TLinearizeArrayIndexFunctor = LinearizeArrayIndexRight, typename TStoredIntegral = internal::StoredIntegralFor<TRecordDim>>
using llama::mapping::BitPackedFloatSoA< TArrayExtents, TRecordDim, ExponentBits, MantissaBits, TLinearizeArrayIndexFunctor, TStoredIntegral >::LinearizeArrayIndexFunctor = TLinearizeArrayIndexFunctor

Definition at line 219 of file BitPackedFloat.hpp.

◆ StoredIntegral

template<typename TArrayExtents , typename TRecordDim , typename ExponentBits = typename TArrayExtents::value_type, typename MantissaBits = ExponentBits, typename TLinearizeArrayIndexFunctor = LinearizeArrayIndexRight, typename TStoredIntegral = internal::StoredIntegralFor<TRecordDim>>
using llama::mapping::BitPackedFloatSoA< TArrayExtents, TRecordDim, ExponentBits, MantissaBits, TLinearizeArrayIndexFunctor, TStoredIntegral >::StoredIntegral = TStoredIntegral

Definition at line 220 of file BitPackedFloat.hpp.

Constructor & Destructor Documentation

◆ BitPackedFloatSoA()

template<typename TArrayExtents , typename TRecordDim , typename ExponentBits = typename TArrayExtents::value_type, typename MantissaBits = ExponentBits, typename TLinearizeArrayIndexFunctor = LinearizeArrayIndexRight, typename TStoredIntegral = internal::StoredIntegralFor<TRecordDim>>
constexpr llama::mapping::BitPackedFloatSoA< TArrayExtents, TRecordDim, ExponentBits, MantissaBits, TLinearizeArrayIndexFunctor, TStoredIntegral >::BitPackedFloatSoA ( TArrayExtents  extents = {},
ExponentBits  exponentBits = {},
MantissaBits  mantissaBits = {},
TRecordDim  = {} 
)
inlineexplicitconstexpr

Definition at line 236 of file BitPackedFloat.hpp.

Member Function Documentation

◆ blobSize()

template<typename TArrayExtents , typename TRecordDim , typename ExponentBits = typename TArrayExtents::value_type, typename MantissaBits = ExponentBits, typename TLinearizeArrayIndexFunctor = LinearizeArrayIndexRight, typename TStoredIntegral = internal::StoredIntegralFor<TRecordDim>>
constexpr auto llama::mapping::BitPackedFloatSoA< TArrayExtents, TRecordDim, ExponentBits, MantissaBits, TLinearizeArrayIndexFunctor, TStoredIntegral >::blobSize ( size_type  ) const -> size_type
inlineconstexpr

Definition at line 249 of file BitPackedFloat.hpp.

◆ compute()

template<typename TArrayExtents , typename TRecordDim , typename ExponentBits = typename TArrayExtents::value_type, typename MantissaBits = ExponentBits, typename TLinearizeArrayIndexFunctor = LinearizeArrayIndexRight, typename TStoredIntegral = internal::StoredIntegralFor<TRecordDim>>
template<std::size_t... RecordCoords, typename Blobs >
constexpr auto llama::mapping::BitPackedFloatSoA< TArrayExtents, TRecordDim, ExponentBits, MantissaBits, TLinearizeArrayIndexFunctor, TStoredIntegral >::compute ( typename Base::ArrayIndex  ai,
RecordCoord< RecordCoords... >  ,
Blobs blobs 
) const
inlineconstexpr

Definition at line 264 of file BitPackedFloat.hpp.

◆ exponentBits()

template<typename TArrayExtents , typename TRecordDim , typename ExponentBits = typename TArrayExtents::value_type, typename MantissaBits = ExponentBits, typename TLinearizeArrayIndexFunctor = LinearizeArrayIndexRight, typename TStoredIntegral = internal::StoredIntegralFor<TRecordDim>>
constexpr auto llama::mapping::BitPackedFloatSoA< TArrayExtents, TRecordDim, ExponentBits, MantissaBits, TLinearizeArrayIndexFunctor, TStoredIntegral >::exponentBits ( ) const -> size_type
inlineconstexpr

Definition at line 224 of file BitPackedFloat.hpp.

◆ isComputed()

template<typename TArrayExtents , typename TRecordDim , typename ExponentBits = typename TArrayExtents::value_type, typename MantissaBits = ExponentBits, typename TLinearizeArrayIndexFunctor = LinearizeArrayIndexRight, typename TStoredIntegral = internal::StoredIntegralFor<TRecordDim>>
template<std::size_t... RecordCoords>
static constexpr auto llama::mapping::BitPackedFloatSoA< TArrayExtents, TRecordDim, ExponentBits, MantissaBits, TLinearizeArrayIndexFunctor, TStoredIntegral >::isComputed ( RecordCoord< RecordCoords... >  )
inlinestaticconstexpr

Definition at line 258 of file BitPackedFloat.hpp.

◆ mantissaBits()

template<typename TArrayExtents , typename TRecordDim , typename ExponentBits = typename TArrayExtents::value_type, typename MantissaBits = ExponentBits, typename TLinearizeArrayIndexFunctor = LinearizeArrayIndexRight, typename TStoredIntegral = internal::StoredIntegralFor<TRecordDim>>
constexpr auto llama::mapping::BitPackedFloatSoA< TArrayExtents, TRecordDim, ExponentBits, MantissaBits, TLinearizeArrayIndexFunctor, TStoredIntegral >::mantissaBits ( ) const -> size_type
inlineconstexpr

Definition at line 230 of file BitPackedFloat.hpp.

Member Data Documentation

◆ blobCount

template<typename TArrayExtents , typename TRecordDim , typename ExponentBits = typename TArrayExtents::value_type, typename MantissaBits = ExponentBits, typename TLinearizeArrayIndexFunctor = LinearizeArrayIndexRight, typename TStoredIntegral = internal::StoredIntegralFor<TRecordDim>>
constexpr std::size_t llama::mapping::BitPackedFloatSoA< TArrayExtents, TRecordDim, ExponentBits, MantissaBits, TLinearizeArrayIndexFunctor, TStoredIntegral >::blobCount = mp_size<FlatRecordDim<TRecordDim>>::value
staticconstexpr

Definition at line 221 of file BitPackedFloat.hpp.


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