-
Notifications
You must be signed in to change notification settings - Fork 11
/
compile_all.sh
executable file
·86 lines (81 loc) · 2.25 KB
/
compile_all.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
# This script compiles all of the subdirectories for the OBPMark project
# check the first argument to see if is a valid word from the list
# if no argument is given, then compile all
# list of valid words
valid_words="all cpu openmp cuda opencl hip allcuda allopencl allhip clean"
input_word=$1
# check if the input word is valid and witch one it is
for word in $valid_words
do
if [ "$input_word" == "$word" ]; then
if [ "all" == "$input_word" ]
then
echo "Compiling all"
# compile all
make clean
make cpu openmp cuda opencl hip
elif [ "cpu" == "$input_word" ]
then
echo "Compiling cpu"
# compile cpu
make clean
make cpu
elif [ "openmp" == "$input_word" ]
then
echo "Compiling openmp"
# compile openmp
make clean
make openmp
elif [ "cuda" == "$input_word" ]
then
echo "Compiling cuda"
# compile cuda
make clean
make cuda
elif [ "opencl" == "$input_word" ]
then
echo "Compiling opencl"
# compile opencl
make clean
make opencl
elif [ "hip" == "$input_word" ]
then
echo "Compiling Hip"
# compile hip
make clean
make hip
elif [ "allcuda" == "$input_word" ]
then
echo "Compiling allcuda"
# compile allcuda
make clean
make cpu cuda openmp
elif [ "allopencl" == "$input_word" ]
then
echo "Compiling allopencl"
# compile allopencl
make clean
make cpu opencl openmp
elif [ "allhip" == "$input_word" ]
then
echo "Compiling allhip"
# compile allhip
make clean
make cpu hip openmp
elif [ "clean" == "$input_word" ]
then
echo "Cleaning"
# clean
make clean
fi
break
fi
done
# check if the argument is empty
if [ -z "$input_word" ]; then
echo "Compiling all"
# compile all
make clean
make cpu openmp cuda opencl hip
fi