ArrayBufferPool
ArrayBufferPool
Section titled “ArrayBufferPool”#include <xalgospp/scheduling/pool.hh>class ArrayBufferPoolDefined in src/lib/xalgospp/scheduling/pool.hh:44
Inherits:
enable_shared_from_this< ArrayBufferPool >
The ArrayBufferPool provides a pool of NCArrays for workers managed by a scheduler.
The pool can be accessed by enqueued Tasks wrapping Algorithm’s that require memory. The pool minimizes the need for dynamic allocations and allows for reuse helping with performance.
Todo: The implementation is currently host only, but is not difficult to move to an agnostic implementation with tags, like in other areas.
List of all members
Section titled “List of all members”| Name | Kind | Owner |
|---|---|---|
ArrayBufferPool |
function |
Declared here |
acquire |
function |
Declared here |
free_count |
function |
Declared here |
capacity |
function |
Declared here |
buffer_size_bytes |
function |
Declared here |
m_mutex |
variable |
Declared here |
m_free_buffers |
variable |
Declared here |
m_total_allocated |
variable |
Declared here |
m_ndim |
variable |
Declared here |
m_shape |
variable |
Declared here |
m_dtype |
variable |
Declared here |
release |
function |
Declared here |
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
ArrayBufferPool inline |
||
std::shared_ptr< ncarray::SOArray > |
acquire inline |
|
std::size_t |
free_count const inline |
|
std::size_t |
capacity const inline |
|
std::size_t |
buffer_size_bytes const inline |
ArrayBufferPool
Section titled “ArrayBufferPool”inline
inline ArrayBufferPool(ssize_t ndim, const ssize_t * shape, ncarray::DType dtype)Defined in src/lib/xalgospp/scheduling/pool.hh:46
acquire
Section titled “acquire”inline
inline std::shared_ptr< ncarray::SOArray > acquire()Defined in src/lib/xalgospp/scheduling/pool.hh:62
free_count
Section titled “free_count”const inline
inline std::size_t free_count() constDefined in src/lib/xalgospp/scheduling/pool.hh:83
capacity
Section titled “capacity”const inline
inline std::size_t capacity() constDefined in src/lib/xalgospp/scheduling/pool.hh:89
buffer_size_bytes
Section titled “buffer_size_bytes”const inline
inline std::size_t buffer_size_bytes() constDefined in src/lib/xalgospp/scheduling/pool.hh:95
Private Attributes
Section titled “Private Attributes”| Return | Name | Description |
|---|---|---|
std::mutex |
m_mutex |
|
std::vector< ncarray::SOArray * > |
m_free_buffers |
|
std::size_t |
m_total_allocated |
|
ssize_t |
m_ndim |
|
std::vector< ssize_t > |
m_shape |
|
ncarray::DType |
m_dtype |
m_mutex
Section titled “m_mutex”std::mutex m_mutexDefined in src/lib/xalgospp/scheduling/pool.hh:113
m_free_buffers
Section titled “m_free_buffers”std::vector< ncarray::SOArray * > m_free_buffersDefined in src/lib/xalgospp/scheduling/pool.hh:114
m_total_allocated
Section titled “m_total_allocated”std::size_t m_total_allocated { 0 }Defined in src/lib/xalgospp/scheduling/pool.hh:115
m_ndim
Section titled “m_ndim”ssize_t m_ndimDefined in src/lib/xalgospp/scheduling/pool.hh:117
m_shape
Section titled “m_shape”std::vector< ssize_t > m_shapeDefined in src/lib/xalgospp/scheduling/pool.hh:118
m_dtype
Section titled “m_dtype”ncarray::DType m_dtypeDefined in src/lib/xalgospp/scheduling/pool.hh:119
Private Methods
Section titled “Private Methods”| Return | Name | Description |
|---|---|---|
void |
release inline |
release
Section titled “release”inline
inline void release(ncarray::SOArray * ptr)Defined in src/lib/xalgospp/scheduling/pool.hh:108