Template Function tvm::codegen::intrin::DispatchPureExtern

Template Function tvm::codegen::intrin::DispatchPureExtern#

Function Documentation#

template<typename T, bool dtype_from_arg = false>
inline PrimExpr tvm::codegen::intrin::DispatchPureExtern(const PrimExpr &e)#

Dispatch pure extern function.

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.

Parameters:

e – The call expression.

Template Parameters:
  • 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.

  • dtype_from_arg – Use the argument type of a unary call instead of its result type.