You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2019/12/17 22:31:25 UTC

[GitHub] [incubator-tvm] tqchen commented on a change in pull request #4532: [WIP] Support standardize runtime module

tqchen commented on a change in pull request #4532: [WIP] Support standardize runtime module
URL: https://github.com/apache/incubator-tvm/pull/4532#discussion_r359063916
 
 

 ##########
 File path: src/runtime/library_module.cc
 ##########
 @@ -123,19 +116,60 @@ void ImportModuleBlob(const char* mblob, std::vector<Module>* mlist) {
   dmlc::Stream* stream = &fs;
   uint64_t size;
   CHECK(stream->Read(&size));
+  std::vector<Module> modules;
+  bool has_import_tree = false;
   for (uint64_t i = 0; i < size; ++i) {
     std::string tkey;
     CHECK(stream->Read(&tkey));
-    std::string fkey = "module.loadbinary_" + tkey;
-    const PackedFunc* f = Registry::Get(fkey);
-    CHECK(f != nullptr)
+    // Currently, _lib is for DSOModule, but we
+    // don't have loadbinary function for it currently
+    if (tkey == "_lib") {
+      auto dso_module = Module(make_object<LibraryModuleNode>(lib));
+      // allow lookup of symbol from dso root (so all symbols are visible).
+      if (auto *ctx_addr =
+          reinterpret_cast<void**>(lib->GetSymbol(runtime::symbol::tvm_module_ctx))) {
+        *ctx_addr = dso_module.operator->();
+      }
+      modules.emplace_back(dso_module);
+    } else if (tkey == "_import_tree") {
+      has_import_tree = true;
 
 Review comment:
   use CSR matrix for the import tree

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services