cbalint13 opened a new pull request, #19851:
URL: https://github.com/apache/tvm/pull/19851
Lifts the LoadVMModule() API from disco submodule to main vm submodule.
Having it in main VM submodule instead, not only disco benefits but it is
usable as public C++ API.
Related to #19849 which also close the gap to a functional c++ inference
using pre-exported DSOs.
---
#### Issue
Using a exported DSO module from a simple C++ only program:
```
#include <runtime/disco/builtin.h>
#include <runtime/vm/vm.h>
int main() {
tvm::Device dev = {kDLCPU, 0};
auto mod = tvm::runtime::vm::LoadVMModule("./lib.tar.so", dev);
return 0;
}
```
#### Before
* From initial disco submodule, ```tvm_runtime_extra``` is also needed,
and gives ```disco``` error:
```
$ c++ -I/usr/include/tvm dso-run-tvm.cpp -o dso-run-tvm -ltvm_ffi
-ltvm_runtime -ltvm_runtime_extra
$ ./dso-run-tvm
terminate called after throwing an instance of 'tvm::ffi::Error'
what(): Check failed: (ret) is false: The current thread is not a
DiscoWorker thread
Aborted (core dumped) ./dso-run-tvm
$
```
#### After
* Only ```tvm_runtime``` is needed, it works fine:
```
$ c++ -I/usr/include/tvm dso-run-tvm.cpp -o dso-run-tvm -ltvm_ffi
-ltvm_runtime
$ ./dso-run-tvm
$
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]