Halide
Halide::Runtime::Internal::RegionAllocator Class Reference

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
 
RegionAllocatoroperator= (const RegionAllocator &)=delete
 
 RegionAllocator ()=delete
 
 ~RegionAllocator ()=delete
 
MemoryRegionreserve (void *user_context, const MemoryRequest &request)
 
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)
 
BlockResourceblock_resource () const
 

Static Public Member Functions

static RegionAllocatorcreate (void *user_context, BlockResource *block, const MemoryAllocators &ma)
 
static int destroy (void *user_context, RegionAllocator *region_allocator)
 
static RegionAllocatorfind_allocator (void *user_context, MemoryRegion *memory_region)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ RegionAllocator() [1/2]

Halide::Runtime::Internal::RegionAllocator::RegionAllocator ( const RegionAllocator )
delete

◆ RegionAllocator() [2/2]

Halide::Runtime::Internal::RegionAllocator::RegionAllocator ( )
delete

◆ ~RegionAllocator()

Halide::Runtime::Internal::RegionAllocator::~RegionAllocator ( )
delete

Member Function Documentation

◆ operator=()

RegionAllocator& Halide::Runtime::Internal::RegionAllocator::operator= ( const RegionAllocator )
delete

◆ create()

RegionAllocator * Halide::Runtime::Internal::RegionAllocator::create ( void *  user_context,
BlockResource block,
const MemoryAllocators ma 
)
static

Definition at line 113 of file region_allocator.h.

◆ destroy() [1/2]

int Halide::Runtime::Internal::RegionAllocator::destroy ( void *  user_context,
RegionAllocator region_allocator 
)
static

Definition at line 126 of file region_allocator.h.

◆ find_allocator()

RegionAllocator * Halide::Runtime::Internal::RegionAllocator::find_allocator ( void *  user_context,
MemoryRegion memory_region 
)
static

Definition at line 217 of file region_allocator.h.

◆ reserve()

MemoryRegion * Halide::Runtime::Internal::RegionAllocator::reserve ( void *  user_context,
const MemoryRequest request 
)

Definition at line 149 of file region_allocator.h.

◆ release() [1/2]

int Halide::Runtime::Internal::RegionAllocator::release ( void *  user_context,
MemoryRegion memory_region 
)

Definition at line 184 of file region_allocator.h.

◆ reclaim()

int Halide::Runtime::Internal::RegionAllocator::reclaim ( void *  user_context,
MemoryRegion memory_region 
)

Definition at line 194 of file region_allocator.h.

◆ retain()

int Halide::Runtime::Internal::RegionAllocator::retain ( void *  user_context,
MemoryRegion memory_region 
)

Definition at line 209 of file region_allocator.h.

◆ collect()

bool Halide::Runtime::Internal::RegionAllocator::collect ( void *  user_context)

Definition at line 635 of file region_allocator.h.

◆ release() [2/2]

int Halide::Runtime::Internal::RegionAllocator::release ( void *  user_context)

Definition at line 618 of file region_allocator.h.

◆ destroy() [2/2]

int Halide::Runtime::Internal::RegionAllocator::destroy ( void *  user_context)

Definition at line 682 of file region_allocator.h.

◆ block_resource()

BlockResource * Halide::Runtime::Internal::RegionAllocator::block_resource ( ) const

Definition at line 739 of file region_allocator.h.


The documentation for this class was generated from the following file: