33 #include <unordered_map> 59 const int& byte_alignment);
65 const size_t& size_bytes);
72 const std::unordered_map<PoolInfo, size_t, ObjectPtrHash, ObjectPtrEqual>& pool_offsets);
79 const std::vector<BufferInfo>& buffer_info_vec);
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...
This is the base class for Greedy Algorithms where the sorting is specialized in the extended classes...
Definition: greedy.h:45
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
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 heur...
Algebra expression simplifications.
Base class for WorkspacePoolInfo and ConstantPoolInfo.
Definition: memory_pools.h:133
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.
Functors for tir stmts utility functions to call common functors.
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
Abstract device memory management API.
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.
Utilities for Unified Static Memory Planner.
Map container of NodeRef->NodeRef in DSL graph. Map implements copy on write semantics, which means map is mutable but copy will happen when array is referenced in more than two places.
Definition: map.h:1271
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.
GreedyBase()
Definition: greedy.h:47