-
Notifications
You must be signed in to change notification settings - Fork 41
/
configure.sh
executable file
·195 lines (183 loc) · 3.21 KB
/
configure.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
#!/bin/bash
tag="${1}"
makefile="Makefile"
function enable_gpu() {
echo "enable GPU flag"
sed -i -e 's/GPU=0/GPU=1/g' $makefile
}
function enable_cudnn() {
echo "enable CUDNN flag"
sed -i -e 's/CUDNN=0/CUDNN=1/g' $makefile
}
function enable_cudnn_half() {
echo "enable CUDNN_HALF flag"
sed -i -e 's/CUDNN_HALF=0/CUDNN_HALF=1/g' $makefile
}
function enable_opencv() {
echo "enable OPENCV flag"
sed -i -e 's/OPENCV=0/OPENCV=1/g' $makefile
}
function enable_avx() {
echo "enable AVX flag"
sed -i -e 's/AVX=0/AVX=1/g' $makefile
}
function enable_openmp() {
echo "enable OPENMP flag"
sed -i -e 's/OPENMP=0/OPENMP=1/g' $makefile
}
function enable_libso() {
echo "enable LIBSO flag"
sed -i -e 's/LIBSO=0/LIBSO=1/g' $makefile
}
function enable_zed_camera() {
echo "enable ZED_CAMERA flag"
sed -i -e 's/ZED_CAMERA=0/ZED_CAMERA=1/g' $makefile
}
function enable_debug() {
echo "enable DEBUG flag"
sed -i -e 's/DEBUG=0/DEBUG=1/g' $makefile
}
function enable_arch() {
echo "enable ARCH= -gencode arch=compute_$1,code[sm_$1,compute_$1"
sed -i -e "s/# ARCH= -gencode arch=compute_$1/ARCH= -gencode arch=compute_$1/g" $makefile
}
case ${tag} in
"cpu")
enable_avx
enable_openmp
;;
"cpu-noopt")
enable_openmp
;;
"cpu-cv")
enable_opencv
enable_avx
enable_openmp
;;
"cpu-noopt-cv")
enable_opencv
enable_openmp
;;
"gpu")
enable_gpu
enable_cudnn
;;
"gpu-cv")
enable_gpu
enable_cudnn
enable_opencv
;;
"gpu-cc53")
enable_gpu
enable_cudnn
enable_arch 53
;;
"gpu-cv-cc53")
enable_gpu
enable_cudnn
enable_opencv
enable_arch 53
;;
"gpu-cc60")
enable_gpu
enable_cudnn
enable_arch 60
;;
"gpu-cv-cc60")
enable_gpu
enable_cudnn
enable_opencv
enable_arch 60
;;
"gpu-cc61")
enable_gpu
enable_cudnn
enable_arch 61
;;
"gpu-cv-cc61")
enable_gpu
enable_cudnn
enable_opencv
enable_arch 61
;;
"gpu-cc62")
enable_gpu
enable_cudnn
enable_arch 62
;;
"gpu-cv-cc62")
enable_gpu
enable_cudnn
enable_opencv
enable_arch 62
;;
"gpu-cc70")
enable_gpu
enable_cudnn
enable_cudnn_half
enable_arch 70
;;
"gpu-cv-cc70")
enable_gpu
enable_cudnn
enable_cudnn_half
enable_opencv
enable_arch 70
;;
"gpu-cc72")
enable_gpu
enable_cudnn
enable_cudnn_half
enable_arch 72
;;
"gpu-cv-cc72")
enable_gpu
enable_cudnn
enable_cudnn_half
enable_opencv
enable_arch 72
;;
"gpu-cc75")
enable_gpu
enable_cudnn
enable_cudnn_half
enable_arch 75
;;
"gpu-cv-cc75")
enable_gpu
enable_cudnn
enable_cudnn_half
enable_opencv
enable_arch 75
;;
"gpu-cc80")
enable_gpu
enable_cudnn
enable_cudnn_half
enable_arch 80
;;
"gpu-cv-cc80")
enable_gpu
enable_cudnn
enable_cudnn_half
enable_opencv
enable_arch 80
;;
"gpu-cc86")
enable_gpu
enable_cudnn
enable_cudnn_half
enable_arch 86
;;
"gpu-cv-cc86")
enable_gpu
enable_cudnn
enable_cudnn_half
enable_opencv
enable_arch 86
;;
*)
echo "error: $tag is not supported"
exit 1
;;
esac