tvm
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
tvm::prim Namespace Reference

Classes

class  Add
 Managed reference to AddNode. More...
 
class  AddNode
 a + b More...
 
class  And
 Managed reference to AndNode. More...
 
class  AndNode
 a && b More...
 
class  BinaryOpNode
 Base template to implement binary ops. More...
 
class  BitwiseAnd
 Managed reference to BitwiseAndNode. More...
 
class  BitwiseAndNode
 a & b More...
 
class  BitwiseNot
 Managed reference to BitwiseNotNode. More...
 
class  BitwiseNotNode
 ~a More...
 
class  BitwiseOr
 Managed reference to BitwiseOrNode. More...
 
class  BitwiseOrNode
 a | b More...
 
class  BitwiseXor
 Managed reference to BitwiseXorNode. More...
 
class  BitwiseXorNode
 a ^ b More...
 
class  Broadcast
 Managed reference to BroadcastNode. More...
 
class  BroadcastNode
 Create a vector where all the elements are value. More...
 
class  Cast
 Managed reference to CastNode. More...
 
class  CastNode
 Cast value from one data type to another. More...
 
class  CmpOpNode
 Base template to implement comparison ops. More...
 
class  Div
 Managed reference to DivNode. More...
 
class  DivNode
 a / b in the C semnatics. More...
 
class  EQ
 Managed reference to EQNode. More...
 
class  EQNode
 a == b More...
 
struct  ExprDeepEqual
 Compare two expressions recursively and check if they are equal to each other without var remapping. More...
 
class  FloorDiv
 Managed reference to FloorDivNode. More...
 
class  FloorDivNode
 Floor division, floor(a/b) More...
 
class  FloorMod
 Managed reference to FloorModNode. More...
 
class  FloorModNode
 The remainder of the floordiv. More...
 
class  GE
 Managed reference to GENode. More...
 
class  GENode
 a >= b More...
 
class  GT
 Managed reference to GTNode. More...
 
class  GTNode
 a > b More...
 
class  LE
 Managed reference to LENode. More...
 
struct  LENode
 a <= b More...
 
class  Let
 Managed reference to LetNode. More...
 
class  LetNode
 Let binding. Bind var to value then evaluate body. More...
 
class  LShift
 Managed reference to LShiftNode. More...
 
class  LShiftNode
 a << b More...
 
class  LT
 Managed reference to LTNode. More...
 
class  LTNode
 a < b More...
 
class  Max
 Managed reference to MaxNode. More...
 
class  MaxNode
 max(a, b) More...
 
class  Min
 Managed reference to MinNode. More...
 
class  MinNode
 min(a, b) More...
 
class  Mod
 Managed reference to ModNode. More...
 
class  ModNode
 a % b in the C semnatics. More...
 
class  Mul
 Managed reference to MulNode. More...
 
class  MulNode
 a * b More...
 
class  NE
 Managed reference to NENode. More...
 
class  NENode
 a != b More...
 
class  Not
 Managed reference to NotNode. More...
 
class  NotNode
 !a More...
 
class  Or
 Managed reference to OrNode. More...
 
class  OrNode
 a || b More...
 
class  Ramp
 Managed reference to RampNode. More...
 
class  RampNode
 Construct a vector with lanes elements where its i-th element equals base + i * stride. This is useful to construct a index for a continuous vector load. More...
 
class  RShift
 Managed reference to RShiftNode. More...
 
class  RShiftNode
 a >> b More...
 
class  Select
 Managed reference to SelectNode. More...
 
class  SelectNode
 return true_value if condition is true, otherwise return false_value. More...
 
class  Shuffle
 Managed reference to ShuffleNode. More...
 
class  ShuffleNode
 Shuffle instruction. vec = concat(vectors) result = (vec[indices[0]], vec[indices[1]] ...) More...
 
class  Sub
 Managed reference to SubNode. More...
 
class  SubNode
 a - b More...
 

Typedefs

using IntImmNode = tvm::IntImmNode
 
using FloatImmNode = tvm::FloatImmNode
 

Functions

template<typename K , typename V >
std::unordered_map< K, V > as_unordered_map (const ffi::Map< K, V > &dmap)
 
TVM_TIRX_DLL const Op & vscale_op ()
 Get the target's vscale value. It will be lowered to llvm.vscale intrinsic (https://llvm.org/docs/LangRef.html#llvm-vscale-intrinsic)
 
TVM_TIRX_DLL const Op & ceil_op ()
 Round up to the nearest integral value.
 
TVM_TIRX_DLL const Op & log2_op ()
 Base-two logarithm.
 
TVM_TIRX_DLL const Op & clz_op ()
 Count leading zero bits.
 
TVM_TIRX_DLL const Op & if_then_else_op ()
 Same as select, used for unsafe memory access.
 
TVM_TIRX_DLL const Op & likely_op ()
 Marks a condition is likely going to happen.
 
TVM_TIRX_DLL PrimExpr clz (PrimExpr x, Location loc=UnknownLoc())
 Count leading zero bits, preserving the input primitive type.
 
TVM_TIRX_DLL PrimExpr min_value (PrimType dtype, Location loc=UnknownLoc())
 
TVM_TIRX_DLL PrimExpr max_value (PrimType dtype, Location loc=UnknownLoc())
 
TVM_TIRX_DLL PrimExpr cast (PrimType t, PrimExpr value, Location loc=UnknownLoc())
 cast value to type.
 
TVM_TIRX_DLL PrimExpr cast (DLDataType t, PrimExpr value, Location loc=UnknownLoc())
 
TVM_TIRX_DLL PrimExpr IntegerAbs (PrimExpr x, Location loc=UnknownLoc())
 Construct integer absolute value; floating absolute value belongs to TIRX.
 
template<typename ValueType , typename = typename std::enable_if<(std::is_standard_layout<ValueType>::value && std::is_trivial<ValueType>::value) || std::is_same<ValueType, ffi::BigInt>::value>::type>
PrimExpr MakeConst (PrimType dtype, ValueType value, Location loc=UnknownLoc())
 Make a const value with certain data type.
 
template<typename ValueType >
PrimExpr MakeConstScalar (PrimType dtype, ValueType value, Location loc=UnknownLoc())
 
template<>
PrimExpr MakeConstScalar (PrimType dtype, bool value, Location loc)
 
bool IsConstInt (const PrimExpr &x, int64_t value)
 Check whether x is a constant integer expression.
 
bool IsOne (const PrimExpr &x)
 Check whether x is a constant integer 1.
 
bool IsZero (const PrimExpr &x)
 Check whether x is a constant integer 0.
 
bool IsConstInt (const PrimExpr &x)
 Check whether x is an integer constant, including wide IntImm values.
 
bool IsConstNumber (const PrimExpr &x)
 Check whether x is an integer or floating-point constant.
 
TVM_TIRX_DLL bool IsPowerOfTwoInt (const PrimExpr &x, int *shift)
 Check whether x is a constant power of two If x is power of two, write the power to the shift.
 
bool IsPositiveConst (const PrimExpr &a)
 Check whether a is a positive integer constant.
 
bool IsNegativeConst (const PrimExpr &a)
 Check whether a is a negative integer constant.
 
TVM_TIRX_DLL PrimExpr infinity (PrimType dtype, Location loc=UnknownLoc())
 
TVM_TIRX_DLL PrimExpr pow (PrimExpr x, PrimExpr y, Location loc=UnknownLoc())
 Calculate power(x, y)
 
TVM_TIRX_DLL PrimExpr abs (PrimExpr x, Location loc=UnknownLoc())
 Calculate absolute value of x.
 
TVM_TIRX_DLL PrimExpr isnan (PrimExpr x, Location loc=UnknownLoc())
 Check if x is NaN.
 
TVM_TIRX_DLL PrimExpr isfinite (PrimExpr x, Location loc=UnknownLoc())
 Check if x is finite.
 
TVM_TIRX_DLL PrimExpr isinf (PrimExpr x, Location loc=UnknownLoc())
 Check if x is infinite.
 
TVM_TIRX_DLL PrimExpr floor (PrimExpr x, Location loc=UnknownLoc())
 Calculate floor(x)
 
TVM_TIRX_DLL PrimExpr round (PrimExpr x, Location loc=UnknownLoc())
 Round x to the nearest integer, ties to even.
 
TVM_TIRX_DLL PrimExpr nearbyint (PrimExpr x, Location loc=UnknownLoc())
 Round x to the nearest integer, ties to even.
 
TVM_TIRX_DLL PrimExpr trunc (PrimExpr x, Location loc=UnknownLoc())
 Calculate trunc(x)
 
TVM_TIRX_DLL PrimExpr fmod (PrimExpr x, PrimExpr y, Location loc=UnknownLoc())
 Floating-point remainder of x divided by y.
 
TVM_TIRX_DLL const Op & pow_op ()
 Raise x to the power y. Arguments: x, y.
 
