Build the example plugin
The example backend implements a simple custom plugin to help show how you can write your own custom plugins. The example backend simulates optimizing addition layers by substituting them with a pre-compiled layer. This pre-compiled layer includes a pre-compiled object that represents an optimized alternative to the addition layer in Arm NN. This pre-compiled object is an instance of a CustomPreCompiledObject
.
Follow these steps to integrate the example custom plugin with your existing Arm NN build:
- Download the ArmNNPluginFramework.zip file containing the example plugin to a temporary location, for example /tmp.
- Extract the contents of the zip file:
cd /tmp
unzip ArmNNPluginFramework.zip - Copy the example plugin to the
src/backends
folder in your Arm NN installation:
cp -r /tmp/custom <armnn_install_dir>/armnn/src/backends/
- Re-run CMake to produce the new makefiles that are needed to build the example plugin:
cd <armnn_install_dir>/armnn/build
cmake .. -DBOOST_ROOT=<boost_lib_dir> - Compile using the
make
command:
make -j32
- Run all the Arm NN unit tests, including those supplied with the example plugin:
cd <armnn_install_dir>/armnn/build
./UnitTestsThe output should be:
Running 1204 test cases...
*** No errors detected