ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
onert::backend::train::LayerScopeMemoryManager Class Reference

#include <MemoryManager.h>

Public Member Functions

 LayerScopeMemoryManager ()
 
void allocate (void)
 
uint8_t * getBuffer (const LayerScopeTensorIndex &ind) const
 
void deallocate (void)
 
void claimPlan (const LayerScopeTensorIndex &ind, uint32_t size)
 
void releasePlan (const LayerScopeTensorIndex &ind)
 

Detailed Description

Definition at line 67 of file MemoryManager.h.

Constructor & Destructor Documentation

◆ LayerScopeMemoryManager()

onert::backend::train::LayerScopeMemoryManager::LayerScopeMemoryManager ( )

Definition at line 92 of file MemoryManager.cc.

92 : _mem_planner{createMemoryPlanner()}
93{
94 // DO NOTHING
95}

Member Function Documentation

◆ allocate()

void onert::backend::train::LayerScopeMemoryManager::allocate ( void  )

Definition at line 103 of file MemoryManager.cc.

104{
105 _mem_alloc = std::make_shared<basic::Allocator>(_mem_planner->capacity());
106 assert(_mem_alloc->base());
107}

◆ claimPlan()

void onert::backend::train::LayerScopeMemoryManager::claimPlan ( const LayerScopeTensorIndex ind,
uint32_t  size 
)

Definition at line 118 of file MemoryManager.cc.

119{
120 _mem_planner->claim(ind, size);
121}
int32_t size[5]
Definition Slice.cpp:35

References size.

◆ deallocate()

void onert::backend::train::LayerScopeMemoryManager::deallocate ( void  )

Definition at line 116 of file MemoryManager.cc.

116{ _mem_alloc->release(); }

◆ getBuffer()

uint8_t * onert::backend::train::LayerScopeMemoryManager::getBuffer ( const LayerScopeTensorIndex ind) const

Definition at line 109 of file MemoryManager.cc.

110{
111 assert(_mem_planner->memory_plans().find(ind) != _mem_planner->memory_plans().end());
112 const auto &mem_blk = _mem_planner->memory_plans().at(ind);
113 return _mem_alloc->base() + mem_blk.offset;
114}

◆ releasePlan()

void onert::backend::train::LayerScopeMemoryManager::releasePlan ( const LayerScopeTensorIndex ind)

Definition at line 123 of file MemoryManager.cc.

124{
125 _mem_planner->release(ind);
126}

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