Skip to content

ArrayBufferPool

#include <xalgospp/scheduling/pool.hh>
class ArrayBufferPool

Defined 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.

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
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

inline

inline ArrayBufferPool(ssize_t ndim, const ssize_t * shape, ncarray::DType dtype)

Defined in src/lib/xalgospp/scheduling/pool.hh:46


inline

inline std::shared_ptr< ncarray::SOArray > acquire()

Defined in src/lib/xalgospp/scheduling/pool.hh:62


const inline

inline std::size_t free_count() const

Defined in src/lib/xalgospp/scheduling/pool.hh:83


const inline

inline std::size_t capacity() const

Defined in src/lib/xalgospp/scheduling/pool.hh:89


const inline

inline std::size_t buffer_size_bytes() const

Defined in src/lib/xalgospp/scheduling/pool.hh:95

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

std::mutex m_mutex

Defined in src/lib/xalgospp/scheduling/pool.hh:113


std::vector< ncarray::SOArray * > m_free_buffers

Defined in src/lib/xalgospp/scheduling/pool.hh:114


std::size_t m_total_allocated { 0 }

Defined in src/lib/xalgospp/scheduling/pool.hh:115


ssize_t m_ndim

Defined in src/lib/xalgospp/scheduling/pool.hh:117


std::vector< ssize_t > m_shape

Defined in src/lib/xalgospp/scheduling/pool.hh:118


ncarray::DType m_dtype

Defined in src/lib/xalgospp/scheduling/pool.hh:119

Return Name Description
void release inline

inline

inline void release(ncarray::SOArray * ptr)

Defined in src/lib/xalgospp/scheduling/pool.hh:108