ONE - On-device Neural Engine
Loading...
Searching...
No Matches
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 71 of file MemoryManager.h.

Constructor & Destructor Documentation

◆ LayerScopeMemoryManager()

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

Definition at line 96 of file MemoryManager.cc.

96 : _mem_planner{createMemoryPlanner()}
97{
98 // DO NOTHING
99}

Member Function Documentation

◆ allocate()

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

Definition at line 107 of file MemoryManager.cc.

108{
109 _mem_alloc = std::make_shared<basic::Allocator>(_mem_planner->capacity());
110 assert(_mem_alloc->base());
111}

◆ claimPlan()

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

Definition at line 122 of file MemoryManager.cc.

123{
124 _mem_planner->claim(ind, size);
125}
int32_t size[5]
Definition Slice.cpp:35

References size.

◆ deallocate()

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

Definition at line 120 of file MemoryManager.cc.

120{ _mem_alloc->release(); }

◆ getBuffer()

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

Definition at line 113 of file MemoryManager.cc.

114{
115 assert(_mem_planner->memory_plans().find(ind) != _mem_planner->memory_plans().end());
116 const auto &mem_blk = _mem_planner->memory_plans().at(ind);
117 return _mem_alloc->base() + mem_blk.offset;
118}

◆ releasePlan()

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

Definition at line 127 of file MemoryManager.cc.

128{
129 _mem_planner->release(ind);
130}

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