22#ifndef __ONERT_BACKEND_TRAIN_MEMORY_PLANNER_H__
23#define __ONERT_BACKEND_TRAIN_MEMORY_PLANNER_H__
31#include <unordered_set>
55 void claim(
const Index &,
size_t)
override;
60 void release(
const Index &)
override;
65 uint32_t
capacity()
override {
return _capacity; }
73 uint32_t _capacity = 0;
74 MemoryPlans _mem_plans;
91 void claim(
const Index &,
size_t)
override;
96 void release(
const Index &)
override;
109 uint32_t _capacity = 0;
110 MemoryPlans _mem_plans;
112 std::map<uint32_t, Index> _claim_table;
131 void claim(
const Index &,
size_t)
override;
136 void release(
const Index &)
override;
154 void buildMemoryPlans();
158 MemoryPlans _mem_plans;
159 std::unordered_set<Index> _live_indices;
160 std::unordered_map<Index, std::vector<Index>> _interference_graph;
162 std::multimap<uint32_t, Index, std::greater<uint32_t>> _indices;
Class to plan memory by bump way.
void release(const Index &) override
Release memory for tensor by bump way.
void claim(const Index &, size_t) override
Claim memory for tensor by bump way.
MemoryPlans & memory_plans() override
Get MemoryPlans.
uint32_t capacity() override
Get capacity for memory planning.
Class to plan memory by firstfit way.
void claim(const Index &, size_t) override
Claim memory for tensor by firstfit way.
void release(const Index &) override
Release memory for tensor by firstfit way.
MemoryPlans & memory_plans() override
Get MemoryPlans.
uint32_t capacity() override
Get capacity for memory planning.
Class to plan memory by Weighted Interval Color algorithm.
void release(const Index &) override
Release memory for tensor by WIC algorithm.
MemoryPlans & memory_plans() override
Get MemoryPlans.
uint32_t capacity() override
Get capacity for memory planning.
void claim(const Index &, size_t) override
Claim memory for tensor by WIC algorithm.
Interface to plan memory.
std::unordered_map< Index, Block > MemoryPlans