op.cmake 6.1 KB
Newer Older
H
hanbuhe 已提交
1 2 3
set(FOUND_MATCH OFF)
if ("googlenet" IN_LIST NET)
  message("googlenet enabled")
D
dolphin8 已提交
4 5 6 7 8 9 10 11 12
  set(CONCAT_OP ON)
  set(CONV_OP ON)
  set(LRN_OP ON)
  set(MUL_OP ON)
  set(ELEMENTWISEADD_OP ON)
  set(FUSION_FC_OP ON)
  set(POOL_OP ON)
  set(RELU_OP ON)
  set(FUSION_CONVADD_OP ON)
Z
zhangyang 已提交
13
  set(FUSION_CONVADDRELU_OP ON)
H
hanbuhe 已提交
14 15 16 17 18 19

  set(FOUND_MATCH ON)
endif()

if ("mobilenet" IN_LIST NET)
  message("mobilenet enabled")
D
dolphin8 已提交
20 21 22 23
  set(CONV_OP ON)
  set(ELEMENTWISEADD_OP ON)
  set(RELU_OP ON)
  set(SOFTMAX_OP ON)
24
  set(MUL_OP ON)
D
dolphin8 已提交
25 26 27 28
  set(DEPTHWISECONV_OP ON)
  set(BATCHNORM_OP ON)
  set(POOL_OP ON)
  set(RESHAPE_OP ON)
W
wangliu 已提交
29 30
  set(FUSION_CONVADDBNRELU_OP ON)
  set(FUSION_CONVADD_OP ON)
H
hanbuhe 已提交
31 32 33 34 35

  set(FOUND_MATCH ON)
endif()


36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
if ("mobilenetssd" IN_LIST NET)
  message("mobilenetssd enabled")
  set(FUSION_CONVBNRELU_OP ON)
  set(FUSION_CONVBNRELU_OP ON)
  set(FUSION_DWCONVBNRELU_OP ON)
  set(FUSION_CONVADD_OP ON)
  set(MULTICLASSNMS_OP ON)
  set(SOFTMAX_OP ON)
  set(TRANSPOSE_OP ON)
    #feed
  set(PRIORBOX_OP ON)
  set(CONCAT_OP ON)
  set(BOXCODER_OP ON)
  set(RESHAPE_OP ON)
#fetch
  #total

  set(FOUND_MATCH ON)

endif()


H
hanbuhe 已提交
58 59
if ("yolo" IN_LIST NET)
  message("yolo enabled")
D
dolphin8 已提交
60 61 62 63
  set(BATCHNORM_OP ON)
  set(CONV_OP ON)
  set(RELU_OP ON)
  set(ELEMENTWISEADD_OP ON)
H
hanbuhe 已提交
64 65 66 67 68 69

  set(FOUND_MATCH ON)
endif()

if ("squeezenet" IN_LIST NET)
  message("squeezenet enabled")
D
dolphin8 已提交
70 71 72 73 74 75 76
  set(CONCAT_OP ON)
  set(CONV_OP ON)
  set(RELU_OP ON)
  set(ELEMENTWISEADD_OP ON)
  set(POOL_OP ON)
  set(RESHAPE_OP ON)
  set(SOFTMAX_OP ON)
H
hanbuhe 已提交
77 78 79 80 81 82 83 84

  set(FOUND_MATCH ON)
endif()


if ("resnet" IN_LIST NET)
  message("resnet enabled")
  set(CONCAT_OP ON)
D
dolphin8 已提交
85
  set(CONV_OP ON)
H
hanbuhe 已提交
86
  set(RELU_OP ON)
D
dolphin8 已提交
87 88
  set(ELEMENTWISEADD_OP ON)
  set(POOL_OP ON)
qnqinan's avatar
qnqinan 已提交
89
  set(BATCHNORM_OP ON)
90
  set(FUSION_CONVBNADDRELU_OP ON)
qnqinan's avatar
qnqinan 已提交
91
  set(MUL_OP ON)
H
hanbuhe 已提交
92 93 94 95 96 97 98 99
  set(RESHAPE_OP ON)
  set(SOFTMAX_OP ON)

  set(FOUND_MATCH ON)
endif()

if ("FPGAnets" IN_LIST NET)
  message("FPGAnets enabled")
Z
zhangyang 已提交
100 101 102
  set(FUSION_CONVADDRELU_OP ON)
  set(FUSION_CONVADDBNRELU_OP ON)
  set(FUSION_CONVADDBN_OP ON)
Z
zhangyang 已提交
103
  set(FUSION_ELEMENTWISEADDRELU_OP ON)
Z
zhangyang 已提交
104 105
  set(FUSION_FC_OP ON)
  set(FUSION_FCRELU_OP ON)
