22#ifndef __ONERT_BACKEND_BASIC_MEMORY_PLANNER_H__
23#define __ONERT_BACKEND_BASIC_MEMORY_PLANNER_H__
27#include <unordered_set>
62 uint32_t
capacity()
override {
return _capacity; }
70 uint32_t _capacity = 0;
95 uint32_t
capacity()
override {
return _capacity; }
103 uint32_t _capacity = 0;
106 std::map<uint32_t, ir::OperandIndex> _claim_table;
145 void buildMemoryPlans();
150 std::unordered_set<ir::OperandIndex> _live_operands;
153 std::multimap<uint32_t, ir::OperandIndex, std::greater<uint32_t>> _operands;
Class to plan memory by bump way.
void release(const ir::OperandIndex &) override
Release memory for operand by bump way.
void claim(const ir::OperandIndex &, size_t) override
Claim memory for operand 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.
uint32_t capacity() override
Get capacity for memory planning.
void claim(const ir::OperandIndex &, size_t) override
Claim memory for operand by firstfit way.
MemoryPlans & memory_plans() override
Get MemoryPlans.
void release(const ir::OperandIndex &) override
Release memory for operand by firstfit way.
Class to plan memory by Weighted Interval Color algorithm.
void claim(const ir::OperandIndex &, size_t) override
Claim memory for operand by WIC algorithm.
MemoryPlans & memory_plans() override
Get MemoryPlans.
uint32_t capacity() override
Get capacity for memory planning.
void release(const ir::OperandIndex &) override
Release memory for operand by WIC algorithm.
std::unordered_map< OperandIndex, T > OperandIndexMap
Interface to plan memory.
std::unordered_map< ir::OperandIndex, Block > MemoryPlans