This folder contain golang interface for TVM runtime. It brings TVM runtime to Golang.
src Module that generates golang package corresponding to the c runtime api exposed from tvm source tree. This process build golang package gotvm.a
samples Sample golang reference application to inference through gotvm package.
Once the Requirements are installed
To build gotvm package
make
To build and run internal tests
make tests
To build sample apps.
make samples
To Demonstrates sample TVM module compilation using python and deploy via golang.
./simple
To deploy a realtime module with lib, graph and param.
python3 gen_mobilenet_lib.py
./complex
To demonstrate go function closure conversion to packed function handle.
./pack_func_convert
To demonstrate a packed function handle given as an argument.
./pack_func_handle_arg
To register go function with runtime as a global function.
./pack_func_register
To demonstrate function closure passed as argument to a function call.
./pack_func_closure_arg
To demonstrate function closure returned from a packed function.
./pack_func_closure_return
gotvm.go is documented with sufficient information about gotvm package. A html version documentation can be accessed by running below command after building runtime.
godoc -http=:6060 -goroot=./gopath
After above command try http://127.0.0.1:6060 from any browser.
Also please refer to the sample applications under sample folder.
Docker setup may need below additions for dependencies and environment preparation.
Please refer docker/install/ubuntu_install_golang.sh
for the packages dependencies.
go compiler 1.10 on ubuntu doesn't install on standard path, hence an explicit export may be needed as shown below.
export PATH="/usr/lib/go-1.10/bin:$PATH"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。