TVM_TIRX_DLL const Op & fabs_op ()
 Absolute value. Argument: x.
 
TVM_TIRX_DLL const Op & fmod_op ()
 Floating-point remainder. Arguments: x, y.
 
TVM_TIRX_DLL const Op & floor_op ()
 Round toward negative infinity. Argument: x.
 
TVM_TIRX_DLL const Op & round_op ()
 Round to nearest integer, ties to even. Argument: x.
 
TVM_TIRX_DLL const Op & nearbyint_op ()
 Round to nearest integer, ties to even. Argument: x.
 
TVM_TIRX_DLL const Op & trunc_op ()
 Round toward zero. Argument: x.
 
TVM_TIRX_DLL const Op & exp_op ()
 Natural exponential. Argument: x.
 
TVM_TIRX_DLL const Op & exp2_op ()
 Base-two exponential. Argument: x.
 
TVM_TIRX_DLL const Op & exp10_op ()
 Base-ten exponential. Argument: x.
 
TVM_TIRX_DLL const Op & erf_op ()
 Error function. Argument: x.
 
TVM_TIRX_DLL const Op & tanh_op ()
 Hyperbolic tangent. Argument: x.
 
TVM_TIRX_DLL const Op & sigmoid_op ()
 Logistic sigmoid. Argument: x.
 
TVM_TIRX_DLL const Op & sqrt_op ()
 Square root. Argument: x.
 
TVM_TIRX_DLL const Op & rsqrt_op ()
 Reciprocal square root. Argument: x.
 
TVM_TIRX_DLL const Op & log_op ()
 Natural logarithm. Argument: x.
 
TVM_TIRX_DLL const Op & log1p_op ()
 Natural logarithm of one plus x. Argument: x.
 
TVM_TIRX_DLL const Op & log10_op ()
 Base-ten logarithm. Argument: x.
 
TVM_TIRX_DLL const Op & tan_op ()
 Tangent. Argument: x.
 
TVM_TIRX_DLL const Op & cos_op ()
 Cosine. Argument: x.
 
TVM_TIRX_DLL const Op & cosh_op ()
 Hyperbolic cosine. Argument: x.
 
TVM_TIRX_DLL const Op & sin_op ()
 Sine. Argument: x.
 
TVM_TIRX_DLL const Op & sinh_op ()
 Hyperbolic sine. Argument: x.
 
TVM_TIRX_DLL const Op & asin_op ()
 Inverse sine. Argument: x.
 
TVM_TIRX_DLL const Op & acos_op ()
 Inverse cosine. Argument: x.
 
TVM_TIRX_DLL const Op & atan_op ()
 Inverse tangent. Argument: x.
 
TVM_TIRX_DLL const Op & acosh_op ()
 Inverse hyperbolic cosine. Argument: x.
 
TVM_TIRX_DLL const Op & asinh_op ()
 Inverse hyperbolic sine. Argument: x.
 
TVM_TIRX_DLL const Op & atanh_op ()
 Inverse hyperbolic tangent. Argument: x.
 
TVM_TIRX_DLL const Op & atan2_op ()
 Inverse tangent of y/x with quadrant selection. Arguments: y, x.
 
TVM_TIRX_DLL const Op & nextafter_op ()
 Next representable value from x toward y. Arguments: x, y.
 
TVM_TIRX_DLL const Op & hypot_op ()
 Euclidean length of x and y. Arguments: x, y.
 
TVM_TIRX_DLL const Op & copysign_op ()
 Magnitude of x with the sign of y. Arguments: x, y.
 
TVM_TIRX_DLL const Op & ldexp_op ()
 Multiply x by two raised to exponent. Arguments: x, exponent.
 
TVM_TIRX_DLL const Op & isnan_op ()
 Check for NaN, preserving the lane count. Argument: x.
 
TVM_TIRX_DLL const Op & popcount_op ()
 Count set bits. Argument: x.
 
TVM_TIRX_DLL const Op & fma_op ()
 Fused multiply-add, x * y + z. Arguments: x, y, z.
 
TVM_TIRX_DLL const Op & assume_op ()
 Record a known condition for simplification. Argument: condition.
 
TVM_TIRX_DLL PrimExpr assume (PrimExpr condition, Location loc=UnknownLoc())
 Record a known condition for compile-time simplification.
 
PrimExpr fma (PrimExpr x, PrimExpr y, PrimExpr z, Location loc=UnknownLoc())
 Fused multiply-add of x, y and z, in that order.
 
