24 #ifndef TVM_TIR_VAR_H_
25 #define TVM_TIR_VAR_H_
66 refl::ObjectDef<VarNode>()
137 refl::ObjectDef<SizeVarNode>();
280 refl::ObjectDef<IterVarNode>()
312 inline IterVar::operator
PrimExpr()
const {
return (*this)->var; }
319 return "ThreadIndex";
331 return "Parallelized";
355 struct std::hash<
tvm::tir::Var> {
357 return tvm::runtime::ObjectPtrHash()(
var);
362 struct std::equal_to<
tvm::tir::Var> {
364 return tvm::runtime::ObjectPtrEqual()(var_a, var_b);
Base class for other IR constructs that can be converted to PrimExpr. This is useful for the FFI to c...
Definition: expr.h:159
Managed reference to PrimExprConvertibleNode.
Definition: expr.h:172
Base node of all primitive expressions.
Definition: expr.h:95
Reference to PrimExprNode.
Definition: expr.h:129
DataType dtype() const
Definition: expr.h:143
Range container
Definition: expr.h:698
Definition: source_map.h:113
Managed reference to TypeNode.
Definition: type.h:101
Runtime primitive data type.
Definition: data_type.h:47
static DataType Int(int bits, int lanes=1)
Construct an int type.
Definition: data_type.h:274
An iteration variable representing an iteration over a one dimensional interval.
Definition: var.h:254
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind
Definition: var.h:288
Var var
The looping variable.
Definition: var.h:262
String thread_tag
additional tag on the iteration variable, set this if this is bound already to a known thread tag.
Definition: var.h:269
static constexpr const char * _type_key
Definition: var.h:287
Span span
Span that points to the original source code. Reserved debug information.
Definition: var.h:274
static void RegisterReflection()
Definition: var.h:278
PrimExpr ToPrimExpr() const final
Definition: var.h:276
Range dom
the domain of iteration, if known, can be None For the intermediate schedule node,...
Definition: var.h:260
TVM_DECLARE_FINAL_OBJECT_INFO(IterVarNode, PrimExprConvertibleNode)
IterVarType iter_type
The type of the IterVar.
Definition: var.h:264
Iteration Variable, represents an iteration over an integer interval.
Definition: var.h:298
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, PrimExprConvertible, IterVarNode)
A variable node represent a tensor index size, whose value must be non-negative.
Definition: var.h:133
static void RegisterReflection()
Definition: var.h:135
TVM_DECLARE_FINAL_OBJECT_INFO(SizeVarNode, VarNode)
static constexpr const char * _type_key
Definition: var.h:139
a named variable represents a tensor index size
Definition: var.h:144
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:171
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:146
const SizeVarNode * operator->() const
Get pointer to the internal value.
Definition: var.h:166
A variable node in the IR.
Definition: var.h:48
static void RegisterReflection()
Definition: var.h:64
static constexpr const char * _type_key
Definition: var.h:72
TVM_DECLARE_BASE_OBJECT_INFO(VarNode, PrimExprNode)
Type type_annotation
type annotation of the variable.
Definition: var.h:62
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind
Definition: var.h:71
static constexpr const uint32_t _type_child_slots
Definition: var.h:73
String name_hint
The hint to the variable name.
Definition: var.h:54
a named variable in TIR
Definition: var.h:78
const VarNode * get() const
Get pointer to the internal value.
Definition: var.h:124
Var(ObjectPtr< Object > n)
Definition: var.h:80
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:119
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.
Definition: repr_printer.h:91
Var var(std::string name_hint, DataType t=DataType::Int(32))
Construct a new Var expression.
Array< Range > Region
Definition: var.h:176
IterVarType
Type of iteration variable. Each IterVar have a specific type.
Definition: var.h:185
@ kVectorized
The loop is vectorized.
Definition: var.h:237
@ kThreadIndex
The IterVar itself is a thread-index of a fixed thread launching group. Note that this is already ass...
Definition: var.h:202
@ kUnrolled
The execution is unrolled.
Definition: var.h:233
@ kTensorized
Marks boundary of tensorization intrinsic.
Definition: var.h:245
@ kDataPar
Data parallel iteration. This normally corresponds to axis of Tensor. Allow all IterVar manipulations...
Definition: var.h:194
@ kOrdered
Serial loops with loop carry dependency, the iteration must execute in order. Cannot be re-ordered.
Definition: var.h:217
@ kCommReduce
Communicative reduction. Cannot be directly parallelized.
Definition: var.h:209
@ kParallelized
The loop is parallelized.
Definition: var.h:241
@ kOpaque
IterVar is opaque,.
Definition: var.h:227
const char * IterVarType2String(IterVarType t)
Definition: var.h:314
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:37
Definitions and helper macros for IR/AST nodes.