tvm
|
runtime implementation for LibTorch/TorchScript. More...
Namespaces | |
arith | |
namespace of arithmetic analysis. | |
attr | |
Generic attribute names that can be attached to any function. | |
auto_scheduler | |
codegen | |
namespace for target translation and codegen. | |
detail | |
instrument | |
meta_schedule | |
relay | |
Relay: a high level functional IR for TVM. | |
runtime | |
script | |
support | |
te | |
Tensor expression language DSL. | |
tir | |
topi | |
transform | |
Classes | |
class | ConstructorNode |
ADT constructor. Constructors compare by pointer equality. More... | |
class | Constructor |
Managed reference to ConstructorNode. More... | |
class | TypeDataNode |
TypeData container node. More... | |
class | TypeData |
Stores all data for an Algebraic Data Type (ADT). More... | |
class | AffineTypeNode |
AffineType representation. More... | |
class | AffineType |
Managed reference to AffineTypeNode. More... | |
class | TensorAffineTypeNode |
TensorAffineType representation. More... | |
class | TensorAffineType |
Managed reference to AffineTypes. More... | |
class | TupleAffineTypeNode |
TupleAffineType representation. More... | |
class | TupleAffineType |
Managed reference to TupleAffineTypes. More... | |
struct | AttrError |
Error thrown during attribute checking. More... | |
class | AttrFieldInfoNode |
Information about attribute fields in string representations. More... | |
class | AttrFieldInfo |
AttrFieldInfo. More... | |
class | BaseAttrsNode |
Base class of all attribute class. More... | |
class | Attrs |
Managed reference to BaseAttrsNode. More... | |
class | DictAttrsNode |
Specialized attribute type that is backed by a map. The DictAttrsNode implements the Attrs behavior, its fields are directly accessible via object.field_name like other normal nodes. More... | |
class | DictAttrs |
Managed reference to DictAttrsNode. More... | |
class | AttrsNode |
The base class of the all the Use "curiously recurring template pattern". More... | |
class | DiagnosticNode |
A compiler diagnostic message. More... | |
class | Diagnostic |
class | DiagnosticBuilder |
A wrapper around std::stringstream to build a diagnostic. More... | |
class | DiagnosticRendererNode |
Display diagnostics in a given display format. More... | |
class | DiagnosticRenderer |
class | DiagnosticContextNode |
class | DiagnosticContext |
class | EnvFuncNode |
A serializable function backed by TVM's global environment. More... | |
class | EnvFunc |
Managed reference to EnvFuncNode. More... | |
class | TypedEnvFunc |
Please refer to TypedEnvFunc<R(Args..)>. More... | |
class | TypedEnvFunc< R(Args...)> |
A typed version of EnvFunc. It is backed by a GlobalFuncNode internally. More... | |
class | BaseExprNode |
Base type of all the expressions. More... | |
class | BaseExpr |
Managed reference to BaseExprNode. More... | |
class | PrimExprNode |
Base node of all primitive expressions. More... | |
class | PrimExpr |
Reference to PrimExprNode. More... | |
class | RelayExprNode |
Base node of all non-primitive expressions. More... | |
class | RelayExpr |
Managed reference to RelayExprNode. More... | |
class | GlobalVarNode |
Global variable that lives in the top-level module. More... | |
class | GlobalVar |
Managed reference to GlobalVarNode. More... | |
class | IntImmNode |
Constant integer literals in the program. More... | |
class | IntImm |
Managed reference class to IntImmNode. More... | |
class | FloatImmNode |
Constant floating point literals in the program. More... | |
class | FloatImm |
Managed reference class to FloatImmNode. More... | |
class | Bool |
Boolean constant. More... | |
class | Integer |
Container of constant int that adds more constructors. More... | |
class | RangeNode |
range over one dimension More... | |
class | Range |
Range container More... | |
class | BaseFuncNode |
Base node of all functions. More... | |
class | BaseFunc |
Managed reference to BaseFuncNode. More... | |
class | GlobalVarSupplyNode |
GlobalVarSupply can be used to generate unique GlobalVars. More... | |
class | GlobalVarSupply |
Managed reference class to GlobalVarSupplyNode. More... | |
struct | PoolInfoNode |
Describes a pool of memory accessible by one or more targets. More... | |
class | PoolInfo |
Base class for WorkspacePoolInfo and ConstantPoolInfo. More... | |
struct | PoolInfoPropertiesNode |
Describes a pool of memory properties. More... | |
class | PoolInfoProperties |
struct | WorkspacePoolInfoNode |
class | WorkspacePoolInfo |
struct | ConstantInfoNode |
class | ConstantInfo |
struct | ConstantPoolInfoNode |
class | ConstantPoolInfo |
struct | WorkspaceMemoryPoolsNode |
class | WorkspaceMemoryPools |
struct | ConstantMemoryPoolsNode |
class | ConstantMemoryPools |
class | IRModuleNode |
IRModule that holds functions and type definitions. More... | |
class | IRModule |
Managed reference class to IRModuleNode. More... | |
class | NameSupplyNode |
NameSupply can be used to generate unique names. More... | |
class | NameSupply |
Managed reference class to NameSupplyNode. More... | |
class | OpAttrMap |
Map<Op,ValueType> used to store meta-information about Op. More... | |
class | OpNode |
Primitive Op(builtin intrinsics) More... | |
class | Op |
Managed reference class to OpNode. More... | |
class | OpRegEntry |
Helper structure to register operators. More... | |
class | SIBuilder |
Source Information Builder, SIBuilder provides helper APIs for filling spans, particularly useful for one-to-many, many-to-one and many-to-many IR transformations. More... | |
class | SourceNameNode |
The name of a source fragment. More... | |
class | SourceName |
The source name of a file span. More... | |
class | SpanNode |
Stores locations in frontend source that generated a node. More... | |
class | Span |
class | SequentialSpanNode |
Store a list of spans for an expr generated from mulitple source exprs. More... | |
class | SequentialSpan |
Reference class of SequentialSpanNode. More... | |
class | SourceNode |
class | Source |
class | SourceMapNode |
Stores locations in frontend source that generated a node. More... | |
class | SourceMap |
class | BaseTensorTypeNode |
Base of all Tensor types This container can hold TensorType or GenericTensorType. More... | |
class | BaseTensorType |
Managed reference to BaseTensorTypeNode. More... | |
class | TensorTypeNode |
This is the most commonly used type in relay. TensorType have a fixed dimension, data type. More... | |
class | TensorType |
Managed reference to TensorTypeNode. More... | |
class | TypeNode |
Type is the base type of all types. More... | |
class | Type |
Managed reference to TypeNode. More... | |
class | PrimTypeNode |
Primitive data types used in the low-level IR. More... | |
class | PrimType |
class | PointerTypeNode |
Low-level raw pointer type. More... | |
class | PointerType |
class | TypeVarNode |
Type parameter in functions. More... | |
class | TypeVar |
Managed reference to TypeVarNode. More... | |
class | GlobalTypeVarNode |
A global type variable that is used for defining new types or type aliases. More... | |
class | GlobalTypeVar |
Managed reference to GlobalTypeVarNode. More... | |
class | TupleTypeNode |
The type of tuple values. More... | |
class | TupleType |
Managed reference to TupleTypeNode. More... | |
class | TypeConstraintNode |
Potential Constraints in a function. More... | |
class | TypeConstraint |
Managed reference to TypeConstraintNode. More... | |
class | FuncTypeNode |
Function type. More... | |
class | FuncType |
Managed reference to FuncTypeNode. More... | |
class | IncompleteTypeNode |
Intermediate values that is used to indicate incomplete type during type inference. More... | |
class | IncompleteType |
Managed reference to IncompleteTypeNode. More... | |
class | RelayRefTypeNode |
Reference Type High-level Relay IR. More... | |
class | RelayRefType |
Managed reference to RelayRefTypeNode. More... | |
class | TypeFunctor |
class | TypeFunctor< R(const Type &n, Args...)> |
class | TypeVisitor |
A type visitor that recursively visit types. More... | |
class | TypeMutator |
TypeMutator that mutates expressions. More... | |
class | TypeCallNode |
Type function application. More... | |
class | TypeCall |
Managed reference to TypeCallNode. More... | |
class | TypeReporterNode |
reporter that reports back to the type resolution information. More... | |
class | TypeReporter |
Container class of TypeReporter. More... | |
class | TypeRelationNode |
User defined type relation, it is an input-output relation on types. More... | |
class | TypeRelation |
Managed reference to TypeRelationNode. More... | |
class | AttrRegistryMapContainerMap |
Generic attribute map. More... | |
class | AttrRegistryMap |
Map<Key, ValueType> used to store meta-data. More... | |
class | NodeFunctor |
A dynamically dispatched functor on the type of the first argument. More... | |
class | NodeFunctor< R(const ObjectRef &n, Args...)> |
class | ObjectPathNode |
Path to an object from some root object. More... | |
class | ObjectPath |
class | RootPathNode |
class | RootPath |
class | AttributeAccessPathNode |
class | AttributeAccessPath |
class | UnknownAttributeAccessPathNode |
class | UnknownAttributeAccessPath |
class | ArrayIndexPathNode |
class | ArrayIndexPath |
class | MissingArrayElementPathNode |
class | MissingArrayElementPath |
class | MapValuePathNode |
class | MapValuePath |
class | MissingMapEntryPathNode |
class | MissingMapEntryPath |
class | AttrVisitor |
Visitor class to get the attributes of an AST/IR node. The content is going to be called for each field. More... | |
class | ReflectionVTable |
Virtual function table to support IR/AST node reflection. More... | |
class | ReprPrinter |
A printer class to print the AST/IR nodes. More... | |
class | ReprLegacyPrinter |
Legacy behavior of ReprPrinter. More... | |
class | PrinterConfigNode |
class | PrinterConfig |
class | TVMScriptPrinter |
Legacy behavior of ReprPrinter. More... | |
class | BaseValueEqual |
Equality definition of base value class. More... | |
class | ObjectPathPairNode |
Pair of ObjectPath s, one for each object being tested for structural equality. More... | |
class | ObjectPathPair |
class | StructuralEqual |
Content-aware structural equality comparator for objects. More... | |
class | SEqualReducer |
A Reducer class to reduce the structural equality result of two objects. More... | |
class | SEqualHandlerDefault |
The default handler for equality testing. More... | |
class | BaseValueHash |
Hash definition of base value classes. More... | |
class | StructuralHash |
Content-aware structural hashing. More... | |
class | SHashReducer |
A Reducer class to reduce the structural hash value. More... | |
class | SHashHandlerDefault |
The default handler for hash key computation. More... | |
struct | NDArrayContainerTrait |
class | AttrRegistry |
class | With |
RAII wrapper function to enter and exit a context object similar to python's with syntax. More... | |
class | CompilationConfigNode |
Gathers the Targets and distinguished VirtualDevices in canonical form needed to compile a Relay module for execution over possibly heterogeneous devices. Centralizes the validation and canonicalization logic needed to transition from targets supplied by the Python APIs to a single internal representation. Also holds a cache of canonical VirtualDevices so that structural equal virtual devices have pointer equal canonical virtual devices. More... | |
class | CompilationConfig |
Managed reference class to CompilationConfig . More... | |
class | GenericFunc |
Generic function that can be specialized on a per-target basis. More... | |
class | GenericFuncNode |
Represents a generic function that can be specialized on a per-target basis. More... | |
class | TargetTagNode |
A target tag. More... | |
class | TargetTag |
Managed reference class to TargetTagNode. More... | |
class | TargetTagRegEntry |
class | TargetNode |
Compilation target. More... | |
class | Target |
Managed reference class to TargetNode. More... | |
class | MemoryInfoNode |
Memory information of special memory region. Use MemoryInfo as its container type. More... | |
class | MemoryInfo |
Defines memory info. More... | |
class | TargetKindAttrMap |
Map<TargetKind, ValueType> used to store meta-information about TargetKind. More... | |
class | TargetKindNode |
Target kind, specifies the kind of the target. More... | |
class | TargetKind |
Managed reference class to TargetKindNode. More... | |
class | TargetKindRegEntry |
Helper structure to register TargetKind. More... | |
class | VirtualDeviceNode |
Describes at compile time the constraints on where data is to be stored at runtime down to the (virtual) device and memory scope level, and how to compile code to compute that data. Used by the PlanDevices pass to collect and solve (virtual) device constraints for the whole Relay program. More... | |
class | VirtualDevice |
Managed reference class to VirtualDeviceNode . More... | |
class | VirtualDeviceCache |
A cache of VirtualDevices . This can be used: More... | |
Typedefs | |
using | TypeRelationFn = TypedEnvFunc< bool(const Array< Type > &args, int num_inputs, const Attrs &attrs, const TypeReporter &reporter)> |
User defined type constraint function. More... | |
using | DataType = runtime::DataType |
using | Device = DLDevice |
using | TargetFeatures = Map< String, ObjectRef > |
Map containing parsed features of a specific Target. More... | |
using | TargetJSON = Map< String, ObjectRef > |
TargetParser to apply on instantiation of a given TargetKind. More... | |
using | FTVMTargetParser = runtime::TypedPackedFunc< TargetJSON(TargetJSON)> |
using | MemoryScope = String |
Enumerations | |
enum class | DiagnosticLevel : int { kBug = 10 , kError = 20 , kWarning = 30 , kNote = 40 , kHelp = 50 } |
The diagnostic level, controls the printing of the message. More... | |
enum class | CallingConv : int { kDefault = 0 , kCPackedFunc = 1 , kDeviceKernelLaunch = 2 } |
Possible Calling conventions. More... | |
enum | TypeKind : int { kType = 0 , kShapeVar = 1 , kBaseType = 2 , kConstraint = 4 , kAdtHandle = 5 , kTypeData = 6 } |
Possible kinds of TypeVars. More... | |
Functions | |
transform::Sequential | MixedModulePassManager (IRModule mixed_mod, Target target) |
Configures and returns the composite Pass for the fused module (pre split) that contains device and host code. More... | |
transform::Sequential | DeviceModulePassManager (IRModule mixed_mod, Target target) |
Configures and returns the composite Pass for the device Target after device/host from mixed module. More... | |
transform::Sequential | HostModulePassManager (IRModule mixed_mod, Target target_host) |
Configures and returns the composite Pass for the host Target after device/host from mixed module. More... | |
IRModule | LowerModule (IRModule mod, bool simple_mode=false) |
Lower an IRModule (optimize with it with the pass list defined in CreatePassList) More... | |
IRModule | LowerPrimFunc (tvm::tir::PrimFunc func, const std::string &name, bool simple_mode=false) |
Lower a primfunc and name (convert to IRModule, and optimize it with the pass list defined in CreatePassList) More... | |
IRModule | LowerSchedule (te::Schedule sch, const Array< te::Tensor > &args, const std::string &name, const std::unordered_map< te::Tensor, tir::Buffer > &binds, GlobalVarSupply global_var_supply, bool simple_mode=false) |
Build an IRModule given a TE schedule, args and binds. This function also applies the lowering passes defined in CreatePassList. More... | |
IRModule | LowerSchedule (te::Schedule sch, const Array< ObjectRef > &args, const std::string &name, const std::unordered_map< te::Tensor, tir::Buffer > &binds, GlobalVarSupply global_var_supply, bool simple_mode=false) |
Build an IRModule given a TE schedule, args and binds. This function also applies the lowering passes defined in CreatePassList. More... | |
IRModule | ScheduleToModule (te::Schedule sch, const Array< ObjectRef > &args, const std::string &name, const std::unordered_map< te::Tensor, tir::Buffer > &binds, GlobalVarSupply global_var_supply) |
Create an IRModule out of a TE Schedule. It does not apply lowering passes. If you want to apply lowering passes as well, use LowerSchedule. More... | |
runtime::Module | build (const IRModule &funcs, const Target &target, const Target &target_host) |
Build a device and host module for a specific target from an IRModule. More... | |
runtime::Module | build (const Map< Target, IRModule > &input, const Target &target_host) |
Build a device and host module for a specific target from a map contains target to IRModule. This function is used for heterogeneous build. More... | |
runtime::Module | build (const Map< String, IRModule > &input, const Target &target_host) |
Build a device and host module for a specific target from a map contains target to IRModule. This function is used for heterogeneous build. More... | |
template<typename TObjectRef > | |
TObjectRef | NullValue () |
Create a NodeRef type that represents null. More... | |
template<> | |
DataType | NullValue< DataType > () |
template<typename TAttrs > | |
TAttrs | AttrsWithDefaultValues () |
Create an Attr object with all default values. More... | |
template<typename TFunc > | |
TFunc | WithAttr (TFunc input, const std::string &attr_key, ObjectRef attr_value) |
Copy the function or module, but overrides the attribute value key with the value. More... | |
template<typename TFunc > | |
TFunc | WithAttrs (TFunc input, Map< String, ObjectRef > attrs) |
Copy the function or module, but overrides the attributes with the entries from attrs . More... | |
template<typename TFunc > | |
TFunc | WithoutAttr (TFunc input, const std::string &attr_key) |
Copy the function or module, but removes the specified attribute. More... | |
DiagnosticRenderer | TerminalRenderer (std::ostream &ostream) |
PrimExpr | operator+ (PrimExpr a, PrimExpr b) |
add operator More... | |
PrimExpr | operator- (PrimExpr a, PrimExpr b) |
subtraction operator More... | |
PrimExpr | operator- (PrimExpr a) |
negation. More... | |
PrimExpr | operator* (PrimExpr a, PrimExpr b) |
multiplication operator More... | |
PrimExpr | operator/ (PrimExpr a, PrimExpr b) |
division operator More... | |
PrimExpr | operator<< (PrimExpr a, PrimExpr b) |
left shift operator More... | |
PrimExpr | operator>> (PrimExpr a, PrimExpr b) |
right shift operator More... | |
PrimExpr | operator> (PrimExpr a, PrimExpr b) |
greater More... | |
PrimExpr | operator>= (PrimExpr a, PrimExpr b) |
greater_equal More... | |
PrimExpr | operator< (PrimExpr a, PrimExpr b) |
less More... | |
PrimExpr | operator<= (PrimExpr a, PrimExpr b) |
less_equal More... | |
PrimExpr | operator== (PrimExpr a, PrimExpr b) |
equal More... | |
PrimExpr | operator!= (PrimExpr a, PrimExpr b) |
not_equal More... | |
PrimExpr | operator&& (PrimExpr a, PrimExpr b) |
and More... | |
PrimExpr | operator|| (PrimExpr a, PrimExpr b) |
or More... | |
PrimExpr | operator! (PrimExpr a) |
not More... | |
PrimExpr | operator& (PrimExpr a, PrimExpr b) |
take bitwise and of two values More... | |
PrimExpr | operator| (PrimExpr a, PrimExpr b) |
take bitwise or of two values More... | |
PrimExpr | operator^ (PrimExpr a, PrimExpr b) |
take bitwise xor of two values More... | |
PrimExpr | operator~ (PrimExpr a) |
take bitwise negation of two values More... | |
Bool | operator|| (const Bool &a, bool b) |
Bool | operator|| (bool a, const Bool &b) |
Bool | operator|| (const Bool &a, const Bool &b) |
Bool | operator&& (const Bool &a, bool b) |
Bool | operator&& (bool a, const Bool &b) |
Bool | operator&& (const Bool &a, const Bool &b) |
bool | operator== (const Bool &a, bool b) |
bool | operator== (bool a, const Bool &b) |
bool | operator== (const Bool &a, const Bool &b) |
bool | IsPrimitiveOp (const RelayExpr &expr) |
Check that an expression is a "primitive operator". More... | |
String | TypeKind2String (TypeKind kind) |
Converts a TypeKind to a string. More... | |
Type | VoidType () |
bool | IsVoidType (const Type &type) |
Check whether the tyep represents void. More... | |
Type | Bind (const Type &type, const Map< TypeVar, Type > &args_map) |
Bind free type variables in the type. More... | |
Optional< String > | GetAttrKeyByAddress (const Object *object, const void *attr_address) |
Given an object and an address of its attribute, return the key of the attribute. More... | |
void | Dump (const runtime::ObjectRef &node) |
Dump the node to stderr, used for debug purposes. More... | |
void | Dump (const runtime::Object *node) |
Dump the node to stderr, used for debug purposes. More... | |
std::string | SaveJSON (const runtime::ObjectRef &node) |
save the node as well as all the node it depends on as json. This can be used to serialize any TVM object More... | |
runtime::ObjectRef | LoadJSON (std::string json_str) |
Internal implementation of LoadJSON Load tvm Node object from json and return a shared_ptr of Node. More... | |
GlobalVar | WithFields (GlobalVar global_var, Optional< String > opt_name_hint={}, Optional< Type > opt_type={}, Optional< VirtualDevice > opt_virtual_device={}, Optional< Span > opt_span={}) |
Returns global_var with the given properties. A null property denotes 'no change'. Returns global_var if all properties are unchanged. Otherwise, returns a copy with the new fields. More... | |
void | CheckAndUpdateHostConsistency (Target *target, Target *host) |
Check and update host field of the given legacy target and target host pair. Note that this function is for legacy target api compatibility issue only, not recommended for other use. More... | |
MemoryInfo | GetMemoryInfo (const std::string &scope) |
get memory info given scope More... | |
Type | GetType (const PrimExpr &expr) |
Get the type of the expression under the unified type system. More... | |
Type | GetTypeFromRuntimeDataType (const DataType &dtype) |
Get the type corresponding to DataType. More... | |
runtime::DataType | GetRuntimeDataType (const Type &type) |
Get the implied DataType for storing values with type during runtime. More... | |
PrimExpr | ret (PrimExpr value, Span span=Span()) |
Return the value. More... | |
PrimExpr | max_value (const DataType &dtype, Span span=Span()) |
PrimExpr | min_value (const DataType &dtype, Span span=Span()) |
PrimExpr | infinity (const DataType &dtype, Span span=Span()) |
PrimExpr | cast (const DataType &t, PrimExpr value, Span span=Span()) |
cast value to type. More... | |
PrimExpr | reinterpret (const DataType &t, PrimExpr value, Span span=Span()) |
perform reinterpret cast value to type. More... | |
PrimExpr | add (PrimExpr a, PrimExpr b, Span span=Span()) |
add operator More... | |
PrimExpr | sub (PrimExpr a, PrimExpr b, Span span=Span()) |
subtraction operator More... | |
PrimExpr | neg (PrimExpr a, Span span=Span()) |
negation. More... | |
PrimExpr | mul (PrimExpr a, PrimExpr b, Span span=Span()) |
multiplication operator More... | |
PrimExpr | left_shift (PrimExpr a, PrimExpr b, Span span=Span()) |
left shift operator More... | |
PrimExpr | right_shift (PrimExpr a, PrimExpr b, Span span=Span()) |
right shift operator More... | |
PrimExpr | greater (PrimExpr a, PrimExpr b, Span span=Span()) |
greater More... | |
PrimExpr | greater_equal (PrimExpr a, PrimExpr b, Span span=Span()) |
greater_equal More... | |
PrimExpr | less (PrimExpr a, PrimExpr b, Span span=Span()) |
less More... | |
PrimExpr | less_equal (PrimExpr a, PrimExpr b, Span span=Span()) |
less_equal More... | |
PrimExpr | equal (PrimExpr a, PrimExpr b, Span span=Span()) |
equal More... | |
PrimExpr | not_equal (PrimExpr a, PrimExpr b, Span span=Span()) |
not_equal More... | |
PrimExpr | logical_and (PrimExpr a, PrimExpr b, Span span=Span()) |
and More... | |
PrimExpr | logical_or (PrimExpr a, PrimExpr b, Span span=Span()) |
or More... | |
PrimExpr | logical_not (PrimExpr a, Span span=Span()) |
not More... | |
PrimExpr | div (PrimExpr a, PrimExpr b, Span span=Span()) |
compute division in C semantics. More... | |
PrimExpr | truncdiv (PrimExpr a, PrimExpr b, Span span=Span()) |
compute trunc(a / b) More... | |
PrimExpr | truncmod (PrimExpr a, PrimExpr b, Span span=Span()) |
compute the remainder of truncdiv More... | |
PrimExpr | indexdiv (PrimExpr a, PrimExpr b, Span span=Span()) |
compute floor(a / b) where a and b are non-negative. More... | |
PrimExpr | shapediv (PrimExpr a, PrimExpr b, Span span=Span()) |
compute ceil(a / b) where a and b are non-negative. More... | |
PrimExpr | indexmod (PrimExpr a, PrimExpr b, Span span=Span()) |
compute the remainder floor(a / b) where a and b are non-negative. More... | |
PrimExpr | floordiv (PrimExpr a, PrimExpr b, Span span=Span()) |
compute floor(a / b) More... | |
PrimExpr | ceildiv (PrimExpr a, PrimExpr b, Span span=Span()) |
compute ceil(a / b) More... | |
PrimExpr | floormod (PrimExpr a, PrimExpr b, Span span=Span()) |
compute the remainder of floordiv More... | |
PrimExpr | max (PrimExpr a, PrimExpr b, Span span=Span()) |
take maximum of two values More... | |
PrimExpr | min (PrimExpr a, PrimExpr b, Span span=Span()) |
take minimum of two values More... | |
PrimExpr | bitwise_and (PrimExpr a, PrimExpr b, Span span=Span()) |
take bitwise and of two values More... | |
PrimExpr | bitwise_or (PrimExpr a, PrimExpr b, Span span=Span()) |
take bitwise or of two values More... | |
PrimExpr | bitwise_xor (PrimExpr a, PrimExpr b, Span span=Span()) |
take bitwise xor of two values More... | |
PrimExpr | bitwise_neg (PrimExpr a, Span span=Span()) |
take bitwise negation of two values More... | |
PrimExpr | if_then_else (PrimExpr cond, PrimExpr true_value, PrimExpr false_value, Span span=Span()) |
Conditional expression. More... | |
PrimExpr | likely (PrimExpr cond, Span span=Span()) |
Mark condition as likely. More... | |
PrimExpr | pow (PrimExpr x, PrimExpr y, Span span=Span()) |
Calculate power(x, y) More... | |
PrimExpr | abs (PrimExpr x, Span span=Span()) |
Calculate absolute value of x. More... | |
PrimExpr | isnan (PrimExpr x, Span span=Span()) |
Check if x is NaN. More... | |
PrimExpr | isfinite (PrimExpr x, Span span=Span()) |
Check if x is finite. More... | |
PrimExpr | isinf (PrimExpr x, Span span=Span()) |
Check if x is infinite. More... | |
PrimExpr | sum (PrimExpr source, Array< tir::IterVar > axis, Array< PrimExpr > init={}, Span span=Span()) |
sum of source expression over axis More... | |
PrimExpr | all (PrimExpr source, Array< tir::IterVar > axis, Array< PrimExpr > init={}, Span span=Span()) |
logical And of source expression over axis More... | |
PrimExpr | any (PrimExpr source, Array< tir::IterVar > axis, Array< PrimExpr > init={}, Span span=Span()) |
logical Or of source expression over axis More... | |
PrimExpr | max (PrimExpr source, Array< tir::IterVar > axis, Array< PrimExpr > init={}, Span span=Span()) |
max of source expression over axis More... | |
PrimExpr | min (PrimExpr source, Array< tir::IterVar > axis, Array< PrimExpr > init={}, Span span=Span()) |
max of source expression over axis More... | |
PrimExpr | prod (PrimExpr source, Array< tir::IterVar > axis, Array< PrimExpr > init={}, Span span=Span()) |
product of source expression over axis More... | |
PrimExpr | floor (PrimExpr x, Span span=Span()) |
Calculate floor(x) More... | |
PrimExpr | ceil (PrimExpr x, Span span=Span()) |
Calculate ceil(x) More... | |
PrimExpr | round (PrimExpr x, Span span=Span()) |
Calculate round(x) More... | |
PrimExpr | nearbyint (PrimExpr x, Span span=Span()) |
Calculates std::nearbyint(x) More... | |
PrimExpr | trunc (PrimExpr x, Span span=Span()) |
Calculate trunc(x) More... | |
PrimExpr | LargeUIntImm (DataType dtype, int64_t low, int64_t high, Span span=Span()) |
Construct a large uint constant by its low 32 bits and high 32bits. More... | |
PrimExpr | q_multiply_shift (PrimExpr x, PrimExpr y, PrimExpr q, PrimExpr s, Span span=Span()) |
Execute a multiplication between two Q-numbers x and y followed by a right shift s. The mathematical expression is: More... | |
PrimExpr | fast_erf_float_expr (PrimExpr arg, int bits) |
Fast_erf_float expression from Eigen. More... | |
PrimExpr | exp (PrimExpr x, Span span=Span()) |
PrimExpr | exp2 (PrimExpr x, Span span=Span()) |
PrimExpr | exp10 (PrimExpr x, Span span=Span()) |
PrimExpr | erf (PrimExpr x, Span span=Span()) |
PrimExpr | tanh (PrimExpr x, Span span=Span()) |
PrimExpr | sigmoid (PrimExpr x, Span span=Span()) |
PrimExpr | sqrt (PrimExpr x, Span span=Span()) |
PrimExpr | rsqrt (PrimExpr x, Span span=Span()) |
PrimExpr | log (PrimExpr x, Span span=Span()) |
PrimExpr | log2 (PrimExpr x, Span span=Span()) |
PrimExpr | log10 (PrimExpr x, Span span=Span()) |
PrimExpr | log1p (PrimExpr x, Span span=Span()) |
PrimExpr | popcount (PrimExpr x, Span span=Span()) |
PrimExpr | tan (PrimExpr x, Span span=Span()) |
PrimExpr | cos (PrimExpr x, Span span=Span()) |
PrimExpr | cosh (PrimExpr x, Span span=Span()) |
PrimExpr | sin (PrimExpr x, Span span=Span()) |
PrimExpr | sinh (PrimExpr x, Span span=Span()) |
PrimExpr | asin (PrimExpr x, Span span=Span()) |
PrimExpr | acos (PrimExpr x, Span span=Span()) |
PrimExpr | atan (PrimExpr x, Span span=Span()) |
PrimExpr | acosh (PrimExpr x, Span span=Span()) |
PrimExpr | asinh (PrimExpr x, Span span=Span()) |
PrimExpr | atanh (PrimExpr x, Span span=Span()) |
PrimExpr | clz (PrimExpr x, Span span=Span()) |
PrimExpr | atan2 (PrimExpr x, PrimExpr y, Span span=Span()) |
PrimExpr | nextafter (PrimExpr x, PrimExpr y, Span span=Span()) |
PrimExpr | copysign (PrimExpr x, PrimExpr y, Span span=Span()) |
PrimExpr | hypot (PrimExpr x, PrimExpr y, Span span=Span()) |
PrimExpr | ldexp (PrimExpr x, PrimExpr y, Span span=Span()) |
PrimExpr | operator+= (PrimExpr &a, PrimExpr b) |
PrimExpr | operator-= (PrimExpr &a, PrimExpr b) |
PrimExpr | operator*= (PrimExpr &a, PrimExpr b) |
PrimExpr | operator+ (const PrimExpr &a, float b) |
PrimExpr | operator+ (float a, const PrimExpr &b) |
PrimExpr | operator+ (int a, const PrimExpr &b) |
PrimExpr | operator+ (const PrimExpr &a, int b) |
PrimExpr | operator+ (const PrimExpr &a, double b) |
PrimExpr | operator- (const PrimExpr &a, float b) |
PrimExpr | operator- (float a, const PrimExpr &b) |
PrimExpr | operator- (int a, const PrimExpr &b) |
PrimExpr | operator- (const PrimExpr &a, int b) |
PrimExpr | operator- (const PrimExpr &a, double b) |
PrimExpr | operator* (const PrimExpr &a, float b) |
PrimExpr | operator* (float a, const PrimExpr &b) |
PrimExpr | operator* (int a, const PrimExpr &b) |
PrimExpr | operator* (const PrimExpr &a, int b) |
PrimExpr | operator* (const PrimExpr &a, double b) |
PrimExpr | operator> (const PrimExpr &a, float b) |
PrimExpr | operator> (float a, const PrimExpr &b) |
PrimExpr | operator> (int a, const PrimExpr &b) |
PrimExpr | operator> (const PrimExpr &a, int b) |
PrimExpr | operator> (const PrimExpr &a, double b) |
PrimExpr | operator>= (const PrimExpr &a, float b) |
PrimExpr | operator>= (float a, const PrimExpr &b) |
PrimExpr | operator>= (int a, const PrimExpr &b) |
PrimExpr | operator>= (const PrimExpr &a, int b) |
PrimExpr | operator>= (const PrimExpr &a, double b) |
PrimExpr | operator< (const PrimExpr &a, float b) |
PrimExpr | operator< (float a, const PrimExpr &b) |
PrimExpr | operator< (int a, const PrimExpr &b) |
PrimExpr | operator< (const PrimExpr &a, int b) |
PrimExpr | operator< (const PrimExpr &a, double b) |
PrimExpr | operator<= (const PrimExpr &a, float b) |
PrimExpr | operator<= (float a, const PrimExpr &b) |
PrimExpr | operator<= (int a, const PrimExpr &b) |
PrimExpr | operator<= (const PrimExpr &a, int b) |
PrimExpr | operator<= (const PrimExpr &a, double b) |
PrimExpr | max (const PrimExpr &a, float b, Span span=Span()) |
PrimExpr | max (float a, const PrimExpr &b, Span span=Span()) |
PrimExpr | max (int a, const PrimExpr &b, Span span=Span()) |
PrimExpr | max (const PrimExpr &a, int b, Span span=Span()) |
PrimExpr | max (const PrimExpr &a, double b, Span span=Span()) |
PrimExpr | min (const PrimExpr &a, float b, Span span=Span()) |
PrimExpr | min (float a, const PrimExpr &b, Span span=Span()) |
PrimExpr | min (int a, const PrimExpr &b, Span span=Span()) |
PrimExpr | min (const PrimExpr &a, int b, Span span=Span()) |
PrimExpr | min (const PrimExpr &a, double b, Span span=Span()) |
PrimExpr | div (const PrimExpr &a, float b, Span span=Span()) |
PrimExpr | div (float a, const PrimExpr &b, Span span=Span()) |
PrimExpr | div (int a, const PrimExpr &b, Span span=Span()) |
PrimExpr | div (const PrimExpr &a, int b, Span span=Span()) |
PrimExpr | div (const PrimExpr &a, double b, Span span=Span()) |
PrimExpr | add (const PrimExpr &a, float b, Span span=Span()) |
PrimExpr | add (float a, const PrimExpr &b, Span span=Span()) |
PrimExpr | add (int a, const PrimExpr &b, Span span=Span()) |
PrimExpr | add (const PrimExpr &a, int b, Span span=Span()) |
PrimExpr | add (const PrimExpr &a, double b, Span span=Span()) |
PrimExpr | sub (const PrimExpr &a, float b, Span span=Span()) |
PrimExpr | sub (float a, const PrimExpr &b, Span span=Span()) |
PrimExpr | sub (int a, const PrimExpr &b, Span span=Span()) |
PrimExpr | sub (const PrimExpr &a, int b, Span span=Span()) |
PrimExpr | sub (const PrimExpr &a, double b, Span span=Span()) |
PrimExpr | mul (const PrimExpr &a, float b, Span span=Span()) |
PrimExpr | mul (float a, const PrimExpr &b, Span span=Span()) |
PrimExpr | mul (int a, const PrimExpr &b, Span span=Span()) |
PrimExpr | mul (const PrimExpr &a, int b, Span span=Span()) |
PrimExpr | mul (const PrimExpr &a, double b, Span span=Span()) |
PrimExpr | greater (const PrimExpr &a, float b, Span span=Span()) |
PrimExpr | greater (float a, const PrimExpr &b, Span span=Span()) |
PrimExpr | greater (int a, const PrimExpr &b, Span span=Span()) |
PrimExpr | greater (const PrimExpr &a, int b, Span span=Span()) |
PrimExpr | greater (const PrimExpr &a, double b, Span span=Span()) |
PrimExpr | greater_equal (const PrimExpr &a, float b, Span span=Span()) |
PrimExpr | greater_equal (float a, const PrimExpr &b, Span span=Span()) |
PrimExpr | greater_equal (int a, const PrimExpr &b, Span span=Span()) |
PrimExpr | greater_equal (const PrimExpr &a, int b, Span span=Span()) |
PrimExpr | greater_equal (const PrimExpr &a, double b, Span span=Span()) |
PrimExpr | less (const PrimExpr &a, float b, Span span=Span()) |
PrimExpr | less (float a, const PrimExpr &b, Span span=Span()) |
PrimExpr | less (int a, const PrimExpr &b, Span span=Span()) |
PrimExpr | less (const PrimExpr &a, int b, Span span=Span()) |
PrimExpr | less (const PrimExpr &a, double b, Span span=Span()) |
PrimExpr | less_equal (const PrimExpr &a, float b, Span span=Span()) |
PrimExpr | less_equal (float a, const PrimExpr &b, Span span=Span()) |
PrimExpr | less_equal (int a, const PrimExpr &b, Span span=Span()) |
PrimExpr | less_equal (const PrimExpr &a, int b, Span span=Span()) |
PrimExpr | less_equal (const PrimExpr &a, double b, Span span=Span()) |
PrimExpr | indexdiv (const PrimExpr &a, int b, Span span=Span()) |
PrimExpr | indexdiv (int a, const PrimExpr &b, Span span=Span()) |
PrimExpr | indexmod (const PrimExpr &a, int b, Span span=Span()) |
PrimExpr | indexmod (int a, const PrimExpr &b, Span span=Span()) |
PrimExpr | truncdiv (const PrimExpr &a, int b, Span span=Span()) |
PrimExpr | truncdiv (int a, const PrimExpr &b, Span span=Span()) |
PrimExpr | truncmod (const PrimExpr &a, int b, Span span=Span()) |
PrimExpr | truncmod (int a, const PrimExpr &b, Span span=Span()) |
PrimExpr | floordiv (const PrimExpr &a, int b, Span span=Span()) |
PrimExpr | floordiv (int a, const PrimExpr &b, Span span=Span()) |
PrimExpr | floormod (const PrimExpr &a, int b, Span span=Span()) |
PrimExpr | floormod (int a, const PrimExpr &b, Span span=Span()) |
PrimExpr | right_shift (const PrimExpr &a, int b, Span span=Span()) |
PrimExpr | right_shift (int a, const PrimExpr &b, Span span=Span()) |
PrimExpr | left_shift (const PrimExpr &a, int b, Span span=Span()) |
PrimExpr | left_shift (int a, const PrimExpr &b, Span span=Span()) |
PrimExpr | bitwise_and (const PrimExpr &a, int b, Span span=Span()) |
PrimExpr | bitwise_and (int a, const PrimExpr &b, Span span=Span()) |
PrimExpr | bitwise_or (const PrimExpr &a, int b, Span span=Span()) |
PrimExpr | bitwise_or (int a, const PrimExpr &b, Span span=Span()) |
PrimExpr | bitwise_xor (const PrimExpr &a, int b, Span span=Span()) |
PrimExpr | bitwise_xor (int a, const PrimExpr &b, Span span=Span()) |
PrimExpr | operator>> (const PrimExpr &a, int b) |
PrimExpr | operator>> (int a, const PrimExpr &b) |
PrimExpr | operator<< (const PrimExpr &a, int b) |
PrimExpr | operator<< (int a, const PrimExpr &b) |
PrimExpr | operator& (const PrimExpr &a, int b) |
PrimExpr | operator& (int a, const PrimExpr &b) |
PrimExpr | operator| (const PrimExpr &a, int b) |
PrimExpr | operator| (int a, const PrimExpr &b) |
PrimExpr | operator^ (const PrimExpr &a, int b) |
PrimExpr | operator^ (int a, const PrimExpr &b) |
PrimExpr | operator&& (const PrimExpr &a, bool b) |
PrimExpr | operator&& (bool a, const PrimExpr &b) |
PrimExpr | operator|| (const PrimExpr &a, bool b) |
PrimExpr | operator|| (bool a, const PrimExpr &b) |
PrimExpr | logical_and (const PrimExpr &a, bool b, Span span=Span()) |
PrimExpr | logical_and (bool a, const PrimExpr &b, Span span=Span()) |
PrimExpr | logical_or (const PrimExpr &a, bool b, Span span=Span()) |
PrimExpr | logical_or (bool a, const PrimExpr &b, Span span=Span()) |
template<typename TA > | |
void | DivAmbiguityError (const TA &a) |
Helper function to raise a compiler error about division ambiguity. More... | |
template<typename TB > | |
PrimExpr | operator/ (const PrimExpr &a, const TB &b) |
template<typename TB > | |
PrimExpr | operator/= (const PrimExpr &a, const TB &b) |
template<typename TB > | |
PrimExpr | operator% (const PrimExpr &a, const TB &b) |
Variables | |
constexpr runtime::NullOptType | NullOpt {} |
constexpr int | kNullDeviceType = 0 |
constexpr int | kInvalidDeviceType = -1 |
constexpr const char * | kVirtualDevice = "virtual_device" |
constexpr const char * | kUSMPEnableOption = "tir.usmp.enable" |
PassContext option to enable the USMP. More... | |
constexpr const char * | kUSMPAlgorithmOption = "tir.usmp.algorithm" |
PassContext option to select the memory planning algorithm in USMP. More... | |
constexpr const char * | kUSMPUseWorkspaceIO = "tir.usmp.use_workspace_io" |
PassContext option to enable placing I/O tensors in the workspace. More... | |
constexpr const char * | kUSMPCustomAlgorithmOption = "tir.usmp.custom_algorithm" |
PassContext option to specify a custom memory planning algorithm in USMP. The algorithm should be provided as registered PackedFunc with the name tir.usmp.algorithm.NAME. More... | |
runtime implementation for LibTorch/TorchScript.
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Performance counters for profiling via the PAPI library.
using tvm::DataType = typedef runtime::DataType |
using tvm::Device = typedef DLDevice |
using tvm::FTVMTargetParser = typedef runtime::TypedPackedFunc<TargetJSON(TargetJSON)> |
using tvm::MemoryScope = typedef String |
Abstract label for an area of memory.
Currently uninterpreted and arbitrary. Likely to be replaced by a structured representation of a memory pool in the future. Please try to use this alias instead of String to aid future code migration.
using tvm::TargetFeatures = typedef Map<String, ObjectRef> |
Map containing parsed features of a specific Target.
using tvm::TargetJSON = typedef Map<String, ObjectRef> |
TargetParser to apply on instantiation of a given TargetKind.
target_json | Target in JSON format to be transformed during parsing. |
using tvm::TypeRelationFn = typedef TypedEnvFunc<bool(const Array<Type>& args, int num_inputs, const Attrs& attrs, const TypeReporter& reporter)> |
User defined type constraint function.
If the input type information can be used to fully decide the IncompleteTypes, then the function should call reporter.Assign to report the new types, and return true. Otherwise, the function should return false.
args | The arguments to the relation. The types are stored in the form of [input_type_0, input_type_1, ... input_type_n, output_type_0, output_type_1, ... output_type_m] |
num_inputs | Number of input types in the args. |
attrs | The additional attributes of the operator. |
reporter | The reporter to report solution to. |
|
strong |
Possible Calling conventions.
NOTE: The calling convention also implies the way we implement the function during lowering.
|
strong |
enum tvm::TypeKind : int |
Calculate absolute value of x.
x | The input data |
span | The location of this operation in the source. |
add operator
a | left operand |
b | right operand |
span | The location of this operation in the source. |
PrimExpr tvm::all | ( | PrimExpr | source, |
Array< tir::IterVar > | axis, | ||
Array< PrimExpr > | init = {} , |
||
Span | span = Span() |
||
) |
logical And of source expression over axis
source | The source expression. |
axis | List of iteration variables that will be used for reduction. |
init | The value with which to initialize the output. |
span | The location of this operation in the source. |
PrimExpr tvm::any | ( | PrimExpr | source, |
Array< tir::IterVar > | axis, | ||
Array< PrimExpr > | init = {} , |
||
Span | span = Span() |
||
) |
logical Or of source expression over axis
source | The source expression. |
axis | List of iteration variables that will be used for reduction. |
init | The value with which to initialize the output. |
span | The location of this operation in the source. |
|
inline |
Create an Attr object with all default values.
TAttrNode | the type to be created. |
Bind free type variables in the type.
type | The type to be updated. |
args_map | The binding map. |
take bitwise and of two values
a | left operand |
b | right operand |
span | The location of this operation in the source. |
take bitwise negation of two values
a | the input expression. |
span | The location of this operation in the source. |
take bitwise or of two values
a | left operand |
b | right operand |
span | The location of this operation in the source. |
take bitwise xor of two values
a | left operand |
b | right operand |
span | The location of this operation in the source. |
runtime::Module tvm::build | ( | const IRModule & | funcs, |
const Target & | target, | ||
const Target & | target_host | ||
) |
Build a device and host module for a specific target from an IRModule.
funcs | The functions to be built. |
target | The target device to build for. |
target_host | The target for building host code. To use the default, pass Target() |
runtime::Module tvm::build | ( | const Map< String, IRModule > & | input, |
const Target & | target_host | ||
) |
Build a device and host module for a specific target from a map contains target to IRModule. This function is used for heterogeneous build.
input | The map contains target string to an IRModule. |
target_host | The target for building host code. To use the default, pass Target(). |
runtime::Module tvm::build | ( | const Map< Target, IRModule > & | input, |
const Target & | target_host | ||
) |
Build a device and host module for a specific target from a map contains target to IRModule. This function is used for heterogeneous build.
input | The map contains target to an IRModule. |
target_host | The target for building host code. To use the default, pass Target(). |
cast value to type.
t | the target type. |
value | The value |
span | The location of this operation in the source. |
Calculate ceil(x)
x | The input expression. |
span | The location of this operation in the source. |
compute ceil(a / b)
a | left operand |
b | right operand |
span | The location of this operation in the source. |
Check and update host field of the given legacy target and target host pair. Note that this function is for legacy target api compatibility issue only, not recommended for other use.
transform::Sequential tvm::DeviceModulePassManager | ( | IRModule | mixed_mod, |
Target | target | ||
) |
compute division in C semantics.
a / b as in C/C++.
When operands are integers, it directly corresponds to truncdiv.
a | left operand |
b | right operand |
span | The location of this operation in the source. |
|
inline |
Helper function to raise a compiler error about division ambiguity.
TA | Any class type. |
void tvm::Dump | ( | const runtime::Object * | node | ) |
Dump the node to stderr, used for debug purposes.
node | The input node |
void tvm::Dump | ( | const runtime::ObjectRef & | node | ) |
Dump the node to stderr, used for debug purposes.
node | The input node |
equal
a | left operand |
b | right operand |
span | The location of this operation in the source. |
Fast_erf_float expression from Eigen.
arg | The input expression. |
bits | The number of bits in the type. |
Calculate floor(x)
x | The input expression. |
span | The location of this operation in the source. |
compute floor(a / b)
a | left operand |
b | right operand |
span | The location of this operation in the source. |
compute the remainder of floordiv
a | left operand |
b | right operand |
span | The location of this operation in the source. |
Given an object and an address of its attribute, return the key of the attribute.
MemoryInfo tvm::GetMemoryInfo | ( | const std::string & | scope | ) |
get memory info given scope
scope | The scope name. |
runtime::DataType tvm::GetRuntimeDataType | ( | const Type & | type | ) |
Get the implied DataType for storing values with type during runtime.
type | The input type. |
Get the type of the expression under the unified type system.
This function could return a more refined type than the runtime type provided by expr->dtype
expr | The input parameter. |
Get the type corresponding to DataType.
dtype | The data type |
greater
a | left operand |
b | right operand |
span | The location of this operation in the source. |
greater_equal
a | left operand |
b | right operand |
span | The location of this operation in the source. |
transform::Sequential tvm::HostModulePassManager | ( | IRModule | mixed_mod, |
Target | target_host | ||
) |
PrimExpr tvm::if_then_else | ( | PrimExpr | cond, |
PrimExpr | true_value, | ||
PrimExpr | false_value, | ||
Span | span = Span() |
||
) |
Conditional expression.
cond | The condition |
true_value | The value when results are true. |
false_value | The value when results are false. |
span | The location of this operation in the source. |
compute floor(a / b) where a and b are non-negative.
Use this function for index split calculation.
This function might take advantage of the fact that a and b are non-negative.
a | left operand |
b | right operand |
span | The location of this operation in the source. |
compute the remainder floor(a / b) where a and b are non-negative.
Use this function for index split calculation. This function might take advantage of the fact that a and b are non-negative.
a | left operand |
b | right operand |
span | The location of this operation in the source. |
Get the value of infinity.
dtype | The data type. |
span | The location of this operation in the source. |
Check if x is finite.
x | The input data |
span | The location of this operation in the source. |
Check if x is infinite.
x | The input data |
span | The location of this operation in the source. |
Check if x is NaN.
x | The input data |
span | The location of this operation in the source. |
|
inline |
Check that an expression is a "primitive operator".
Will return true if the expression is an operator which matches the form of primitive operators registered directly by the Relay codebase.
That is the arguments are all type variables, and there is a single type relation applied to the input and output types.
expr | An expression. |
|
inline |
Check whether the tyep represents void.
Construct a large uint constant by its low 32 bits and high 32bits.
dtype | The final data type. |
low | The lower 32 bits. |
high | The higher 32 bits. |
span | The location of this operation in the source. |
left shift operator
a | left operand |
b | right operand |
span | The location of this operation in the source. |
less
a | left operand |
b | right operand |
span | The location of this operation in the source. |
less_equal
a | left operand |
b | right operand |
span | The location of this operation in the source. |
Mark condition as likely.
cond | The condition |
span | The location of this operation in the source. |
runtime::ObjectRef tvm::LoadJSON | ( | std::string | json_str | ) |
Internal implementation of LoadJSON Load tvm Node object from json and return a shared_ptr of Node.
json_str | The json string to load from. |
and
a | left operand |
b | right operand |
span | The location of this operation in the source. |
not
a | left operand |
span | The location of this operation in the source. |
or
a | left operand |
b | right operand |
span | The location of this operation in the source. |
Lower an IRModule (optimize with it with the pass list defined in CreatePassList)
mod | The IRmodule to lower |
simple_mode | Disables the loop partition pass. Defaults to false. |
IRModule tvm::LowerPrimFunc | ( | tvm::tir::PrimFunc | func, |
const std::string & | name, | ||
bool | simple_mode = false |
||
) |
Lower a primfunc and name (convert to IRModule, and optimize it with the pass list defined in CreatePassList)
func | The PrimFunc to lower |
name | The name of the lowered function. |
simple_mode | Disables the loop partition pass. Defaults to false. |
IRModule tvm::LowerSchedule | ( | te::Schedule | sch, |
const Array< ObjectRef > & | args, | ||
const std::string & | name, | ||
const std::unordered_map< te::Tensor, tir::Buffer > & | binds, | ||
GlobalVarSupply | global_var_supply, | ||
bool | simple_mode = false |
||
) |
Build an IRModule given a TE schedule, args and binds. This function also applies the lowering passes defined in CreatePassList.
sch | The TE schedule to lower. |
args | The arguments to the function (Array of Tensor, Buffer and Vars) |
name | The name of the lowered function. |
binds | Buffer assignments. |
global_var_supply | The GlobalVarSupply to be used in the module. |
simple_mode | Disables the loop partition pass. Defaults to false. |
IRModule tvm::LowerSchedule | ( | te::Schedule | sch, |
const Array< te::Tensor > & | args, | ||
const std::string & | name, | ||
const std::unordered_map< te::Tensor, tir::Buffer > & | binds, | ||
GlobalVarSupply | global_var_supply, | ||
bool | simple_mode = false |
||
) |
Build an IRModule given a TE schedule, args and binds. This function also applies the lowering passes defined in CreatePassList.
sch | The TE schedule to lower. |
args | The arguments to the function. |
name | The name of the lowered function. |
binds | Buffer assignments. |
global_var_supply | The GlobalVarSupply to be used in the module. |
simple_mode | Disables the loop partition pass. Defaults to false. |
take maximum of two values
a | left operand |
b | right operand |
span | The location of this operation in the source. |
PrimExpr tvm::max | ( | PrimExpr | source, |
Array< tir::IterVar > | axis, | ||
Array< PrimExpr > | init = {} , |
||
Span | span = Span() |
||
) |
max of source expression over axis
source | The source expression. |
axis | List of iteration variables that will be used for reduction. |
init | The value with which to initialize the output. |
span | The location of this operation in the source. |
Query the maximum possible value of dtype.
dtype | The data type. |
span | The location of this operation in the source. |
take minimum of two values
a | left operand |
b | right operand |
span | The location of this operation in the source. |
PrimExpr tvm::min | ( | PrimExpr | source, |
Array< tir::IterVar > | axis, | ||
Array< PrimExpr > | init = {} , |
||
Span | span = Span() |
||
) |
max of source expression over axis
source | The source expression. |
axis | List of iteration variables that will be used for reduction. |
init | The value with which to initialize the output. |
span | The location of this operation in the source. |
Query the minimum possible value of dtype.
dtype | The data type. |
span | The location of this operation in the source. |
transform::Sequential tvm::MixedModulePassManager | ( | IRModule | mixed_mod, |
Target | target | ||
) |
Configures and returns the composite Pass for the fused module (pre split) that contains device and host code.
mixed_mod | The original mixed module. |
target | The device Target. |
multiplication operator
a | left operand |
b | right operand |
span | The location of this operation in the source. |
Calculates std::nearbyint(x)
x | The input expression. |
span | The location of this operation in the source. |
negation.
a | input. |
span | The location of this operation in the source. |
not_equal
a | left operand |
b | right operand |
span | The location of this operation in the source. |
|
inline |
Create a NodeRef type that represents null.
TNodeRef | the type to be created. |
|
inline |
not
a | left operand |
PrimExpr tvm::operator!= | ( | PrimExpr | a, |
PrimExpr | b | ||
) |
not_equal
a | left operand |
b | right operand |
take bitwise and of two values
a | left operand |
b | right operand |
and
a | left operand |
b | right operand |
multiplication operator
a | left operand |
b | right operand |
add operator
a | left operand |
b | right operand |
negation.
a | input. |
subtraction operator
a | left operand |
b | right operand |
division operator
a | left operand |
b | right operand |
less
a | left operand |
b | right operand |
left shift operator
a | left operand |
b | right operand |
less_equal
a | left operand |
b | right operand |
|
inline |
|
inline |
equal
a | left operand |
b | right operand |
greater
a | left operand |
b | right operand |
greater_equal
a | left operand |
b | right operand |
right shift operator
a | left operand |
b | right operand |
take bitwise xor of two values
a | left operand |
b | right operand |
take bitwise or of two values
a | left operand |
b | right operand |
or
a | left operand |
b | right operand |
take bitwise negation of two values
a | the input expression. |
Calculate power(x, y)
x | The left operand. |
y | The right operand. |
span | The location of this operation in the source. |
PrimExpr tvm::prod | ( | PrimExpr | source, |
Array< tir::IterVar > | axis, | ||
Array< PrimExpr > | init = {} , |
||
Span | span = Span() |
||
) |
product of source expression over axis
source | The source expression. |
axis | List of iteration variables that will be used for reduction. |
init | The value with which to initialize the output. |
span | The location of this operation in the source. |
PrimExpr tvm::q_multiply_shift | ( | PrimExpr | x, |
PrimExpr | y, | ||
PrimExpr | q, | ||
PrimExpr | s, | ||
Span | span = Span() |
||
) |
Execute a multiplication between two Q-numbers x and y followed by a right shift s. The mathematical expression is:
out = round(x*y*2^-s)
Please note that the two Q-numbers x and y are supposed to have the same number of fractional bits q.
More about Q-numbers here: https://en.wikipedia.org/wiki/Q_(number_format)
The rounding rule is to the nearest value, rounding half up (i.e., round(x.1) = x and round (x.5) = x+1)
x | first Q-number |
y | second Q-number |
q | number of fractional bits in x and y. Needs to be > 0 |
s | integer right shift |
span | The location of this operation in the source. |
perform reinterpret cast value to type.
t | the target type. |
value | The value |
span | The location of this operation in the source. |
Return the value.
value | The returned value. |
span | The location of this operation in the source. |
right shift operator
a | left operand |
b | right operand |
span | The location of this operation in the source. |
Calculate round(x)
x | The input expression. |
span | The location of this operation in the source. |
std::string tvm::SaveJSON | ( | const runtime::ObjectRef & | node | ) |
save the node as well as all the node it depends on as json. This can be used to serialize any TVM object
IRModule tvm::ScheduleToModule | ( | te::Schedule | sch, |
const Array< ObjectRef > & | args, | ||
const std::string & | name, | ||
const std::unordered_map< te::Tensor, tir::Buffer > & | binds, | ||
GlobalVarSupply | global_var_supply | ||
) |
Create an IRModule out of a TE Schedule. It does not apply lowering passes. If you want to apply lowering passes as well, use LowerSchedule.
sch | The schedule |
args | The arguments to the function. |
name | The name of the lowered function. |
binds | Buffer assignments. |
global_var_supply | The GlobalVarSupply to be used in the module and when creating GlobalVars. |
compute ceil(a / b) where a and b are non-negative.
Use this function for shape split calculation.
This function might take advantage of the fact that a and b are non-negative.
a | left operand |
b | right operand |
span | The location of this operation in the source. |
subtraction operator
a | left operand |
b | right operand |
span | The location of this operation in the source. |
PrimExpr tvm::sum | ( | PrimExpr | source, |
Array< tir::IterVar > | axis, | ||
Array< PrimExpr > | init = {} , |
||
Span | span = Span() |
||
) |
sum of source expression over axis
source | The source expression. |
axis | List of iteration variables that will be used for reduction. |
init | The value with which to initialize the output. |
span | The location of this operation in the source. |
DiagnosticRenderer tvm::TerminalRenderer | ( | std::ostream & | ostream | ) |
Calculate trunc(x)
x | The input expression. |
span | The location of this operation in the source. |
compute trunc(a / b)
This is the default integer division behavior in C.
a | left operand |
b | right operand |
span | The location of this operation in the source. |
compute the remainder of truncdiv
This is the default integer division behavior in C.
a | left operand |
b | right operand |
span | The location of this operation in the source. |
|
inline |
|
inline |
Copy the function or module, but overrides the attribute value key with the value.
input | The thing to annotate (BaseFunc or IRModule) |
attr_key | The attribute key. |
attr_value | The value attribute value. |
TFunc | The corresponding function or module type. |
This is also why we make it as a function instead of a member function and why we pass by value in the first argument.
|
inline |
Copy the function or module, but overrides the attributes with the entries from attrs
.
input | The thing to annotate (BaseFunc or IRModule) |
attrs | Key/values attributes to add to input . |
TFunc | The corresponding function or module type. |
GlobalVar tvm::WithFields | ( | GlobalVar | global_var, |
Optional< String > | opt_name_hint = {} , |
||
Optional< Type > | opt_type = {} , |
||
Optional< VirtualDevice > | opt_virtual_device = {} , |
||
Optional< Span > | opt_span = {} |
||
) |
Returns global_var
with the given properties. A null property denotes 'no change'. Returns global_var
if all properties are unchanged. Otherwise, returns a copy with the new fields.
|
inline |
Copy the function or module, but removes the specified attribute.
TFunc | The corresponding function or module type. |
This is also why we make it as a function instead of a member function and why we pass by value in the first argument.
|
constexpr |
|
constexpr |
|
constexpr |
PassContext option to select the memory planning algorithm in USMP.
|
constexpr |
PassContext option to specify a custom memory planning algorithm in USMP. The algorithm should be provided as registered PackedFunc with the name tir.usmp.algorithm.NAME.
|
constexpr |
PassContext option to enable the USMP.
|
constexpr |
PassContext option to enable placing I/O tensors in the workspace.
|
constexpr |
brief The attribute key for the virtual device. This key will be promoted to first class on functions. For use in the parser and printer only.
|
constexpr |