Compute Library
 23.08
IMemoryGroup Class Referenceabstract

Memory group interface. More...

#include <IMemoryGroup.h>

Public Member Functions

virtual ~IMemoryGroup ()=default
 Default virtual destructor. More...
 
virtual void manage (IMemoryManageable *obj)=0
 Sets a object to be managed by the given memory group. More...
 
virtual void finalize_memory (IMemoryManageable *obj, IMemory &obj_memory, size_t size, size_t alignment)=0
 Finalizes memory for a given object. More...
 
virtual void acquire ()=0
 Acquires backing memory for the whole group. More...
 
virtual void release ()=0
 Releases backing memory of the whole group. More...
 
virtual MemoryMappingsmappings ()=0
 Gets the memory mapping of the group. More...
 

Detailed Description

Memory group interface.

Definition at line 37 of file IMemoryGroup.h.

Constructor & Destructor Documentation

◆ ~IMemoryGroup()

virtual ~IMemoryGroup ( )
virtualdefault

Default virtual destructor.

Member Function Documentation

◆ acquire()

virtual void acquire ( )
pure virtual

Acquires backing memory for the whole group.

Implemented in MemoryGroup.

Referenced by MemoryGroupResourceScope::MemoryGroupResourceScope().

◆ finalize_memory()

virtual void finalize_memory ( IMemoryManageable obj,
IMemory obj_memory,
size_t  size,
size_t  alignment 
)
pure virtual

Finalizes memory for a given object.

Note
Manager must not be finalized
Parameters
[in,out]objObject to request memory for
[in,out]obj_memoryObject's memory handling interface which can be used to alter the underlying memory that is used by the object.
[in]sizeSize of memory to allocate
[in]alignment(Optional) Alignment to use

Implemented in MemoryGroup.

Referenced by TensorAllocator::allocate(), and CLTensorAllocator::allocate().

◆ manage()

virtual void manage ( IMemoryManageable obj)
pure virtual

Sets a object to be managed by the given memory group.

Note
Manager must not be finalized
Parameters
[in]objObject to be managed

Implemented in MemoryGroup.

Referenced by CLTensorHandle::manage(), and NETensorHandle::manage().

◆ mappings()

virtual MemoryMappings& mappings ( )
pure virtual

Gets the memory mapping of the group.

Implemented in MemoryGroup.

Referenced by ISimpleLifetimeManager::release_group().

◆ release()

virtual void release ( )
pure virtual

Releases backing memory of the whole group.

Implemented in MemoryGroup.

Referenced by MemoryGroupResourceScope::~MemoryGroupResourceScope().


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