aboutsummaryrefslogtreecommitdiff
path: root/build-tool/scripts
diff options
context:
space:
mode:
authorNikhil Raj <nikhil.raj@arm.com>2023-04-26 16:22:10 +0100
committerNikhil Raj Arm <nikhil.raj@arm.com>2023-05-02 10:44:01 +0000
commit542c848730b9d96c3131cba25b3494022011e58f (patch)
treebdd9b5c294d348dfc919553a932e6e9504e89d89 /build-tool/scripts
parent86b0357c2b64cc902864fffc5fa4406cf5af1b6f (diff)
downloadarmnn-542c848730b9d96c3131cba25b3494022011e58f.tar.gz
IVGCVSW-7536 Update Build Tool for Opaque Delegate
Signed-off-by: Nikhil Raj <nikhil.raj@arm.com> Change-Id: Iaf3f1b5e4e41d0d946a21504c6d44e47d83273e0
Diffstat (limited to 'build-tool/scripts')
-rwxr-xr-xbuild-tool/scripts/build-armnn.sh62
-rwxr-xr-xbuild-tool/scripts/setup-armnn.sh51
-rwxr-xr-xbuild-tool/scripts/validation.sh2
3 files changed, 67 insertions, 48 deletions
diff --git a/build-tool/scripts/build-armnn.sh b/build-tool/scripts/build-armnn.sh
index 61cd36967a..6b5b57d784 100755
--- a/build-tool/scripts/build-armnn.sh
+++ b/build-tool/scripts/build-armnn.sh
@@ -96,7 +96,8 @@ build_armnn()
eval "$compile_flags" \
cmake -DCMAKE_BUILD_TYPE="$build_type" \
- -DBUILD_CLASSIC_DELEGATE="$flag_tflite_delegate" \
+ -DBUILD_CLASSIC_DELEGATE="$flag_tflite_classic_delegate" \
+ -DBUILD_OPAQUE_DELEGATE="$flag_tflite_opaque_delegate" \
-DBUILD_TF_LITE_PARSER="$flag_tflite_parser" \
-DBUILD_DELEGATE_JNI_INTERFACE="$flag_jni" \
-DBUILD_ONNX_PARSER="$flag_onnx_parser" \
@@ -194,8 +195,10 @@ usage()
cat <<EOF
build-armnn.sh - Build Arm NN and ACL
build-armnn.sh [OPTION]...
- --tflite-delegate
- build the Arm NN TF Lite Delegate component
+ --tflite-classic-delegate
+ build the existing Arm NN TF Lite Delegate component
+ --tflite-opaque-delegate
+ build the new Arm NN opaque delegate component
--tflite-parser
build the Arm NN TF Lite Parser component
--onnx-parser
@@ -225,7 +228,7 @@ build-armnn.sh [OPTION]...
-x
enable shell tracing in this script
-At least one component (i.e. --tflite-delegate, --tflite-parser, --onnx-parser) must be provided or else provide --all to build all Arm NN components.
+At least one component (i.e. --tflite-classic-delegate, --tflite-opaque-delegate, --tflite-parser, --onnx-parser) must be provided or else provide --all to build all Arm NN components.
At least one backend (i.e. --neon-backend, --cl-backend, --ref-backend) must be chosen.
This script must be executed from the same root directory in which setup-armnn.sh was executed from.
@@ -239,7 +242,7 @@ Examples:
Build for aarch64 with all Arm NN components, NEON enabled and OpenCL enabled:
<PATH_TO>/build-armnn.sh --target-arch=aarch64 --all --neon-backend --cl-backend
Build for aarch64 with TF Lite Delegate, OpenCL enabled and additional ACL scons params:
- <PATH_TO>/build-armnn.sh --target-arch=aarch64 --tflite-delegate --cl-backend --acl-scons-params='compress_kernels=1,benchmark_examples=1'
+ <PATH_TO>/build-armnn.sh --target-arch=aarch64 --tflite-classic-delegate --cl-backend --acl-scons-params='compress_kernels=1,benchmark_examples=1'
Setup for aarch64 with all Arm NN dependencies, OpenCL enabled and additional Arm NN cmake args:
<PATH_TO>/build-armnn.sh --target-arch=aarch64 --all --cl-backend --armnn-cmake-args='-DBUILD_SAMPLE_APP=1,-DBUILD_UNIT_TESTS=0'
EOF
@@ -249,7 +252,8 @@ EOF
target_arch=""
# Default flag values
-flag_tflite_delegate=0
+flag_tflite_classic_delegate=0
+flag_tflite_opaque_delegate=0
flag_tflite_parser=0
flag_onnx_parser=0
flag_neon_backend=0
@@ -274,7 +278,7 @@ if [ $# -eq 0 ]; then
exit 1
fi
-args=$(getopt -ohx -l tflite-delegate,tflite-parser,onnx-parser,all,target-arch:,neon-backend,cl-backend,ref-backend,clean,debug,armnn-cmake-args:,acl-scons-params:,num-threads:,help -n "$name" -- "$@")
+args=$(getopt -ohx -l tflite-classic-delegate,tflite-opaque-delegate,tflite-parser,onnx-parser,all,target-arch:,neon-backend,cl-backend,ref-backend,clean,debug,armnn-cmake-args:,acl-scons-params:,num-threads:,help -n "$name" -- "$@")
eval set -- "$args"
while [ $# -gt 0 ]; do
if [ -n "${opt_prev:-}" ]; then
@@ -295,16 +299,21 @@ while [ $# -gt 0 ]; do
flag_tflite_parser=1
;;
- --tflite-delegate)
+ --tflite-classic-delegate)
flag_tflite_delegate=1
;;
+ --tflite-opaque-delegate)
+ flag_tflite_opaque_delegate=1
+ ;;
+
--onnx-parser)
flag_onnx_parser=1
;;
--all)
- flag_tflite_delegate=1
+ flag_tflite_classic_delegate=1
+ flag_tflite_opaque_delegate=1
flag_tflite_parser=1
flag_onnx_parser=1
;;
@@ -441,23 +450,24 @@ ARMNN_BUILD_TARGET="$ARMNN_BUILD_ROOT"/"$ARMNN_BUILD_DIR_NAME"
ACL_BUILD_TARGET="$BUILD_DIR"/acl/"$TARGET_ARCH"_build"$DEBUG_POSTFIX"
echo -e "\nINFO: Displaying configuration information before execution of $name"
-echo " target-arch: $TARGET_ARCH"
-echo " host-arch: $HOST_ARCH"
-echo " tflite-delegate: $flag_tflite_delegate"
-echo " tflite-parser: $flag_tflite_parser"
-echo " onnx-parser: $flag_onnx_parser"
-echo " neon-backend: $flag_neon_backend"
-echo " cl-backend: $flag_cl_backend"
-echo " ref-backend: $flag_ref_backend"
-echo " clean: $flag_clean"
-echo " debug: $flag_debug"
-echo "armnn-cmake-args: $armnn_cmake_args"
-echo "acl-scons-params: $acl_scons_params"
-echo " num-threads: $NUM_THREADS"
-echo " root directory: $ROOT_DIR"
-echo "source directory: $SOURCE_DIR"
-echo " build directory: $BUILD_DIR"
-echo " armnn build dir: $ARMNN_BUILD_TARGET"
+echo " target-arch: $TARGET_ARCH"
+echo " host-arch: $HOST_ARCH"
+echo "tflite-classic-delegate: $flag_tflite_classic_delegate"
+echo "tflite-opaque-delegate : $flag_tflite_opaque_delegate"
+echo " tflite-parser: $flag_tflite_parser"
+echo " onnx-parser: $flag_onnx_parser"
+echo " neon-backend: $flag_neon_backend"
+echo " cl-backend: $flag_cl_backend"
+echo " ref-backend: $flag_ref_backend"
+echo " clean: $flag_clean"
+echo " debug: $flag_debug"
+echo " armnn-cmake-args: $armnn_cmake_args"
+echo " acl-scons-params: $acl_scons_params"
+echo " num-threads: $NUM_THREADS"
+echo " root directory: $ROOT_DIR"
+echo " source directory: $SOURCE_DIR"
+echo " build directory: $BUILD_DIR"
+echo " armnn build dir: $ARMNN_BUILD_TARGET"
echo -e "\nScript execution will begin in 10 seconds..."
sleep 10
diff --git a/build-tool/scripts/setup-armnn.sh b/build-tool/scripts/setup-armnn.sh
index 9a398d5a46..156bb2fb95 100755
--- a/build-tool/scripts/setup-armnn.sh
+++ b/build-tool/scripts/setup-armnn.sh
@@ -215,8 +215,10 @@ usage()
cat <<EOF
setup-armnn.sh - Download and build Arm NN dependencies in the current directory (ROOT_DIR)
setup-armnn.sh [OPTION]...
- --tflite-delegate
- setup dependencies for the Arm NN TF Lite Delegate
+ --tflite-classic-delegate
+ setup dependencies for the existing Arm NN TF Lite Delegate
+ --tflite-opaque-delegate
+ setup dependencies for the new Opaque Delegate
--tflite-parser
setup dependencies for the Arm NN TF Lite Parser
--onnx-parser
@@ -232,15 +234,15 @@ setup-armnn.sh [OPTION]...
-x
enable shell tracing in this script
-At least one dependency flag (e.g. --tflite-delegate) must be provided or else provide --all to setup all dependencies.
+At least one dependency flag (e.g. --tflite-classic-delegate) must be provided or else provide --all to setup all dependencies.
Directories called "source" and "build" will be generated in the current directory (ROOT_DIR) from which this script is called.
It's recommended to call this script in a directory outside of this Arm NN source repo, to avoid nested repositories.
Examples:
Setup for aarch64 with all Arm NN dependencies:
<PATH_TO>/setup-armnn.sh --target-arch=aarch64 --all
-Setup for aarch64 with TF Lite Delegate and TF Lite Parser dependencies only:
- <PATH_TO>/setup-armnn.sh --target-arch=aarch64 --tflite-delegate --tflite-parser
+Setup for aarch64 with the existing TF Lite Delegate and TF Lite Parser dependencies only:
+ <PATH_TO>/setup-armnn.sh --target-arch=aarch64 --tflite-classic-delegate --tflite-parser
EOF
}
@@ -248,7 +250,8 @@ EOF
target_arch=""
# Default flag values
-flag_tflite_delegate=0
+flag_tflite_classic_delegate=0
+flag_tflite_opaque_delegate=0
flag_tflite_parser=0
flag_onnx_parser=0
@@ -263,7 +266,7 @@ if [ $# -eq 0 ]; then
exit 1
fi
-args=$(getopt -ohx -l tflite-delegate,tflite-parser,onnx-parser,all,target-arch:,num-threads:,help -n "$name" -- "$@")
+args=$(getopt -ohx -l tflite-classic-delegate,tflite-opaque-delegate,tflite-parser,onnx-parser,all,target-arch:,num-threads:,help -n "$name" -- "$@")
eval set -- "$args"
while [ $# -gt 0 ]; do
if [ -n "${opt_prev:-}" ]; then
@@ -284,8 +287,12 @@ while [ $# -gt 0 ]; do
flag_tflite_parser=1
;;
- --tflite-delegate)
- flag_tflite_delegate=1
+ --tflite-classic-delegate)
+ flag_tflite_classic_delegate=1
+ ;;
+
+ --tflite-opaque-delegate)
+ flag_tflite_opaque_delegate=1
;;
--onnx-parser)
@@ -293,7 +300,8 @@ while [ $# -gt 0 ]; do
;;
--all)
- flag_tflite_delegate=1
+ flag_tflite_classic_delegate=1
+ flag_tflite_opaque_delegate=1
flag_tflite_parser=1
flag_onnx_parser=1
;;
@@ -328,15 +336,16 @@ done
source "$rel_path"/common.sh
echo -e "\nINFO: Displaying configuration information before execution of $name"
-echo " target-arch: $TARGET_ARCH"
-echo " host-arch: $HOST_ARCH"
-echo " tflite-delegate: $flag_tflite_delegate"
-echo " tflite-parser: $flag_tflite_parser"
-echo " onnx-parser: $flag_onnx_parser"
-echo " num-threads: $NUM_THREADS"
-echo " root directory: $ROOT_DIR"
-echo "source directory: $SOURCE_DIR"
-echo " build directory: $BUILD_DIR"
+echo " target-arch: $TARGET_ARCH"
+echo " host-arch: $HOST_ARCH"
+echo "tflite-classic-delegate: $flag_tflite_classic_delegate"
+echo "tflite-opaque-delegate : $flag_tflite_opaque_delegate"
+echo " tflite-parser: $flag_tflite_parser"
+echo " onnx-parser: $flag_onnx_parser"
+echo " num-threads: $NUM_THREADS"
+echo " root directory: $ROOT_DIR"
+echo " source directory: $SOURCE_DIR"
+echo " build directory: $BUILD_DIR"
if check_if_repository .; then
echo -e "\n***** WARNING: Running script inside a git repository. To avoid nested repos, call this script from outside of this repo. *****"
@@ -349,7 +358,7 @@ sleep 10
mkdir -p "$SOURCE_DIR"
mkdir -p "$BUILD_DIR"
-if [ "$flag_tflite_delegate" -eq 1 ] || [ "$flag_tflite_parser" -eq 1 ]; then
+if [ "$flag_tflite_classic_delegate" -eq 1 ] || [ "$flag_tflite_opaque_delegate" -eq 1 ] || [ "$flag_tflite_parser" -eq 1 ]; then
download_flatbuffers
# Host build
@@ -367,7 +376,7 @@ if [ "$flag_tflite_parser" -eq 1 ]; then
generate_tflite_schema
fi
-if [ "$flag_tflite_delegate" -eq 1 ]; then
+if [ "$flag_tflite_classic_delegate" -eq 1 ] || [ "$flag_tflite_opaque_delegate" -eq 1 ]; then
build_tflite
fi
diff --git a/build-tool/scripts/validation.sh b/build-tool/scripts/validation.sh
index 7928952577..12988b6ae8 100755
--- a/build-tool/scripts/validation.sh
+++ b/build-tool/scripts/validation.sh
@@ -34,7 +34,7 @@ fi
# Validation of chosen Arm NN dependencies
if [ "$flag_tflite_delegate" -eq 0 ] && [ "$flag_tflite_parser" -eq 0 ] && [ "$flag_onnx_parser" -eq 0 ]; then
- echo "$name: at least one of flags --tflite-delegate, --tflite-parser or --onnx-parser must be set (or --all)."
+ echo "$name: at least one of flags --tflite-classic-delegate, --tflite-opaque-delegate, --tflite-parser or --onnx-parser must be set (or --all)."
exit 1
fi