void CheckMathUnaryOpInputDType (const char *op_name, const PrimType &dtype)
 
PrimExpr exp (PrimExpr x, Location loc=UnknownLoc())
 
PrimExpr exp2 (PrimExpr x, Location loc=UnknownLoc())
 
PrimExpr exp10 (PrimExpr x, Location loc=UnknownLoc())
 
PrimExpr erf (PrimExpr x, Location loc=UnknownLoc())
 
PrimExpr tanh (PrimExpr x, Location loc=UnknownLoc())
 
PrimExpr sigmoid (PrimExpr x, Location loc=UnknownLoc())
 
PrimExpr sqrt (PrimExpr x, Location loc=UnknownLoc())
 
PrimExpr rsqrt (PrimExpr x, Location loc=UnknownLoc())
 
PrimExpr log (PrimExpr x, Location loc=UnknownLoc())
 
PrimExpr log10 (PrimExpr x, Location loc=UnknownLoc())
 
PrimExpr log1p (PrimExpr x, Location loc=UnknownLoc())
 
PrimExpr popcount (PrimExpr x, Location loc=UnknownLoc())
 
PrimExpr tan (PrimExpr x, Location loc=UnknownLoc())
 
PrimExpr cos (PrimExpr x, Location loc=UnknownLoc())
 
PrimExpr cosh (PrimExpr x, Location loc=UnknownLoc())
 
PrimExpr sin (PrimExpr x, Location loc=UnknownLoc())
 
PrimExpr sinh (PrimExpr x, Location loc=UnknownLoc())
 
PrimExpr asin (PrimExpr x, Location loc=UnknownLoc())
 
PrimExpr acos (PrimExpr x, Location loc=UnknownLoc())
 
PrimExpr atan (PrimExpr x, Location loc=UnknownLoc())
 
PrimExpr acosh (PrimExpr x, Location loc=UnknownLoc())
 
PrimExpr asinh (PrimExpr x, Location loc=UnknownLoc())
 
PrimExpr atanh (PrimExpr x, Location loc=UnknownLoc())
 
PrimExpr atan2 (PrimExpr x, PrimExpr y, Location loc=UnknownLoc())
 
PrimExpr nextafter (PrimExpr x, PrimExpr y, Location loc=UnknownLoc())
 
PrimExpr copysign (PrimExpr x, PrimExpr y, Location loc=UnknownLoc())
 
PrimExpr hypot (PrimExpr x, PrimExpr y, Location loc=UnknownLoc())
 
PrimExpr ldexp (PrimExpr x, PrimExpr y, Location loc=UnknownLoc())
 
template<typename FReduce >
PrimExpr foldl (FReduce freduce, PrimExpr init_value, const ffi::Array< PrimExpr > &values, Location loc=UnknownLoc())
 
PrimExpr sum (PrimExpr source, ffi::Array< s_tir::IterVar > axis, ffi::Array< PrimExpr > init={}, Location loc=UnknownLoc())
 sum of source expression over axis
 
PrimExpr all (PrimExpr source, ffi::Array< s_tir::IterVar > axis, ffi::Array< PrimExpr > init={}, Location loc=UnknownLoc())
 logical And of source expression over axis
 
PrimExpr any (PrimExpr source, ffi::Array< s_tir::IterVar > axis, ffi::Array< PrimExpr > init={}, Location loc=UnknownLoc())
 logical Or of source expression over axis
 
PrimExpr prod (PrimExpr source, ffi::Array< s_tir::IterVar > axis, ffi::Array< PrimExpr > init={}, Location loc=UnknownLoc())
 product of source expression over axis
 

Typedef Documentation

◆ FloatImmNode

◆ IntImmNode

Function Documentation

◆ abs()

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

Calculate absolute value of x.

Parameters
xThe input data
locThe location of this operation in the source.
Returns
The absolute value of input data x

◆ acos()

PrimExpr tvm::prim::acos ( PrimExpr  x,
Location  loc = UnknownLoc() 
)
inline

◆ acos_op()

TVM_TIRX_DLL const Op & tvm::prim::acos_op ( )

Inverse cosine. Argument: x.

◆ acosh()

PrimExpr tvm::prim::acosh ( PrimExpr  x,
Location  loc = UnknownLoc() 
)
inline

◆ acosh_op()

TVM_TIRX_DLL const Op & tvm::prim::acosh_op ( )

Inverse hyperbolic cosine. Argument: x.

◆ all()

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

logical And 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.

◆ any()

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

logical Or 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.

◆ as_unordered_map()

