1 # Standalone dynamic backend developer guide
3 Arm NN allows adding new dynamic backends. Dynamic Backends can be compiled as standalone against Arm NN
4 and can be loaded by Arm NN dynamically at runtime.
6 To be properly loaded and used, the backend instances must comply to the standard interface for dynamic backends
7 and to the versioning rules that enforce ABI compatibility.
8 The details of how to add dynamic backends can be found in [src/backends/README.md](../backends/README.md).
11 ## Standalone dynamic backend example
13 The source code includes an example that is used to generate a simple dynamic backend and is provided at
15 [SampleDynamicBackend.hpp](./sample/SampleDynamicBackend.hpp)
16 [SampleDynamicBackend.cpp](./sample/SampleDynamicBackend.cpp)
18 The details of how to create backends can be found in [src/backends/README.md](../backends/README.md).
20 The makefile used for building the standalone reference dynamic backend is also provided:
21 [CMakeLists.txt](./sample/CMakeLists.txt)
23 ### Standalone dynamic backend build
25 The easiest way to build a standalone sample dynamic backend is to build using environment configured compiler
26 and specify the Arm NN path and Boost path to the CMake command:
29 cd ${DYNAMIC_BACKEND_DIR}
32 cmake -DBOOST_ROOT=${BOOST_PATH} \
33 -DBoost_SYSTEM_LIBRARY=${BOOST_PATH}/lib/libboost_system.a \
34 -DBoost_FILESYSTEM_LIBRARY=${BOOST_PATH}/lib/libboost_filesystem.a \
35 -DARMNN_PATH=${ARMNN_PATH}/libarmnn.so ..
44 The library will be created in ${DYNAMIC_BACKEND_DIR}/build.
47 ## Dynamic backend loading paths
49 During the creation of the Runtime, Arm NN will scan a given set of paths searching for suitable dynamic backend objects to load.
50 A list of (absolute) paths can be specified at compile-time by setting a define named ```DYNAMIC_BACKEND_PATHS```
51 in the form of a colon-separated list of strings.
54 -DDYNAMIC_BACKEND_PATHS="PATH_1:PATH_2...:PATH_N"
57 Example for setting the path to the sample standalone dynamic backend built from the previous step:
60 -DDYNAMIC_BACKEND_PATHS=${DYNAMIC_BACKEND_DIR}/build
63 The paths will be processed in the same order as they are indicated in the macro.