summaryrefslogtreecommitdiff
path: root/infra/scripts/test_arm_neurun_mixed.sh
diff options
context:
space:
mode:
Diffstat (limited to 'infra/scripts/test_arm_neurun_mixed.sh')
-rw-r--r--infra/scripts/test_arm_neurun_mixed.sh44
1 files changed, 44 insertions, 0 deletions
diff --git a/infra/scripts/test_arm_neurun_mixed.sh b/infra/scripts/test_arm_neurun_mixed.sh
new file mode 100644
index 000000000..7ba9d2098
--- /dev/null
+++ b/infra/scripts/test_arm_neurun_mixed.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+[[ "${BASH_SOURCE[0]}" != "${0}" ]] && echo "Please don't source ${BASH_SOURCE[0]}, execute it" && return
+
+CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+ROOT_PATH="$CURRENT_PATH/../../"
+
+# Model download server setting
+if [[ -z $MODELFILE_SERVER ]]; then
+ echo "Need model file server setting"
+ exit 1
+fi
+
+set -e
+
+pushd $ROOT_PATH > /dev/null
+
+export EXECUTOR=Linear
+
+# NOTE Fixed backend assignment by type of operation
+# TODO Enhance this with randomized test
+BACKENDS=(cpu acl_cl acl_neon)
+unset OP_BACKEND_ALLOPS
+export OP_BACKEND_Conv2DNode=cpu
+export OP_BACKEND_MaxPool2DNode=acl_cl
+export OP_BACKEND_AvgPool2DNode=acl_neon
+export ACL_LAYOUT=NCHW
+
+# Get the intersect of framework test list files(each backend has a lsit)
+TESTLIST_PREFIX="tests/scripts/neurun_frameworktest_list.armv7l"
+cat $TESTLIST_PREFIX.${BACKENDS[0]}.txt | sort > $TESTLIST_PREFIX.intersect.txt
+for BACKEND in $BACKENDS; do
+ comm -12 <(sort $TESTLIST_PREFIX.intersect.txt) <(sort $TESTLIST_PREFIX.$BACKEND.txt) > $TESTLIST_PREFIX.intersect.next.txt
+ mv $TESTLIST_PREFIX.intersect.next.txt $TESTLIST_PREFIX.intersect.txt
+done
+
+# Run the test
+cp -v ./Product/out/unittest/nnapi_gtest.skip.armv7l-linux ./Product/out/unittest/nnapi_gtest.skip
+source ./tests/scripts/test_driver.sh \
+ --frameworktest_list_file=$TESTLIST_PREFIX.intersect.txt \
+ --ldlibrarypath="$ROOT_PATH/Product/out/lib/neurun:$ROOT_PATH/Product/out/lib" \
+ --reportdir="$ROOT_PATH/report/mixed" .
+
+popd > /dev/null