Skip to content

PerUnitBuffer

#include <sbio/storage/per_unit_buffer.hh>
template<class Inner, class Policy>
struct PerUnitBuffer

Defined in src/lib/sbio/storage/per_unit_buffer.hh:47

A buffer with one instance per parallel unit ([BufferScope::PerUnit](api-sbio.md#namespacesbio_1a3ceb0599575063c416cdcfc24c8fdc87a699a2f0f0b31a281375f40580dac7810)).

Different execution policies use a different base parallel unit (e.g. thread, or MPI rank/process). Each of the base units has its own instance of a PerUnitBuffer through the SegmentState that the execution policy defines.

  • Inner The actual underlying buffer type of each unit’s instance.

  • Policy The Execution policy.

Return Name Description
Inner & local const inline The calling unit’s instance, allocated on first access.
void * ptr const inline
std::size_t size const inline
void set_memory inline Set the size of each unit’s instance (allocated later, per unit).

const inline

inline Inner & local() const

Defined in src/lib/sbio/storage/per_unit_buffer.hh:53

The calling unit’s instance, allocated on first access.


const inline

inline void * ptr() const

Defined in src/lib/sbio/storage/per_unit_buffer.hh:64


const inline

inline std::size_t size() const

Defined in src/lib/sbio/storage/per_unit_buffer.hh:66


inline

inline void set_memory(void *, std::size_t size)

Defined in src/lib/sbio/storage/per_unit_buffer.hh:71

Set the size of each unit’s instance (allocated later, per unit).

Return Name Description
constexpr MemorySpace memory_space static inline constexpr

static inline constexpr

constexpr static inline constexpr MemorySpace memory_space()

Defined in src/lib/sbio/storage/per_unit_buffer.hh:48

Return Name Description
Policy::template SegmentState< std::shared_ptr< Slot > > m_units
std::shared_ptr< Units > m_all
std::size_t m_size

Policy::template SegmentState< std::shared_ptr< Slot > > m_units {}

Type: Policy::template SegmentState< std::shared_ptr< Slot > >

Defined in src/lib/sbio/storage/per_unit_buffer.hh:105


std::shared_ptr< Units > m_all { std::make_shared<Units>() }

Type: std::shared_ptr< Units >

Defined in src/lib/sbio/storage/per_unit_buffer.hh:106


std::size_t m_size { 0 }

Defined in src/lib/sbio/storage/per_unit_buffer.hh:107