Skip to content

Commit

Permalink
fix cpplint
Browse files Browse the repository at this point in the history
  • Loading branch information
masahi committed Apr 12, 2021
1 parent b2c3597 commit 8ff2ef5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/target/llvm/intrin_rule_llvm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ TVM_REGISTER_GLOBAL("tvm.intrin.rule.llvm.clz").set_body([](const TVMArgs& targs
cargs.push_back(IntImm(DataType::UInt(32), ::llvm::Intrinsic::ctlz));
cargs.push_back(IntImm(DataType::UInt(32), 2));
cargs.push_back(call->args[0]);
cargs.push_back(IntImm(DataType::Int(1), 1)); // is_zero_undef
cargs.push_back(IntImm(DataType::Int(1), 1)); // is_zero_undef
// LLVM requires that the return type must match the first argument type
auto clz = tir::Call(call->args[0]->dtype, tir::builtin::call_llvm_intrin(), cargs);
*rv = cast(call->dtype, clz);
Expand Down
19 changes: 10 additions & 9 deletions src/target/spirv/intrin_rule_spirv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,16 @@ TVM_REGISTER_GLOBAL("tvm.intrin.rule.vulkan.pow").set_body(DispatchGLSLPureIntri

TVM_REGISTER_GLOBAL("tvm.intrin.rule.vulkan.tanh").set_body(DispatchGLSLPureIntrin<GLSLstd450Tanh>);

TVM_REGISTER_GLOBAL("tvm.intrin.rule.vulkan.clz").set_body([](const TVMArgs& targs, TVMRetValue* rv) {
PrimExpr e = targs[0];
const tir::CallNode* call = e.as<tir::CallNode>();
ICHECK(call != nullptr);
ICHECK_EQ(call->args.size(), 1);
PrimExpr arg = call->args[0];
PrimExpr msb = CallGLSLIntrin<GLSLstd450FindUMsb>(targs, rv);
*rv = PrimExpr(arg.dtype().bits() - 1) - msb;
});
TVM_REGISTER_GLOBAL("tvm.intrin.rule.vulkan.clz")
.set_body([](const TVMArgs& targs, TVMRetValue* rv) {
PrimExpr e = targs[0];
const tir::CallNode* call = e.as<tir::CallNode>();
ICHECK(call != nullptr);
ICHECK_EQ(call->args.size(), 1);
PrimExpr arg = call->args[0];
PrimExpr msb = CallGLSLIntrin<GLSLstd450FindUMsb>(targs, rv);
*rv = PrimExpr(arg.dtype().bits() - 1) - msb;
});

// WebGPU rules.
TVM_REGISTER_GLOBAL("tvm.intrin.rule.webgpu.floor")
Expand Down

0 comments on commit 8ff2ef5

Please sign in to comment.