From 234f3ea9d54968f9aeffbd27b507f516b7ada055 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9D=B4=EC=B6=98=EC=84=9D/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Senior=20Engineer/=EC=82=BC=EC=84=B1?= =?utf8?q?=EC=A0=84=EC=9E=90?= Date: Wed, 2 May 2018 13:03:20 +0900 Subject: [PATCH] Introduce xxx_driverbin in test_driver.sh (#976) Now, we can pass proper driver binary depending on test type(framework/verification/benchmark). Signed-off-by: Chunseok Lee --- tools/test_driver/test_driver.sh | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/tools/test_driver/test_driver.sh b/tools/test_driver/test_driver.sh index e2d0c38..5ae27c1 100755 --- a/tools/test_driver/test_driver.sh +++ b/tools/test_driver/test_driver.sh @@ -35,7 +35,9 @@ function Usage() echo "--benchmark - (default=off) run benchmark" echo "" echo "etc." - echo "--driverbin - (default=../../Product/out/bin/tflite_run) runner for runnning framework tests" + echo "--framework_driverbin - (default=../../Product/out/bin/tflite_run) runner for runnning framework tests" + echo "--verification_driverbin - (default=../../Product/out/bin/nnapi_test) runner for runnning verification tests" + echo "--benchmark_driverbin - (default=../../Product/out/bin/tflite_benchmark) runner for runnning benchmark" echo "--runtestsh - (default=\$ARTIFACT_PATH/tests/framework/run_test.sh) run_test.sh with path where it is for framework test and verification" echo "--unittestdir - (default=\$ARTIFACT_PATH/Product/out/unittest) directory that has unittest binaries for unit test" echo "" @@ -46,7 +48,9 @@ function Usage() } ARTIFACT_PATH="" -DRIVER_BIN="" +FRAMEWORK_DRIVER_BIN="" +VERIFICATION_DRIVER_BIN="" +BENCHMARK_DRIVER_BIN="" RUN_TEST_SH="" UNIT_TEST_DIR="" LD_LIBRARY_PATH_IN_SHELL="" @@ -68,8 +72,14 @@ do --artifactpath=*) ARTIFACT_PATH=${i#*=} ;; - --driverbin=*) - DRIVER_BIN=${i#*=} + --framework_driverbin=*) + FRAMEWORK_DRIVER_BIN=${i#*=} + ;; + --verification_driverbin=*) + VERIFICATION_DRIVER_BIN=${i#*=} + ;; + --benchmark_driverbin=*) + BENCHMARK_DRIVER_BIN=${i#*=} ;; --runtestsh=*) RUN_TEST_SH=${i#*=} @@ -171,8 +181,8 @@ fi # Run tflite_run with various tflite models if [ "$ALLTEST_ON" == "true" ] || [ "$FRAMEWORKTEST_ON" == "true" ]; then - if [ -z "$DRIVER_BIN" ]; then - DRIVER_BIN=$ARTIFACT_PATH/Product/out/bin/tflite_run + if [ -z "$FRAMEWORK_DRIVER_BIN" ]; then + FRAMEWORK_DRIVER_BIN=$ARTIFACT_PATH/Product/out/bin/tflite_run fi if [ ! -e "$ARTIFACT_PATH/report" ]; then @@ -182,7 +192,7 @@ if [ "$ALLTEST_ON" == "true" ] || [ "$FRAMEWORKTEST_ON" == "true" ]; then echo "" echo "============================================" echo "Framework Test with tflite_run..." - $RUN_TEST_SH --driverbin=$DRIVER_BIN \ + $RUN_TEST_SH --driverbin=$FRAMEWORK_DRIVER_BIN \ --reportdir=$ARTIFACT_PATH/report \ --tapname=framework_test.tap \ > $ARTIFACT_PATH/report/framework_test.log 2>&1 @@ -194,9 +204,8 @@ fi # Run nnapi_test with various tflite models if [ "$ALLTEST_ON" == "true" ] || [ "$VERIFICATION_ON" == "true" ]; then - unset DRIVER_BIN - if [ -z "$DRIVER_BIN" ]; then - DRIVER_BIN=$ARTIFACT_PATH/Product/out/bin/nnapi_test + if [ -z "$VERIFICATION_DRIVER_BIN" ]; then + VERIFICATION_DRIVER_BIN=$ARTIFACT_PATH/Product/out/bin/nnapi_test fi if [ ! -e "$ARTIFACT_PATH/report" ]; then @@ -206,7 +215,7 @@ if [ "$ALLTEST_ON" == "true" ] || [ "$VERIFICATION_ON" == "true" ]; then echo "" echo "============================================" echo "Verification with nnapi_test..." - $RUN_TEST_SH --driverbin=$DRIVER_BIN \ + $RUN_TEST_SH --driverbin=$VERIFICATION_DRIVER_BIN \ --reportdir=$ARTIFACT_PATH/report \ --tapname=verification.tap \ > $ARTIFACT_PATH/report/verification.log 2>&1 @@ -242,7 +251,11 @@ function run_benchmark_test() mkdir -p $REPORT_MODEL_DIR export COUNT=5 - local DRIVER_BIN=$ARTIFACT_PATH/Product/out/bin/tflite_benchmark + if [ -z "$BENCHMARK_DRIVER_BIN" ]; then + local DRIVER_BIN=$ARTIFACT_PATH/Product/out/bin/tflite_benchmark + else + local DRIVER_BIN=$BENCHMARK_DRIVER_BIN + fi echo "============================================" echo -n "TFLite + CPU................... " -- 2.7.4