template<typename K , typename V >
std::unordered_map< K, V > tvm::prim::as_unordered_map ( const ffi::Map< K, V > &  dmap)
inline

◆ asin()

PrimExpr tvm::prim::asin ( PrimExpr  x,
Location  loc = UnknownLoc() 
)
inline

◆ asin_op()

TVM_TIRX_DLL const Op & tvm::prim::asin_op ( )

Inverse sine. Argument: x.

◆ asinh()

PrimExpr tvm::prim::asinh ( PrimExpr  x,
Location  loc = UnknownLoc() 
)
inline

◆ asinh_op()

TVM_TIRX_DLL const Op & tvm::prim::asinh_op ( )

Inverse hyperbolic sine. Argument: x.

◆ assume()

TVM_TIRX_DLL PrimExpr tvm::prim::assume ( PrimExpr  condition,
Location  loc = UnknownLoc() 
)

Record a known condition for compile-time simplification.

◆ assume_op()

TVM_TIRX_DLL const Op & tvm::prim::assume_op ( )

Record a known condition for simplification. Argument: condition.

◆ atan()

PrimExpr tvm::prim::atan ( PrimExpr  x,
Location  loc = UnknownLoc() 
)
inline

◆ atan2()

PrimExpr tvm::prim::atan2 ( PrimExpr  x,
PrimExpr  y,
Location  loc = UnknownLoc() 
)
inline

◆ atan2_op()

TVM_TIRX_DLL const Op & tvm::prim::atan2_op ( )

Inverse tangent of y/x with quadrant selection. Arguments: y, x.

◆ atan_op()

TVM_TIRX_DLL const Op & tvm::prim::atan_op ( )

Inverse tangent. Argument: x.

◆ atanh()

PrimExpr tvm::prim::atanh ( PrimExpr  x,
Location  loc = UnknownLoc() 
)
inline

◆ atanh_op()

TVM_TIRX_DLL const Op & tvm::prim::atanh_op ( )

Inverse hyperbolic tangent. Argument: x.

◆ cast() [1/2]

TVM_TIRX_DLL PrimExpr tvm::prim::cast ( DLDataType  t,
PrimExpr  value,
Location  loc = UnknownLoc() 
)

◆ cast() [2/2]

TVM_TIRX_DLL PrimExpr tvm::prim::cast ( PrimType  t,
PrimExpr  value,
Location  loc = UnknownLoc() 
)

cast value to type.

Parameters
tthe target type.
valueThe value
locThe location of this operation in the source.
Returns
The result expression.
Note
This function may return value if the type is the same. Constant folding uses MakeConst for scalar and vector constants.

◆ ceil_op()

TVM_TIRX_DLL const Op & tvm::prim::ceil_op ( )

Round up to the nearest integral value.

◆ CheckMathUnaryOpInputDType()

void tvm::prim::CheckMathUnaryOpInputDType ( const char *  op_name,
const PrimType &  dtype 
)
inline

◆ clz()

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

Count leading zero bits, preserving the input primitive type.

◆ clz_op()

TVM_TIRX_DLL const Op & tvm::prim::clz_op ( )

Count leading zero bits.

◆ copysign()

PrimExpr tvm::prim::copysign ( PrimExpr  x,
PrimExpr  y,
Location  loc = UnknownLoc() 
)
inline

◆ copysign_op()

TVM_TIRX_DLL const Op & tvm::prim::copysign_op ( )

Magnitude of x with the sign of y. Arguments: x, y.

◆ cos()

PrimExpr tvm::prim::cos ( PrimExpr  x,
Location  loc = UnknownLoc() 
)
inline

◆ cos_op()

TVM_TIRX_DLL const Op & tvm::prim::cos_op ( )

Cosine. Argument: x.

◆ cosh()

PrimExpr tvm::prim::cosh ( PrimExpr  x,
Location  loc = UnknownLoc() 
)
inline

◆ cosh_op()

TVM_TIRX_DLL const Op & tvm::prim::cosh_op ( )

Hyperbolic cosine. Argument: x.

◆ erf()

PrimExpr tvm::prim::erf ( PrimExpr  x,
Location  loc = UnknownLoc() 
)
inline

◆ erf_op()

TVM_TIRX_DLL const Op & tvm::prim::erf_op ( )

Error function. Argument: x.

◆ exp()

PrimExpr tvm::prim::exp ( PrimExpr  x,
Location  loc = UnknownLoc() 
)
inline

◆ exp10()

