-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_mnist_simple.sh
executable file
·32 lines (24 loc) · 944 Bytes
/
run_mnist_simple.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
#!/bin/bash
# RUN: %s %t.1 %t.2
curr_dir=`dirname $0`
if [[ $# != 0 ]];then
export TEST_TEMP_DIR=`dirname $1`
fi
out=$TEST_TEMP_DIR
model_name="mnist_simple"
model_path=$MODELS_ROOT/vision/classification/$model_name
$HALO_BIN -target cxx -o $out/mnist_simple.so $model_path/$model_name.pb -I $ODLA_INC
g++ -c $curr_dir/main.cc -I$out -o $out/main.o
if [[ $TEST_WITH_GPU -eq 1 ]]; then
echo "Using TensorRT based ODLA runtime"
g++ -o $out/test $out/main.o $out/mnist_simple.so \
-L$ODLA_LIB -lodla_tensorrt -Wl,-rpath=$ODLA_LIB
$out/test $model_path/test_image $model_path/test_label | tee $1
# RUN: FileCheck --input-file %t.1 %s
fi
echo "Using DNNL-based ODLA implementation"
g++ -o $out/test $out/main.o $out/mnist_simple.so \
-L$ODLA_LIB -lodla_dnnl -Wl,-rpath=$ODLA_LIB
$out/test $model_path/test_image $model_path/test_label | tee $2
# RUN: FileCheck --input-file %t.2 %s
# CHECK: Accuracy 91{{.*}}/10000 (91.{{.*}}%)