task_example_test.sh 681 Bytes
Newer Older
Lingfan Yu's avatar
Lingfan Yu committed
1
2
#!/bin/bash

3
GCN_EXAMPLE_DIR="../../examples/pytorch/"
Lingfan Yu's avatar
Lingfan Yu committed
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

function fail {
    echo FAIL: $@
    exit -1
}

function usage {
    echo "Usage: $0 [CPU|GPU]"
}

# check arguments
if [ $# -ne 1 ]; then
    usage
    fail "Error: must specify device"
fi

if [ "$1" == "CPU" ]; then
    dev=-1
elif [ "$1" == "GPU" ]; then
    export CUDA_VISIBLE_DEVICES=0
    dev=0
else
    usage
    fail "Unknown device $1"
fi

pushd $GCN_EXAMPLE_DIR> /dev/null

32
33
34
35
# test
python3 pagerank.py || fail "run pagerank.py on $1"
python3 gcn/gcn.py --dataset cora --gpu $dev || fail "run gcn/gcn.py on $1"
python3 gcn/gcn_spmv.py --dataset cora --gpu $dev || fail "run gcn/gcn_spmv.py on $1"
Lingfan Yu's avatar
Lingfan Yu committed
36
37

popd > /dev/null