PrimExpr tvm::prim::exp10 ( PrimExpr  x,
Location  loc = UnknownLoc() 
)
inline

◆ exp10_op()

TVM_TIRX_DLL const Op & tvm::prim::exp10_op ( )

Base-ten exponential. Argument: x.

◆ exp2()

PrimExpr tvm::prim::exp2 ( PrimExpr  x,
Location  loc = UnknownLoc() 
)
inline

◆ exp2_op()

TVM_TIRX_DLL const Op & tvm::prim::exp2_op ( )

Base-two exponential. Argument: x.

◆ exp_op()

TVM_TIRX_DLL const Op & tvm::prim::exp_op ( )

Natural exponential. Argument: x.

◆ fabs_op()

TVM_TIRX_DLL const Op & tvm::prim::fabs_op ( )

Absolute value. Argument: x.

◆ floor()

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

Calculate floor(x)

Parameters
xThe input expression.
locThe location of this operation in the source.
Returns
The result expression.

◆ floor_op()

TVM_TIRX_DLL const Op & tvm::prim::floor_op ( )

Round toward negative infinity. Argument: x.

◆ fma()

PrimExpr tvm::prim::fma ( PrimExpr  x,
PrimExpr  y,
PrimExpr  z,
Location  loc = UnknownLoc() 
)
inline

Fused multiply-add of x, y and z, in that order.

◆ fma_op()

TVM_TIRX_DLL const Op & tvm::prim::fma_op ( )

Fused multiply-add, x * y + z. Arguments: x, y, z.

◆ fmod()

TVM_TIRX_DLL PrimExpr tvm::prim::fmod ( PrimExpr  x,
PrimExpr  y,
Location  loc = UnknownLoc() 
)

Floating-point remainder of x divided by y.

◆ fmod_op()

TVM_TIRX_DLL const Op & tvm::prim::fmod_op ( )

Floating-point remainder. Arguments: x, y.

◆ foldl()

template<typename FReduce >
PrimExpr tvm::prim::foldl ( FReduce  freduce,
PrimExpr  init_value,
const ffi::Array< PrimExpr > &  values,
Location  loc = UnknownLoc() 
)
inline

◆ hypot()

PrimExpr tvm::prim::hypot ( PrimExpr  x,
PrimExpr  y,
Location  loc = UnknownLoc() 
)
inline

◆ hypot_op()

TVM_TIRX_DLL const Op & tvm::prim::hypot_op ( )

Euclidean length of x and y. Arguments: x, y.

◆ if_then_else_op()

TVM_TIRX_DLL const Op & tvm::prim::if_then_else_op ( )

Same as select, used for unsafe memory access.

Type tvm_if_then_else(cond, a, b) { return cond ? a : b; }

◆ infinity()

TVM_TIRX_DLL PrimExpr tvm::prim::infinity ( PrimType  dtype,
Location  loc = UnknownLoc() 
)

Get the value of infinity.

Parameters
dtypeThe primitive type.
locThe location of this operation in the source.
Returns
the infinity value in this format.

◆ IntegerAbs()

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

Construct integer absolute value; floating absolute value belongs to TIRX.

◆ IsConstInt() [1/2]

bool tvm::prim::IsConstInt ( const PrimExpr &  x)
inline

Check whether x is an integer constant, including wide IntImm values.

Returns
whether x is constant

◆ IsConstInt() [2/2]

bool tvm::prim::IsConstInt ( const PrimExpr &  x,
int64_t  value 
)
inline

Check whether x is a constant integer expression.

Parameters
xThe input argument
valuethe value to be compared against.
Returns
whether x is constant expression.

◆ IsConstNumber()

bool tvm::prim::IsConstNumber ( const PrimExpr &  x)
inline

Check whether x is an integer or floating-point constant.

Note
Also recognizes a Broadcast containing an integer or floating-point constant.
Returns
whether x is constant

◆ isfinite()

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

Check if x is finite.

Parameters
xThe input data
locThe location of this operation in the source.
Returns
The result expression.

◆ isinf()

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

Check if x is infinite.

Parameters
xThe input data
locThe location of this operation in the source.
Returns
The result expression.

◆ isnan()

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

Check if x is NaN.

Parameters
xThe input data
locThe location of this operation in the source.
Returns
The result expression.

◆ isnan_op()

TVM_TIRX_DLL const Op & tvm::prim::isnan_op ( )

Check for NaN, preserving the lane count. Argument: x.

◆ IsNegativeConst()

bool tvm::prim::IsNegativeConst ( const PrimExpr &  a)
inline

