|
tvm
|
Classes | |
| struct | Direct |
| Preserve the intrinsic name for every primitive type. More... | |
| struct | FloatSuffix |
| Append f for scalar float32, preserve scalar float64, and reject other types. More... | |
Functions | |
| template<typename T , bool dtype_from_arg = false> | |
| PrimExpr | DispatchPureExtern (const PrimExpr &e, const Target &target) |
| Dispatch pure extern function. | |
| TVM_TIRX_DLL PrimExpr | DispatchFastErf (const PrimExpr &e, const Target &target) |
| Lower a unary float16/float32 erf call to a rational approximation. The expansion clamps the input to [-4, 4] and evaluates numerator and denominator polynomials using the input element width; other types are rejected. | |
| TVM_TIRX_DLL PrimExpr | DispatchNumericallyStableTanh (const PrimExpr &e, const Target &target) |
| Lower a unary floating-point tanh call using sign-dependent exponential formulas. The expansion avoids the large-positive-input overflow of the symmetric formula; accuracy follows the floating-point arithmetic and exponential lowering in use. | |
| TVM_TIRX_DLL PrimExpr tvm::codegen::intrin::DispatchFastErf | ( | const PrimExpr & | e, |
| const Target & | target | ||
| ) |
Lower a unary float16/float32 erf call to a rational approximation. The expansion clamps the input to [-4, 4] and evaluates numerator and denominator polynomials using the input element width; other types are rejected.
| TVM_TIRX_DLL PrimExpr tvm::codegen::intrin::DispatchNumericallyStableTanh | ( | const PrimExpr & | e, |
| const Target & | target | ||
| ) |
Lower a unary floating-point tanh call using sign-dependent exponential formulas. The expansion avoids the large-positive-input overflow of the symmetric formula; accuracy follows the floating-point arithmetic and exponential lowering in use.
|
inline |
Dispatch pure extern function.
| e | The call expression. |
| target | The explicit compilation target. |
| T | Name mapper with std::string operator()(const PrimType&, std::string). The mapper receives the type and the intrinsic name without its prim. or tirx. prefix. An empty mapped name leaves the original call unchanged. |
For example, an off-tree backend can register a C math mapping with OpDef("prim.exp").set_attr<tirx::FLowerIntrinsic>( "my_backend.FLowerIntrinsic", DispatchPureExtern<FloatSuffix>) after including tvm/tirx/op/attr.h.
| dtype_from_arg | Use the argument type of a unary call instead of its result type. |