PerUnitBuffer
PerUnitBuffer
Section titled “PerUnitBuffer”#include <sbio/storage/per_unit_buffer.hh>template<class Inner, class Policy>struct PerUnitBufferDefined 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.
Template Parameters
Section titled “Template Parameters”-
InnerThe actual underlying buffer type of each unit’s instance. -
PolicyThe Execution policy.
Public Methods
Section titled “Public Methods”| 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() constDefined in src/lib/sbio/storage/per_unit_buffer.hh:53
The calling unit’s instance, allocated on first access.
const inline
inline void * ptr() constDefined in src/lib/sbio/storage/per_unit_buffer.hh:64
const inline
inline std::size_t size() constDefined in src/lib/sbio/storage/per_unit_buffer.hh:66
set_memory
Section titled “set_memory”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).
Public Static Methods
Section titled “Public Static Methods”| Return | Name | Description |
|---|---|---|
constexpr MemorySpace |
memory_space static inline constexpr |
memory_space
Section titled “memory_space”static inline constexpr
constexpr static inline constexpr MemorySpace memory_space()Defined in src/lib/sbio/storage/per_unit_buffer.hh:48
Private Attributes
Section titled “Private Attributes”| Return | Name | Description |
|---|---|---|
Policy::template SegmentState< std::shared_ptr< Slot > > |
m_units |
|
std::shared_ptr< Units > |
m_all |
|
std::size_t |
m_size |
m_units
Section titled “m_units”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
m_size
Section titled “m_size”std::size_t m_size { 0 }Defined in src/lib/sbio/storage/per_unit_buffer.hh:107