Check whether a is a negative integer constant.

◆ IsOne()

bool tvm::prim::IsOne ( const PrimExpr &  x)
inline

Check whether x is a constant integer 1.

Parameters
xThe input argument.
Note
This only returns true for integer types.
Returns
whether x is constant 1

◆ IsPositiveConst()

bool tvm::prim::IsPositiveConst ( const PrimExpr &  a)
inline

Check whether a is a positive integer constant.

◆ IsPowerOfTwoInt()

TVM_TIRX_DLL bool tvm::prim::IsPowerOfTwoInt ( const PrimExpr &  x,
int *  shift 
)

Check whether x is a constant power of two If x is power of two, write the power to the shift.

Parameters
xThe input expression.
shiftThe output shift if x is power of two.
Returns
whether x is constant power of two

◆ IsZero()

bool tvm::prim::IsZero ( const PrimExpr &  x)
inline

Check whether x is a constant integer 0.

Parameters
xThe input argument
Returns
whether x is constant 0
Note
This only returns true for integer types.

◆ ldexp()

PrimExpr tvm::prim::ldexp ( PrimExpr  x,
PrimExpr  y,
Location  loc = UnknownLoc() 
)
inline

◆ ldexp_op()

TVM_TIRX_DLL const Op & tvm::prim::ldexp_op ( )

Multiply x by two raised to exponent. Arguments: x, exponent.

◆ likely_op()

TVM_TIRX_DLL const Op & tvm::prim::likely_op ( )

Marks a condition is likely going to happen.

◆ log()

PrimExpr tvm::prim::log ( PrimExpr  x,
Location  loc = UnknownLoc() 
)
inline

◆ log10()

PrimExpr tvm::prim::log10 ( PrimExpr  x,
Location  loc = UnknownLoc() 
)
inline

◆ log10_op()

TVM_TIRX_DLL const Op & tvm::prim::log10_op ( )

Base-ten logarithm. Argument: x.

◆ log1p()

PrimExpr tvm::prim::log1p ( PrimExpr  x,
Location  loc = UnknownLoc() 
)
inline

◆ log1p_op()

TVM_TIRX_DLL const Op & tvm::prim::log1p_op ( )

Natural logarithm of one plus x. Argument: x.

◆ log2_op()

TVM_TIRX_DLL const Op & tvm::prim::log2_op ( )

Base-two logarithm.

◆ log_op()

TVM_TIRX_DLL const Op & tvm::prim::log_op ( )

Natural logarithm. Argument: x.

◆ MakeConst()

template<typename ValueType , typename = typename std::enable_if<(std::is_standard_layout<ValueType>::value && std::is_trivial<ValueType>::value) || std::is_same<ValueType, ffi::BigInt>::value>::type>
PrimExpr tvm::prim::MakeConst ( PrimType  dtype,
ValueType  value,
Location  loc = UnknownLoc() 
)
inline

Make a const value with certain data type.

Prefer direct IntImm or FloatImm construction when dtype is known to be scalar integer or floating point. This makes the compiled code more compact and efficient. Keep MakeConst for generic overload cases where dtype can be integer, floating point, or vector-valued and the caller needs its scalar/vector dispatch. Integer payloads use the exact BigInt representation.

Parameters
dtypeThe target type.
valueThe input value
Returns
the result expression.
Template Parameters
ValueTypeThe constant value type
Parameters
locThe location of this operation in the source.

◆ MakeConstScalar() [1/2]

template<>
PrimExpr tvm::prim::MakeConstScalar ( PrimType  dtype,
bool  value,
Location  loc 
)
inline

◆ MakeConstScalar() [2/2]

template<typename ValueType >
PrimExpr tvm::prim::MakeConstScalar ( PrimType  dtype,
ValueType  value,
Location  loc = UnknownLoc() 
)
inline

◆ max_value()

TVM_TIRX_DLL PrimExpr tvm::prim::max_value ( PrimType  dtype,
Location  loc = UnknownLoc() 
)

Query the maximum possible value of dtype.

Parameters
dtypeThe primitive type.
locThe location of this operation in the source.
Returns
the maximum possible value in this format.

◆ min_value()

TVM_TIRX_DLL PrimExpr tvm::prim::min_value ( PrimType  dtype,
Location  loc = UnknownLoc() 
)

Query the minimum possible value of dtype.

Parameters
dtypeThe primitive type.
locThe location of this operation in the source.
Returns
the minimum possible value in this format.

◆ nearbyint()

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

Round x to the nearest integer, ties to even.

