|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | - | - |
| sample/ | | 03-May-2024 | - | 1,034 | 737 |
| README.md | D | 03-May-2024 | 2.1 KiB | 63 | 41 |
README.md
1# Standalone dynamic backend developer guide
2
3Arm NN allows adding new dynamic backends. Dynamic Backends can be compiled as standalone against Arm NN
4and can be loaded by Arm NN dynamically at runtime.
5
6To be properly loaded and used, the backend instances must comply to the standard interface for dynamic backends
7and to the versioning rules that enforce ABI compatibility.
8The details of how to add dynamic backends can be found in [src/backends/README.md](../backends/README.md).
9
10
11## Standalone dynamic backend example
12
13The source code includes an example that is used to generate a simple dynamic backend and is provided at
14
15[SampleDynamicBackend.hpp](./sample/SampleDynamicBackend.hpp)
16[SampleDynamicBackend.cpp](./sample/SampleDynamicBackend.cpp)
17
18The details of how to create backends can be found in [src/backends/README.md](../backends/README.md).
19
20The makefile used for building the standalone reference dynamic backend is also provided:
21[CMakeLists.txt](./sample/CMakeLists.txt)
22
23### Standalone dynamic backend build
24
25The easiest way to build a standalone sample dynamic backend is to build using environment configured compiler
26and specify the Arm NN path and Boost path to the CMake command:
27
28```shell
29cd ${DYNAMIC_BACKEND_DIR}
30mkdir build
31cd build
32cmake -DBOOST_ROOT=${BOOST_PATH} \
33 -DBoost_SYSTEM_LIBRARY=${BOOST_PATH}/lib/libboost_system.a \
34 -DARMNN_PATH=${ARMNN_PATH}/libarmnn.so ..
35```
36
37Then run the build
38
39```shell
40make
41```
42
43The library will be created in ${DYNAMIC_BACKEND_DIR}/build.
44
45
46## Dynamic backend loading paths
47
48During the creation of the Runtime, Arm NN will scan a given set of paths searching for suitable dynamic backend objects to load.
49A list of (absolute) paths can be specified at compile-time by setting a define named ```DYNAMIC_BACKEND_PATHS```
50 in the form of a colon-separated list of strings.
51
52```shell
53-DDYNAMIC_BACKEND_PATHS="PATH_1:PATH_2...:PATH_N"
54```
55
56Example for setting the path to the sample standalone dynamic backend built from the previous step:
57
58```shell
59-DDYNAMIC_BACKEND_PATHS=${DYNAMIC_BACKEND_DIR}/build
60```
61
62The paths will be processed in the same order as they are indicated in the macro.
63