tqchen commented on code in PR #16976:
URL: https://github.com/apache/tvm/pull/16976#discussion_r1593914420
##########
src/target/source/codegen_webgpu.cc:
##########
@@ -405,6 +410,19 @@ void CodeGenWebGPU::VisitExpr_(const CallNode* op,
std::ostream& os) { // NOLIN
this->EndScope(else_scope);
}
os << result;
+ } else if (op->op.same_as(builtin::call_pure_extern())) {
+ ICHECK_GE(op->args.size(), 1U);
+ const std::string& func_name = op->args[0].as<StringImmNode>()->value;
+ if (func_name == "__dp4a") {
+ if (op->args.size() != 3) {
+ LOG(FATAL) << "__dp4a can only accept 2 parameters (now: " <<
op->args.size() - 1 << ")";
+ } else {
+ os << "dot4I8Packed(" << PrintExpr(op->args[1]) << ", " <<
PrintExpr(op->args[2]) << ")";
Review Comment:
given we are calling `pure_extern` about we use `dot4I8Packed` directly in
code? instead of `__dp4a`. If there is a builtin high-level intrinsic function
`tir.dp4a`, we can do the intrinsic translation to this `dot4I8Packed` in
https://github.com/apache/tvm/blob/main/src/target/source/intrin_rule_webgpu.cc
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]