masahi commented on a change in pull request #10365:
URL: https://github.com/apache/tvm/pull/10365#discussion_r813681691
##########
File path: src/tir/transforms/lower_tvm_builtin.cc
##########
@@ -209,10 +209,26 @@ class BuiltinLower : public StmtExprMutator {
return MakeArray(op);
} else if (op->op.same_as(builtin::tvm_context_id())) {
return make_zero(op->dtype);
+ } else if (op->op.same_as(builtin::mem_copy())) {
+ return MakeMemCopy(op);
} else {
return StmtExprMutator::VisitExpr_(op);
}
}
+
+ PrimExpr MakeMemCopy(const CallNode* op) {
+ PrimExpr dst = op->args[0];
+ PrimExpr src = op->args[1];
+ PrimExpr size = op->args[2];
+
+ std::string fdevapi_prefix = "device_api.";
+ fdevapi_prefix +=
runtime::DeviceName(device_type_.as<IntImmNode>()->value);
Review comment:
can just initialize `std::string fdevapi_prefix = "device_api." +
runtime::DeviceName(device_type_.as<IntImmNode>()->value);`
--
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]