File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -236,6 +236,38 @@ function run_test-ops()
236236
237237}
238238
239+ function run_test-op()
240+ {
241+ prepare_run_on_phone test-backend-ops
242+
243+ qnnbackendname=qnn-cpu
244+ case $qnnbackend in
245+ 0)
246+ qnnbackendname=qnn-cpu
247+ ;;
248+ 1)
249+ qnnbackendname=qnn-gpu
250+ ;;
251+ 2)
252+ qnnbackendname=qnn-npu
253+ ;;
254+ * )
255+ qnnbackendname=qnn-cpu
256+ ;;
257+ esac
258+
259+ # debug
260+ echo " adb shell cd ${REMOTE_PATH} \
261+ && export LD_LIBRARY_PATH=${REMOTE_PATH} \
262+ && ${REMOTE_PATH} /test-backend-ops test -o $opname -b $qnnbackendname "
263+
264+ echo " \n"
265+ adb shell " cd ${REMOTE_PATH} \
266+ && export LD_LIBRARY_PATH=${REMOTE_PATH} \
267+ && ${REMOTE_PATH} /test-backend-ops test -o $opname -b $qnnbackendname "
268+
269+ }
270+
239271
240272function print_oplist()
241273{
@@ -325,6 +357,7 @@ function show_usage()
325357 echo " $0 build"
326358 echo " $0 updateqnnlib"
327359 echo " $0 run_testops"
360+ echo " $0 run_testop [ADD/MUL_MAT] [0 (QNN_CPU) / 1 (QNN_GPU) / 2 (QNN_NPU)]"
328361 echo " $0 run_llamacli"
329362 echo " $0 run_llamabench"
330363
@@ -370,6 +403,19 @@ elif [ $# == 1 ]; then
370403 show_usage
371404 exit 1
372405 fi
406+ elif [ $# == 3 ]; then
407+ opname=$2
408+ # TODO: check opname in oplist
409+ # opname can be found via print_oplist:
410+
411+ qnnbackend=$3
412+ if [ ${qnnbackend} -gt 3 ]; then
413+ show_usage
414+ exit 1
415+ fi
416+
417+ run_test-op
418+ exit 0
373419else
374420 show_usage
375421 exit 1
You can’t perform that action at this time.
0 commit comments