Environment
ARM ComputeLibrary
$ scons -j`nproc` \
> extra_cxx_flags="-fPIC" \
> benchmark_tests=1 validation_tests=1 \
> neon=1 opencl=0 arch=armv7a debug=0
$ ./graph_alexnet 0 ./alexnet/ ./alexnet/go_kart.ppm ./alexnet/labels.txt neon
./graph_alexnet
---------- Top 5 predictions ----------
0.9722 - [id = 573], n03444034 go-kart
0.0123 - [id = 518], n03127747 crash helmet
0.0115 - [id = 751], n04037443 racer, race car, racing car
0.0023 - [id = 817], n04285008 sports car, sport car
0.0007 - [id = 670], n03791053 motor scooter, scooter
---------- Top 5 predictions ----------
0.9722 - [id = 573], n03444034 go-kart
0.0123 - [id = 518], n03127747 crash helmet
0.0115 - [id = 751], n04037443 racer, race car, racing car
0.0023 - [id = 817], n04285008 sports car, sport car
0.0007 - [id = 670], n03791053 motor scooter, scooter
Test passed
$ ./arm_compute_benchmark ./data
Version = arm_compute_version=v18.05 Build options: {'arch': 'armv7a', 'opencl': '0', 'neon': '1', 'examples': '1', 'asserts': '0', 'debug': '0', 'os': 'linux', 'Werror': '1'} Git hash=unknown
Seed = 1243123845
Iterations = 1
Threads = 1
Dataset mode = PRECOMMIT
Running [0] 'NEON/SYSTEM_TESTS/AlexNet@DataType=F32:Batches=1'
Wall clock/Wall clock time: AVG=4641019.0000 us
Running [1] 'NEON/SYSTEM_TESTS/AlexNet@DataType=F32:Batches=2'
Wall clock/Wall clock time: AVG=7905115.0000 us
Running [2] 'NEON/SYSTEM_TESTS/AlexNet@DataType=F32:Batches=4'
...
Running [3869] 'NEON/Transpose/RunSmall@Shape=128x64:DataType=U32'
Wall clock/Wall clock time: AVG=81.0000 us
Executed 1511 test(s) (1480 passed, 0 expected failures, 0 failed, 0 crashed, 0 disabled) in 209 second(s)
./arm_compute_validation ./data
Version = arm_compute_version=v18.05 Build options: {'arch': 'armv7a', 'opencl': '0', 'neon': '1', 'examples': '1', 'asserts': '0', 'debug': '0', 'os': 'linux', 'Werror': '1'} Git hash=unknown
Seed = 3980534247
Iterations = 1
Threads = 1
Dataset mode = PRECOMMIT
Running [0] 'UNIT/FixedPoint/FixedPointQS8Inputs@FunctionNames=ADD:FractionalBits=1'
Wall clock/Wall clock time: AVG=3318.0000 us
...
Running [46325] 'NEON/WarpPerspective/RunSmall@Shape=9x9x3x5:DataType=U8:InterpolationPolicy=BILINEAR:BorderMode=REPLICATE'
Wall clock/Wall clock time: AVG=1174.0000 us
Executed 30450 test(s) (30386 passed, 0 expected failures, 0 failed, 0 crashed, 0 disabled) in 2157 second(s)
ARM NN SDK
$ ./bootstrap.sh
# Replace the line in project-config.jam:
# using gcc ;
# with
# using gcc : arm : arm-linux-gnueabihf-g++ ;
$ nano project-config.jam
$ ./bjam install toolset=gcc-arm \
> --prefix=<lib output dir> \
> -j`nproc` link=static cxxflags=-fPIC \
> --with-filesystem --with-test --with-log --with-program_options \
> install
- Build NN SDK
- Edit cmake/GlobalConfig.cmake like below if necessary
# find_package(Boost 1.59 REQUIRED COMPONENTS unit_test_framework system filesystem log program_options)
find_package(Boost 1.59 REQUIRED COMPONENTS unit_test_framework system filesystem log thread program_options)
$ cmake .. -G"Unix Makefiles" \
-DCMAKE_TOOLCHAIN_FILE=~/toolchain.make \
-DCMAKE_INSTALL_PREFIX=`pwd`/_install \
-DARMCOMPUTE_ROOT=~/arm/ComputeLibrary-18.05/ \
-DARMCOMPUTE_BUILD_DIR=~/arm/ComputeLibrary-18.05/build \
-DBOOST_ROOT=~/arm/_boost \
-DCAFFE_GENERATED_SOURCES=~/work/caffe-1.0/.build_release/src \
-DBUILD_CAFFE_PARSER=1 \
-DARMCOMPUTENEON=1 -DARMCOMPUTECL=0 \
-DPROTOBUF_ROOT=~/git_repo/zynq-library/dl-framework/caffe-dependency/
$ LD_LIBRARY_PATH=. ./UnitTests
Running 398 test cases...
*** No errors detected
Reference