48 #ifndef TVM_ARITH_ITER_AFFINE_MAP_H_ 49 #define TVM_ARITH_ITER_AFFINE_MAP_H_ 70 static constexpr
const char*
_type_key =
"arith.IterMapExpr";
104 v->Visit(
"source", &source);
105 v->Visit(
"extent", &extent);
121 static constexpr
const char*
_type_key =
"arith.IterMark";
160 v->Visit(
"source", &source);
161 v->Visit(
"lower_factor", &lower_factor);
162 v->Visit(
"extent", &extent);
163 v->Visit(
"scale", &scale);
173 hash_reduce(lower_factor);
178 static constexpr
const char*
_type_key =
"arith.IterSplitExpr";
227 v->Visit(
"args", &args);
228 v->Visit(
"base", &base);
240 static constexpr
const char*
_type_key =
"arith.IterSumExpr";
283 const PrimExpr& predicate,
bool require_bijective,
296 const PrimExpr& input_pred,
bool require_bijective);
351 #endif // TVM_ARITH_ITER_AFFINE_MAP_H_ static constexpr const char * _type_key
Definition: iter_affine_map.h:70
Managed reference to IterSplitExprNode.
Definition: iter_affine_map.h:186
Fuse multiple iterators by summing them with scaling.
Definition: iter_affine_map.h:218
bool SEqualReduce(const IterSumExprNode *other, SEqualReducer equal) const
Definition: iter_affine_map.h:231
Map< Var, PrimExpr > InverseAffineIterMap(const Array< IterSumExpr > &iter_map, const Array< PrimExpr > outputs)
Apply the inverse of the affine transformation to the outputs.
void VisitAttrs(tvm::AttrVisitor *v)
Definition: iter_affine_map.h:68
Split of an iterator.
Definition: iter_affine_map.h:147
A Reducer class to reduce the structural equality result of two objects.
Definition: structural_equal.h:102
static constexpr const bool _type_has_method_shash_reduce
Definition: expr.h:56
PrimExpr extent
The extent of the iteration.
Definition: iter_affine_map.h:100
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:36
A Reducer class to reduce the structural hash value.
Definition: structural_hash.h:101
PrimExpr equal(PrimExpr a, PrimExpr b, Span span=Span())
equal
Algebra expression simplifications.
PrimExpr scale
Additional scale.
Definition: iter_affine_map.h:156
PrimExpr source
The source expression, can either be a IterSumExpr or a Var.
Definition: iter_affine_map.h:96
void VisitAttrs(tvm::AttrVisitor *v)
Definition: iter_affine_map.h:103
base class of all object containers.
Definition: object.h:165
bool SEqualReduce(const IterSplitExprNode *other, SEqualReducer equal) const
Definition: iter_affine_map.h:166
Base class of all iter map expressions.
Definition: iter_affine_map.h:65
Managed reference to IterSumExprNode.
Definition: iter_affine_map.h:248
virtual void MarkGraphNode()=0
Mark current comparison as graph node equal comparison.
Array< Array< IterMark > > SubspaceDivide(const Array< PrimExpr > &bindings, const Map< Var, Range > &input_iters, const Array< Var > &sub_iters, const PrimExpr &predicate, bool require_bijective, arith::Analyzer *analyzer)
Detect if bindings can be written as [a_0*e_0 + b_0 + c_0, a_1*e_1 + b_1, ..., a_n*e_n + b_n]...
PrimExpr lower_factor
The lower factor to split the source.
Definition: iter_affine_map.h:152
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
void VisitAttrs(tvm::AttrVisitor *v)
Definition: iter_affine_map.h:226
PrimExpr extent
The extent of the split.
Definition: iter_affine_map.h:154
Array< IterSplitExpr > args
The args to the sum.
Definition: iter_affine_map.h:221
virtual void MarkGraphNode()=0
Mark current comparison as graph node in hashing. Graph node hash will depends on the graph structure...
bool SEqualReduce(const IterMarkNode *other, SEqualReducer equal) const
Definition: iter_affine_map.h:108
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:270
static constexpr const bool _type_has_method_sequal_reduce
Definition: expr.h:55
void VisitAttrs(tvm::AttrVisitor *v)
Definition: iter_affine_map.h:159
IterMark source
The source marked iterator.
Definition: iter_affine_map.h:150
#define TVM_DEFINE_OBJECT_REF_METHODS(TypeName, ParentType, ObjectName)
Definition: object.h:706
Managed reference to IterMarkExprNode.
Definition: iter_affine_map.h:129
Array< IterSumExpr > DetectIterMap(const Array< PrimExpr > &indices, const Map< Var, Range > &input_iters, const PrimExpr &predicate, bool require_bijective, arith::Analyzer *analyzer)
Detect if indices can be written as [y_0 + c_0, y_1 + c_1, ..., y_n + c_n].
Base class of all object reference.
Definition: object.h:504
#define TVM_DEFINE_OBJECT_REF_COW_METHOD(ObjectName)
Define CopyOnWrite function in an ObjectRef.
Definition: object.h:778
Mark the source as an iterator in [0, extent).
Definition: iter_affine_map.h:90
#define TVM_DECLARE_FINAL_OBJECT_INFO(TypeName, ParentType)
helper macro to declare type information in a final class.
Definition: object.h:664
static constexpr const uint32_t _type_child_slots
Definition: iter_affine_map.h:71
TVM_DECLARE_BASE_OBJECT_INFO(IterMapExprNode, PrimExprNode)
void SHashReduce(SHashReducer hash_reduce) const
Definition: iter_affine_map.h:235
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:1235
Managed reference to IterMapExprNode.
Definition: iter_affine_map.h:79
void SHashReduce(SHashReducer hash_reduce) const
Definition: iter_affine_map.h:171
Array< PrimExpr > IterMapSimplify(const Array< PrimExpr > &indices, const Map< Var, Range > &input_iters, const PrimExpr &input_pred, bool require_bijective)
Use IterVarMap detector to rewrite and simplify the indices.
Reference to PrimExprNode.
Definition: expr.h:109
PrimExpr base
The base offset.
Definition: iter_affine_map.h:223
Analyzer that contains bunch of sub-analyzers.
Definition: analyzer.h:387
void SHashReduce(SHashReducer hash_reduce) const
Definition: iter_affine_map.h:113
Base node of all primitive expressions.
Definition: expr.h:82