An arena for allocating memory for a thread. More...
#include <arena.hpp>
Public Member Functions | |
arena (global_arena< Upstream > &global_arena) | |
Construct an arena . More... | |
arena (arena const &)=delete | |
arena & | operator= (arena const &)=delete |
arena (arena &&) noexcept=delete | |
arena & | operator= (arena &&) noexcept=delete |
void * | allocate (std::size_t size) |
Allocates memory of size at least size bytes. More... | |
bool | deallocate (void *ptr, std::size_t size, cuda_stream_view stream) |
Deallocate memory pointed to by ptr , and possibly return superblocks to upstream. More... | |
bool | deallocate (void *ptr, std::size_t size) |
Deallocate memory pointed to by ptr , and possibly return superblocks to upstream. More... | |
void | clean () |
Clean the arena and release all superblocks to the global arena. | |
void | defragment () |
Defragment the arena and release empty superblock to the global arena. | |
An arena for allocating memory for a thread.
An arena is a per-thread or per-non-default-stream memory pool. It allocates superblocks from the global arena, and returns them when the superblocks become empty.
Upstream | Memory resource to use for allocating the global arena. Implements rmm::mr::device_memory_resource interface. |
|
inlineexplicit |
Construct an arena
.
global_arena | The global arena from which to allocate superblocks. |
|
inline |
Allocates memory of size at least size
bytes.
size | The size in bytes of the allocation. |
|
inline |
Deallocate memory pointed to by ptr
, and possibly return superblocks to upstream.
ptr | Pointer to be deallocated. |
size | The size in bytes of the allocation. This must be equal to the value of size that was passed to the allocate call that returned p . |
|
inline |
Deallocate memory pointed to by ptr
, and possibly return superblocks to upstream.
ptr | Pointer to be deallocated. |
size | The size in bytes of the allocation. This must be equal to the value of size that was passed to the allocate call that returned p . |
stream | Stream on which to perform deallocation. |