Compute Library
 23.11
IAllocator Class Referenceabstract

Allocator interface. More...

#include <IAllocator.h>

Public Member Functions

virtual ~IAllocator ()=default
 Default virtual destructor. More...
 
virtual void * allocate (size_t size, size_t alignment)=0
 Interface to be implemented by the child class to allocate bytes. More...
 
virtual void free (void *ptr)=0
 Interface to be implemented by the child class to free the allocated tensor. More...
 
virtual std::unique_ptr< IMemoryRegionmake_region (size_t size, size_t alignment)=0
 Create self-managed memory region. More...
 

Detailed Description

Allocator interface.

Definition at line 35 of file IAllocator.h.

Constructor & Destructor Documentation

◆ ~IAllocator()

virtual ~IAllocator ( )
virtualdefault

Default virtual destructor.

Member Function Documentation

◆ allocate()

virtual void* allocate ( size_t  size,
size_t  alignment 
)
pure virtual

Interface to be implemented by the child class to allocate bytes.

Parameters
[in]sizeSize to allocate
[in]alignmentAlignment that the returned pointer should comply with
Returns
A pointer to the allocated memory

Implemented in Allocator, and CLBufferAllocator.

◆ free()

virtual void free ( void *  ptr)
pure virtual

Interface to be implemented by the child class to free the allocated tensor.

Implemented in Allocator, and CLBufferAllocator.

◆ make_region()

virtual std::unique_ptr<IMemoryRegion> make_region ( size_t  size,
size_t  alignment 
)
pure virtual

Create self-managed memory region.

Parameters
[in]sizeSize of the memory region
[in]alignmentAlignment of the memory region
Returns
The memory region object

Implemented in Allocator, and CLBufferAllocator.

Referenced by OffsetMemoryPool::OffsetMemoryPool().


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