24 #ifndef TVM_TIR_VAR_H_
25 #define TVM_TIR_VAR_H_
65 v->Visit(
"dtype", &
dtype);
68 v->Visit(
"span", &
span);
74 return equal.FreeVarEqualImpl(
this, other);
284 v->Visit(
"dom", &
dom);
285 v->Visit(
"var", &
var);
288 v->Visit(
"span", &
span);
329 inline IterVar::operator
PrimExpr()
const {
return (*this)->var; }
336 return "ThreadIndex";
348 return "Parallelized";
372 struct std::hash<
tvm::tir::Var> {
379 struct std::equal_to<
tvm::tir::Var> {
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
Span span
Span that points to the original source code. Reserved debug information.
Definition: expr.h:56
Base node of all primitive expressions.
Definition: expr.h:86
DataType dtype
The runtime data type of the primitive expression.
Definition: expr.h:102
Reference to PrimExprNode.
Definition: expr.h:115
DataType dtype() const
Definition: expr.h:129
Range container
Definition: expr.h:687
A Reducer class to reduce the structural equality result of two objects.
Definition: structural_equal.h:135
A Reducer class to reduce the structural hash value.
Definition: structural_hash.h:121
void FreeVarHashImpl(const runtime::Object *var) const
Implementation for hash for a free var.
Definition: structural_hash.h:203
void DefHash(const ObjectRef &key) const
Push hash of key to the current sequence of hash values.
Definition: structural_hash.h:198
Definition: source_map.h:120
Managed reference to TypeNode.
Definition: type.h:93
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
Runtime primitive data type.
Definition: data_type.h:43
static DataType Int(int bits, int lanes=1)
Construct an int type.
Definition: data_type.h:227
A custom smart pointer for Object.
Definition: object.h:363
Base class of all object reference.
Definition: object.h:520
ObjectPtr< Object > data_
Internal pointer that backs the reference.
Definition: object.h:606
base class of all object containers.
Definition: object.h:172
Reference to string objects.
Definition: string.h:97
An iteration variable representing an iteration over a one dimensional interval.
Definition: var.h:261
Var var
The looping variable.
Definition: var.h:269
String thread_tag
additional tag on the iteration variable, set this if this is bound already to a known thread tag.
Definition: var.h:276
void SHashReduce(SHashReducer hash_reduce) const
Definition: var.h:296
TVM_DECLARE_FINAL_OBJECT_INFO(IterVarNode, Object)
static constexpr const bool _type_has_method_sequal_reduce
Definition: var.h:304
bool SEqualReduce(const IterVarNode *other, SEqualReducer equal) const
Definition: var.h:291
static constexpr const char * _type_key
Definition: var.h:303
Span span
Span that points to the original source code. Reserved debug information.
Definition: var.h:281
Range dom
the domain of iteration, if known, can be None For the intermediate schedule node,...
Definition: var.h:267
static constexpr const bool _type_has_method_shash_reduce
Definition: var.h:305
void VisitAttrs(AttrVisitor *v)
Definition: var.h:283
IterVarType iter_type
The type of the IterVar.
Definition: var.h:271
Iteration Variable, represents an iteration over an integer interval.
Definition: var.h:315
IterVar(Range dom, Var var, IterVarType iter_type, String thread_tag="", Span span=Span())
TVM_DEFINE_OBJECT_REF_COW_METHOD(IterVarNode)
TVM_DEFINE_OBJECT_REF_METHODS(IterVar, ObjectRef, IterVarNode)
A variable node represent a tensor index size, whose value must be non-negative.
Definition: var.h:144
TVM_DECLARE_FINAL_OBJECT_INFO(SizeVarNode, VarNode)
static constexpr const char * _type_key
Definition: var.h:146
a named variable represents a tensor index size
Definition: var.h:151
SizeVar(String name_hint="s", DataType t=DataType::Int(32), Span span=Span())
constructor
const SizeVarNode * get() const
Get pointer to the internal value.
Definition: var.h:178
SizeVar(String name_hint, Type type_annotation, Span span=Span())
Constructor which provides a more detailed type annotation.
SizeVar(ObjectPtr< Object > n)
Definition: var.h:153
const SizeVarNode * operator->() const
Get pointer to the internal value.
Definition: var.h:173
A variable node in the IR.
Definition: var.h:48
static constexpr const char * _type_key
Definition: var.h:83
TVM_DECLARE_BASE_OBJECT_INFO(VarNode, PrimExprNode)
void SHashReduce(SHashReducer hash_reduce) const
Definition: var.h:77
void VisitAttrs(AttrVisitor *v)
Definition: var.h:64
Type type_annotation
type annotation of the variable.
Definition: var.h:62
bool SEqualReduce(const VarNode *other, SEqualReducer equal) const
Definition: var.h:71
static constexpr const uint32_t _type_child_slots
Definition: var.h:84
String name_hint
The hint to the variable name.
Definition: var.h:54
a named variable in TIR
Definition: var.h:89
const VarNode * get() const
Get pointer to the internal value.
Definition: var.h:135
Var(ObjectPtr< Object > n)
Definition: var.h:91
Var(String name_hint, Type type_annotation, Span span=Span())
Constructor which provides a more detailed type annotation.
const VarNode * operator->() const
Get pointer to the internal value.
Definition: var.h:130
Var copy_with_name(const String &name) const
Make a new copy of var with same type, but a different nam.
Var(String name_hint="v", DataType dtype=DataType::Int(32), Span span=Span())
Constructor.
Var copy_with_suffix(const String &suffix) const
Make a new copy of var with same type, append suffix.
Var copy_with_dtype(DataType dtype) const
Make a new copy of the variable with specified dtype.
Var var(std::string name_hint, DataType t=DataType::Int(32))
Construct a new Var expression.
IterVarType
Type of iteration variable. Each IterVar have a specific type.
Definition: var.h:192
@ kVectorized
The loop is vectorized.
Definition: var.h:244
@ kThreadIndex
The IterVar itself is a thread-index of a fixed thread launching group. Note that this is already ass...
Definition: var.h:209
@ kUnrolled
The execution is unrolled.
Definition: var.h:240
@ kTensorized
Marks boundary of tensorization intrinsic.
Definition: var.h:252
@ kDataPar
Data parallel iteration. This normally corresponds to axis of Tensor. Allow all IterVar manipulations...
Definition: var.h:201
@ kOrdered
Serial loops with loop carry dependency, the iteration must execute in order. Cannot be re-ordered.
Definition: var.h:224
@ kCommReduce
Communicative reduction. Cannot be directly parallelized.
Definition: var.h:216
@ kParallelized
The loop is parallelized.
Definition: var.h:248
@ kOpaque
IterVar is opaque,.
Definition: var.h:234
const char * IterVarType2String(IterVarType t)
Definition: var.h:331
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:36
PrimExpr equal(PrimExpr a, PrimExpr b, Span span=Span())
equal
Definitions and helper macros for IR/AST nodes.
ObjectRef equal functor.
Definition: object.h:666
ObjectRef hash functor.
Definition: object.h:656