ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert::backend::train::BumpPlanner< Index > Class Template Reference

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

#include <MemoryPlanner.h>

Collaboration diagram for onert::backend::train::BumpPlanner< Index >:

Public Member Functions

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

Additional Inherited Members

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

Detailed Description

template<typename Index>
class onert::backend::train::BumpPlanner< Index >

Class to plan memory by bump way.

Definition at line 44 of file MemoryPlanner.h.

Member Function Documentation

◆ capacity()

template<typename Index >
uint32_t onert::backend::train::BumpPlanner< Index >::capacity ( )
inlineoverridevirtual

Get capacity for memory planning.

Returns
The value of capacity

Implements onert::backend::basic::IMemoryPlanner< Index >.

Definition at line 65 of file MemoryPlanner.h.

65{ return _capacity; }

◆ claim()

template<typename Index >
void onert::backend::train::BumpPlanner< Index >::claim ( const Index &  ind,
size_t  size 
)
overridevirtual

Claim memory for tensor by bump way.

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

Implements onert::backend::basic::IMemoryPlanner< Index >.

Definition at line 33 of file MemoryPlanner.cc.

34{
35 basic::Block blk{_capacity, size};
36 _mem_plans[ind] = blk;
37 _capacity += size;
38
39 VERBOSE(BP_PLANNER) << "CLAIM(" << ind << "): " << blk.offset << ", " << blk.size << std::endl;
40}
#define VERBOSE(name, lv)
Definition Log.h:71
int32_t size[5]
Definition Slice.cpp:35

References onert::backend::basic::Block::offset, size, and VERBOSE.

◆ memory_plans()

template<typename Index >
MemoryPlans & onert::backend::train::BumpPlanner< Index >::memory_plans ( )
inlineoverridevirtual

Get MemoryPlans.

Returns
MemoryPlans

Implements onert::backend::basic::IMemoryPlanner< Index >.

Definition at line 70 of file MemoryPlanner.h.

70{ return _mem_plans; }

◆ release()

template<typename Index >
void onert::backend::train::BumpPlanner< Index >::release ( const Index &  ind)
overridevirtual

Release memory for tensor by bump way.

Parameters
[in]indexThe tensor index

Implements onert::backend::basic::IMemoryPlanner< Index >.

Definition at line 42 of file MemoryPlanner.cc.

43{
44 VERBOSE(BP_PLANNER) << "RELEASE(" << ind << "): "
45 << "NOTHING does" << std::endl;
46}

References VERBOSE.


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