24 #ifndef TVM_IR_MEMORY_POOLS_H_ 25 #define TVM_IR_MEMORY_POOLS_H_ 67 v->Visit(
"pool_name", &pool_name);
68 v->Visit(
"targets", &targets);
69 v->Visit(
"size_hint_bytes", &size_hint_bytes);
70 v->Visit(
"clock_frequency_hz", &clock_frequency_hz);
71 v->Visit(
"read_bandwidth_bytes_per_cycle", &read_bandwidth_bytes_per_cycle);
72 v->Visit(
"write_bandwidth_bytes_per_cycle", &write_bandwidth_bytes_per_cycle);
73 v->Visit(
"read_latency_cycles", &read_latency_cycles);
74 v->Visit(
"write_latency_cycles", &write_latency_cycles);
75 v->Visit(
"target_burst_bytes", &target_burst_bytes);
76 v->Visit(
"is_internal", &is_internal);
91 hash_reduce(pool_name);
92 hash_reduce(size_hint_bytes);
93 hash_reduce(clock_frequency_hz);
94 hash_reduce(read_bandwidth_bytes_per_cycle);
95 hash_reduce(write_bandwidth_bytes_per_cycle);
96 hash_reduce(read_latency_cycles);
97 hash_reduce(write_latency_cycles);
98 hash_reduce(target_burst_bytes);
99 hash_reduce(is_internal);
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;
174 v->Visit(
"size_hint_bytes", &size_hint_bytes);
175 v->Visit(
"clock_frequency_hz", &clock_frequency_hz);
176 v->Visit(
"read_bandwidth_bytes_per_cycle", &read_bandwidth_bytes_per_cycle);
177 v->Visit(
"write_bandwidth_bytes_per_cycle", &write_bandwidth_bytes_per_cycle);
178 v->Visit(
"read_latency_cycles", &read_latency_cycles);
179 v->Visit(
"write_latency_cycles", &write_latency_cycles);
181 v->Visit(
"is_internal", &is_internal);
196 hash_reduce(size_hint_bytes);
197 hash_reduce(clock_frequency_hz);
198 hash_reduce(read_bandwidth_bytes_per_cycle);
199 hash_reduce(write_bandwidth_bytes_per_cycle);
200 hash_reduce(read_latency_cycles);
201 hash_reduce(write_latency_cycles);
203 hash_reduce(is_internal);
206 static constexpr
const char*
_type_key =
"ir.PoolInfoProperties";
232 static constexpr
const char*
_type_key =
"ir.WorkspacePoolInfo";
254 v->Visit(
"name_hint", &name_hint);
255 v->Visit(
"byte_offset", &byte_offset);
256 v->Visit(
"data", &data);
265 hash_reduce(name_hint);
266 hash_reduce(byte_offset);
270 static constexpr
const char*
_type_key =
"ir.ConstantInfo";
278 TVM_DLL
ConstantInfo(
const struct ::TVMConstantInfo* data);
290 v->Visit(
"constant_info_array", &constant_info_array);
300 hash_reduce(constant_info_array);
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";
361 #endif // TVM_IR_MEMORY_POOLS_H_ Definition: memory_pools.h:331
Integer read_latency_cycles
The read latency in cycles.
Definition: memory_pools.h:162
Boolean constant.
Definition: expr.h:587
Definition: memory_pools.h:236
void SHashReduce(SHashReducer hash_reduce) const
Definition: memory_pools.h:325
String name_hint
Definition: memory_pools.h:249
TVM_DECLARE_BASE_OBJECT_INFO(PoolInfoNode, Object)
A Reducer class to reduce the structural equality result of two objects.
Definition: structural_equal.h:124
void VisitAttrs(tvm::AttrVisitor *v)
Definition: memory_pools.h:319
Integer write_bandwidth_bytes_per_cycle
The write bandwidth in bytes/cycle.
Definition: memory_pools.h:50
void VisitAttrs(tvm::AttrVisitor *v)
Definition: memory_pools.h:253
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
A Reducer class to reduce the structural hash value.
Definition: structural_hash.h:110
void VisitAttrs(tvm::AttrVisitor *v)
Definition: memory_pools.h:288
void VisitAttrs(tvm::AttrVisitor *v)
Definition: memory_pools.h:173
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
PrimExpr equal(PrimExpr a, PrimExpr b, Span span=Span())
equal
Integer write_latency_cycles
The write latency in cycles.
Definition: memory_pools.h:164
Base class for WorkspacePoolInfo and ConstantPoolInfo.
Definition: memory_pools.h:133
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
Integer write_bandwidth_bytes_per_cycle
The write bandwidth in bytes/cycle.
Definition: memory_pools.h:160
Definition: memory_pools.h:276
Integer read_latency_cycles
The read latency in cycles.
Definition: memory_pools.h:52
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
Integer read_bandwidth_bytes_per_cycle
The read bandwidth in bytes/cycle.
Definition: memory_pools.h:48
base class of all object containers.
Definition: object.h:167
Map< Target, Integer > target_burst_bytes
The burst length in bytes for each Target.
Definition: memory_pools.h:56
Managed NDArray. The array is backed by reference counted blocks.
Definition: ndarray.h:51
Map< Target, Integer > target_burst_bytes
The burst length in bytes for each Target.
Definition: memory_pools.h:166
Integer clock_frequency_hz
The clock frequency of the memory in Hz.
Definition: memory_pools.h:46
#define TVM_DEFINE_MUTABLE_OBJECT_REF_METHODS(TypeName, ParentType, ObjectName)
Definition: object.h:744
bool SEqualReduce(const WorkspaceMemoryPoolsNode *other, SEqualReducer equal) const
Definition: memory_pools.h:321
static constexpr const char * _type_key
Definition: memory_pools.h:102
Array< Target > targets
The targets linked to the pool.
Definition: memory_pools.h:64
Definition: memory_pools.h:248
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
Array< ConstantPoolInfo > pools
Definition: memory_pools.h:339
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:171
Array< PoolInfo > pools
Definition: memory_pools.h:317
bool SEqualReduce(const ConstantPoolInfoNode *other, SEqualReducer equal) const
Definition: memory_pools.h:293
void VisitAttrs(tvm::AttrVisitor *v)
Definition: memory_pools.h:224
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
String pool_name
The name of the memory pool.
Definition: memory_pools.h:39
Reference to string objects.
Definition: string.h:98
bool SEqualReduce(const PoolInfoPropertiesNode *other, SEqualReducer equal) const
Definition: memory_pools.h:184
void SHashReduce(SHashReducer hash_reduce) const
Definition: memory_pools.h:90
#define TVM_DEFINE_OBJECT_REF_METHODS(TypeName, ParentType, ObjectName)
Definition: object.h:713
Integer write_latency_cycles
The write latency in cycles.
Definition: memory_pools.h:54
Definition: memory_pools.h:353
runtime::NDArray data
Definition: memory_pools.h:251
Base class of all object reference.
Definition: object.h:511
void SHashReduce(SHashReducer hash_reduce) const
Definition: memory_pools.h:264
void SHashReduce(SHashReducer hash_reduce) const
Definition: memory_pools.h:195
Definition: memory_pools.h:307
Integer clock_frequency_hz
The clock frequency of the memory in Hz.
Definition: memory_pools.h:156
Describes one constant argument to run_model.
Definition: metadata_types.h:94
#define TVM_DECLARE_FINAL_OBJECT_INFO(TypeName, ParentType)
helper macro to declare type information in a final class.
Definition: object.h:671
Integer byte_offset
Definition: memory_pools.h:250
bool SEqualReduce(const WorkspacePoolInfoNode *other, SEqualReducer equal) const
Definition: memory_pools.h:226
Integer read_bandwidth_bytes_per_cycle
The read bandwidth in bytes/cycle.
Definition: memory_pools.h:158
bool SEqualReduce(const PoolInfoNode *other, SEqualReducer equal) const
Definition: memory_pools.h:79
Compilation target object.
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
void SHashReduce(SHashReducer hash_reduce) const
Definition: memory_pools.h:230
static constexpr bool _type_has_method_shash_reduce
Definition: object.h:234
bool SEqualReduce(const ConstantInfoNode *other, SEqualReducer equal) const
Definition: memory_pools.h:259
Definition: memory_pools.h:210
void VisitAttrs(tvm::AttrVisitor *v)
Definition: memory_pools.h:341
Definition: memory_pools.h:285
Definition: memory_pools.h:338
Describes a pool of memory accessible by one or more targets.
Definition: memory_pools.h:36
bool SEqualReduce(const ConstantMemoryPoolsNode *other, SEqualReducer equal) const
Definition: memory_pools.h:343
Describes a pool of memory properties.
Definition: memory_pools.h:149
void SHashReduce(SHashReducer hash_reduce) const
Definition: memory_pools.h:347
Definition: memory_pools.h:316
static constexpr bool _type_has_method_sequal_reduce
Definition: object.h:233
Array< ConstantInfo > constant_info_array
Definition: memory_pools.h:286
void SHashReduce(SHashReducer hash_reduce) const
Definition: memory_pools.h:298
This file defines the TVM global function registry.
Definition: memory_pools.h:223
Container of constant int that adds more constructors.
Definition: expr.h:622