Z
zhangyang 已提交
106 107
  set(POOL_OP ON)
  set(CONCAT_OP ON)
H
hanbuhe 已提交
108
  set(SOFTMAX_OP ON)
Z
zhangyang 已提交
109
  set(DROPOUT_OP ON)
Z
zhangyang 已提交
110 111
  set(FUSION_CONVBNRELU_OP ON)
  set(FUSION_CONVBN_OP ON)
qnqinan's avatar
qnqinan 已提交
112
  set(FUSION_CONVADD_OP ON)
H
hanbuhe 已提交
113

xiebaiyuan's avatar
xiebaiyuan 已提交
114
  set(FOUND_MATCH ON)
H
hanbuhe 已提交
115 116 117 118 119
endif()


if(NOT FOUND_MATCH)
  message("--default--")
D
dolphin8 已提交
120
  set(BATCHNORM_OP ON)
L
liuruilong 已提交
121
  set(CONV_TRANSPOSE_OP ON)
D
dolphin8 已提交
122 123 124 125 126 127
  set(BOXCODER_OP ON)
  set(CONCAT_OP ON)
  set(CONV_OP ON)
  set(DEPTHWISECONV_OP ON)
  set(ELEMENTWISEADD_OP ON)
  set(FUSION_CONVADD_OP ON)
128
  set(FUSION_CONVADDPRELU_OP ON)
Z
zhangyang 已提交
129
  set(FUSION_CONVADDRELU_OP ON)
D
dolphin8 已提交
130 131 132 133 134 135 136 137 138 139 140
  set(FUSION_FC_OP ON)
  set(LRN_OP ON)
  set(MUL_OP ON)
  set(MULTICLASSNMS_OP ON)
  set(POOL_OP ON)
  set(PRIORBOX_OP ON)
  set(RELU_OP ON)
  set(RESHAPE_OP ON)
  set(SIGMOID_OP ON)
  set(SOFTMAX_OP ON)
  set(TRANSPOSE_OP ON)
E
eclipsess 已提交
141
  set(FUSION_CONVADDBNRELU_OP ON)
142
  set(FUSION_CONVADDADDPRELU_OP ON)
E
eclipsess 已提交
143
  set(FUSION_DWCONVBNRELU_OP ON)
144
  set(FUSION_CONVBNRELU_OP ON)
145
  set(FUSION_CONVBNADDRELU_OP ON)
T
Tian 已提交
146 147 148 149
  set(PRELU_OP ON)
  set(RESIZE_OP ON)
  set(SCALE_OP ON)
  set(SLICE_OP ON)
Y
Yao,kun 已提交
150 151
  set(DROPOUT_OP ON)
  set(IM2SEQUENCE_OP ON)
xiebaiyuan's avatar
xiebaiyuan 已提交
152 153 154
  set(LOOKUP_OP ON)
  set(GRU_OP ON)
  set(CRF_OP ON)
H
hanbuhe 已提交
155 156
endif()

D
dolphin8 已提交
157 158 159 160 161 162 163
  # option(BATCHNORM_OP "" ON)
  # option(BOXCODER_OP "" ON)
  # option(CONCAT_OP "" ON)
  # option(CONV_OP "" ON)
  # option(DEPTHWISECONV_OP "" ON)
  # option(ELEMENTWISEADD_OP "" ON)
  # option(FUSION_CONVADD_OP "" ON)
Z
zhangyang 已提交
164
  # option(FUSION_CONVADDRELU_OP "" ON)
D
dolphin8 已提交
165 166 167 168 169 170 171 172 173 174 175
  # option(FUSION_FC_OP "" ON)
  # option(LRN_OP "" ON)
  # option(MUL_OP "" ON)
  # option(MULTICLASSNMS_OP "" ON)
  # option(POOL_OP "" ON)
  # option(PRIORBOX_OP "" ON)
  # option(RELU_OP "" ON)
  # option(RESHAPE_OP "" ON)
  # option(SIGMOID_OP "" ON)
  # option(SOFTMAX_OP "" ON)
  # option(TRANSPOSE_OP "" ON)
H
hanbuhe 已提交
176
# endif ()
D
dolphin8 已提交
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198

if (BATCHNORM_OP)
  add_definitions(-DBATCHNORM_OP)
endif()
if (BOXCODER_OP)
  add_definitions(-DBOXCODER_OP)
endif()
if (CONCAT_OP)
  add_definitions(-DCONCAT_OP)
endif()
if (CONV_OP)
  add_definitions(-DCONV_OP)
endif()
if (DEPTHWISECONV_OP)
  add_definitions(-DDEPTHWISECONV_OP)
