forked from Samsung/ONE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_ubuntu_runtime.sh
executable file
·73 lines (61 loc) · 1.57 KB
/
test_ubuntu_runtime.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
set -eo pipefail
source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
: ${TEST_ARCH:=$(uname -m | tr '[:upper:]' '[:lower:]')}
BACKEND="cpu"
TEST_OS="linux"
TEST_PLATFORM="$TEST_ARCH-$TEST_OS"
LINEAR_ONLY="0"
RUN_INTERP="0"
function Usage()
{
echo "Usage: $0 $(basename ${BASH_SOURCE[0]}) [OPTIONS]"
echo ""
echo "Options:"
echo " --backend <BACKEND> Runtime backend to test (default: ${BACKEND})"
echo " --linear-only Use Linear executor only"
}
while [[ $# -gt 0 ]]
do
arg="$1"
case $arg in
-h|--help|help)
Usage
exit 0
;;
--backend)
BACKEND=$(echo $2 | tr '[:upper:]' '[:lower:]')
shift 2
;;
--backend=*)
BACKEND=$(echo ${1#*=} | tr '[:upper:]' '[:lower:]')
shift
;;
--linear-only)
LINEAR_ONLY="1"
shift
;;
*)
# Ignore
shift
;;
esac
done
CheckTestPrepared
echo "[[ ${TEST_PLATFORM}: ${BACKEND} backend test ]]"
UNITTEST_SKIPLIST="Product/out/nnapi-gtest/nnapi_gtest.skip.${TEST_PLATFORM}.${BACKEND}"
TFLITE_TESTLIST="Product/out/test/list/tflite_comparator.${TEST_ARCH}.${BACKEND}.list"
REPORT_BASE="report/${BACKEND}"
EXECUTORS=("Linear" "Dataflow" "Parallel")
if [ $LINEAR_ONLY = "1" ]; then
EXECUTORS=("Linear")
fi
for EXECUTOR in "${EXECUTORS[@]}";
do
echo "[EXECUTOR]: ${EXECUTOR}"
REPORT_PATH="${REPORT_BASE}/${EXECUTOR}"
export EXECUTOR="${EXECUTOR}"
NNAPIGTest "${BACKEND}" "${UNITTEST_SKIPLIST}" "${REPORT_PATH}"
TFLiteModelVerification "${BACKEND}" "${TFLITE_TESTLIST}" "${REPORT_PATH}"
unset EXECUTOR
done