tvm
|
IR/AST nodes for the unified type system in TVM. More...
#include <tvm/ir/source_map.h>
#include <tvm/node/node.h>
#include <tvm/runtime/container/array.h>
#include <tvm/runtime/data_type.h>
#include <tvm/runtime/object.h>
#include <string>
Go to the source code of this file.
Classes | |
class | tvm::TypeNode |
Type is the base type of all types. More... | |
class | tvm::Type |
Managed reference to TypeNode. More... | |
class | tvm::PrimTypeNode |
Primitive data types used in the low-level IR. More... | |
class | tvm::PrimType |
class | tvm::PointerTypeNode |
Low-level raw pointer type. More... | |
class | tvm::PointerType |
class | tvm::TupleTypeNode |
The type of tuple values. More... | |
class | tvm::TupleType |
Managed reference to TupleTypeNode. More... | |
class | tvm::FuncTypeNode |
Function type. More... | |
class | tvm::FuncType |
Managed reference to FuncTypeNode. More... | |
Namespaces | |
tvm | |
Performance counters for profiling via the PAPI library. | |
Functions | |
Type | tvm::VoidType () |
bool | tvm::IsVoidType (const Type &type) |
Check whether the tyep represents void. More... | |
IR/AST nodes for the unified type system in TVM.
We use TVM's type system as the unified type system throughout the stack.
This file contains types that are common across IR variants.
Besides Type, we also store a dtype field in the low-level PrimExpr. runtime::DataType(dtype) provides coarse grained type information during compile time and runtime. It is eagerly built in low-level expression construction and can be used for quick type checking in the low-level IR. For example, when an Expr's dtype is int32, we know for sure that its type is also int32.
On the other hand, Type provides more fine grained information. For example, a low level expression can have DataType::Handle() as its dtype and MemRef[float32] as its type. Types are usually lazily constructed via type checking, so they may not readily be available during IR construction.
The unified Type serves as a common bridge across IR dialects. For example, we require all the functions to have a type signature, which allow us to build cross dialect function calls.