Commit c99b7056 authored by Lei Wang's avatar Lei Wang Committed by LeiWang1999
Browse files

[Typo] Rename `power_of_int` with `pow_of_int` for consistency (#468)

* typo fix

* Rename `power_of_int` to `pow_of_int` in math operations and update corresponding Python API reference. Adjusted registration attributes to reflect the new naming convention.
parent 1f5eb492
...@@ -13,25 +13,25 @@ namespace tvm { ...@@ -13,25 +13,25 @@ namespace tvm {
namespace tl { namespace tl {
using namespace tir; using namespace tir;
PrimExpr power_of_int_op(PrimExpr args) { PrimExpr pow_of_int_op(PrimExpr args) {
const CallNode *call = args.as<CallNode>(); const CallNode *call = args.as<CallNode>();
CHECK(call != nullptr); CHECK(call != nullptr);
const Array<PrimExpr> &arg = call->args; const Array<PrimExpr> &arg = call->args;
ICHECK_EQ(arg.size(), 2); ICHECK_EQ(arg.size(), 2);
PrimExpr base = arg[0]; PrimExpr base = arg[0];
PrimExpr exp = arg[1]; PrimExpr exp = arg[1];
String power_of_int_name = String pow_of_int_name =
"tl::power_of_int<" + std::to_string(exp.as<IntImmNode>()->value) + ">"; "tl::pow_of_int<" + std::to_string(exp.as<IntImmNode>()->value) + ">";
return tir::Call(base.dtype(), tir::builtin::call_extern(), return tir::Call(base.dtype(), tir::builtin::call_extern(),
{StringImm(power_of_int_name), base}); {StringImm(pow_of_int_name), base});
} }
TVM_REGISTER_OP("tl.power_of_int") TVM_REGISTER_OP("tl.pow_of_int")
.set_num_inputs(2) .set_num_inputs(2)
.set_attr<TCallEffectKind>("TCallEffectKind", .set_attr<TCallEffectKind>("TCallEffectKind",
Integer(CallEffectKind::kPure)) Integer(CallEffectKind::kPure))
.set_attr<TScriptPrinterName>("TScriptPrinterName", "power_of_int") .set_attr<TScriptPrinterName>("TScriptPrinterName", "pow_of_int")
.set_attr<FLowerIntrinsic>("cuda.FLowerIntrinsic", power_of_int_op); .set_attr<FLowerIntrinsic>("cuda.FLowerIntrinsic", pow_of_int_op);
} // namespace tl } // namespace tl
} // namespace tvm } // namespace tvm
...@@ -2609,7 +2609,7 @@ def pow_of_int(x: PrimExpr, y: int) -> PrimExpr: ...@@ -2609,7 +2609,7 @@ def pow_of_int(x: PrimExpr, y: int) -> PrimExpr:
""" """
return call_intrin( return call_intrin(
x.dtype, x.dtype,
tvm.tir.op.Op.get("tl.power_of_int"), tvm.tir.op.Op.get("tl.pow_of_int"),
x, x,
y, y,
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment