tvm
|
This is the base class for Greedy Algorithms where the sorting is specialized in the extended classes based on the greedy criteria. More...
#include <greedy.h>
Public Member Functions | |
GreedyBase () | |
virtual Map< BufferInfo, PoolAllocation > | PlanMemory (const Array< BufferInfo > &buffer_info_arr)=0 |
This function should be implemented by the extended classes to sort the BufferInfo objects based on a criteria and then calling PostSortAllocation. More... | |
Protected Member Functions | |
size_t | round_up_to_byte_alignment (const size_t &non_aligned_byte_offset, const int &byte_alignment) |
Rounds up the offset to satisfy the alignement requirement. More... | |
bool | IsValidPlacement (const PoolInfo &candidate_pool, const size_t &next_offset, const size_t &size_bytes) |
A helper function check whether a offset is valid given the constraints. More... | |
PoolInfo | SelectPlacementPool (const BufferInfo &buf_info, const std::unordered_map< PoolInfo, size_t, ObjectPtrHash, ObjectPtrEqual > &pool_offsets) |
Selects a pool for placement in the given set of ordered pool candidates. More... | |
Map< BufferInfo, PoolAllocation > | PostSortAllocation (const std::vector< BufferInfo > &buffer_info_vec) |
This is the base allocation function that works on sorted BufferInfo objects based on the greedy heuristic. The sorting algorithm has to be called before calling this. More... | |
This is the base class for Greedy Algorithms where the sorting is specialized in the extended classes based on the greedy criteria.
|
inline |
|
protected |
A helper function check whether a offset is valid given the constraints.
|
pure virtual |
This function should be implemented by the extended classes to sort the BufferInfo objects based on a criteria and then calling PostSortAllocation.
|
protected |
This is the base allocation function that works on sorted BufferInfo objects based on the greedy heuristic. The sorting algorithm has to be called before calling this.
|
protected |
Rounds up the offset to satisfy the alignement requirement.
|
protected |
Selects a pool for placement in the given set of ordered pool candidates.