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);
Algebra expression simplifications.
Base class for WorkspacePoolInfo and ConstantPoolInfo.
Definition: memory_pools.h:133
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
Map container of NodeRef->NodeRef in DSL graph. Map implements copy on write semantics,...
Definition: map.h:1271
This is the base class for Greedy Algorithms where the sorting is specialized in the extended classes...
Definition: greedy.h:45
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...
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.
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.
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.
GreedyBase()
Definition: greedy.h:47
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...
Abstract device memory management API.
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
Functors for tir stmts utility functions to call common functors.
Utilities for Unified Static Memory Planner.