How to deploy vm using c++ api

how to deploy vm using c++ api.I find some case such as graph runtinme,but no vm.

it’s quite big amount of code should be shared, I would like to point to some example and highlight some places

The app itself is jsut simple classificaiton app, stays here: dldt_tools/samples/tvm/hello_classification_vm at amalyshe/ac_configs · elvin-n/dldt_tools · GitHub

It consist of two parts - network compilation py file and native sample. The example is targeted to onnx mobilenet v2 which can be downloaded from onnx model zoo.

The virtual machine compiled network can be represented in two forms

  1. independent kernels, ro and constants files
  2. all three assets together in one library

I am not yet aware how deal with the only one file, while it is possible and this how RPC works. For now we can stick to 1st approach. The difference is only in loading of library. Probably will update later

After execution of the like

python -m mobilenetv2-7.onnx -t "opencl" -l "llvm"

, there will be three files that have to be copied into same directory as tvm_hello_classification_vm and can be executed like

./tvm_hello_classification_vm ./ cat.png OpenCL

BTW, for compilation of tvm_hello_classification_vm you need to build OpenCV and define two env variables if you want to build exactly this sample

export TVM_HOME=<tvm root>
export OpenCV_DIR=$HOME/tools/opencv/build.x86.release