forked from codeplaysoftware/portDNN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·55 lines (39 loc) · 834 Bytes
/
build.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#! /bin/bash
function display_help() {
cat <<EOT
To use build.sh to compile SYCL-DNN with ComputeCpp:
./build.sh "path/to/ComputeCpp"
(the path to ComputeCpp can be relative)
For example:
./build.sh /home/user/ComputeCpp
EOT
}
# Useless to go on when an error occurs
set -o errexit
# Minimal emergency case to display the help message whatever happens
trap display_help ERR
echo "build.sh entering mode: ComputeCpp"
CMAKE_ARGS="$CMAKE_ARGS -DCOMPUTECPP_PACKAGE_ROOT_DIR=$(readlink -f $1)"
CMAKE_ARGS="$CMAKE_ARGS -DSNN_TEST_EIGEN=OFF"
shift
NPROC=$(nproc)
function configure {
mkdir -p build && pushd build
cmake .. $CMAKE_ARGS
popd
}
function mak {
pushd build && make -j$NPROC
popd
}
function tst {
pushd build
ctest -VV --timeout 600
popd
}
function main {
configure
mak
tst
}
main