49 #ifndef TVM_IR_TYPE_H_
50 #define TVM_IR_TYPE_H_
52 #include <tvm/ffi/cast.h>
53 #include <tvm/ffi/container/array.h>
54 #include <tvm/ffi/reflection/registry.h>
83 namespace refl = tvm::ffi::reflection;
85 refl::ObjectDef<TypeNode>().def_ro(
"span", &
TypeNode::span, refl::DefaultValue(
Span()),
86 refl::AttachFieldFlag::SEqHashIgnore());
99 class Type :
public ffi::ObjectRef {
120 namespace refl = tvm::ffi::reflection;
164 namespace refl = tvm::ffi::reflection;
165 refl::ObjectDef<PointerTypeNode>()
200 namespace refl = tvm::ffi::reflection;
239 return n && n->
fields.size() == 0;
258 namespace refl = tvm::ffi::reflection;
259 refl::ObjectDef<FuncTypeNode>()
291 namespace refl = tvm::ffi::reflection;
292 refl::ObjectDef<TensorMapTypeNode>();
Function type.
Definition: type.h:250
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("ir.FuncType", FuncTypeNode, TypeNode)
Type ret_type
The type of return value.
Definition: type.h:255
ffi::Array< Type > arg_types
type type of arguments
Definition: type.h:253
static void RegisterReflection()
Definition: type.h:257
Managed reference to FuncTypeNode.
Definition: type.h:270
FuncType(ffi::Array< Type > arg_types, Type ret_type, Span span=Span())
Constructor.
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(FuncType, Type, FuncTypeNode)
Low-level raw pointer type.
Definition: type.h:152
Type element_type
The type of the element which the pointer points to.
Definition: type.h:157
ffi::String storage_scope
The storage scope of the pointer.
Definition: type.h:161
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("ir.PointerType", PointerTypeNode, TypeNode)
static void RegisterReflection()
Definition: type.h:163
PointerType(Type element_type, ffi::String storage_scope="")
Constructor.
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(PointerType, Type, PointerTypeNode)
Primitive data types used in the low-level IR.
Definition: type.h:112
runtime::DataType dtype
The corresponding dtype field.
Definition: type.h:117
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("ir.PrimType", PrimTypeNode, TypeNode)
static void RegisterReflection()
Definition: type.h:119
PrimType(runtime::DataType dtype, Span span=Span())
Constructor.
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(PrimType, Type, PrimTypeNode)
Definition: source_map.h:111
The type of tensor map.
Definition: type.h:288
static void RegisterReflection()
Definition: type.h:290
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("ir.TensorMapType", TensorMapTypeNode, TypeNode)
Managed reference to TensorMapTypeNode.
Definition: type.h:301
TensorMapType(Span span=Span())
const TensorMapTypeNode * get() const
Definition: type.h:313
TensorMapType & operator=(TensorMapType &&)=default
TensorMapType & operator=(const TensorMapType &)=default
const TensorMapTypeNode * operator->() const
Definition: type.h:310
TensorMapType(const TensorMapType &)=default
TensorMapType(::tvm::ffi::ObjectPtr< TensorMapTypeNode > n)
Definition: type.h:305
TensorMapType(TensorMapType &&)=default
The type of tuple values.
Definition: type.h:192
TupleTypeNode()
Definition: type.h:197
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("ir.TupleType", TupleTypeNode, TypeNode)
static void RegisterReflection()
Definition: type.h:199
ffi::Array< Type > fields
The type of each field in the tuple.
Definition: type.h:195
Managed reference to TupleTypeNode.
Definition: type.h:210
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(TupleType, Type, TupleTypeNode)
TupleType(ffi::Array< Type > fields, Span span=Span())
Constructor.
static TupleType Empty()
Create an empty tuple type that constains nothing.
Type is the base type of all types.
Definition: type.h:74
static constexpr const uint32_t _type_child_slots
Definition: type.h:91
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind
Definition: type.h:89
TVM_FFI_DECLARE_OBJECT_INFO("ir.Type", TypeNode, ffi::Object)
static void RegisterReflection()
Definition: type.h:82
Span span
Span that points to the original source code. Reserved debug information.
Definition: type.h:80
Managed reference to TypeNode.
Definition: type.h:99
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(Type, ffi::ObjectRef, TypeNode)
Runtime primitive data type.
Definition: data_type.h:45
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition: analyzer.h:37
bool IsVoidType(const Type &type)
Check whether the tyep represents void.
Definition: type.h:237
Type VoidType()
Definition: type.h:231
A map from source names to source code.