ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert::backend::basic::BumpPlanner Class Reference

Class to plan memory by bump way. More...

#include <MemoryPlanner.h>

Collaboration diagram for onert::backend::basic::BumpPlanner:

Public Member Functions

void claim (const ir::OperandIndex &, size_t) override
 Claim memory for operand by bump way.
 
void release (const ir::OperandIndex &) override
 Release memory for operand by bump way.
 
uint32_t capacity () override
 Get capacity for memory planning.
 
MemoryPlansmemory_plans () override
 Get MemoryPlans.
 
- Public Member Functions inherited from onert::backend::basic::IMemoryPlanner< ir::OperandIndex >
virtual ~IMemoryPlanner ()=default
 

Additional Inherited Members

- Public Types inherited from onert::backend::basic::IMemoryPlanner< ir::OperandIndex >
using MemoryPlans = std::unordered_map< ir::OperandIndex, Block >
 

Detailed Description

Class to plan memory by bump way.

Definition at line 44 of file MemoryPlanner.h.

Member Function Documentation

◆ capacity()

uint32_t onert::backend::basic::BumpPlanner::capacity ( )
inlineoverridevirtual

Get capacity for memory planning.

Returns
The value of capacity

Implements onert::backend::basic::IMemoryPlanner< ir::OperandIndex >.

Definition at line 62 of file MemoryPlanner.h.

62{ return _capacity; }

◆ claim()

void onert::backend::basic::BumpPlanner::claim ( const ir::OperandIndex ind,
size_t  size 
)
overridevirtual

Claim memory for operand by bump way.

Parameters
[in]indexThe operand index
[in]sizeThe size of the memory

Implements onert::backend::basic::IMemoryPlanner< ir::OperandIndex >.

Definition at line 28 of file MemoryPlanner.cc.

29{
30 Block blk{_capacity, size};
31 _mem_plans[ind] = blk;
32 _capacity += size;
33
34 VERBOSE(BP_PLANNER) << "CLAIM(" << ind << "): " << blk.offset << ", " << blk.size << std::endl;
35}
#define VERBOSE(name, lv)
Definition Log.h:71
int32_t size[5]
Definition Slice.cpp:35

References size, and VERBOSE.

◆ memory_plans()

MemoryPlans & onert::backend::basic::BumpPlanner::memory_plans ( )
inlineoverridevirtual

Get MemoryPlans.

Returns
MemoryPlans

Implements onert::backend::basic::IMemoryPlanner< ir::OperandIndex >.

Definition at line 67 of file MemoryPlanner.h.

67{ return _mem_plans; }

◆ release()

void onert::backend::basic::BumpPlanner::release ( const ir::OperandIndex ind)
overridevirtual

Release memory for operand by bump way.

Parameters
[in]indexThe operand index

Implements onert::backend::basic::IMemoryPlanner< ir::OperandIndex >.

Definition at line 37 of file MemoryPlanner.cc.

38{
39 VERBOSE(BP_PLANNER) << "RELEASE(" << ind << "): "
40 << "NOTHING does" << std::endl;
41}

References VERBOSE.


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