24 #ifndef TVM_IR_MEMORY_POOLS_H_
25 #define TVM_IR_MEMORY_POOLS_H_
111 static constexpr
const char* kTargetPoolReadWriteAccess =
"rw";
118 static constexpr
const char* kTargetPoolReadOnlyAccess =
"ro";
121 static const int kUnrestrictedPoolSizeHint = -1;
124 static const int kUnknownClockFrequency = -1;
127 static const int kUnknownReadBandwidth = -1;
130 static const int kUnknownWriteBandwidth = -1;
136 Integer clock_frequency_hz = kUnknownClockFrequency,
137 Integer read_bandwidth_bytes_per_cycle = kUnknownReadBandwidth,
138 Integer write_bandwidth_bytes_per_cycle = kUnknownWriteBandwidth,
139 Integer read_latency_cycles = 0,
Integer write_latency_cycles = 0,
206 static constexpr
const char*
_type_key =
"ir.PoolInfoProperties";
213 Integer clock_frequency_hz = kUnknownClockFrequency,
214 Integer read_bandwidth_bytes_per_cycle = kUnknownReadBandwidth,
215 Integer write_bandwidth_bytes_per_cycle = kUnknownWriteBandwidth,
216 Integer read_latency_cycles = 0,
Integer write_latency_cycles = 0,
232 static constexpr
const char*
_type_key =
"ir.WorkspacePoolInfo";
256 v->Visit(
"data", &
data);
270 static constexpr
const char*
_type_key =
"ir.ConstantInfo";
303 static constexpr
const char*
_type_key =
"ir.ConstantPoolInfo";
327 static constexpr
const char*
_type_key =
"ir.WorkspaceMemoryPools";
349 static constexpr
const char*
_type_key =
"ir.ConstantMemoryPools";
Visitor class to get the attributes of an AST/IR node. The content is going to be called for each fie...
Definition: reflection.h:52
Boolean constant.
Definition: expr.h:597
Definition: memory_pools.h:276
TVM_DEFINE_MUTABLE_OBJECT_REF_METHODS(ConstantInfo, ObjectRef, ConstantInfoNode)
ConstantInfo(const struct ::TVMConstantInfo *data)
ConstantInfo(String name, Integer byte_offset, runtime::NDArray data)
Definition: memory_pools.h:353
ConstantMemoryPools(Array< ConstantPoolInfo > pools)
TVM_DEFINE_MUTABLE_OBJECT_REF_METHODS(ConstantMemoryPools, ObjectRef, ConstantMemoryPoolsNode)
Definition: memory_pools.h:307
TVM_DEFINE_MUTABLE_OBJECT_REF_METHODS(ConstantPoolInfo, PoolInfo, ConstantPoolInfoNode)
ConstantPoolInfo(String pool_name, Array< Target > targets, Array< ConstantInfo > constant_info_array, PoolInfoProperties properties=PoolInfoProperties(kUnrestrictedPoolSizeHint))
Container of constant int that adds more constructors.
Definition: expr.h:632
Definition: memory_pools.h:210
PoolInfoProperties(Integer size_hint_bytes, Integer clock_frequency_hz=kUnknownClockFrequency, Integer read_bandwidth_bytes_per_cycle=kUnknownReadBandwidth, Integer write_bandwidth_bytes_per_cycle=kUnknownWriteBandwidth, Integer read_latency_cycles=0, Integer write_latency_cycles=0, Map< Target, Integer > target_burst_bytes={}, Bool is_internal=Bool(false))
TVM_DEFINE_MUTABLE_OBJECT_REF_METHODS(PoolInfoProperties, ObjectRef, PoolInfoPropertiesNode)
Base class for WorkspacePoolInfo and ConstantPoolInfo.
Definition: memory_pools.h:133
PoolInfo(String pool_name, Integer size_hint_bytes=kUnrestrictedPoolSizeHint, Integer clock_frequency_hz=kUnknownClockFrequency, Integer read_bandwidth_bytes_per_cycle=kUnknownReadBandwidth, Integer write_bandwidth_bytes_per_cycle=kUnknownWriteBandwidth, Integer read_latency_cycles=0, Integer write_latency_cycles=0, Map< Target, Integer > target_burst_bytes={}, Bool is_internal=Bool(false))
TVM_DEFINE_OBJECT_REF_METHODS(PoolInfo, ObjectRef, PoolInfoNode)
A Reducer class to reduce the structural equality result of two objects.
Definition: structural_equal.h:137
A Reducer class to reduce the structural hash value.
Definition: structural_hash.h:121
Definition: memory_pools.h:331
WorkspaceMemoryPools(Array< PoolInfo > pools)
TVM_DEFINE_MUTABLE_OBJECT_REF_METHODS(WorkspaceMemoryPools, ObjectRef, WorkspaceMemoryPoolsNode)
Definition: memory_pools.h:236
WorkspacePoolInfo(String pool_name, Array< Target > targets, PoolInfoProperties properties=PoolInfoProperties(kUnrestrictedPoolSizeHint))
TVM_DEFINE_MUTABLE_OBJECT_REF_METHODS(WorkspacePoolInfo, PoolInfo, WorkspacePoolInfoNode)
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
Managed NDArray. The array is backed by reference counted blocks.
Definition: ndarray.h:51
Base class of all object reference.
Definition: object.h:519
base class of all object containers.
Definition: object.h:171
Reference to string objects.
Definition: string.h:98
Box< bool > Bool
Boxed version of C++ bool.
Definition: boxed_primitive.h:121
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
PrimExpr equal(PrimExpr a, PrimExpr b, Span span=Span())
equal
This file defines the TVM global function registry.
Describes one constant argument to run_model.
Definition: metadata_types.h:94
Definition: memory_pools.h:248
String name_hint
Definition: memory_pools.h:249
void VisitAttrs(tvm::AttrVisitor *v)
Definition: memory_pools.h:253
bool SEqualReduce(const ConstantInfoNode *other, SEqualReducer equal) const
Definition: memory_pools.h:259
runtime::NDArray data
Definition: memory_pools.h:251
void SHashReduce(SHashReducer hash_reduce) const
Definition: memory_pools.h:264
TVM_DECLARE_FINAL_OBJECT_INFO(ConstantInfoNode, Object)
static constexpr bool _type_has_method_sequal_reduce
Definition: memory_pools.h:271
static constexpr const char * _type_key
Definition: memory_pools.h:270
static constexpr bool _type_has_method_shash_reduce
Definition: memory_pools.h:272
Integer byte_offset
Definition: memory_pools.h:250
Definition: memory_pools.h:338
bool SEqualReduce(const ConstantMemoryPoolsNode *other, SEqualReducer equal) const
Definition: memory_pools.h:343
static constexpr const char * _type_key
Definition: memory_pools.h:349
Array< ConstantPoolInfo > pools
Definition: memory_pools.h:339
void VisitAttrs(tvm::AttrVisitor *v)
Definition: memory_pools.h:341
void SHashReduce(SHashReducer hash_reduce) const
Definition: memory_pools.h:347
TVM_DECLARE_FINAL_OBJECT_INFO(ConstantMemoryPoolsNode, Object)
Definition: memory_pools.h:285
void VisitAttrs(tvm::AttrVisitor *v)
Definition: memory_pools.h:288
TVM_DECLARE_FINAL_OBJECT_INFO(ConstantPoolInfoNode, PoolInfoNode)
Array< ConstantInfo > constant_info_array
Definition: memory_pools.h:286
bool SEqualReduce(const ConstantPoolInfoNode *other, SEqualReducer equal) const
Definition: memory_pools.h:293
static constexpr const char * _type_key
Definition: memory_pools.h:303
void SHashReduce(SHashReducer hash_reduce) const
Definition: memory_pools.h:298
Describes a pool of memory accessible by one or more targets.
Definition: memory_pools.h:36
Integer read_bandwidth_bytes_per_cycle
The read bandwidth in bytes/cycle.
Definition: memory_pools.h:48
Integer read_latency_cycles
The read latency in cycles.
Definition: memory_pools.h:52
String pool_name
The name of the memory pool.
Definition: memory_pools.h:39
Integer write_bandwidth_bytes_per_cycle
The write bandwidth in bytes/cycle.
Definition: memory_pools.h:50
static constexpr const char * _type_key
Definition: memory_pools.h:102
Integer write_latency_cycles
The write latency in cycles.
Definition: memory_pools.h:54
Array< Target > targets
The targets linked to the pool.
Definition: memory_pools.h:64
Integer clock_frequency_hz
The clock frequency of the memory in Hz.
Definition: memory_pools.h:46
Map< Target, Integer > target_burst_bytes
The burst length in bytes for each Target.
Definition: memory_pools.h:56
void SHashReduce(SHashReducer hash_reduce) const
Definition: memory_pools.h:90
TVM_DECLARE_BASE_OBJECT_INFO(PoolInfoNode, Object)
Integer size_hint_bytes
The expected size hint to be used by the allocator. The size_hint_bytes is set to kUnrestrictedPoolSi...
Definition: memory_pools.h:44
void VisitAttrs(tvm::AttrVisitor *v)
Definition: memory_pools.h:66
bool is_internal
Whether pool is internally generated. The internal pools will be generated as part of the entry point...
Definition: memory_pools.h:61
bool SEqualReduce(const PoolInfoNode *other, SEqualReducer equal) const
Definition: memory_pools.h:79
Describes a pool of memory properties.
Definition: memory_pools.h:149
Integer write_latency_cycles
The write latency in cycles.
Definition: memory_pools.h:164
static constexpr const char * _type_key
Definition: memory_pools.h:206
Integer write_bandwidth_bytes_per_cycle
The write bandwidth in bytes/cycle.
Definition: memory_pools.h:160
TVM_DECLARE_FINAL_OBJECT_INFO(PoolInfoPropertiesNode, Object)
void SHashReduce(SHashReducer hash_reduce) const
Definition: memory_pools.h:195
Map< Target, Integer > target_burst_bytes
The burst length in bytes for each Target.
Definition: memory_pools.h:166
bool is_internal
Whether pool is internally generated. The internal pools will be generated as part of the entry point...
Definition: memory_pools.h:171
bool SEqualReduce(const PoolInfoPropertiesNode *other, SEqualReducer equal) const
Definition: memory_pools.h:184
Integer clock_frequency_hz
The clock frequency of the memory in Hz.
Definition: memory_pools.h:156
Integer read_latency_cycles
The read latency in cycles.
Definition: memory_pools.h:162
Integer size_hint_bytes
The expected size hint to be used by the allocator. The size_hint_bytes is set to kUnrestrictedPoolSi...
Definition: memory_pools.h:154
Integer read_bandwidth_bytes_per_cycle
The read bandwidth in bytes/cycle.
Definition: memory_pools.h:158
void VisitAttrs(tvm::AttrVisitor *v)
Definition: memory_pools.h:173
Definition: memory_pools.h:316
void VisitAttrs(tvm::AttrVisitor *v)
Definition: memory_pools.h:319
static constexpr const char * _type_key
Definition: memory_pools.h:327
Array< PoolInfo > pools
Definition: memory_pools.h:317
bool SEqualReduce(const WorkspaceMemoryPoolsNode *other, SEqualReducer equal) const
Definition: memory_pools.h:321
void SHashReduce(SHashReducer hash_reduce) const
Definition: memory_pools.h:325
TVM_DECLARE_FINAL_OBJECT_INFO(WorkspaceMemoryPoolsNode, Object)
Definition: memory_pools.h:223
static constexpr const char * _type_key
Definition: memory_pools.h:232
void VisitAttrs(tvm::AttrVisitor *v)
Definition: memory_pools.h:224
TVM_DECLARE_FINAL_OBJECT_INFO(WorkspacePoolInfoNode, PoolInfoNode)
void SHashReduce(SHashReducer hash_reduce) const
Definition: memory_pools.h:230
bool SEqualReduce(const WorkspacePoolInfoNode *other, SEqualReducer equal) const
Definition: memory_pools.h:226
Compilation target object.