summaryrefslogtreecommitdiff
path: root/infra/scripts/test_tizen_neurun_mixed.sh
blob: ef1781486670556e7318fd1d49444901df4bbb45 (plain)
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
#!/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/../../"

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-tizen ./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