Skip to content

Commit

Permalink
Sync with upstream and use CreateDSOLibraryObject. (apache#9376)
Browse files Browse the repository at this point in the history
  • Loading branch information
csullivan authored and ylc committed Jan 7, 2022
1 parent 8b653cb commit 26646d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/runtime/hexagon/hexagon/hexagon_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

#include <dlpack/dlpack.h>
#include <tvm/runtime/c_backend_api.h>
#include <tvm/runtime/object.h>
#include <tvm/runtime/packed_func.h>

#if defined(__hexagon__)
#include <HAP_farf.h>
Expand Down
8 changes: 3 additions & 5 deletions src/runtime/hexagon/hexagon/hexagon_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <utility>
#include <vector>

#include "../../dso_library.h"
#include "../../library_module.h"
#include "hexagon_buffer.h"
#include "hexagon_common.h"

Expand All @@ -44,14 +44,12 @@ Module HexagonModuleCreate(std::string data, std::string fmt,
const std::set<std::string>& packed_c_abi) {
CHECK(fmt == "so") << "Invalid format provided when constructing Hexagon runtime module: " << fmt
<< ". Valid formats are: 'so'.";
auto n = make_object<DSOLibrary>();
n->Init(data);
ObjectPtr<Library> n = CreateDSOLibraryObject(data);
return CreateModuleFromLibrary(n, hexagon::WrapPackedFunc);
}

TVM_REGISTER_GLOBAL("runtime.module.loadfile_hexagon").set_body([](TVMArgs args, TVMRetValue* rv) {
auto n = make_object<DSOLibrary>();
n->Init(args[0]);
ObjectPtr<Library> n = CreateDSOLibraryObject(args[0]);
*rv = CreateModuleFromLibrary(n, hexagon::WrapPackedFunc);
});
} // namespace runtime
Expand Down

0 comments on commit 26646d0

Please sign in to comment.