|
Halide 21.0.0
Halide compiler and libraries
|
Allocator class interface for sub-allocating a contiguous memory block into smaller regions of memory. More...
#include <region_allocator.h>
Classes | |
| struct | MemoryAllocators |
Public Member Functions | |
| RegionAllocator (const RegionAllocator &)=delete | |
| RegionAllocator & | operator= (const RegionAllocator &)=delete |
| RegionAllocator ()=delete | |
| ~RegionAllocator ()=delete | |
| MemoryRegion * | reserve (void *user_context, const MemoryRequest &request) |
| int | conform (void *user_context, MemoryRequest *request) const |
| int | release (void *user_context, MemoryRegion *memory_region) |
| int | reclaim (void *user_context, MemoryRegion *memory_region) |
| int | retain (void *user_context, MemoryRegion *memory_region) |
| bool | collect (void *user_context) |
| int | release (void *user_context) |
| int | destroy (void *user_context) |
| BlockResource * | block_resource () const |
Static Public Member Functions | |
| static RegionAllocator * | create (void *user_context, BlockResource *block, const MemoryAllocators &ma) |
| static int | destroy (void *user_context, RegionAllocator *region_allocator) |
| static RegionAllocator * | find_allocator (void *user_context, MemoryRegion *memory_region) |
Allocator class interface for sub-allocating a contiguous memory block into smaller regions of memory.
This class only manages the address creation for the regions – allocation callback functions are used to request the memory from the necessary system or API calls. This class is intended to be used inside of a higher level memory management class that provides thread safety, policy management and API integration for a specific runtime API (eg Vulkan, OpenCL, etc)
Definition at line 24 of file region_allocator.h.
|
delete |
References RegionAllocator().
Referenced by create(), destroy(), find_allocator(), operator=(), and RegionAllocator().
|
delete |
|
delete |
|
delete |
References RegionAllocator().
|
static |
Definition at line 114 of file region_allocator.h.
References block_resource(), halide_abort_if_false, and RegionAllocator().
|
static |
Definition at line 127 of file region_allocator.h.
References destroy(), halide_abort_if_false, and RegionAllocator().
Referenced by destroy().
|
static |
Definition at line 240 of file region_allocator.h.
References Halide::Runtime::Internal::BlockResource::allocator, Halide::Runtime::Internal::BlockRegion::block_ptr, and RegionAllocator().
Referenced by Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::allocate_region(), Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::create_crop(), Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::destroy_crop(), Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::map(), Halide::Runtime::Internal::BlockAllocator::reclaim(), Halide::Runtime::Internal::BlockAllocator::release(), Halide::Runtime::Internal::BlockAllocator::retain(), and Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::unmap().
| MemoryRegion * Halide::Runtime::Internal::RegionAllocator::reserve | ( | void * | user_context, |
| const MemoryRequest & | request ) |
Definition at line 166 of file region_allocator.h.
References conform(), debug, halide_abort_if_false, Halide::Runtime::Internal::BlockRegion::memory, Halide::Runtime::Internal::MemoryRegion::size, and Halide::Runtime::Internal::MemoryRequest::size.
| int Halide::Runtime::Internal::RegionAllocator::conform | ( | void * | user_context, |
| MemoryRequest * | request ) const |
Definition at line 152 of file region_allocator.h.
References Halide::Runtime::Internal::aligned_offset(), Halide::Runtime::Internal::MemoryRequest::alignment, Halide::Runtime::Internal::conform_alignment(), Halide::Runtime::Internal::conform_size(), Halide::Runtime::Internal::MemoryRequest::offset, and Halide::Runtime::Internal::MemoryRequest::size.
Referenced by reserve().
| int Halide::Runtime::Internal::RegionAllocator::release | ( | void * | user_context, |
| MemoryRegion * | memory_region ) |
Definition at line 210 of file region_allocator.h.
References Halide::Runtime::Internal::BlockRegion::block_ptr, halide_abort_if_false, and Halide::Runtime::Internal::BlockRegion::usage_count.
Referenced by Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::destroy_crop(), and Halide::Runtime::Internal::BlockAllocator::release().
| int Halide::Runtime::Internal::RegionAllocator::reclaim | ( | void * | user_context, |
| MemoryRegion * | memory_region ) |
Definition at line 220 of file region_allocator.h.
References Halide::Runtime::Internal::BlockRegion::block_ptr, halide_abort_if_false, and Halide::Runtime::Internal::BlockRegion::usage_count.
Referenced by Halide::Runtime::Internal::BlockAllocator::reclaim().
| int Halide::Runtime::Internal::RegionAllocator::retain | ( | void * | user_context, |
| MemoryRegion * | memory_region ) |
Definition at line 232 of file region_allocator.h.
References Halide::Runtime::Internal::BlockRegion::block_ptr, halide_abort_if_false, and Halide::Runtime::Internal::BlockRegion::usage_count.
Referenced by Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::create_crop(), and Halide::Runtime::Internal::BlockAllocator::retain().
| bool Halide::Runtime::Internal::RegionAllocator::collect | ( | void * | user_context | ) |
Definition at line 692 of file region_allocator.h.
References Halide::Runtime::Internal::BlockRegion::block_ptr, debug, Halide::Runtime::Internal::BlockRegion::memory, Halide::Runtime::Internal::BlockRegion::next_ptr, Halide::Runtime::Internal::MemoryRegion::size, Halide::Runtime::Internal::BlockRegion::status, and Halide::Runtime::Internal::BlockRegion::usage_count.
Referenced by Halide::Runtime::Internal::BlockAllocator::collect().
| int Halide::Runtime::Internal::RegionAllocator::release | ( | void * | user_context | ) |
Definition at line 675 of file region_allocator.h.
References debug, and Halide::Runtime::Internal::BlockRegion::next_ptr.
| int Halide::Runtime::Internal::RegionAllocator::destroy | ( | void * | user_context | ) |
Definition at line 771 of file region_allocator.h.
References debug, Halide::Runtime::Internal::MemoryArena::destroy(), and Halide::Runtime::Internal::BlockRegion::next_ptr.
| BlockResource * Halide::Runtime::Internal::RegionAllocator::block_resource | ( | ) | const |