add doc for cmake build & run (#185)
This commit is contained in:
parent
17f0dde5ba
commit
8aacd785b1
46
README.md
46
README.md
|
|
@ -21,19 +21,26 @@ Main Features
|
|||
|
||||
Feel free to raise a github issue if you wish to add TIM-VX for other frameworks.
|
||||
|
||||
## Get started
|
||||
# Get started
|
||||
|
||||
### Build and Run
|
||||
TIM-VX supports both [bazel](https://bazel.build) and cmake. [Install bazel](https://docs.bazel.build/versions/master/install.html) to get started.
|
||||
## Build and Run
|
||||
|
||||
TIM-VX supports both [bazel](https://bazel.build) and cmake.
|
||||
|
||||
### Bazel
|
||||
|
||||
[Install bazel](https://docs.bazel.build/versions/master/install.html) to get started.
|
||||
|
||||
TIM-VX needs to be compiled and linked against VeriSilicon OpenVX SDK which provides related header files and pre-compiled libraries. A default linux-x86_64 SDK is provided which contains the simulation environment on PC. Platform specific SDKs can be obtained from respective SoC vendors.
|
||||
|
||||
To build TIM-VX
|
||||
To build TIM-VX:
|
||||
|
||||
```shell
|
||||
bazel build libtim-vx.so
|
||||
```
|
||||
|
||||
To run sample LeNet
|
||||
To run sample LeNet:
|
||||
|
||||
```shell
|
||||
# set VIVANTE_SDK_DIR for runtime compilation environment
|
||||
export VIVANTE_SDK_DIR=`pwd`/prebuilt-sdk/x86_64_linux
|
||||
|
|
@ -42,6 +49,35 @@ bazel build //samples/lenet:lenet_asymu8_cc
|
|||
bazel run //samples/lenet:lenet_asymu8_cc
|
||||
```
|
||||
|
||||
### Cmake
|
||||
|
||||
To build TIM-VX:
|
||||
|
||||
```shell
|
||||
mkdir host_build
|
||||
cd host_build
|
||||
cmake ..
|
||||
make -j8
|
||||
```
|
||||
|
||||
Cmake option:
|
||||
|
||||
`CONFIG`: Set Target Platform. Such as: `A311D`, `S905D3`, `vim3_android`, `YOCTO`. Default is `X86_64_linux`.
|
||||
|
||||
`TIM_VX_ENABLE_TEST`: Build the unit test. Default is ON.
|
||||
|
||||
`TIM_VX_USE_EXTERNAL_OVXLIB`: Use external OVXLIB. Default is OFF.
|
||||
|
||||
run unit test:
|
||||
|
||||
```shell
|
||||
cd host_build/src/tim
|
||||
export LD_LIBRARY_PATH=`pwd`/../../../prebuilt-sdk/x86_64_linux/lib:$LD_LIBRARY_PATH
|
||||
./unit_test
|
||||
```
|
||||
|
||||
## Other
|
||||
|
||||
To build and run Tensorflow-Lite with TIM-VX, please see [README](https://github.com/VeriSilicon/tflite-vx-delegate#readme)
|
||||
|
||||
To build and run TVM with TIM-VX, please see [TVM README](https://github.com/VeriSilicon/tvm/blob/vsi_npu/README.VSI.md)
|
||||
|
|
|
|||
Loading…
Reference in New Issue