Compute Library
 21.05
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 CLBufferAllocator, and Allocator.

◆ free()

virtual void free ( void *  ptr)
pure virtual

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

Implemented in CLBufferAllocator, and Allocator.

◆ 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 CLBufferAllocator, and Allocator.

Referenced by OffsetMemoryPool::OffsetMemoryPool().


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