tvm
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions
tvm Namespace Reference

An object that builds and maintains block scope and StmtSref mapping for Dependence analysis. More...

Namespaces

namespace  attr
 Generic attribute names that can be attached to any function.
 
namespace  backend
 
namespace  codegen
 namespace for target translation and codegen.
 
namespace  ffi
 
namespace  op_attr
 
namespace  prim
 
namespace  relax
 
namespace  runtime
 
namespace  s_tir
 
namespace  script
 
namespace  sig
 
namespace  support
 
namespace  sym
 namespace of symbolic analysis.
 
namespace  te
 Tensor expression language DSL.
 
namespace  tirx
 Backend-defined execution hierarchy nodes shared by layouts and tile calls.
 
namespace  topi
 
namespace  transform
 
namespace  type_attr
 

Classes

class  AnyType
 Managed reference to AnyTypeNode. More...
 
class  AnyTypeNode
 The top type, which admits any value. More...
 
class  ArgumentInfo
 Managed reference to an argument descriptor. More...
 
class  ArgumentInfoObj
 An operator argument's name and documentation. More...
 
class  AssertStmt
 Managed reference to AssertStmtNode. More...
 
class  AssertStmtNode
 Assert condition, if an error occurs, return the error message. More...
 
class  Attrs
 Managed reference to AttrsNode. More...
 
class  AttrsNode
 Base class of all attribute class. More...
 
class  BaseFunc
 Managed reference to BaseFuncNode. More...
 
class  BaseFuncNode
 Base node of all functions. More...
 
class  Bind
 Managed reference to BindNode. More...
 
class  BindNode
 Bind a variable to a value in the enclosing scope. More...
 
class  Break
 Managed reference to BreakNode. More...
 
class  BreakNode
 A Break in control flow. More...
 
class  Call
 Managed reference to CallNode. More...
 
class  CallNode
 Call corresponds to callable invocation. More...
 
class  CallSiteLoc
 Explicit inline callee/caller provenance. More...
 
class  CallSiteLocNode
 The location of a callee together with its caller's provenance. More...
 
class  ConfigSchema
 Dynamic config schema for map-like options. More...
 
class  Constant
 Managed reference to a literal constant. More...
 
class  ConstantNode
 Base node for literal constants. More...
 
class  Continue
 Managed reference to ContinueNode. More...
 
class  ContinueNode
 A Continue in control flow. More...
 
class  DataTypeImm
 Managed reference to a data type literal. More...
 
class  DataTypeImmNode
 A data type literal with AnyType as its expression type. More...
 
class  DictAttrs
 Managed reference to DictAttrsNode. 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  EnvFunc
 Managed reference to EnvFuncObj. More...
 
class  EnvFuncObj
 A serializable function backed by TVM's global environment. More...
 
class  Evaluate
 Managed reference to EvaluateNode. More...
 
class  EvaluateNode
 Evaluates an expression. This is mostly used for putting a Call node into Stmt. More...
 
class  Expr
 Managed reference to ExprNode. More...
 
class  ExprFunctor
 Type-dispatched expression functor with a caller-selected signature. More...
 
class  ExprFunctor< R(const Expr &, Args...)>
 
class  ExprMutator
 Structural Expr mutator with native overrides for core expressions and structural fallback for other objects. More...
 
class  ExprNode
 Base type of all the expressions. More...
 
class  ExprVisitor
 Structural Expr visitor with native overrides for core expressions. More...
 
class  FloatImm
 Managed reference class to FloatImmNode. More...
 
class  FloatImmNode
 Constant floating point literals in the program. More...
 
class  For
 Managed reference to ForNode. More...
 
class  ForNode
 A for loop, with possible type annotations. More...
 
class  FuncType
 Managed reference to FuncTypeNode. More...
 
class  FuncTypeNode
 Function type. More...
 
class  GenericConst
 Managed reference to a generic constant. More...
 
class  GenericConstNode
 A constant whose payload is separate from its expression type. More...
 
class  GlobalInfo
 Managed reference to GlobalInfoNode. More...
 
class  GlobalInfoNode
 GlobalInfo are globally static object that are referred by the IR itself. Base node for all global info that can appear in the IR. More...
 
class  GlobalVar
 Managed reference to GlobalVarNode. More...
 
class  GlobalVarNode
 Global variable that lives in the top-level module. More...
 
class  If
 Managed reference to IfNode. More...
 
class  IfNode
 If statement. More...
 
class  IntExpr
 View over a scalar signed or unsigned integer expression of any bit width. More...
 
class  IntImm
 Managed reference class to IntImmNode. More...
 
class  IntImmNode
 Constant integer literals in the program. More...
 
class  IRModule
 Managed reference class to IRModuleNode. More...
 
class  IRModuleNode
 IRModule that holds functions and type definitions. More...
 
class  LambdaExpr
 Managed reference to a typed staging lambda. More...
 
class  LambdaExprNode
 A typed staging expression representing a lambda computation. More...
 
class  Location
 Non-nullable source-location metadata. More...
 
class  LocationNode
 Base class for immutable source-location metadata. More...
 
class  MissingType
 Managed reference to the MissingTypeNode singleton. More...
 
class  MissingTypeNode
 Type information that has not been supplied or computed. More...
 
class  ObjectFunctor
 A dynamically dispatched functor on the type of the first argument. More...
 
class  ObjectFunctor< R(NodeArg, Args...)>
 
class  ObjectMutator
 Native mutation with exact dispatch and structural fallback. More...
 
class  ObjectVisitor
 Native visiting with exact dispatch and structural fallback. More...
 
class  Op
 Reference-counted handle to a canonical named operator. More...
 
class  OpaqueExpr
 Managed reference to OpaqueExprNode. More...
 
class  OpaqueExprNode
 Base node for opaque construction-time expressions. More...
 
class  OpaqueType
 Managed reference to OpaqueTypeNode. More...
 
class  OpaqueTypeNode
 Type marker for opaque construction-time expressions. More...
 
class  OpAttrMap
 Typed live view of an Op attribute column. More...
 
class  OpDef
 Noncopyable temporary builder for a canonical Op; see Op for the example. More...
 
class  OpNode
 Metadata for a canonical primitive operator invoked through Call. More...
 
class  PrimExpr
 Typed reference/view over any Expr whose ExprNode::ty is PrimType. More...
 
class  PrimType
 
class  PrimTypeNode
 Primitive data types used in the low-level IR. More...
 
class  PrimVar
 Checked scalar view over a VarNode. More...
 
class  PrinterConfig
 
class  PrinterConfigObj
 
class  PtrType
 
class  PtrTypeNode
 Low-level raw pointer type. More...
 
class  Range
 Range container
More...
 
class  RangeNode
 range over one dimension More...
 
class  RegionStmt
 Managed reference to RegionStmtNode. More...
 
class  RegionStmtNode
 A single-body statement whose semantics are defined by an operator. Operands are evaluated in the enclosing scope. Body parameters are definitions at body entry; result variables are definitions following the region. More...
 
class  Return
 Managed reference to ReturnNode. More...
 
class  ReturnNode
 A return from the current function. More...
 
class  ScopeStack
 A scope stack for maintaining hierarchical state during IR visiting. More...
 
class  SeqStmt
 Sequence statement. More...
 
class  SeqStmtNode
 The container of seq statement. Represent a sequence of statements. More...
 
class  Source
 
class  SourceLoc
 A concrete source range. More...
 
class  SourceLocNode
 A range in one source, retaining frontend coordinate conventions. More...
 
class  SourceMap
 
class  SourceMapObj
 Stores locations in frontend source that generated a node. More...
 
class  SourceName
 The source name of a file loc. More...
 
class  SourceNameNode
 The name of a source fragment. More...
 
class  SourceObj
 
class  StagingExpr
 Managed reference to a staging expression. More...
 
class  StagingExprNode
 Base node for traversable expressions eliminated during compilation. More...
 
class  Stmt
 Container of all statements. More...
 
class  StmtNode
 Base node of all statements. More...
 
class  StringImm
 Managed reference to a string literal. More...
 
class  StringImmNode
 A string literal with shared semantic StringType. More...
 
class  StringType
 Managed reference to StringTypeNode. More...
 
class  StringTypeNode
 Semantic string type; its physical representation is context dependent. More...
 
class  Target
 Managed reference class to TargetObj. More...
 
class  TargetKind
 Managed reference class to TargetKindObj. More...
 
class  TargetKindDef
 Temporary fluent builder for registering a target kind. More...
 
class  TargetKindObj
 Target kind, specifies the kind of the target. More...
 
class  TargetKindRegistry
 Process-wide registry of canonical target kinds, keyed by name. More...
 
class  TargetObj
 Compilation target. More...
 
class  TargetTagRegistry
 Registry of target configurations keyed by tag name. More...
 
class  TensorLoad
 Managed reference to TensorLoadNode. More...
 
class  TensorLoadNode
 Load a value from an indexed expression source. More...
 
class  TensorRegion
 Managed reference to TensorRegionNode. More...
 
class  TensorRegionNode
 A region of an indexed expression source. More...
 
class  TensorRegionType
 Managed reference to TensorRegionTypeNode. More...
 
class  TensorRegionTypeNode
 The type of a multi-dimensional tensor region expression. More...
 
class  TensorStore
 Managed reference to TensorStoreNode. More...
 
class  TensorStoreNode
 Store a primitive value to an indexed destination expression. More...
 
class  Tuple
 Managed reference to TupleNode. More...
 
class  TupleGetItem
 Managed reference to TupleGetItemNode. More...
 
class  TupleGetItemNode
 Get the index-th field out of a tuple. More...
 
class  TupleNode
 Tuple container. More...
 
class  TupleType
 Managed reference to TupleTypeNode. More...
 
class  TupleTypeNode
 The type of tuple values. More...
 
class  Type
 Managed reference to TypeNode. 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  TypedExpr
 Typed reference/view over an expression whose result type is a specific Type subtype. More...
 
class  TypeNode
 Type is the base type of all types. More...
 
class  UniqueNameSupply
 Managed reference class to UniqueNameSupplyObj. More...
 
class  UniqueNameSupplyObj
 UniqueNameSupply can be used to generate unique names. More...
 
class  UnknownLoc
 Reference to the shared immutable unknown location. More...
 
class  UnknownLocNode
 No source-location information is available. More...
 
class  Var
 Managed reference to VarNode. More...
 
class  VarNode
 A local variable in the IR. More...
 
class  While
 Managed reference to WhileNode. More...
 
class  WhileNode
 A While loop. More...
 
class  With
 RAII wrapper function to enter and exit a context object similar to python's with syntax. More...
 
class  WithGroup
 A group of RAII contexts managed together. More...
 

Typedefs

using TCallEffectKind = int64_t
 Use integer to record the kind.
 
using TFixedReturnType = Type
 An operator's result type independent of operands, attributes, and type arguments. When present, this concrete type takes precedence over FInferType.
 
using FInferType = ffi::reflection::NativeFunctionView< Type(const CallNode *call)>
 Infer a Call's result type from its explicit inputs without builder state.
 
using FRegionGetBodyParams = ffi::reflection::NativeFunctionView< ffi::Array< Var >(const CallNode *call)>
 Construct fresh typed variables for a region's lexical body parameters.
 
using FRegionValidate = ffi::reflection::NativeFunctionView< void(const RegionStmtNode *)>
 Optional dialect validation of a complete region statement.
 
using Device = DLDevice
 
using FTargetCanonicalizer = ffi::TypedFunction< ffi::Map< ffi::String, ffi::Any >(ffi::Map< ffi::String, ffi::Any >)>
 Target canonicalizer applied on instantiation of a given TargetKind.
 

Enumerations

enum class  CallEffectKind : int {
  kExprAnnotation = 0 , kPure = 1 , kReadState = 2 , kUpdateState = 3 ,
  kOpaque = kUpdateState , kSpecialCallArg = 4 , kEmbedInfo = 5 , kControlJump = 6
}
 The effect type of the call. More...
 
enum class  CallingConv : int { kDefault = 0 , kCPackedFunc = 1 , kDeviceKernelLaunch = 2 }
 Possible Calling conventions. More...
 
enum class  LinkageType : int { kInternal = 0 , kExternal = 1 }
 Supported linkage types. More...
 
enum class  ForKind : int { kDefault = 0 , kParallel = 1 , kVectorized = 2 , kUnrolled = 3 }
 The kind of the loop. More...
 

Functions

ffi::Array< Var > UndefinedVars (ffi::AnyView object, const ffi::Array< Var > &defs={})
 Find variable uses without a preceding definition in well-formed IR.
 
template<typename TFunc >
TFunc WithAttr (TFunc input, const std::string &attr_key, Any attr_value)
 Copy the function or module, but overrides the attribute value key with the value.
 
template<typename TFunc >
TFunc WithAttrs (TFunc input, ffi::Map< ffi::String, Any > attrs)
 Copy the function or module, but overrides the attributes with the entries from attrs.
 
template<typename TFunc >
TFunc WithoutAttr (TFunc input, const std::string &attr_key)
 Copy the function or module, but removes the specified attribute.
 
bool operator== (const PrimType &lhs, const PrimType &rhs)
 
bool operator!= (const PrimType &lhs, const PrimType &rhs)
 
TVM_TIRX_DLL PrimExpr operator+ (PrimExpr a, PrimExpr b)
 add operator
 
TVM_TIRX_DLL PrimExpr operator- (PrimExpr a, PrimExpr b)
 subtraction operator
 
TVM_TIRX_DLL PrimExpr operator- (PrimExpr a)
 negation.
 
TVM_TIRX_DLL PrimExpr operator* (PrimExpr a, PrimExpr b)
 multiplication operator
 
TVM_TIRX_DLL PrimExpr operator/ (PrimExpr a, PrimExpr b)
 division operator
 
TVM_TIRX_DLL PrimExpr operator<< (PrimExpr a, PrimExpr b)
 left shift operator
 
TVM_TIRX_DLL PrimExpr operator>> (PrimExpr a, PrimExpr b)
 right shift operator
 
TVM_TIRX_DLL PrimExpr operator> (PrimExpr a, PrimExpr b)
 greater
 
TVM_TIRX_DLL PrimExpr operator>= (PrimExpr a, PrimExpr b)
 greater_equal
 
TVM_TIRX_DLL PrimExpr operator< (PrimExpr a, PrimExpr b)
 less
 
TVM_TIRX_DLL PrimExpr operator<= (PrimExpr a, PrimExpr b)
 less_equal
 
TVM_TIRX_DLL PrimExpr operator== (PrimExpr a, PrimExpr b)
 equal
 
TVM_TIRX_DLL PrimExpr operator!= (PrimExpr a, PrimExpr b)
 not_equal
 
TVM_TIRX_DLL PrimExpr operator&& (PrimExpr a, PrimExpr b)
 and
 
TVM_TIRX_DLL PrimExpr operator|| (PrimExpr a, PrimExpr b)
 or
 
TVM_TIRX_DLL PrimExpr operator! (PrimExpr a)
 not
 
TVM_TIRX_DLL PrimExpr operator& (PrimExpr a, PrimExpr b)
 take bitwise and of two values
 
TVM_TIRX_DLL PrimExpr operator| (PrimExpr a, PrimExpr b)
 take bitwise or of two values
 
TVM_TIRX_DLL PrimExpr operator^ (PrimExpr a, PrimExpr b)
 take bitwise xor of two values
 
TVM_TIRX_DLL PrimExpr operator~ (PrimExpr a)
 take bitwise negation of two values
 
