spla
|
Linear allocator for temporary device local buffer allocations. More...
#include <cl_alloc_linear.hpp>
Public Member Functions | |
CLAllocLinear (std::size_t arena_size=DEFAULT_SIZE, std::size_t alignment=DEFAULT_ALIGNMENT) | |
~CLAllocLinear () override=default | |
cl::Buffer | alloc (std::size_t size) override |
void | free (cl::Buffer buffer) override |
void | free_all () override |
![]() | |
virtual | ~CLAlloc ()=default |
Static Public Attributes | |
static constexpr const uint | DEFAULT_SIZE = 1024 * 1024 |
static constexpr const uint | DEFAULT_ALIGNMENT = 128 |
Protected Member Functions | |
void | expand () |
void | shrink () |
Linear allocator for temporary device local buffer allocations.
Linear allocator uses linear allocation strategy. It places allocated buffers sequentially in a large pre-allocated arena buffer. If arena is full, new arena allocated. On a free all step, all allocations must be invalid. All allocated arenas cleared, and one new bigger arena allocated.
|
explicit |
|
overridedefault |
|
overridevirtual |
Implements spla::CLAlloc.
|
protected |
|
overridevirtual |
Implements spla::CLAlloc.
|
overridevirtual |
Implements spla::CLAlloc.
|
protected |
|
staticconstexpr |
|
staticconstexpr |