endif()
if (ELEMENTWISEADD_OP)
  add_definitions(-DELEMENTWISEADD_OP)
endif()
if (FUSION_CONVADD_OP)
  add_definitions(-DFUSION_CONVADD_OP)
endif()
Z
zhangyang 已提交
199 200
if (FUSION_CONVADDRELU_OP)
  add_definitions(-DFUSION_CONVADDRELU_OP)
D
dolphin8 已提交
201
endif()
202 203 204 205 206 207
if (FUSION_CONVADDPRELU_OP)
  add_definitions(-DFUSION_CONVADDPRELU_OP)
endif()
if (FUSION_CONVADDADDPRELU_OP)
  add_definitions(-DFUSION_CONVADDADDPRELU_OP)
endif()
D
dolphin8 已提交
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
if (FUSION_FC_OP)
  add_definitions(-DFUSION_FC_OP)
endif()
if (LRN_OP)
  add_definitions(-DLRN_OP)
endif()
if (MUL_OP)
  add_definitions(-DMUL_OP)
endif()
if (MULTICLASSNMS_OP)
  add_definitions(-DMULTICLASSNMS_OP)
endif()
if (POOL_OP)
  add_definitions(-DPOOL_OP)
endif()
if (PRIORBOX_OP)
  add_definitions(-DPRIORBOX_OP)
endif()
if (RELU_OP)
  add_definitions(-DRELU_OP)
endif()
if (RESHAPE_OP)
  add_definitions(-DRESHAPE_OP)
endif()
if (SIGMOID_OP)
  add_definitions(-DSIGMOID_OP)
endif()
if (SOFTMAX_OP)
  add_definitions(-DSOFTMAX_OP)
endif()
if (TRANSPOSE_OP)
  add_definitions(-DTRANSPOSE_OP)
endif()
E
eclipsess 已提交
241 242 243
if (FUSION_CONVADDBNRELU_OP)
  add_definitions(-DFUSION_CONVADDBNRELU_OP)
endif()
E
eclipsess 已提交
244 245 246
if (FUSION_DWCONVBNRELU_OP)
  add_definitions(-DFUSION_DWCONVBNRELU_OP)
endif()
247 248 249 250 251

if (FUSION_CONVBNRELU_OP)
  add_definitions(-DFUSION_CONVBNRELU_OP)
endif()

252 253 254 255
if (FUSION_CONVBNADDRELU_OP)
  add_definitions(-DFUSION_CONVBNADDRELU_OP)
endif()

T
Tian 已提交
256 257 258 259 260 261 262 263 264 265 266
if (PRELU_OP)
  add_definitions(-DPRELU_OP)
endif()
if (RESIZE_OP)
  add_definitions(-DRESIZE_OP)
endif()
if (SCALE_OP)
  add_definitions(-DSCALE_OP)
endif()
if (SLICE_OP)
  add_definitions(-DSLICE_OP)
L
liuruilong 已提交
267
endif()
Y
Yao,kun 已提交
268 269 270
if (DROPOUT_OP)
  add_definitions(-DDROPOUT_OP)
endif()
Y
bugfix  
Yao,kun 已提交
271 272
if (IM2SEQUENCE_OP)
  add_definitions(-DIM2SEQUENCE_OP)
T
Tian 已提交
273
endif()
Z
zhangyang 已提交
274

Z
zhangyang 已提交
275 276
if (FUSION_CONVADDBN_OP)
  add_definitions(-DFUSION_CONVADDBN_OP)
Z
zhangyang 已提交
277
endif()
Z
zhangyang 已提交
278 279
if (FUSION_FCRELU_OP)
  add_definitions(-DFUSION_FCRELU_OP)
Z
zhangyang 已提交
280 281 282 283 284 285 286
endif()
if (FUSION_POOLBN_OP)
  add_definitions(-DFUSION_POOLBN_OP)
endif()
if (FUSION_ELEMENTWISEADDRELU_OP)
  add_definitions(-DFUSION_ELEMENTWISEADDRELU_OP)
endif()
Z
zhangyang 已提交
287 288
if (FUSION_CONVBN_OP)
  add_definitions(-DFUSION_CONVBN_OP)
Z
zhangyang 已提交
289 290
endif()

L
liuruilong 已提交
291 292 293
if (CONV_TRANSPOSE_OP)
  add_definitions(-DCONV_TRANSPOSE)
endif()
xiebaiyuan's avatar
xiebaiyuan 已提交
294 295 296 297 298 299 300 301 302 303 304 305

if (LOOKUP_OP)
  add_definitions(-DLOOKUP_OP)
endif()

if (GRU_OP)
  add_definitions(-DGRU_OP)
endif()

if (CRF_OP)
  add_definitions(-DCRF_OP)
endif()