aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Conroy <james.conroy@arm.com>2022-11-18 17:43:22 +0000
committerTeresa Charlin <teresa.charlinreyes@arm.com>2022-11-18 17:58:57 +0000
commit0d884d55b9fb91e065fb47141c0ff65f387c932b (patch)
treee6ec4af067aad9d728dbbad49c2fc40e01bcd9e1
parent758ff9f0ed3baeda3a5cd485d67e8369607e52ba (diff)
downloadarmnn-0d884d55b9fb91e065fb47141c0ff65f387c932b.tar.gz
IVGCVSW-7330 Add end-to-end dynamic sample build steps
* Moving from other build guides which are being removed and/or consolidated. Provides steps on how to build the standalone backend unit tests using the build-tool. Signed-off-by: James Conroy <james.conroy@arm.com> Change-Id: I3994bffc9038632ab7271ac31db25a38157f2bb7
-rw-r--r--src/dynamic/README.md69
1 files changed, 55 insertions, 14 deletions
diff --git a/src/dynamic/README.md b/src/dynamic/README.md
index 6efec20465..53bf935bbc 100644
--- a/src/dynamic/README.md
+++ b/src/dynamic/README.md
@@ -7,19 +7,6 @@ To be properly loaded and used, the backend instances must comply to the standar
and to the versioning rules that enforce ABI compatibility.
The details of how to add dynamic backends can be found in [src/backends/README.md](../backends/README.md).
-
-## Standalone dynamic backend example
-
-The source code includes an example that is used to generate a simple dynamic backend and is provided at
-
-[SampleDynamicBackend.hpp](./sample/SampleDynamicBackend.hpp)
-[SampleDynamicBackend.cpp](./sample/SampleDynamicBackend.cpp)
-
-The details of how to create backends can be found in [src/backends/README.md](../backends/README.md).
-
-The makefile used for building the standalone reference dynamic backend is also provided:
-[CMakeLists.txt](./sample/CMakeLists.txt)
-
### Standalone dynamic backend build
The easiest way to build a standalone sample dynamic backend is to build using environment configured compiler
@@ -40,7 +27,6 @@ make
The library will be created in ${DYNAMIC_BACKEND_DIR}/build.
-
## Dynamic backend loading paths
During the creation of the Runtime, Arm NN will scan a given set of paths searching for suitable dynamic backend objects to load.
@@ -58,3 +44,58 @@ Example for setting the path to the sample standalone dynamic backend built from
```
The paths will be processed in the same order as they are indicated in the macro.
+
+## Standalone dynamic backend example
+
+The source code includes an example that is used to generate a simple dynamic backend and is provided at
+
+[SampleDynamicBackend.hpp](./sample/SampleDynamicBackend.hpp)
+[SampleDynamicBackend.cpp](./sample/SampleDynamicBackend.cpp)
+
+The details of how to create backends can be found in [src/backends/README.md](../backends/README.md).
+
+The makefile used for building the standalone reference dynamic backend is also provided:
+[CMakeLists.txt](./sample/CMakeLists.txt)
+
+### End-To-End steps to build and test the sample dynamic backend
+To build and test the sample dynamic backend mentioned above, first Arm NN must be built with the
+sample dynamic unit tests turned on (**-DSAMPLE_DYNAMIC_BACKEND**) and the path must be provided to the Arm NN build the
+location of where the sample dynamic backend will be located at (**-DDYNAMIC_BACKEND_PATHS**) at runtime.
+This path should reflect the location on the target device, if this is different that the machine on which Arm NN was built.
+
+Arm NN can be built using the [Build Tool](../../build-tool/README.md) with the following additional comma-separated **--armnn-cmake-args** in the **BUILD_ARGS**:
+```shell
+--armnn-cmake-args='-DSAMPLE_DYNAMIC_BACKEND=1,-DDYNAMIC_BACKEND_PATHS=/tmp/armnn/sample_dynamic_backend'
+```
+
+Then the sample dynamic backend can be built standalone using the following commands:
+```shell
+cd armnn/src/dynamic/sample
+mkdir build
+cd build
+cmake -DARMNN_PATH=${ARMNN_BUILD_PATH}/libarmnn.so ..
+make
+```
+
+A shared library file named **libArm_SampleDynamic_backend.so** will now be located in the build directory. Copy this to the location
+defined by -DDYNAMIC_BACKEND_PATHS at compile time:
+```shell
+cp libArm_SampleDynamic_backend.so /tmp/armnn/sample_dynamic_backend
+```
+
+Then run the Arm NN unit tests which will be located inside the build directory created by the Arm NN build-tool:
+```shell
+./UnitTests
+```
+
+To be confident that the standalone dynamic backend tests are running, run the unit tests with the following filter:
+```shell
+./UnitTests -tc=CreateSampleDynamicBackend,SampleDynamicBackendEndToEnd
+[doctest] doctest version is "2.4.6"
+[doctest] run with "--help" for options
+===============================================================================
+[doctest] test cases: 2 | 2 passed | 0 failed | 2796 skipped
+[doctest] assertions: 11 | 11 passed | 0 failed |
+[doctest] Status: SUCCESS!
+
+```