Halide  17.0.2
Halide compiler and libraries
Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator Class Reference

Vulkan Memory Allocator class interface for managing large memory requests stored as contiguous blocks of memory, which are then sub-allocated into smaller regions of memory to avoid the excessive cost of vkAllocate and the limited number of available allocation calls through the API. More...

#include <vulkan_memory.h>

Public Member Functions

 VulkanMemoryAllocator (const VulkanMemoryAllocator &)=delete
 
VulkanMemoryAllocatoroperator= (const VulkanMemoryAllocator &)=delete
 
 VulkanMemoryAllocator ()=delete
 
 ~VulkanMemoryAllocator ()=delete
 
MemoryRegionreserve (void *user_context, const MemoryRequest &request)
 
int conform (void *user_context, MemoryRequest *request)
 
int release (void *user_context, MemoryRegion *region)
 
int reclaim (void *user_context, MemoryRegion *region)
 
int retain (void *user_context, MemoryRegion *region)
 
bool collect (void *user_context)
 
int release (void *user_context)
 
int destroy (void *user_context)
 
void * map (void *user_context, MemoryRegion *region)
 
int unmap (void *user_context, MemoryRegion *region)
 
MemoryRegioncreate_crop (void *user_context, MemoryRegion *region, uint64_t offset)
 
int destroy_crop (void *user_context, MemoryRegion *region)
 
MemoryRegionowner_of (void *user_context, MemoryRegion *region)
 
VkDevice current_device () const
 
VkPhysicalDevice current_physical_device () const
 
const VkAllocationCallbackscallbacks () const
 
size_t bytes_allocated_for_blocks () const
 
size_t blocks_allocated () const
 
size_t bytes_allocated_for_regions () const
 
size_t regions_allocated () const
 

Static Public Member Functions

static VulkanMemoryAllocatorcreate (void *user_context, const VulkanMemoryConfig &config, VkDevice dev, VkPhysicalDevice phys_dev, const SystemMemoryAllocatorFns &system_allocator, const VkAllocationCallbacks *alloc_callbacks=nullptr)
 
static int destroy (void *user_context, VulkanMemoryAllocator *allocator)
 
static const VulkanMemoryConfigdefault_config ()
 
static int allocate_block (void *instance_ptr, MemoryBlock *block)
 
static int deallocate_block (void *instance_ptr, MemoryBlock *block)
 
static int conform_block_request (void *instance_ptr, MemoryRequest *request)
 
static int allocate_region (void *instance_ptr, MemoryRegion *region)
 
static int deallocate_region (void *instance_ptr, MemoryRegion *region)
 
static int conform_region_request (void *instance_ptr, MemoryRequest *request)
 

Detailed Description

Vulkan Memory Allocator class interface for managing large memory requests stored as contiguous blocks of memory, which are then sub-allocated into smaller regions of memory to avoid the excessive cost of vkAllocate and the limited number of available allocation calls through the API.

Definition at line 42 of file vulkan_memory.h.

Constructor & Destructor Documentation

◆ VulkanMemoryAllocator() [1/2]

Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::VulkanMemoryAllocator ( const VulkanMemoryAllocator )
delete

◆ VulkanMemoryAllocator() [2/2]

Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::VulkanMemoryAllocator ( )
delete

◆ ~VulkanMemoryAllocator()

Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::~VulkanMemoryAllocator ( )
delete

Member Function Documentation

◆ operator=()

VulkanMemoryAllocator& Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::operator= ( const VulkanMemoryAllocator )
delete

◆ create()

VulkanMemoryAllocator * Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::create ( void *  user_context,
const VulkanMemoryConfig config,
VkDevice  dev,
VkPhysicalDevice  phys_dev,
const SystemMemoryAllocatorFns system_allocator,
const VkAllocationCallbacks alloc_callbacks = nullptr 
)
static

Definition at line 134 of file vulkan_memory.h.

◆ destroy() [1/2]

int Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::destroy ( void *  user_context,
VulkanMemoryAllocator allocator 
)
static

Definition at line 156 of file vulkan_memory.h.

◆ reserve()

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

Definition at line 210 of file vulkan_memory.h.

◆ conform()

int Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::conform ( void *  user_context,
MemoryRequest request 
)

Definition at line 849 of file vulkan_memory.h.

◆ release() [1/2]

int Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::release ( void *  user_context,
MemoryRegion region 
)

Definition at line 430 of file vulkan_memory.h.

◆ reclaim()

int Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::reclaim ( void *  user_context,
MemoryRegion region 
)

Definition at line 449 of file vulkan_memory.h.

◆ retain()

int Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::retain ( void *  user_context,
MemoryRegion region 
)

Definition at line 468 of file vulkan_memory.h.

◆ collect()

bool Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::collect ( void *  user_context)

Definition at line 487 of file vulkan_memory.h.

◆ release() [2/2]

int Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::release ( void *  user_context)

Definition at line 498 of file vulkan_memory.h.

◆ destroy() [2/2]

int Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::destroy ( void *  user_context)

Definition at line 515 of file vulkan_memory.h.

◆ map()

void * Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::map ( void *  user_context,
MemoryRegion region 
)

Definition at line 233 of file vulkan_memory.h.

◆ unmap()

int Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::unmap ( void *  user_context,
MemoryRegion region 
)

Definition at line 299 of file vulkan_memory.h.

◆ create_crop()

MemoryRegion * Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::create_crop ( void *  user_context,
MemoryRegion region,
uint64_t  offset 
)

Definition at line 338 of file vulkan_memory.h.

◆ destroy_crop()

int Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::destroy_crop ( void *  user_context,
MemoryRegion region 
)

Definition at line 391 of file vulkan_memory.h.

◆ owner_of()

MemoryRegion * Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::owner_of ( void *  user_context,
MemoryRegion region 
)

Definition at line 421 of file vulkan_memory.h.

◆ current_device()

VkDevice Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::current_device ( ) const
inline

Definition at line 76 of file vulkan_memory.h.

◆ current_physical_device()

VkPhysicalDevice Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::current_physical_device ( ) const
inline

Definition at line 79 of file vulkan_memory.h.

◆ callbacks()

const VkAllocationCallbacks* Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::callbacks ( ) const
inline

Definition at line 82 of file vulkan_memory.h.

◆ default_config()

const VulkanMemoryConfig & Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::default_config ( )
static

Definition at line 531 of file vulkan_memory.h.

◆ allocate_block()

int Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::allocate_block ( void *  instance_ptr,
MemoryBlock block 
)
static

Definition at line 611 of file vulkan_memory.h.

References halide_error_code_internal_error.

◆ deallocate_block()

int Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::deallocate_block ( void *  instance_ptr,
MemoryBlock block 
)
static

Definition at line 675 of file vulkan_memory.h.

References halide_error_code_internal_error.

◆ conform_block_request()

int Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::conform_block_request ( void *  instance_ptr,
MemoryRequest request 
)
static

Definition at line 569 of file vulkan_memory.h.

References halide_error_code_internal_error.

◆ allocate_region()

int Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::allocate_region ( void *  instance_ptr,
MemoryRegion region 
)
static

Definition at line 941 of file vulkan_memory.h.

References halide_error_code_internal_error.

◆ deallocate_region()

int Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::deallocate_region ( void *  instance_ptr,
MemoryRegion region 
)
static

Definition at line 1066 of file vulkan_memory.h.

References halide_error_code_internal_error.

◆ conform_region_request()

int Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::conform_region_request ( void *  instance_ptr,
MemoryRequest request 
)
static

Definition at line 909 of file vulkan_memory.h.

References halide_error_code_internal_error.

◆ bytes_allocated_for_blocks()

size_t Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::bytes_allocated_for_blocks ( ) const

Definition at line 747 of file vulkan_memory.h.

◆ blocks_allocated()

size_t Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::blocks_allocated ( ) const

Definition at line 743 of file vulkan_memory.h.

◆ bytes_allocated_for_regions()

size_t Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::bytes_allocated_for_regions ( ) const

Definition at line 1139 of file vulkan_memory.h.

◆ regions_allocated()

size_t Halide::Runtime::Internal::Vulkan::VulkanMemoryAllocator::regions_allocated ( ) const

Definition at line 1135 of file vulkan_memory.h.


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