Equivalent to round(). Both use IEEE 754 default rounding mode (ties-to-even).

Parameters
xThe input expression.
locThe location of this operation in the source.
Returns
The result expression.

◆ nearbyint_op()

TVM_TIRX_DLL const Op & tvm::prim::nearbyint_op ( )

Round to nearest integer, ties to even. Argument: x.

◆ nextafter()

PrimExpr tvm::prim::nextafter ( PrimExpr  x,
PrimExpr  y,
Location  loc = UnknownLoc() 
)
inline

◆ nextafter_op()

TVM_TIRX_DLL const Op & tvm::prim::nextafter_op ( )

Next representable value from x toward y. Arguments: x, y.

◆ popcount()

PrimExpr tvm::prim::popcount ( PrimExpr  x,
Location  loc = UnknownLoc() 
)
inline

◆ popcount_op()

TVM_TIRX_DLL const Op & tvm::prim::popcount_op ( )

Count set bits. Argument: x.

◆ pow()

TVM_TIRX_DLL PrimExpr tvm::prim::pow ( PrimExpr  x,
PrimExpr  y,
Location  loc = UnknownLoc() 
)

Calculate power(x, y)

Parameters
xThe left operand.
yThe right operand.
locThe location of this operation in the source.

◆ pow_op()

TVM_TIRX_DLL const Op & tvm::prim::pow_op ( )

Raise x to the power y. Arguments: x, y.

◆ prod()

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

product 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.

◆ round()

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

Round x to the nearest integer, ties to even.

Uses IEEE 754 default rounding mode (ties-to-even / banker's rounding). Constant-folding and all backends consistently use std::nearbyint semantics.

Parameters
xThe input expression.
locThe location of this operation in the source.
Returns
The result expression.

◆ round_op()

TVM_TIRX_DLL const Op & tvm::prim::round_op ( )

Round to nearest integer, ties to even. Argument: x.

◆ rsqrt()

PrimExpr tvm::prim::rsqrt ( PrimExpr  x,
Location  loc = UnknownLoc() 
)
inline

◆ rsqrt_op()

TVM_TIRX_DLL const Op & tvm::prim::rsqrt_op ( )

Reciprocal square root. Argument: x.

◆ sigmoid()

PrimExpr tvm::prim::sigmoid ( PrimExpr  x,
Location  loc = UnknownLoc() 
)
inline

◆ sigmoid_op()

TVM_TIRX_DLL const Op & tvm::prim::sigmoid_op ( )

Logistic sigmoid. Argument: x.

◆ sin()

PrimExpr tvm::prim::sin ( PrimExpr  x,
Location  loc = UnknownLoc() 
)
inline

◆ sin_op()

TVM_TIRX_DLL const Op & tvm::prim::sin_op ( )

Sine. Argument: x.

◆ sinh()

PrimExpr tvm::prim::sinh ( PrimExpr  x,
Location  loc = UnknownLoc() 
)
inline

◆ sinh_op()

TVM_TIRX_DLL const Op & tvm::prim::sinh_op ( )

Hyperbolic sine. Argument: x.

◆ sqrt()

PrimExpr tvm::prim::sqrt ( PrimExpr  x,
Location  loc = UnknownLoc() 
)
inline

◆ sqrt_op()

TVM_TIRX_DLL const Op & tvm::prim::sqrt_op ( )

Square root. Argument: x.

◆ sum()

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

sum 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.

◆ tan()

PrimExpr tvm::prim::tan ( PrimExpr  x,
Location  loc = UnknownLoc() 
)
inline

◆ tan_op()

TVM_TIRX_DLL const Op & tvm::prim::tan_op ( )

Tangent. Argument: x.

◆ tanh()

PrimExpr tvm::prim::tanh ( PrimExpr  x,
Location  loc = UnknownLoc() 
)
inline

◆ tanh_op()

TVM_TIRX_DLL const Op & tvm::prim::tanh_op ( )

Hyperbolic tangent. Argument: x.

◆ trunc()

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

Calculate trunc(x)

Parameters
xThe input expression.
locThe location of this operation in the source.
Returns
The result expression.

◆ trunc_op()

TVM_TIRX_DLL const Op & tvm::prim::trunc_op ( )

Round toward zero. Argument: x.

◆ vscale_op()

TVM_TIRX_DLL const Op & tvm::prim::vscale_op ( )

Get the target's vscale value. It will be lowered to llvm.vscale intrinsic (https://llvm.org/docs/LangRef.html#llvm-vscale-intrinsic)