std::ostream & operator<< (std::ostream &os, CallEffectKind side_effect)
 
TVM_TIRX_DLL CallEffectKind SideEffect (const Expr &expr)
 Analyze the runtime effects of an expression.
 
TVM_TIRX_DLL PrimExpr add (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 add operator
 
TVM_TIRX_DLL PrimExpr sub (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 subtraction operator
 
TVM_TIRX_DLL PrimExpr neg (PrimExpr a, Location loc=UnknownLoc())
 negation.
 
TVM_TIRX_DLL PrimExpr mul (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 multiplication operator
 
TVM_TIRX_DLL PrimExpr left_shift (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 left shift operator
 
TVM_TIRX_DLL PrimExpr right_shift (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 right shift operator
 
TVM_TIRX_DLL PrimExpr greater (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 greater
 
TVM_TIRX_DLL PrimExpr greater_equal (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 greater_equal
 
TVM_TIRX_DLL PrimExpr less (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 less
 
TVM_TIRX_DLL PrimExpr less_equal (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 less_equal
 
TVM_TIRX_DLL PrimExpr equal (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 equal
 
TVM_TIRX_DLL PrimExpr not_equal (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 not_equal
 
TVM_TIRX_DLL PrimExpr logical_and (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 and
 
TVM_TIRX_DLL PrimExpr logical_or (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 or
 
TVM_TIRX_DLL PrimExpr logical_not (PrimExpr a, Location loc=UnknownLoc())
 not
 
TVM_TIRX_DLL PrimExpr div (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 compute division in C semantics.
 
TVM_TIRX_DLL PrimExpr truncdiv (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 compute trunc(a / b)
 
TVM_TIRX_DLL PrimExpr truncmod (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 compute the remainder of truncdiv
 
TVM_TIRX_DLL PrimExpr indexdiv (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 compute floor(a / b) where a and b are non-negative.
 
TVM_TIRX_DLL PrimExpr shapediv (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 compute ceil(a / b) where a and b are non-negative.
 
TVM_TIRX_DLL PrimExpr indexmod (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 compute the remainder floor(a / b) where a and b are non-negative.
 
TVM_TIRX_DLL PrimExpr floordiv (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 compute floor(a / b)
 
TVM_TIRX_DLL PrimExpr ceildiv (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 compute ceil(a / b)
 
TVM_TIRX_DLL PrimExpr floormod (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 compute the remainder of floordiv
 
TVM_TIRX_DLL PrimExpr max (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 take maximum of two values
 
TVM_TIRX_DLL PrimExpr min (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 take minimum of two values
 
TVM_TIRX_DLL PrimExpr bitwise_and (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 take bitwise and of two values
 
TVM_TIRX_DLL PrimExpr bitwise_or (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 take bitwise or of two values
 
TVM_TIRX_DLL PrimExpr bitwise_xor (PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
 take bitwise xor of two values
 
TVM_TIRX_DLL PrimExpr bitwise_neg (PrimExpr a, Location loc=UnknownLoc())
 take bitwise negation of two values
 
TVM_TIRX_DLL PrimExpr if_then_else (PrimExpr cond, PrimExpr true_value, PrimExpr false_value, Location loc=UnknownLoc())
 Conditional expression.
 
TVM_TIRX_DLL PrimExpr likely (PrimExpr cond, Location loc=UnknownLoc())
 Mark condition as likely.
 
TVM_TIRX_DLL PrimExpr ceil (PrimExpr x, Location loc=UnknownLoc())
 Round up to the nearest integral value, preserving the input type.
 
TVM_TIRX_DLL PrimExpr log2 (PrimExpr x, Location loc=UnknownLoc())
 Construct a base-two logarithm with the input's primitive type.
 
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, Location loc=UnknownLoc())
 
PrimExpr max (float a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr max (int a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr max (const PrimExpr &a, int b, Location loc=UnknownLoc())
 
PrimExpr max (const PrimExpr &a, double b, Location loc=UnknownLoc())
 
PrimExpr min (const PrimExpr &a, float b, Location loc=UnknownLoc())
 
PrimExpr min (float a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr min (int a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr min (const PrimExpr &a, int b, Location loc=UnknownLoc())
 
PrimExpr min (const PrimExpr &a, double b, Location loc=UnknownLoc())
 
PrimExpr div (const PrimExpr &a, float b, Location loc=UnknownLoc())
 
PrimExpr div (float a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr div (int a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr div (const PrimExpr &a, int b, Location loc=UnknownLoc())
 
PrimExpr div (const PrimExpr &a, double b, Location loc=UnknownLoc())
 
PrimExpr add (const PrimExpr &a, float b, Location loc=UnknownLoc())
 
PrimExpr add (float a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr add (int a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr add (const PrimExpr &a, int b, Location loc=UnknownLoc())
 
PrimExpr add (const PrimExpr &a, double b, Location loc=UnknownLoc())
 
PrimExpr sub (const PrimExpr &a, float b, Location loc=UnknownLoc())
 
PrimExpr sub (float a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr sub (int a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr sub (const PrimExpr &a, int b, Location loc=UnknownLoc())
 
PrimExpr sub (const PrimExpr &a, double b, Location loc=UnknownLoc())
 
PrimExpr mul (const PrimExpr &a, float b, Location loc=UnknownLoc())
 
PrimExpr mul (float a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr mul (int a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr mul (const PrimExpr &a, int b, Location loc=UnknownLoc())
 
PrimExpr mul (const PrimExpr &a, double b, Location loc=UnknownLoc())
 
PrimExpr greater (const PrimExpr &a, float b, Location loc=UnknownLoc())
 
PrimExpr greater (float a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr greater (int a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr greater (const PrimExpr &a, int b, Location loc=UnknownLoc())
 
PrimExpr greater (const PrimExpr &a, double b, Location loc=UnknownLoc())
 
PrimExpr greater_equal (const PrimExpr &a, float b, Location loc=UnknownLoc())
 
PrimExpr greater_equal (float a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr greater_equal (int a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr greater_equal (const PrimExpr &a, int b, Location loc=UnknownLoc())
 
PrimExpr greater_equal (const PrimExpr &a, double b, Location loc=UnknownLoc())
 
PrimExpr less (const PrimExpr &a, float b, Location loc=UnknownLoc())
 
PrimExpr less (float a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr less (int a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr less (const PrimExpr &a, int b, Location loc=UnknownLoc())
 
PrimExpr less (const PrimExpr &a, double b, Location loc=UnknownLoc())
 
PrimExpr less_equal (const PrimExpr &a, float b, Location loc=UnknownLoc())
 
PrimExpr less_equal (float a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr less_equal (int a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr less_equal (const PrimExpr &a, int b, Location loc=UnknownLoc())
 
PrimExpr less_equal (const PrimExpr &a, double b, Location loc=UnknownLoc())
 
PrimExpr indexdiv (const PrimExpr &a, int b, Location loc=UnknownLoc())
 
PrimExpr indexdiv (int a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr indexmod (const PrimExpr &a, int b, Location loc=UnknownLoc())
 
PrimExpr indexmod (int a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr truncdiv (const PrimExpr &a, int b, Location loc=UnknownLoc())
 
PrimExpr truncdiv (int a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr truncmod (const PrimExpr &a, int b, Location loc=UnknownLoc())
 
PrimExpr truncmod (int a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr floordiv (const PrimExpr &a, int b, Location loc=UnknownLoc())
 
PrimExpr floordiv (int a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr floormod (const PrimExpr &a, int b, Location loc=UnknownLoc())
 
PrimExpr floormod (int a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr right_shift (const PrimExpr &a, int b, Location loc=UnknownLoc())
 
PrimExpr right_shift (int a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr left_shift (const PrimExpr &a, int b, Location loc=UnknownLoc())
 
PrimExpr left_shift (int a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr bitwise_and (const PrimExpr &a, int b, Location loc=UnknownLoc())
 
PrimExpr bitwise_and (int a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr bitwise_or (const PrimExpr &a, int b, Location loc=UnknownLoc())
 
PrimExpr bitwise_or (int a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr bitwise_xor (const PrimExpr &a, int b, Location loc=UnknownLoc())
 
PrimExpr bitwise_xor (int a, const PrimExpr &b, Location loc=UnknownLoc())
 
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, Location loc=UnknownLoc())
 
PrimExpr logical_and (bool a, const PrimExpr &b, Location loc=UnknownLoc())
 
PrimExpr logical_or (const PrimExpr &a, bool b, Location loc=UnknownLoc())
 
PrimExpr logical_or (bool a, const PrimExpr &b, Location loc=UnknownLoc())
 
template<typename TA >
void DivAmbiguityError (const TA &a)
 Helper function to raise a compiler error about division ambiguity.
 
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)
 
TVM_TIRX_DLL bool IsRegionOp (const Op &op)
 Check FRegionGetBodyParams registration without invoking it or creating variables.
 
TVM_TIRX_DLL ffi::Array< Var > GetRegionBodyParams (Op op, ffi::Array< Expr > args, DictAttrs attrs)
 Validate region operands and construct fresh typed body parameters.
 
TVM_TIRX_DLL std::ostream & operator<< (std::ostream &os, ForKind kind)
 
const char * ForKind2String (ForKind t)
 
Type VoidType ()
 
bool IsVoidType (const Type &type)
 Check whether the tyep represents void.
 
TVM_TIRX_DLL std::string RedirectedReprPrinterMethod (const ffi::ObjectRef &obj)
 Render an IR object for its registered repr callback.
 
TVM_TIRX_DLL std::string Script (const ffi::ObjectRef &node, const ffi::Optional< PrinterConfig > &config=std::nullopt)
 Print an IR object as TVMScript, using repr when no translation hook exists.
 
PrimExpr max (PrimExpr source, ffi::Array< s_tir::IterVar > axis, ffi::Array< PrimExpr > init={}, Location loc=UnknownLoc())
 max of source expression over axis
 
PrimExpr min (PrimExpr source, ffi::Array< s_tir::IterVar > axis, ffi::Array< PrimExpr > init={}, Location loc=UnknownLoc())
 max of source expression over axis
 

Detailed Description

An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.

Context and callbacks shared by tile operation dispatchers.

Typedef Documentation

◆ Device

using tvm::Device = typedef DLDevice

◆ FInferType

using tvm::FInferType = typedef ffi::reflection::NativeFunctionView<Type(const CallNode* call)>

Infer a Call's result type from its explicit inputs without builder state.

◆ FRegionGetBodyParams

using tvm::FRegionGetBodyParams = typedef ffi::reflection::NativeFunctionView<ffi::Array<Var>(const CallNode* call)>

Construct fresh typed variables for a region's lexical body parameters.

The input carries only the operation, operands and attributes, without a body or builder state. Parameters are ordered, distinct definitions and may have name hints. Every region operation must register this hook, returning an empty array when it has no body parameters. Presence of the attribute identifies region support without invoking the hook or allocating variables.

◆ FRegionValidate

using tvm::FRegionValidate = typedef ffi::reflection::NativeFunctionView<void(const RegionStmtNode*)>

Optional dialect validation of a complete region statement.

◆ FTargetCanonicalizer

using tvm::FTargetCanonicalizer = typedef ffi::TypedFunction<ffi::Map<ffi::String, ffi::Any>(ffi::Map<ffi::String, ffi::Any>)>

Target canonicalizer applied on instantiation of a given TargetKind.

Parameters
target_jsonTarget in JSON format to be transformed during canonicalization.
Returns
The transformed Target JSON object.

◆ TCallEffectKind

using tvm::TCallEffectKind = typedef int64_t

Use integer to record the kind.

◆ TFixedReturnType

using tvm::TFixedReturnType = typedef Type

An operator's result type independent of operands, attributes, and type arguments. When present, this concrete type takes precedence over FInferType.

Enumeration Type Documentation

◆ CallEffectKind

enum class tvm::CallEffectKind : int
strong

The effect type of the call.

Enumerator
kExprAnnotation 

Function corresponds to an annotation(e.g. likely) and can translate to identity.

kPure 

Pure function that do not interacts with any external state.

kReadState 

Function's that may read from states(e.g. RAM)

kUpdateState 

Function that may read/write from states(e.g. RAM).

kOpaque 

Opaque function, cannot make any assumption.

kSpecialCallArg 

Special intrinsic to annotate call arguments info only valid as a direct argument to a call.

kEmbedInfo 

Embed opaque information in the Expr, cannot be codegen.

kControlJump 

Function that changes control flow.

◆ CallingConv

enum class tvm::CallingConv : int
strong

Possible Calling conventions.

NOTE: The calling convention also implies the way we implement the function during lowering.

Enumerator
kDefault 

Default calling convention.

  • Uses the native calling convention of the target.
  • Implementation: specified by the native target.
kCPackedFunc 

ffi::Function that exposes a Cffi::Function signature.

  • Calling by ffi::Function calling convention.
  • Implementation: Expose a function with the Cffi::Function signature.
kDeviceKernelLaunch 

Device kernel launch.

  • Call by ffi::Function calling convention.
  • Implementation: defined by device runtime(e.g. runtime/cuda)

◆ ForKind

enum class tvm::ForKind : int
strong

The kind of the loop.

ForKind can change the control flow semantics of the loop. So the kind field needs to be considered in all TIR passes.

Enumerator
kDefault 

Ordinary loop with sequential iteration semantics.

kParallel 

Parallel execution.

kVectorized 

Vector SIMD loop. The loop body will be vectorized.

kUnrolled 

The loop body must be unrolled.

◆ LinkageType

enum class tvm::LinkageType : int
strong

Supported linkage types.

Enumerator
kInternal 

Internal linkage.

kExternal 

External linkage.

  • Function with external linkage should have a global symbol attached to it.

Function Documentation

◆ add() [1/6]

PrimExpr tvm::add ( const PrimExpr &  a,
double  b,
Location  loc = UnknownLoc() 
)
inline

◆ add() [2/6]

PrimExpr tvm::add ( const PrimExpr &  a,
float  b,
Location  loc = UnknownLoc() 
)
inline

◆ add() [3/6]

PrimExpr tvm::add ( const PrimExpr &  a,
int  b,
Location  loc = UnknownLoc() 
)
inline

◆ add() [4/6]

PrimExpr tvm::add ( float  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ add() [5/6]

PrimExpr tvm::add ( int  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ add() [6/6]

TVM_TIRX_DLL PrimExpr tvm::add ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

add operator

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ bitwise_and() [1/3]

PrimExpr tvm::bitwise_and ( const PrimExpr &  a,
int  b,
Location  loc = UnknownLoc() 
)
inline

◆ bitwise_and() [2/3]

PrimExpr tvm::bitwise_and ( int  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ bitwise_and() [3/3]

TVM_TIRX_DLL PrimExpr tvm::bitwise_and ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

take bitwise and of two values

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ bitwise_neg()

TVM_TIRX_DLL PrimExpr tvm::bitwise_neg ( PrimExpr  a,
Location  loc = UnknownLoc() 
)

take bitwise negation of two values

Parameters
athe input expression.
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ bitwise_or() [1/3]

PrimExpr tvm::bitwise_or ( const PrimExpr &  a,
int  b,
Location  loc = UnknownLoc() 
)
inline

◆ bitwise_or() [2/3]

PrimExpr tvm::bitwise_or ( int  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ bitwise_or() [3/3]

TVM_TIRX_DLL PrimExpr tvm::bitwise_or ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

take bitwise or of two values

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ bitwise_xor() [1/3]

PrimExpr tvm::bitwise_xor ( const PrimExpr &  a,
int  b,
Location  loc = UnknownLoc() 
)
inline

◆ bitwise_xor() [2/3]

PrimExpr tvm::bitwise_xor ( int  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ bitwise_xor() [3/3]

TVM_TIRX_DLL PrimExpr tvm::bitwise_xor ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

take bitwise xor of two values

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ ceil()

TVM_TIRX_DLL PrimExpr tvm::ceil ( PrimExpr  x,
Location  loc = UnknownLoc() 
)

Round up to the nearest integral value, preserving the input type.

◆ ceildiv()

TVM_TIRX_DLL PrimExpr tvm::ceildiv ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

compute ceil(a / b)

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ div() [1/6]

PrimExpr tvm::div ( const PrimExpr &  a,
double  b,
Location  loc = UnknownLoc() 
)
inline

◆ div() [2/6]

PrimExpr tvm::div ( const PrimExpr &  a,
float  b,
Location  loc = UnknownLoc() 
)
inline

◆ div() [3/6]

PrimExpr tvm::div ( const PrimExpr &  a,
int  b,
Location  loc = UnknownLoc() 
)
inline

◆ div() [4/6]

PrimExpr tvm::div ( float  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ div() [5/6]

PrimExpr tvm::div ( int  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ div() [6/6]

TVM_TIRX_DLL PrimExpr tvm::div ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

compute division in C semantics.

a / b as in C/C++.

When operands are integers, it directly corresponds to truncdiv.

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ DivAmbiguityError()

template<typename TA >
void tvm::DivAmbiguityError ( const TA &  a)
inline

Helper function to raise a compiler error about division ambiguity.

Note
The call to this function will always results in a compiler error.
Template Parameters
TAAny class type.

◆ equal()

TVM_TIRX_DLL PrimExpr tvm::equal ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

equal

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ floordiv() [1/3]

PrimExpr tvm::floordiv ( const PrimExpr &  a,
int  b,
Location  loc = UnknownLoc() 
)
inline

◆ floordiv() [2/3]

PrimExpr tvm::floordiv ( int  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ floordiv() [3/3]

TVM_TIRX_DLL PrimExpr tvm::floordiv ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

compute floor(a / b)

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ floormod() [1/3]

PrimExpr tvm::floormod ( const PrimExpr &  a,
int  b,
Location  loc = UnknownLoc() 
)
inline

◆ floormod() [2/3]

PrimExpr tvm::floormod ( int  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ floormod() [3/3]

TVM_TIRX_DLL PrimExpr tvm::floormod ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

compute the remainder of floordiv

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ ForKind2String()

const char * tvm::ForKind2String ( ForKind  t)
inline

◆ GetRegionBodyParams()

TVM_TIRX_DLL ffi::Array< Var > tvm::GetRegionBodyParams ( Op  op,
ffi::Array< Expr >  args,
DictAttrs  attrs 
)

Validate region operands and construct fresh typed body parameters.

Parameters
opThe region operation.
argsOperands evaluated in the enclosing scope.
attrsAttributes evaluated in the enclosing scope.
Returns
Parameters from the required FRegionGetBodyParams hook.
Exceptions
ValueErrorif the operation has no registered region hook.

◆ greater() [1/6]

PrimExpr tvm::greater ( const PrimExpr &  a,
double  b,
Location  loc = UnknownLoc() 
)
inline

◆ greater() [2/6]

PrimExpr tvm::greater ( const PrimExpr &  a,
float  b,
Location  loc = UnknownLoc() 
)
inline

◆ greater() [3/6]

PrimExpr tvm::greater ( const PrimExpr &  a,
int  b,
Location  loc = UnknownLoc() 
)
inline

◆ greater() [4/6]

PrimExpr tvm::greater ( float  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ greater() [5/6]

PrimExpr tvm::greater ( int  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ greater() [6/6]

TVM_TIRX_DLL PrimExpr tvm::greater ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

greater

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ greater_equal() [1/6]

PrimExpr tvm::greater_equal ( const PrimExpr &  a,
double  b,
Location  loc = UnknownLoc() 
)
inline

◆ greater_equal() [2/6]

PrimExpr tvm::greater_equal ( const PrimExpr &  a,
float  b,
Location  loc = UnknownLoc() 
)
inline

◆ greater_equal() [3/6]

PrimExpr tvm::greater_equal ( const PrimExpr &  a,
int  b,
Location  loc = UnknownLoc() 
)
inline

◆ greater_equal() [4/6]

PrimExpr tvm::greater_equal ( float  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ greater_equal() [5/6]

PrimExpr tvm::greater_equal ( int  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ greater_equal() [6/6]

TVM_TIRX_DLL PrimExpr tvm::greater_equal ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

greater_equal

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ if_then_else()

TVM_TIRX_DLL PrimExpr tvm::if_then_else ( PrimExpr  cond,
PrimExpr  true_value,
PrimExpr  false_value,
Location  loc = UnknownLoc() 
)

Conditional expression.

Parameters
condThe condition
true_valueThe value when results are true.
false_valueThe value when results are false.
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ indexdiv() [1/3]

PrimExpr tvm::indexdiv ( const PrimExpr &  a,
int  b,
Location  loc = UnknownLoc() 
)
inline

◆ indexdiv() [2/3]

PrimExpr tvm::indexdiv ( int  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ indexdiv() [3/3]

TVM_TIRX_DLL PrimExpr tvm::indexdiv ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

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.

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ indexmod() [1/3]

PrimExpr tvm::indexmod ( const PrimExpr &  a,
int  b,
Location  loc = UnknownLoc() 
)
inline

◆ indexmod() [2/3]

PrimExpr tvm::indexmod ( int  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ indexmod() [3/3]

TVM_TIRX_DLL PrimExpr tvm::indexmod ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

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.

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ IsRegionOp()

TVM_TIRX_DLL bool tvm::IsRegionOp ( const Op &  op)

Check FRegionGetBodyParams registration without invoking it or creating variables.

◆ IsVoidType()

bool tvm::IsVoidType ( const Type &  type)
inline

Check whether the tyep represents void.

Returns
The check result.

◆ left_shift() [1/3]

PrimExpr tvm::left_shift ( const PrimExpr &  a,
int  b,
Location  loc = UnknownLoc() 
)
inline

◆ left_shift() [2/3]

PrimExpr tvm::left_shift ( int  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ left_shift() [3/3]

TVM_TIRX_DLL PrimExpr tvm::left_shift ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

left shift operator

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ less() [1/6]

PrimExpr tvm::less ( const PrimExpr &  a,
double  b,
Location  loc = UnknownLoc() 
)
inline

◆ less() [2/6]

PrimExpr tvm::less ( const PrimExpr &  a,
float  b,
Location  loc = UnknownLoc() 
)
inline

◆ less() [3/6]

PrimExpr tvm::less ( const PrimExpr &  a,
int  b,
Location  loc = UnknownLoc() 
)
inline

◆ less() [4/6]

PrimExpr tvm::less ( float  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ less() [5/6]

PrimExpr tvm::less ( int  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ less() [6/6]

TVM_TIRX_DLL PrimExpr tvm::less ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

less

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ less_equal() [1/6]

PrimExpr tvm::less_equal ( const PrimExpr &  a,
double  b,
Location  loc = UnknownLoc() 
)
inline

◆ less_equal() [2/6]

PrimExpr tvm::less_equal ( const PrimExpr &  a,
float  b,
Location  loc = UnknownLoc() 
)
inline

◆ less_equal() [3/6]

PrimExpr tvm::less_equal ( const PrimExpr &  a,
int  b,
Location  loc = UnknownLoc() 
)
inline

◆ less_equal() [4/6]

PrimExpr tvm::less_equal ( float  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ less_equal() [5/6]

PrimExpr tvm::less_equal ( int  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ less_equal() [6/6]

TVM_TIRX_DLL PrimExpr tvm::less_equal ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

less_equal

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ likely()

TVM_TIRX_DLL PrimExpr tvm::likely ( PrimExpr  cond,
Location  loc = UnknownLoc() 
)

Mark condition as likely.

Parameters
condThe condition
locThe location of this operation in the source.
Returns
The marked expression.

◆ log2()

TVM_TIRX_DLL PrimExpr tvm::log2 ( PrimExpr  x,
Location  loc = UnknownLoc() 
)

Construct a base-two logarithm with the input's primitive type.

◆ logical_and() [1/3]

PrimExpr tvm::logical_and ( bool  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ logical_and() [2/3]

PrimExpr tvm::logical_and ( const PrimExpr &  a,
bool  b,
Location  loc = UnknownLoc() 
)
inline

◆ logical_and() [3/3]

TVM_TIRX_DLL PrimExpr tvm::logical_and ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

and

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
This operator does eager constant folding.

◆ logical_not()

TVM_TIRX_DLL PrimExpr tvm::logical_not ( PrimExpr  a,
Location  loc = UnknownLoc() 
)

not

Parameters
aleft operand
locThe location of this operation in the source.
Returns
The result expression.
Note
This operator does eager constant folding.

◆ logical_or() [1/3]

PrimExpr tvm::logical_or ( bool  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ logical_or() [2/3]

PrimExpr tvm::logical_or ( const PrimExpr &  a,
bool  b,
Location  loc = UnknownLoc() 
)
inline

◆ logical_or() [3/3]

TVM_TIRX_DLL PrimExpr tvm::logical_or ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

or

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
This operator does eager constant folding.

◆ max() [1/7]

PrimExpr tvm::max ( const PrimExpr &  a,
double  b,
Location  loc = UnknownLoc() 
)
inline

◆ max() [2/7]

PrimExpr tvm::max ( const PrimExpr &  a,
float  b,
Location  loc = UnknownLoc() 
)
inline

◆ max() [3/7]

PrimExpr tvm::max ( const PrimExpr &  a,
int  b,
Location  loc = UnknownLoc() 
)
inline

◆ max() [4/7]

PrimExpr tvm::max ( float  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ max() [5/7]

PrimExpr tvm::max ( int  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ max() [6/7]

TVM_TIRX_DLL PrimExpr tvm::max ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

take maximum of two values

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ max() [7/7]

PrimExpr tvm::max ( PrimExpr  source,
ffi::Array< s_tir::IterVar >  axis,
ffi::Array< PrimExpr >  init = {},
Location  loc = UnknownLoc() 
)

max of source expression over axis

Parameters
sourceThe source expression.
axisList of iteration variables that will be used for reduction.
initThe value with which to initialize the output.
locThe location of this operation in the source.
Returns
The result.

◆ min() [1/7]

PrimExpr tvm::min ( const PrimExpr &  a,
double  b,
Location  loc = UnknownLoc() 
)
inline

◆ min() [2/7]

PrimExpr tvm::min ( const PrimExpr &  a,
float  b,
Location  loc = UnknownLoc() 
)
inline

◆ min() [3/7]

PrimExpr tvm::min ( const PrimExpr &  a,
int  b,
Location  loc = UnknownLoc() 
)
inline

◆ min() [4/7]

PrimExpr tvm::min ( float  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ min() [5/7]

PrimExpr tvm::min ( int  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ min() [6/7]

TVM_TIRX_DLL PrimExpr tvm::min ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

take minimum of two values

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ min() [7/7]

PrimExpr tvm::min ( PrimExpr  source,
ffi::Array< s_tir::IterVar >  axis,
ffi::Array< PrimExpr >  init = {},
Location  loc = UnknownLoc() 
)

max of source expression over axis

Parameters
sourceThe source expression.
axisList of iteration variables that will be used for reduction.
initThe value with which to initialize the output.
locThe location of this operation in the source.
Returns
The result.

◆ mul() [1/6]

PrimExpr tvm::mul ( const PrimExpr &  a,
double  b,
Location  loc = UnknownLoc() 
)
inline

◆ mul() [2/6]

PrimExpr tvm::mul ( const PrimExpr &  a,
float  b,
Location  loc = UnknownLoc() 
)
inline

◆ mul() [3/6]

PrimExpr tvm::mul ( const PrimExpr &  a,
int  b,
Location  loc = UnknownLoc() 
)
inline

◆ mul() [4/6]

PrimExpr tvm::mul ( float  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ mul() [5/6]

PrimExpr tvm::mul ( int  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ mul() [6/6]

TVM_TIRX_DLL PrimExpr tvm::mul ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

multiplication operator

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ neg()

TVM_TIRX_DLL PrimExpr tvm::neg ( PrimExpr  a,
Location  loc = UnknownLoc() 
)

negation.

Parameters
ainput.
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ not_equal()

TVM_TIRX_DLL PrimExpr tvm::not_equal ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

not_equal

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ operator!()

TVM_TIRX_DLL PrimExpr tvm::operator! ( PrimExpr  a)

not

Parameters
aleft operand
Returns
The result expression.
Note
This operator does eager constant folding.

◆ operator!=() [1/2]

bool tvm::operator!= ( const PrimType &  lhs,
const PrimType &  rhs 
)
inline

◆ operator!=() [2/2]

not_equal

Parameters
aleft operand
bright operand
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ operator%()

template<typename TB >
PrimExpr tvm::operator% ( const PrimExpr &  a,
const TB &  b 
)
inline

◆ operator&() [1/3]

PrimExpr tvm::operator& ( const PrimExpr &  a,
int  b 
)
inline

◆ operator&() [2/3]

PrimExpr tvm::operator& ( int  a,
const PrimExpr &  b 
)
inline

◆ operator&() [3/3]

TVM_TIRX_DLL PrimExpr tvm::operator& ( PrimExpr  a,
PrimExpr  b 
)

take bitwise and of two values

Parameters
aleft operand
bright operand
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ operator&&() [1/3]

PrimExpr tvm::operator&& ( bool  a,
const PrimExpr &  b 
)
inline

◆ operator&&() [2/3]

PrimExpr tvm::operator&& ( const PrimExpr &  a,
bool  b 
)
inline

◆ operator&&() [3/3]

TVM_TIRX_DLL PrimExpr tvm::operator&& ( PrimExpr  a,
PrimExpr  b 
)

and

Parameters
aleft operand
bright operand
Returns
The result expression.
Note
This operator does eager constant folding.

◆ operator*() [1/6]

PrimExpr tvm::operator* ( const PrimExpr &  a,
double  b 
)
inline

◆ operator*() [2/6]

PrimExpr tvm::operator* ( const PrimExpr &  a,
float  b 
)
inline

◆ operator*() [3/6]

PrimExpr tvm::operator* ( const PrimExpr &  a,
int  b 
)
inline

◆ operator*() [4/6]

PrimExpr tvm::operator* ( float  a,
const PrimExpr &  b 
)
inline

◆ operator*() [5/6]

PrimExpr tvm::operator* ( int  a,
const PrimExpr &  b 
)
inline

◆ operator*() [6/6]

TVM_TIRX_DLL PrimExpr tvm::operator* ( PrimExpr  a,
PrimExpr  b 
)

multiplication operator

Parameters
aleft operand
bright operand
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ operator*=()

PrimExpr tvm::operator*= ( PrimExpr &  a,
PrimExpr  b 
)
inline

◆ operator+() [1/6]

PrimExpr tvm::operator+ ( const PrimExpr &  a,
double  b 
)
inline

◆ operator+() [2/6]

PrimExpr tvm::operator+ ( const PrimExpr &  a,
float  b 
)
inline

◆ operator+() [3/6]

PrimExpr tvm::operator+ ( const PrimExpr &  a,
int  b 
)
inline

◆ operator+() [4/6]

PrimExpr tvm::operator+ ( float  a,
const PrimExpr &  b 
)
inline

◆ operator+() [5/6]

PrimExpr tvm::operator+ ( int  a,
const PrimExpr &  b 
)
inline

◆ operator+() [6/6]

TVM_TIRX_DLL PrimExpr tvm::operator+ ( PrimExpr  a,
PrimExpr  b 
)

add operator

Parameters
aleft operand
bright operand
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ operator+=()

PrimExpr tvm::operator+= ( PrimExpr &  a,
PrimExpr  b 
)
inline

◆ operator-() [1/7]

PrimExpr tvm::operator- ( const PrimExpr &  a,
double  b 
)
inline

◆ operator-() [2/7]

PrimExpr tvm::operator- ( const PrimExpr &  a,
float  b 
)
inline

◆ operator-() [3/7]

PrimExpr tvm::operator- ( const PrimExpr &  a,
int  b 
)
inline

◆ operator-() [4/7]

PrimExpr tvm::operator- ( float  a,
const PrimExpr &  b 
)
inline

◆ operator-() [5/7]

PrimExpr tvm::operator- ( int  a,
const PrimExpr &  b 
)
inline

◆ operator-() [6/7]

TVM_TIRX_DLL PrimExpr tvm::operator- ( PrimExpr  a)

negation.

Parameters
ainput.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ operator-() [7/7]

TVM_TIRX_DLL PrimExpr tvm::operator- ( PrimExpr  a,
PrimExpr  b 
)

subtraction operator

Parameters
aleft operand
bright operand
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ operator-=()

PrimExpr tvm::operator-= ( PrimExpr &  a,
PrimExpr  b 
)
inline

◆ operator/() [1/2]

template<typename TB >
PrimExpr tvm::operator/ ( const PrimExpr &  a,
const TB &  b 
)
inline

◆ operator/() [2/2]

TVM_TIRX_DLL PrimExpr tvm::operator/ ( PrimExpr  a,
PrimExpr  b 
)

division operator

Parameters
aleft operand
bright operand
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ operator/=()

template<typename TB >
PrimExpr tvm::operator/= ( const PrimExpr &  a,
const TB &  b 
)
inline

◆ operator<() [1/6]

PrimExpr tvm::operator< ( const PrimExpr &  a,
double  b 
)
inline

◆ operator<() [2/6]

PrimExpr tvm::operator< ( const PrimExpr &  a,
float  b 
)
inline

◆ operator<() [3/6]

PrimExpr tvm::operator< ( const PrimExpr &  a,
int  b 
)
inline

◆ operator<() [4/6]

PrimExpr tvm::operator< ( float  a,
const PrimExpr &  b 
)
inline

◆ operator<() [5/6]

PrimExpr tvm::operator< ( int  a,
const PrimExpr &  b 
)
inline

◆ operator<() [6/6]

TVM_TIRX_DLL PrimExpr tvm::operator< ( PrimExpr  a,
PrimExpr  b 
)

less

Parameters
aleft operand
bright operand
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ operator<<() [1/5]

PrimExpr tvm::operator<< ( const PrimExpr &  a,
int  b 
)
inline

◆ operator<<() [2/5]

PrimExpr tvm::operator<< ( int  a,
const PrimExpr &  b 
)
inline

◆ operator<<() [3/5]

TVM_TIRX_DLL PrimExpr tvm::operator<< ( PrimExpr  a,
PrimExpr  b 
)

left shift operator

Parameters
aleft operand
bright operand
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ operator<<() [4/5]

std::ostream & tvm::operator<< ( std::ostream &  os,
CallEffectKind  side_effect 
)
inline

◆ operator<<() [5/5]

TVM_TIRX_DLL std::ostream & tvm::operator<< ( std::ostream &  os,
ForKind  kind 
)

◆ operator<=() [1/6]

PrimExpr tvm::operator<= ( const PrimExpr &  a,
double  b 
)
inline

◆ operator<=() [2/6]

PrimExpr tvm::operator<= ( const PrimExpr &  a,
float  b 
)
inline

◆ operator<=() [3/6]

PrimExpr tvm::operator<= ( const PrimExpr &  a,
int  b 
)
inline

◆ operator<=() [4/6]

PrimExpr tvm::operator<= ( float  a,
const PrimExpr &  b 
)
inline

◆ operator<=() [5/6]

PrimExpr tvm::operator<= ( int  a,
const PrimExpr &  b 
)
inline

◆ operator<=() [6/6]

TVM_TIRX_DLL PrimExpr tvm::operator<= ( PrimExpr  a,
PrimExpr  b 
)

less_equal

Parameters
aleft operand
bright operand
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ operator==() [1/2]

bool tvm::operator== ( const PrimType &  lhs,
const PrimType &  rhs 
)
inline

◆ operator==() [2/2]

TVM_TIRX_DLL PrimExpr tvm::operator== ( PrimExpr  a,
PrimExpr  b 
)

equal

Parameters
aleft operand
bright operand
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ operator>() [1/6]

PrimExpr tvm::operator> ( const PrimExpr &  a,
double  b 
)
inline

◆ operator>() [2/6]

PrimExpr tvm::operator> ( const PrimExpr &  a,
float  b 
)
inline

◆ operator>() [3/6]

PrimExpr tvm::operator> ( const PrimExpr &  a,
int  b 
)
inline

◆ operator>() [4/6]

PrimExpr tvm::operator> ( float  a,
const PrimExpr &  b 
)
inline

◆ operator>() [5/6]

PrimExpr tvm::operator> ( int  a,
const PrimExpr &  b 
)
inline

◆ operator>() [6/6]

TVM_TIRX_DLL PrimExpr tvm::operator> ( PrimExpr  a,
PrimExpr  b 
)

greater

Parameters
aleft operand
bright operand
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ operator>=() [1/6]

PrimExpr tvm::operator>= ( const PrimExpr &  a,
double  b 
)
inline

◆ operator>=() [2/6]

PrimExpr tvm::operator>= ( const PrimExpr &  a,
float  b 
)
inline

◆ operator>=() [3/6]

PrimExpr tvm::operator>= ( const PrimExpr &  a,
int  b 
)
inline

◆ operator>=() [4/6]

PrimExpr tvm::operator>= ( float  a,
const PrimExpr &  b 
)
inline

◆ operator>=() [5/6]

PrimExpr tvm::operator>= ( int  a,
const PrimExpr &  b 
)
inline

◆ operator>=() [6/6]

TVM_TIRX_DLL PrimExpr tvm::operator>= ( PrimExpr  a,
PrimExpr  b 
)

greater_equal

Parameters
aleft operand
bright operand
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ operator>>() [1/3]

PrimExpr tvm::operator>> ( const PrimExpr &  a,
int  b 
)
inline

◆ operator>>() [2/3]

PrimExpr tvm::operator>> ( int  a,
const PrimExpr &  b 
)
inline

◆ operator>>() [3/3]

TVM_TIRX_DLL PrimExpr tvm::operator>> ( PrimExpr  a,
PrimExpr  b 
)

right shift operator

Parameters
aleft operand
bright operand
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ operator^() [1/3]

PrimExpr tvm::operator^ ( const PrimExpr &  a,
int  b 
)
inline

◆ operator^() [2/3]

PrimExpr tvm::operator^ ( int  a,
const PrimExpr &  b 
)
inline

◆ operator^() [3/3]

TVM_TIRX_DLL PrimExpr tvm::operator^ ( PrimExpr  a,
PrimExpr  b 
)

take bitwise xor of two values

Parameters
aleft operand
bright operand
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ operator|() [1/3]

PrimExpr tvm::operator| ( const PrimExpr &  a,
int  b 
)
inline

◆ operator|() [2/3]

PrimExpr tvm::operator| ( int  a,
const PrimExpr &  b 
)
inline

◆ operator|() [3/3]

TVM_TIRX_DLL PrimExpr tvm::operator| ( PrimExpr  a,
PrimExpr  b 
)

take bitwise or of two values

Parameters
aleft operand
bright operand
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ operator||() [1/3]

PrimExpr tvm::operator|| ( bool  a,
const PrimExpr &  b 
)
inline

◆ operator||() [2/3]

PrimExpr tvm::operator|| ( const PrimExpr &  a,
bool  b 
)
inline

◆ operator||() [3/3]

TVM_TIRX_DLL PrimExpr tvm::operator|| ( PrimExpr  a,
PrimExpr  b 
)

or

Parameters
aleft operand
bright operand
Returns
The result expression.
Note
This operator does eager constant folding.

◆ operator~()

TVM_TIRX_DLL PrimExpr tvm::operator~ ( PrimExpr  a)

take bitwise negation of two values

Parameters
athe input expression.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ RedirectedReprPrinterMethod()

TVM_TIRX_DLL std::string tvm::RedirectedReprPrinterMethod ( const ffi::ObjectRef &  obj)

Render an IR object for its registered repr callback.

Tries to translate obj directly; on error falls back to a plain address string. Defined in src/script/printer/script_printer.cc so that <tvm/runtime/logging.h> is not pulled into this public header.

◆ right_shift() [1/3]

PrimExpr tvm::right_shift ( const PrimExpr &  a,
int  b,
Location  loc = UnknownLoc() 
)
inline

◆ right_shift() [2/3]

PrimExpr tvm::right_shift ( int  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ right_shift() [3/3]

TVM_TIRX_DLL PrimExpr tvm::right_shift ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

right shift operator

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ Script()

TVM_TIRX_DLL std::string tvm::Script ( const ffi::ObjectRef &  node,
const ffi::Optional< PrinterConfig > &  config = std::nullopt 
)

Print an IR object as TVMScript, using repr when no translation hook exists.

Parameters
nodeThe input IR object.
configOptional translation and rendering configuration.
Returns
The rendered script or fallback representation.

◆ shapediv()

TVM_TIRX_DLL PrimExpr tvm::shapediv ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

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.

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for shape types(int32, int64) when possible.

◆ SideEffect()

TVM_TIRX_DLL CallEffectKind tvm::SideEffect ( const Expr &  expr)

Analyze the runtime effects of an expression.

Accumulates effects of evaluated expression children, excluding type and vector lane-count metadata. Non-operator callees are conservatively opaque. Missing operator effect attributes are errors unless an earlier update effect stops traversal. Returns kPure, kReadState, or kUpdateState.

Shared IR contains only minimal analyses of expression properties. Arithmetic reasoning, constraint solving, and target- or dialect-specific analyses belong in their respective modules.

Parameters
exprThe expression to inspect.
Returns
The strongest runtime effect of the expression.

◆ sub() [1/6]

PrimExpr tvm::sub ( const PrimExpr &  a,
double  b,
Location  loc = UnknownLoc() 
)
inline

◆ sub() [2/6]

PrimExpr tvm::sub ( const PrimExpr &  a,
float  b,
Location  loc = UnknownLoc() 
)
inline

◆ sub() [3/6]

PrimExpr tvm::sub ( const PrimExpr &  a,
int  b,
Location  loc = UnknownLoc() 
)
inline

◆ sub() [4/6]

PrimExpr tvm::sub ( float  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ sub() [5/6]

PrimExpr tvm::sub ( int  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ sub() [6/6]

TVM_TIRX_DLL PrimExpr tvm::sub ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

subtraction operator

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ truncdiv() [1/3]

PrimExpr tvm::truncdiv ( const PrimExpr &  a,
int  b,
Location  loc = UnknownLoc() 
)
inline

◆ truncdiv() [2/3]

PrimExpr tvm::truncdiv ( int  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ truncdiv() [3/3]

TVM_TIRX_DLL PrimExpr tvm::truncdiv ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

compute trunc(a / b)

This is the default integer division behavior in C.

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ truncmod() [1/3]

PrimExpr tvm::truncmod ( const PrimExpr &  a,
int  b,
Location  loc = UnknownLoc() 
)
inline

◆ truncmod() [2/3]

PrimExpr tvm::truncmod ( int  a,
const PrimExpr &  b,
Location  loc = UnknownLoc() 
)
inline

◆ truncmod() [3/3]

TVM_TIRX_DLL PrimExpr tvm::truncmod ( PrimExpr  a,
PrimExpr  b,
Location  loc = UnknownLoc() 
)

compute the remainder of truncdiv

This is the default integer division behavior in C.

Parameters
aleft operand
bright operand
locThe location of this operation in the source.
Returns
The result expression.
Note
this function does eager constant folding for index types(int32, int64) when possible.

◆ UndefinedVars()

ffi::Array< Var > tvm::UndefinedVars ( ffi::AnyView  object,
const ffi::Array< Var > &  defs = {} 
)
inline

Find variable uses without a preceding definition in well-formed IR.

Definitions follow the structural definition-site metadata. Variable types are traversed at definitions, while variable uses are leaves. Scope and duplicate-definition validation belong to the IR verifier.

Parameters
objectThe IR object to visit.
defsVariables already defined outside the object.
Returns
Undefined variables, uniquely ordered by their first use.

◆ VoidType()

Type tvm::VoidType ( )
inline
Returns
a type that represents void.

◆ WithAttr()

template<typename TFunc >
TFunc tvm::WithAttr ( TFunc  input,
const std::string &  attr_key,
Any  attr_value 
)
inline

Copy the function or module, but overrides the attribute value key with the value.

Parameters
inputThe thing to annotate (BaseFunc or IRModule)
attr_keyThe attribute key.
attr_valueThe value attribute value.
Template Parameters
TFuncThe corresponding function or module type, including BaseFunc. Shared inputs must register a reflected shallow-copy constructor.
Returns
The new function or module with updated attributes.
Note
This function performs copy on write optimization for func and module. If we move a uniquely referenced func or module into WithAttr, then no additional copy will be performed.

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.

// Recommended way to trigger copy on write
func = WithAttr(std::move(func), "key1", value1);
func = WithAttr(std::move(func), "key2", value2);
TFunc WithAttr(TFunc input, const std::string &attr_key, Any attr_value)
Copy the function or module, but overrides the attribute value key with the value.
Definition attrs.h:252

◆ WithAttrs()

template<typename TFunc >
TFunc tvm::WithAttrs ( TFunc  input,
ffi::Map< ffi::String, Any >  attrs 
)
inline

Copy the function or module, but overrides the attributes with the entries from attrs.

Parameters
inputThe thing to annotate (BaseFunc or IRModule)
attrsKey/values attributes to add to input.
Template Parameters
TFuncThe corresponding function or module type, including BaseFunc. Shared inputs must register a reflected shallow-copy constructor.
Returns
The new function or module with updated attributes.

◆ WithoutAttr()

template<typename TFunc >
TFunc tvm::WithoutAttr ( TFunc  input,
const std::string &  attr_key 
)
inline

Copy the function or module, but removes the specified attribute.

Parameters
inputThe thing to annotate (BaseFunc or IRModule)
attr_keyThe attribute key.
Template Parameters
TFuncThe corresponding function or module type, including BaseFunc. Shared inputs must register a reflected shallow-copy constructor.
Returns
The new function or module with removed attribute.
Note
This function performs copy on write optimization for func and module. If we move a uniquely referenced func or module into WithoutAttr, then no additional copy will be performed.

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.

// Recommended way to trigger copy on write
func = WithoutAttr(std::move(func), "key1");
func = WithoutAttr(std::move(func), "key2");
TFunc WithoutAttr(TFunc input, const std::string &attr_key)
Copy the function or module, but removes the specified attribute.
Definition attrs.h:340