23#ifndef TVM_IR_PRIM_OP_H_
24#define TVM_IR_PRIM_OP_H_
775template <
typename ValueType,
776 typename =
typename std::enable_if<(std::is_standard_layout<ValueType>::value &&
777 std::is_trivial<ValueType>::value) ||
778 std::is_same<ValueType, ffi::BigInt>::value>::type>
781template <
typename ValueType>
783 if constexpr (std::is_enum_v<ValueType>) {
784 return MakeConstScalar(dtype,
static_cast<std::underlying_type_t<ValueType>
>(value), loc);
786 DLDataTypeCode code = dtype.
code();
787 if (code == DLDataTypeCode::kDLInt || code == DLDataTypeCode::kDLBool) {
788 return IntImm(dtype, ffi::BigInt(value), loc);
790 if (code == DLDataTypeCode::kDLUInt) {
791 TVM_FFI_ICHECK(value >= 0) <<
"cannot make uint from negative value " << value;
792 return IntImm(dtype, ffi::BigInt(value), loc);
794 if (dtype.
MatchesCode(DLDataTypeCode::kDLFloat, DLDataTypeCode::kDLFloat8_e3m4,
795 DLDataTypeCode::kDLFloat8_e4m3, DLDataTypeCode::kDLFloat8_e4m3b11fnuz,
796 DLDataTypeCode::kDLFloat8_e4m3fn, DLDataTypeCode::kDLFloat8_e4m3fnuz,
797 DLDataTypeCode::kDLFloat8_e5m2, DLDataTypeCode::kDLFloat8_e5m2fnuz,
798 DLDataTypeCode::kDLFloat8_e8m0fnu, DLDataTypeCode::kDLFloat6_e2m3fn,
799 DLDataTypeCode::kDLFloat6_e3m2fn, DLDataTypeCode::kDLFloat4_e2m1fn) ||
801 return FloatImm(dtype,
static_cast<double>(value), loc);
803 TVM_FFI_THROW(InternalError) <<
"cannot make const for type " << dtype;
813template <
typename ValueType,
typename>
830#define TVM_DEFINE_BINOP_CONST_VAL_OVERLOAD(Name) \
831 inline PrimExpr Name(const PrimExpr& a, float b) { return Name(a, PrimExpr(b)); } \
832 inline PrimExpr Name(float a, const PrimExpr& b) { return Name(PrimExpr(a), b); } \
833 inline PrimExpr Name(int a, const PrimExpr& b) { return Name(prim::MakeConst(b.ty(), a), b); } \
834 inline PrimExpr Name(const PrimExpr& a, int b) { return Name(a, prim::MakeConst(a.ty(), b)); } \
835 inline PrimExpr Name(const PrimExpr& a, double b) { \
836 return Name(a, FloatImm(PrimType::Float(64), b)); \
839#define TVM_DEFINE_BINOP_CONST_VAL_OVERLOAD_SPANNED(Name) \
840 inline PrimExpr Name(const PrimExpr& a, float b, Location loc = UnknownLoc()) { \
841 return Name(a, PrimExpr(b), loc); \
843 inline PrimExpr Name(float a, const PrimExpr& b, Location loc = UnknownLoc()) { \
844 return Name(PrimExpr(a), b, loc); \
846 inline PrimExpr Name(int a, const PrimExpr& b, Location loc = UnknownLoc()) { \
847 return Name(prim::MakeConst(b.ty(), a), b, loc); \
849 inline PrimExpr Name(const PrimExpr& a, int b, Location loc = UnknownLoc()) { \
850 return Name(a, prim::MakeConst(a.ty(), b), loc); \
852 inline PrimExpr Name(const PrimExpr& a, double b, Location loc = UnknownLoc()) { \
853 return Name(a, FloatImm(PrimType::Float(64), b), loc); \
856#define TVM_DEFINE_LOGICAL_OP_CONST_VAL_OVERLOAD(Name) \
857 inline PrimExpr Name(const PrimExpr& a, bool b) { return Name(a, PrimExpr(b)); } \
858 inline PrimExpr Name(bool a, const PrimExpr& b) { return Name(PrimExpr(a), b); }
860#define TVM_DEFINE_LOGICAL_OP_CONST_VAL_OVERLOAD_SPANNED(Name) \
861 inline PrimExpr Name(const PrimExpr& a, bool b, Location loc = UnknownLoc()) { \
862 return Name(a, PrimExpr(b), loc); \
864 inline PrimExpr Name(bool a, const PrimExpr& b, Location loc = UnknownLoc()) { \
865 return Name(PrimExpr(a), b, loc); \
868#define TVM_DEFINE_INT_OP_CONST_VAL_OVERLOAD(Name) \
869 inline PrimExpr Name(const PrimExpr& a, int b) { return Name(a, prim::MakeConst(a.ty(), b)); } \
870 inline PrimExpr Name(int a, const PrimExpr& b) { return Name(prim::MakeConst(b.ty(), a), b); }
872#define TVM_DEFINE_INT_OP_CONST_VAL_OVERLOAD_SPANNED(Name) \
873 inline PrimExpr Name(const PrimExpr& a, int b, Location loc = UnknownLoc()) { \
874 return Name(a, prim::MakeConst(a.ty(), b), loc); \
876 inline PrimExpr Name(int a, const PrimExpr& b, Location loc = UnknownLoc()) { \
877 return Name(prim::MakeConst(b.ty(), a), b, loc); \
925template <
typename TA>
927 constexpr bool div_ambiguity = !std::is_class<TA>::value;
928 static_assert(div_ambiguity,
929 "TVM supports multiple types of integer divisions, "
930 "please call div, indexdiv/indexmod, "
931 "floordiv/floormod or truncdiv/truncmod directly "
932 "to avoid ambiguity in the code. "
933 "Checkout these functions in ir/prim/op.h.");
941template <
typename TB>
947template <
typename TB>
953template <
typename TB>
968inline bool IsConstInt(
const PrimExpr& x, int64_t value);
976inline bool IsOne(
const PrimExpr& x);
984inline bool IsZero(
const PrimExpr& x);
990inline bool IsConstInt(
const PrimExpr& x);
997inline bool IsConstNumber(
const PrimExpr& x);
1031 return as_int && as_int->
value > 0;
1036 return as_int && as_int->
value < 0;
1039inline bool IsConstInt(
const PrimExpr& x, int64_t value) {
1041 return as_int && as_int->
value == value;
1219 return Call(x.
ty(),
fma_op(), {x, y, z}, {}, {}, loc).as_or_throw<PrimExpr>();
1223 TVM_FFI_CHECK(dtype.
code() == DLDataTypeCode::kDLFloat ||
1226 <<
"prim." << op_name <<
" only supports floating-point inputs, but got " << dtype;
1230#define TVM_DECLARE_INTRIN_UNARY_WITH_CHECK(OpName, CheckInputDType) \
1231 inline PrimExpr OpName(PrimExpr x, Location loc = UnknownLoc()) { \
1232 static const Op op = Op::Get("prim." #OpName); \
1233 PrimType x_ty = x.ty(); \
1234 CheckInputDType(#OpName, x_ty); \
1235 if (x_ty.MatchesElementType(DLDataTypeCode::kDLBfloat, 16)) { \
1236 PrimType bf16_ty = x_ty; \
1238 x_ty.IsScalableVector() \
1239 ? PrimType::ScalableVector(DLDataTypeCode::kDLFloat, 32, x_ty.VScaleFactor()) \
1240 : PrimType::Float(32, x_ty.lanes()); \
1241 PrimExpr x_fp32 = prim::Cast(f32_ty, x, loc); \
1242 PrimExpr result_fp32 = Call(f32_ty, op, {x_fp32}, {}, {}, loc).as_or_throw<PrimExpr>(); \
1243 return prim::Cast(bf16_ty, result_fp32, loc); \
1245 return Call(x_ty, op, {x}, {}, {}, loc).as_or_throw<PrimExpr>(); \
1249#define TVM_DECLARE_INTRIN_UNARY(OpName) \
1250 TVM_DECLARE_INTRIN_UNARY_WITH_CHECK(OpName, [](const char*, const PrimType&) {})
1252#define TVM_DECLARE_FLOAT_INTRIN_UNARY(OpName) \
1253 TVM_DECLARE_INTRIN_UNARY_WITH_CHECK(OpName, CheckMathUnaryOpInputDType)
1279#define TVM_DECLARE_INTRIN_BINARY(OpName) \
1280 inline PrimExpr OpName(PrimExpr x, PrimExpr y, Location loc = UnknownLoc()) { \
1281 static const Op op = Op::Get("prim." #OpName); \
1282 return Call(x.ty(), op, {x, y}, {}, {}, loc).as_or_throw<PrimExpr>(); \
1291template <
typename FReduce>
1295 init_value = freduce(init_value, val, loc);
Canonical primitive operators and their registration.
#define TVM_DECLARE_INTRIN_UNARY(OpName)
Definition op.h:1249
#define TVM_DEFINE_INT_OP_CONST_VAL_OVERLOAD(Name)
Definition op.h:868
#define TVM_DEFINE_LOGICAL_OP_CONST_VAL_OVERLOAD_SPANNED(Name)
Definition op.h:860
#define TVM_DECLARE_FLOAT_INTRIN_UNARY(OpName)
Definition op.h:1252
#define TVM_DEFINE_BINOP_CONST_VAL_OVERLOAD_SPANNED(Name)
Definition op.h:839
#define TVM_DEFINE_BINOP_CONST_VAL_OVERLOAD(Name)
Definition op.h:830
#define TVM_DEFINE_LOGICAL_OP_CONST_VAL_OVERLOAD(Name)
Definition op.h:856
#define TVM_DECLARE_INTRIN_BINARY(OpName)
Definition op.h:1279
#define TVM_DEFINE_INT_OP_CONST_VAL_OVERLOAD_SPANNED(Name)
Definition op.h:872
#define TVM_TIRX_DLL
Definition base.h:55
Managed reference to CallObj.
Definition expr.h:825
Constant floating point literals in the program.
Definition expr.h:394
Managed reference class to FloatImmObj.
Definition expr.h:411
Constant integer literals in the program.
Definition expr.h:314
ffi::BigInt value
the Internal value.
Definition expr.h:317
Managed reference class to IntImmObj.
Definition expr.h:331
Non-nullable source-location metadata.
Definition location.h:91
Reference-counted handle to a canonical named operator.
Definition op.h:140
Typed reference/view over any Expr whose ExprObj::ty is PrimType.
Definition expr.h:187
TVM_FFI_INLINE DLDataTypeCode code() const
Definition type.h:219
TVM_FFI_INLINE PrimType WithLanes(int lanes) const
Return the same scalar element type with a fixed lane count.
Definition type.h:319
TVM_FFI_INLINE bool IsScalableVector() const
Whether this type is a scalable vector.
Definition type.h:272
TVM_FFI_INLINE bool IsFixedLengthVector() const
Whether this type is a fixed-length vector.
Definition type.h:277
TVM_FFI_INLINE bool MatchesCode(Codes... codes) const
Check whether the dtype code matches any of the provided DLPack codes.
Definition type.h:253
TVM_FFI_INLINE bool MatchesElementType(DLDataTypeCode code, int bits) const
Check the scalar element code and bit width.
Definition type.h:243
static TVM_TIRX_DLL PrimType Int(int bits, int lanes=1)
Construct a signed integer type with fixed lanes.
TVM_FFI_INLINE int32_t VScaleFactor() const
Definition type.h:324
TVM_FFI_INLINE int32_t lanes() const
Definition type.h:230
ExpectedType ty() const
Definition expr.h:164
Reference to the shared immutable unknown location.
Definition location.h:105
Create a vector where all the elements are value.
Definition vector_expr.h:82
Managed reference to BroadcastObj.
Definition vector_expr.h:104
Managed reference to MulObj.
Definition expr.h:266
TVM_TIRX_DLL PrimExpr log2(PrimExpr x, Location loc=UnknownLoc())
Construct a base-two logarithm with the input's primitive type.
TVM_TIRX_DLL PrimExpr nearbyint(PrimExpr x, Location loc=UnknownLoc())
Round x to the nearest integer, ties to even.
TVM_TIRX_DLL const Op & log_op()
Natural logarithm. Argument: x.
TVM_TIRX_DLL const Op & assume_op()
Record a known condition for simplification. Argument: condition.
TVM_TIRX_DLL const Op & log10_op()
Base-ten logarithm. Argument: x.
TVM_TIRX_DLL const Op & atan_op()
Inverse tangent. Argument: x.
TVM_TIRX_DLL const Op & isnan_op()
Check for NaN, preserving the lane count. Argument: x.
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.
TVM_TIRX_DLL const Op & tan_op()
Tangent. Argument: x.
void CheckMathUnaryOpInputDType(const char *op_name, const PrimType &dtype)
Definition op.h:1222
TVM_TIRX_DLL PrimExpr min_value(PrimType dtype, Location loc=UnknownLoc())
PrimExpr foldl(FReduce freduce, PrimExpr init_value, const ffi::Array< PrimExpr > &values, Location loc=UnknownLoc())
Definition op.h:1292
TVM_TIRX_DLL const Op & ceil_op()
Round up to the nearest integral value.
TVM_TIRX_DLL PrimExpr IntegerAbs(PrimExpr x, Location loc=UnknownLoc())
Construct integer absolute value; floating absolute value belongs to TIRX.
TVM_TIRX_DLL const Op & sqrt_op()
Square root. Argument: x.
TVM_TIRX_DLL const Op & clz_op()
Count leading zero bits.
TVM_TIRX_DLL const Op & acos_op()
Inverse cosine. Argument: x.
TVM_TIRX_DLL const Op & pow_op()
Raise x to the power y. Arguments: x, y.
TVM_TIRX_DLL const Op & ldexp_op()
Multiply x by two raised to exponent. Arguments: x, exponent.
PrimExpr MakeConstScalar(PrimType dtype, ValueType value, Location loc=UnknownLoc())
Definition op.h:782
TVM_TIRX_DLL const Op & cosh_op()
Hyperbolic cosine. Argument: x.
TVM_TIRX_DLL const Op & fma_op()
Fused multiply-add, x * y + z. Arguments: x, y, z.
TVM_TIRX_DLL PrimExpr assume(PrimExpr condition, Location loc=UnknownLoc())
Record a known condition for compile-time simplification.
TVM_TIRX_DLL const Op & round_op()
Round to nearest integer, ties to even. Argument: x.
TVM_TIRX_DLL const Op & nextafter_op()
Next representable value from x toward y. Arguments: x, y.
TVM_TIRX_DLL const PrimExpr & neg_inf()
Symbolic negative infinity for unbounded integer intervals.
TVM_TIRX_DLL const Op & atan2_op()
Inverse tangent of y/x with quadrant selection. Arguments: y, x.
TVM_TIRX_DLL const PrimExpr & pos_inf()
Symbolic positive infinity for unbounded integer intervals.
TVM_TIRX_DLL const Op & cos_op()
Cosine. Argument: x.
TVM_TIRX_DLL PrimExpr max_value(PrimType dtype, Location loc=UnknownLoc())
TVM_TIRX_DLL const Op & asinh_op()
Inverse hyperbolic sine. Argument: x.
TVM_TIRX_DLL const Op & exp2_op()
Base-two exponential. Argument: x.
TVM_TIRX_DLL const Op & tanh_op()
Hyperbolic tangent. Argument: x.
TVM_TIRX_DLL const Op & sin_op()
Sine. Argument: x.
bool IsOne(const PrimExpr &x)
Check whether x is a constant integer 1.
Definition op.h:1044
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 & exp_op()
Natural exponential. Argument: x.
TVM_TIRX_DLL const Op & nearbyint_op()
Round to nearest integer, ties to even. Argument: x.
TVM_TIRX_DLL const Op & exp10_op()
Base-ten exponential. Argument: x.
TVM_TIRX_DLL bool is_pos_inf(const PrimExpr &value)
Check whether a value is the symbolic positive infinity sentinel.
TVM_TIRX_DLL PrimExpr cast(PrimExpr value, PrimType t, Location loc=UnknownLoc())
cast value to type.
bool IsConstNumber(const PrimExpr &x)
Check whether x is an integer or floating-point constant.
Definition op.h:1018
TVM_TIRX_DLL bool is_neg_inf(const PrimExpr &value)
Check whether a value is the symbolic negative infinity sentinel.
TVM_TIRX_DLL PrimExpr infinity(PrimType dtype, Location loc=UnknownLoc())
TVM_TIRX_DLL const Op & trunc_op()
Round toward zero. Argument: x.
TVM_TIRX_DLL const Op & log1p_op()
Natural logarithm of one plus x. Argument: x.
bool IsZero(const PrimExpr &x)
Check whether x is a constant integer 0.
Definition op.h:1046
TVM_TIRX_DLL const Op & sinh_op()
Hyperbolic sine. Argument: x.
TVM_TIRX_DLL const Op & likely_op()
Marks a condition is likely going to happen.
TVM_TIRX_DLL const Op & fabs_op()
Absolute value. Argument: x.
TVM_TIRX_DLL const Op & vscale_op()
Get the target's vscale value. It will be lowered to llvm.vscale intrinsic (https://llvm....
TVM_TIRX_DLL const Op & acosh_op()
Inverse hyperbolic cosine. Argument: x.
PrimExpr MakeConst(PrimType dtype, ValueType value, Location loc=UnknownLoc())
Make a const value with certain data type.
Definition op.h:814
TVM_TIRX_DLL const Op & sigmoid_op()
Logistic sigmoid. Argument: x.
TVM_TIRX_DLL const Op & popcount_op()
Count set bits. Argument: x.
bool IsNegativeConst(const PrimExpr &a)
Check whether a is a negative integer constant.
Definition op.h:1034
TVM_TIRX_DLL const Op & asin_op()
Inverse sine. Argument: x.
PrimExpr fma(PrimExpr x, PrimExpr y, PrimExpr z, Location loc=UnknownLoc())
Fused multiply-add of x, y and z, in that order.
Definition op.h:1218
TVM_TIRX_DLL const Op & hypot_op()
Euclidean length of x and y. Arguments: x, y.
TVM_TIRX_DLL const Op & if_then_else_op()
Same as select, used for unsafe memory access.
TVM_TIRX_DLL const Op & erf_op()
Error function. Argument: x.
TVM_TIRX_DLL PrimExpr clz(PrimExpr x, Location loc=UnknownLoc())
Count leading zero bits, preserving the input primitive type.
TVM_TIRX_DLL PrimExpr ceil(PrimExpr x, Location loc=UnknownLoc())
Round up to the nearest integral value, preserving the input type.
TVM_TIRX_DLL const Op & rsqrt_op()
Reciprocal square root. Argument: x.
TVM_TIRX_DLL PrimExpr pow(PrimExpr x, PrimExpr y, Location loc=UnknownLoc())
Calculate power(x, y)
TVM_TIRX_DLL const Op & floor_op()
Round toward negative infinity. Argument: x.
TVM_TIRX_DLL const Op & copysign_op()
Magnitude of x with the sign of y. Arguments: x, y.
TVM_TIRX_DLL const Op & fmod_op()
Floating-point remainder. Arguments: x, y.
bool IsPositiveConst(const PrimExpr &a)
Check whether a is a positive integer constant.
Definition op.h:1029
TVM_TIRX_DLL const Op & atanh_op()
Inverse hyperbolic tangent. Argument: x.
TVM_TIRX_DLL const Op & log2_op()
Base-two logarithm.
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition analysis.h:41
TVM_TIRX_DLL PrimExpr bitwise_and(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
take bitwise and of two values
TVM_TIRX_DLL PrimExpr logical_and(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
and
TVM_TIRX_DLL PrimExpr mul(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
multiplication operator
PrimExpr operator-=(PrimExpr &a, PrimExpr b)
Subtract an expression in place.
Definition op.h:255
std::ostream & operator<<(std::ostream &os, CallEffectKind side_effect)
Definition expr.h:757
TVM_TIRX_DLL PrimExpr operator!=(PrimExpr a, PrimExpr b)
not_equal
TVM_TIRX_DLL PrimExpr bitwise_neg(PrimExpr a, Location loc=UnknownLoc())
take bitwise negation of two values
TVM_TIRX_DLL PrimExpr operator<(PrimExpr a, PrimExpr b)
less
void DivAmbiguityError(const TA &a)
Helper function to raise a compiler error about division ambiguity.
Definition op.h:926
TVM_TIRX_DLL PrimExpr operator!(PrimExpr a)
not
TVM_TIRX_DLL PrimExpr not_equal(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
not_equal
TVM_TIRX_DLL PrimExpr if_then_else(PrimExpr cond, PrimExpr true_value, PrimExpr false_value, Location loc=UnknownLoc())
Conditional expression.
TVM_TIRX_DLL PrimExpr operator<=(PrimExpr a, PrimExpr b)
less_equal
TVM_TIRX_DLL PrimExpr greater_equal(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
greater_equal
TVM_TIRX_DLL PrimExpr truncdiv(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
compute trunc(a / b)
TVM_TIRX_DLL PrimExpr left_shift(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
left shift operator
TVM_TIRX_DLL PrimExpr less_equal(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
less_equal
PrimExpr operator/=(const PrimExpr &a, const TB &b)
Definition op.h:948
TVM_TIRX_DLL PrimExpr operator~(PrimExpr a)
take bitwise negation of two values
TVM_TIRX_DLL PrimExpr neg(PrimExpr a, Location loc=UnknownLoc())
negation.
TVM_TIRX_DLL PrimExpr operator>=(PrimExpr a, PrimExpr b)
greater_equal
TVM_TIRX_DLL PrimExpr operator+(PrimExpr a, PrimExpr b)
add operator
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 greater(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
greater
TVM_TIRX_DLL PrimExpr div(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
compute division in C semantics.
TVM_TIRX_DLL PrimExpr operator>(PrimExpr a, PrimExpr b)
greater
TVM_TIRX_DLL PrimExpr right_shift(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
right shift operator
TVM_TIRX_DLL PrimExpr equal(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
equal
TVM_TIRX_DLL PrimExpr logical_or(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
or
TVM_TIRX_DLL PrimExpr operator/(PrimExpr a, PrimExpr b)
division operator
TVM_TIRX_DLL PrimExpr operator||(PrimExpr a, PrimExpr b)
or
TVM_TIRX_DLL PrimExpr floormod(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
compute the remainder of floordiv
TVM_TIRX_DLL PrimExpr truncmod(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
compute the remainder of truncdiv
TVM_TIRX_DLL PrimExpr logical_not(PrimExpr a, Location loc=UnknownLoc())
not
TVM_TIRX_DLL PrimExpr likely(PrimExpr cond, Location loc=UnknownLoc())
Mark condition as likely.
TVM_TIRX_DLL PrimExpr floordiv(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
compute floor(a / b)
TVM_TIRX_DLL PrimExpr operator^(PrimExpr a, PrimExpr b)
take bitwise xor of two values
TVM_TIRX_DLL PrimExpr add(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
add operator
PrimExpr operator*=(PrimExpr &a, PrimExpr b)
Multiply an expression in place.
Definition op.h:261
TVM_TIRX_DLL PrimExpr operator&(PrimExpr a, PrimExpr b)
take bitwise and of two values
PrimExpr operator+=(PrimExpr &a, PrimExpr b)
Add an expression in place.
Definition op.h:249
TVM_TIRX_DLL PrimExpr operator==(PrimExpr a, PrimExpr b)
equal
TVM_TIRX_DLL PrimExpr sub(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
subtraction operator
TVM_TIRX_DLL PrimExpr less(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
less
PrimExpr operator%(const PrimExpr &a, const TB &b)
Definition op.h:954
TVM_TIRX_DLL PrimExpr operator>>(PrimExpr a, PrimExpr b)
right shift operator
TVM_TIRX_DLL PrimExpr shapediv(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
compute ceil(a / b) where a and b are non-negative.
PrimExpr max(PrimExpr source, ffi::Array< s_tir::IterVar > axis, ffi::Array< PrimExpr > init={}, Location loc=UnknownLoc())
max of source expression over axis
TVM_TIRX_DLL PrimExpr ceildiv(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
compute ceil(a / b)
TVM_TIRX_DLL PrimExpr operator|(PrimExpr a, PrimExpr b)
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_or(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
take bitwise or of two values
PrimExpr min(PrimExpr source, ffi::Array< s_tir::IterVar > axis, ffi::Array< PrimExpr > init={}, Location loc=UnknownLoc())
max of source expression over axis
TVM_TIRX_DLL PrimExpr operator&&(PrimExpr a, PrimExpr b)
and
TVM_TIRX_DLL PrimExpr operator*(PrimExpr a, PrimExpr b)
multiplication operator
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 operator-(PrimExpr a, PrimExpr b)
subtraction operator