areusch commented on a change in pull request #6917:
URL: https://github.com/apache/incubator-tvm/pull/6917#discussion_r529196680
##########
File path: src/relay/backend/build_module.cc
##########
@@ -443,16 +456,35 @@ class RelayBuildModule : public runtime::ModuleNode {
auto lowered_funcs = graph_codegen_->GetIRModule();
- // When there is no lowered_funcs due to reasons such as optimization.
- if (lowered_funcs.size() == 0) {
- Target target_host = GetTargetHost();
+ Target target_host = GetTargetHost();
+ // If no target_host has been set, we choose a default one, which is
+ // llvm if "codegen.LLVMModuleCreate" is accessible.
+ const runtime::PackedFunc* pf =
runtime::Registry::Get("codegen.LLVMModuleCreate");
+ if (!target_host.defined()) target_host = (pf != nullptr) ? Target("llvm")
: Target("stackvm");
+
+ if (target_host->GetAttr<Bool>("link-params").value_or(Bool(false))) {
Review comment:
done
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]