Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 1 | // Copyright 2020 Google LLC |
| 2 | // |
| 3 | // This source code is licensed under the BSD-style license found in the |
| 4 | // LICENSE file in the root directory of this source tree. |
| 5 | |
| 6 | #include <xnnpack.h> |
| 7 | |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 8 | #include <array> |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 9 | #include <algorithm> |
| 10 | #include <functional> |
| 11 | #include <iostream> |
| 12 | #include <limits> |
| 13 | #include <random> |
| 14 | |
| 15 | #include "models/models.h" |
| 16 | |
| 17 | namespace models { |
| 18 | |
| 19 | ExecutionPlan QS8MobileNetV1(pthreadpool_t threadpool) { |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 20 | alignas(16) static std::array<int8_t, 150528> v0; |
| 21 | alignas(16) static std::array<int8_t, 401408> v1; |
| 22 | alignas(16) static std::array<int8_t, 401408> v2; |
| 23 | alignas(16) static std::array<int8_t, 802816> v3; |
| 24 | alignas(16) static std::array<int8_t, 200704> v4; |
| 25 | alignas(16) static std::array<int8_t, 401408> v5; |
| 26 | alignas(16) static std::array<int8_t, 401408> v6; |
| 27 | alignas(16) static std::array<int8_t, 401408> v7; |
| 28 | alignas(16) static std::array<int8_t, 100352> v8; |
| 29 | alignas(16) static std::array<int8_t, 200704> v9; |
| 30 | alignas(16) static std::array<int8_t, 200704> v10; |
| 31 | alignas(16) static std::array<int8_t, 200704> v11; |
| 32 | alignas(16) static std::array<int8_t, 50176> v12; |
| 33 | alignas(16) static std::array<int8_t, 100352> v13; |
| 34 | alignas(16) static std::array<int8_t, 100352> v14; |
| 35 | alignas(16) static std::array<int8_t, 100352> v15; |
| 36 | alignas(16) static std::array<int8_t, 100352> v16; |
| 37 | alignas(16) static std::array<int8_t, 100352> v17; |
| 38 | alignas(16) static std::array<int8_t, 100352> v18; |
| 39 | alignas(16) static std::array<int8_t, 100352> v19; |
| 40 | alignas(16) static std::array<int8_t, 100352> v20; |
| 41 | alignas(16) static std::array<int8_t, 100352> v21; |
| 42 | alignas(16) static std::array<int8_t, 100352> v22; |
| 43 | alignas(16) static std::array<int8_t, 100352> v23; |
| 44 | alignas(16) static std::array<int8_t, 25088> v24; |
| 45 | alignas(16) static std::array<int8_t, 50176> v25; |
| 46 | alignas(16) static std::array<int8_t, 50176> v26; |
| 47 | alignas(16) static std::array<int8_t, 50176> v27; |
| 48 | alignas(16) static std::array<int8_t, 1024> v28; |
| 49 | alignas(16) static std::array<int8_t, 1001> v29; |
| 50 | alignas(16) static std::array<int8_t, 864> w30; |
| 51 | alignas(16) static std::array<int32_t, 32> w31; |
| 52 | alignas(16) static std::array<int8_t, 288> w32; |
| 53 | alignas(16) static std::array<int32_t, 32> w33; |
| 54 | alignas(16) static std::array<int8_t, 2048> w34; |
| 55 | alignas(16) static std::array<int32_t, 64> w35; |
| 56 | alignas(16) static std::array<int8_t, 576> w36; |
| 57 | alignas(16) static std::array<int32_t, 64> w37; |
| 58 | alignas(16) static std::array<int8_t, 8192> w38; |
| 59 | alignas(16) static std::array<int32_t, 128> w39; |
| 60 | alignas(16) static std::array<int8_t, 1152> w40; |
| 61 | alignas(16) static std::array<int32_t, 128> w41; |
| 62 | alignas(16) static std::array<int8_t, 16384> w42; |
| 63 | alignas(16) static std::array<int32_t, 128> w43; |
| 64 | alignas(16) static std::array<int8_t, 1152> w44; |
| 65 | alignas(16) static std::array<int32_t, 128> w45; |
| 66 | alignas(16) static std::array<int8_t, 32768> w46; |
| 67 | alignas(16) static std::array<int32_t, 256> w47; |
| 68 | alignas(16) static std::array<int8_t, 2304> w48; |
| 69 | alignas(16) static std::array<int32_t, 256> w49; |
| 70 | alignas(16) static std::array<int8_t, 65536> w50; |
| 71 | alignas(16) static std::array<int32_t, 256> w51; |
| 72 | alignas(16) static std::array<int8_t, 2304> w52; |
| 73 | alignas(16) static std::array<int32_t, 256> w53; |
| 74 | alignas(16) static std::array<int8_t, 131072> w54; |
| 75 | alignas(16) static std::array<int32_t, 512> w55; |
| 76 | alignas(16) static std::array<int8_t, 4608> w56; |
| 77 | alignas(16) static std::array<int32_t, 512> w57; |
| 78 | alignas(16) static std::array<int8_t, 262144> w58; |
| 79 | alignas(16) static std::array<int32_t, 512> w59; |
| 80 | alignas(16) static std::array<int8_t, 4608> w60; |
| 81 | alignas(16) static std::array<int32_t, 512> w61; |
| 82 | alignas(16) static std::array<int8_t, 262144> w62; |
| 83 | alignas(16) static std::array<int32_t, 512> w63; |
| 84 | alignas(16) static std::array<int8_t, 4608> w64; |
| 85 | alignas(16) static std::array<int32_t, 512> w65; |
| 86 | alignas(16) static std::array<int8_t, 262144> w66; |
| 87 | alignas(16) static std::array<int32_t, 512> w67; |
| 88 | alignas(16) static std::array<int8_t, 4608> w68; |
| 89 | alignas(16) static std::array<int32_t, 512> w69; |
| 90 | alignas(16) static std::array<int8_t, 262144> w70; |
| 91 | alignas(16) static std::array<int32_t, 512> w71; |
| 92 | alignas(16) static std::array<int8_t, 4608> w72; |
| 93 | alignas(16) static std::array<int32_t, 512> w73; |
| 94 | alignas(16) static std::array<int8_t, 262144> w74; |
| 95 | alignas(16) static std::array<int32_t, 512> w75; |
| 96 | alignas(16) static std::array<int8_t, 4608> w76; |
| 97 | alignas(16) static std::array<int32_t, 512> w77; |
| 98 | alignas(16) static std::array<int8_t, 524288> w78; |
| 99 | alignas(16) static std::array<int32_t, 1024> w79; |
| 100 | alignas(16) static std::array<int8_t, 9216> w80; |
| 101 | alignas(16) static std::array<int32_t, 1024> w81; |
| 102 | alignas(16) static std::array<int8_t, 1048576> w82; |
| 103 | alignas(16) static std::array<int32_t, 1024> w83; |
| 104 | alignas(16) static std::array<int8_t, 1025024> w84; |
| 105 | alignas(16) static std::array<int32_t, 1001> w85; |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 106 | |
| 107 | std::random_device random_device; |
| 108 | auto rng = std::mt19937(random_device()); |
| 109 | auto i8rng = std::bind(std::uniform_int_distribution<int32_t>(-127, 127), std::ref(rng)); |
| 110 | auto i32rng = std::bind(std::uniform_int_distribution<int32_t>(-10000, 10000), std::ref(rng)); |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 111 | std::generate(v0.begin(), v0.end(), std::ref(i8rng)); |
| 112 | std::generate(v1.begin(), v1.end(), std::ref(i8rng)); |
| 113 | std::generate(v2.begin(), v2.end(), std::ref(i8rng)); |
| 114 | std::generate(v3.begin(), v3.end(), std::ref(i8rng)); |
| 115 | std::generate(v4.begin(), v4.end(), std::ref(i8rng)); |
| 116 | std::generate(v5.begin(), v5.end(), std::ref(i8rng)); |
| 117 | std::generate(v6.begin(), v6.end(), std::ref(i8rng)); |
| 118 | std::generate(v7.begin(), v7.end(), std::ref(i8rng)); |
| 119 | std::generate(v8.begin(), v8.end(), std::ref(i8rng)); |
| 120 | std::generate(v9.begin(), v9.end(), std::ref(i8rng)); |
| 121 | std::generate(v10.begin(), v10.end(), std::ref(i8rng)); |
| 122 | std::generate(v11.begin(), v11.end(), std::ref(i8rng)); |
| 123 | std::generate(v12.begin(), v12.end(), std::ref(i8rng)); |
| 124 | std::generate(v13.begin(), v13.end(), std::ref(i8rng)); |
| 125 | std::generate(v14.begin(), v14.end(), std::ref(i8rng)); |
| 126 | std::generate(v15.begin(), v15.end(), std::ref(i8rng)); |
| 127 | std::generate(v16.begin(), v16.end(), std::ref(i8rng)); |
| 128 | std::generate(v17.begin(), v17.end(), std::ref(i8rng)); |
| 129 | std::generate(v18.begin(), v18.end(), std::ref(i8rng)); |
| 130 | std::generate(v19.begin(), v19.end(), std::ref(i8rng)); |
| 131 | std::generate(v20.begin(), v20.end(), std::ref(i8rng)); |
| 132 | std::generate(v21.begin(), v21.end(), std::ref(i8rng)); |
| 133 | std::generate(v22.begin(), v22.end(), std::ref(i8rng)); |
| 134 | std::generate(v23.begin(), v23.end(), std::ref(i8rng)); |
| 135 | std::generate(v24.begin(), v24.end(), std::ref(i8rng)); |
| 136 | std::generate(v25.begin(), v25.end(), std::ref(i8rng)); |
| 137 | std::generate(v26.begin(), v26.end(), std::ref(i8rng)); |
| 138 | std::generate(v27.begin(), v27.end(), std::ref(i8rng)); |
| 139 | std::generate(v28.begin(), v28.end(), std::ref(i8rng)); |
| 140 | std::generate(v29.begin(), v29.end(), std::ref(i8rng)); |
| 141 | std::generate(w30.begin(), w30.end(), std::ref(i8rng)); |
| 142 | std::generate(w31.begin(), w31.end(), std::ref(i32rng)); |
| 143 | std::generate(w32.begin(), w32.end(), std::ref(i8rng)); |
| 144 | std::generate(w33.begin(), w33.end(), std::ref(i32rng)); |
| 145 | std::generate(w34.begin(), w34.end(), std::ref(i8rng)); |
| 146 | std::generate(w35.begin(), w35.end(), std::ref(i32rng)); |
| 147 | std::generate(w36.begin(), w36.end(), std::ref(i8rng)); |
| 148 | std::generate(w37.begin(), w37.end(), std::ref(i32rng)); |
| 149 | std::generate(w38.begin(), w38.end(), std::ref(i8rng)); |
| 150 | std::generate(w39.begin(), w39.end(), std::ref(i32rng)); |
| 151 | std::generate(w40.begin(), w40.end(), std::ref(i8rng)); |
| 152 | std::generate(w41.begin(), w41.end(), std::ref(i32rng)); |
| 153 | std::generate(w42.begin(), w42.end(), std::ref(i8rng)); |
| 154 | std::generate(w43.begin(), w43.end(), std::ref(i32rng)); |
| 155 | std::generate(w44.begin(), w44.end(), std::ref(i8rng)); |
| 156 | std::generate(w45.begin(), w45.end(), std::ref(i32rng)); |
| 157 | std::generate(w46.begin(), w46.end(), std::ref(i8rng)); |
| 158 | std::generate(w47.begin(), w47.end(), std::ref(i32rng)); |
| 159 | std::generate(w48.begin(), w48.end(), std::ref(i8rng)); |
| 160 | std::generate(w49.begin(), w49.end(), std::ref(i32rng)); |
| 161 | std::generate(w50.begin(), w50.end(), std::ref(i8rng)); |
| 162 | std::generate(w51.begin(), w51.end(), std::ref(i32rng)); |
| 163 | std::generate(w52.begin(), w52.end(), std::ref(i8rng)); |
| 164 | std::generate(w53.begin(), w53.end(), std::ref(i32rng)); |
| 165 | std::generate(w54.begin(), w54.end(), std::ref(i8rng)); |
| 166 | std::generate(w55.begin(), w55.end(), std::ref(i32rng)); |
| 167 | std::generate(w56.begin(), w56.end(), std::ref(i8rng)); |
| 168 | std::generate(w57.begin(), w57.end(), std::ref(i32rng)); |
| 169 | std::generate(w58.begin(), w58.end(), std::ref(i8rng)); |
| 170 | std::generate(w59.begin(), w59.end(), std::ref(i32rng)); |
| 171 | std::generate(w60.begin(), w60.end(), std::ref(i8rng)); |
| 172 | std::generate(w61.begin(), w61.end(), std::ref(i32rng)); |
| 173 | std::generate(w62.begin(), w62.end(), std::ref(i8rng)); |
| 174 | std::generate(w63.begin(), w63.end(), std::ref(i32rng)); |
| 175 | std::generate(w64.begin(), w64.end(), std::ref(i8rng)); |
| 176 | std::generate(w65.begin(), w65.end(), std::ref(i32rng)); |
| 177 | std::generate(w66.begin(), w66.end(), std::ref(i8rng)); |
| 178 | std::generate(w67.begin(), w67.end(), std::ref(i32rng)); |
| 179 | std::generate(w68.begin(), w68.end(), std::ref(i8rng)); |
| 180 | std::generate(w69.begin(), w69.end(), std::ref(i32rng)); |
| 181 | std::generate(w70.begin(), w70.end(), std::ref(i8rng)); |
| 182 | std::generate(w71.begin(), w71.end(), std::ref(i32rng)); |
| 183 | std::generate(w72.begin(), w72.end(), std::ref(i8rng)); |
| 184 | std::generate(w73.begin(), w73.end(), std::ref(i32rng)); |
| 185 | std::generate(w74.begin(), w74.end(), std::ref(i8rng)); |
| 186 | std::generate(w75.begin(), w75.end(), std::ref(i32rng)); |
| 187 | std::generate(w76.begin(), w76.end(), std::ref(i8rng)); |
| 188 | std::generate(w77.begin(), w77.end(), std::ref(i32rng)); |
| 189 | std::generate(w78.begin(), w78.end(), std::ref(i8rng)); |
| 190 | std::generate(w79.begin(), w79.end(), std::ref(i32rng)); |
| 191 | std::generate(w80.begin(), w80.end(), std::ref(i8rng)); |
| 192 | std::generate(w81.begin(), w81.end(), std::ref(i32rng)); |
| 193 | std::generate(w82.begin(), w82.end(), std::ref(i8rng)); |
| 194 | std::generate(w83.begin(), w83.end(), std::ref(i32rng)); |
| 195 | std::generate(w84.begin(), w84.end(), std::ref(i8rng)); |
| 196 | std::generate(w85.begin(), w85.end(), std::ref(i32rng)); |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 197 | |
| 198 | ExecutionPlan operators; |
| 199 | xnn_status status; |
| 200 | |
| 201 | xnn_operator_t op0 = nullptr; |
| 202 | status = xnn_create_convolution2d_nhwc_qs8( |
| 203 | 0 /* top padding */, 1 /* right padding */, |
| 204 | 1 /* bottom padding */, 0 /* left padding */, |
| 205 | 3 /* kernel height */, 3 /* kernel width */, |
| 206 | 2 /* subsampling height */, 2 /* subsampling width */, |
| 207 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 208 | 1 /* groups */, |
| 209 | 3 /* input channels per group */, |
| 210 | 32 /* output_channels_per_group */, |
| 211 | 3 /* input pixel stride */, |
| 212 | 32 /* output pixel stride */, |
| 213 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 214 | w30.data(), w31.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 215 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 216 | 0 /* flags */, |
| 217 | &op0); |
| 218 | if (status != xnn_status_success) { |
| 219 | std::cerr << "failed to create operation #0" << std::endl; |
| 220 | return ExecutionPlan(); |
| 221 | } |
| 222 | operators.emplace_back(op0, xnn_delete_operator); |
| 223 | |
| 224 | xnn_operator_t op1 = nullptr; |
| 225 | status = xnn_create_convolution2d_nhwc_qs8( |
| 226 | 1 /* top padding */, 1 /* right padding */, |
| 227 | 1 /* bottom padding */, 1 /* left padding */, |
| 228 | 3 /* kernel height */, 3 /* kernel width */, |
| 229 | 1 /* subsampling height */, 1 /* subsampling width */, |
| 230 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 231 | 32 /* groups */, |
| 232 | 1 /* input channels per group */, |
| 233 | 1 /* output_channels_per_group */, |
| 234 | 32 /* input pixel stride */, |
| 235 | 32 /* output pixel stride */, |
| 236 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 237 | w32.data(), w33.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 238 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 239 | 0 /* flags */, |
| 240 | &op1); |
| 241 | if (status != xnn_status_success) { |
| 242 | std::cerr << "failed to create operation #1" << std::endl; |
| 243 | return ExecutionPlan(); |
| 244 | } |
| 245 | operators.emplace_back(op1, xnn_delete_operator); |
| 246 | |
| 247 | xnn_operator_t op2 = nullptr; |
| 248 | status = xnn_create_convolution2d_nhwc_qs8( |
| 249 | 0 /* top padding */, 0 /* right padding */, |
| 250 | 0 /* bottom padding */, 0 /* left padding */, |
| 251 | 1 /* kernel height */, 1 /* kernel width */, |
| 252 | 1 /* subsampling height */, 1 /* subsampling width */, |
| 253 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 254 | 1 /* groups */, |
| 255 | 32 /* input channels per group */, |
| 256 | 64 /* output_channels_per_group */, |
| 257 | 32 /* input pixel stride */, |
| 258 | 64 /* output pixel stride */, |
| 259 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 260 | w34.data(), w35.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 261 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 262 | 0 /* flags */, |
| 263 | &op2); |
| 264 | if (status != xnn_status_success) { |
| 265 | std::cerr << "failed to create operation #2" << std::endl; |
| 266 | return ExecutionPlan(); |
| 267 | } |
| 268 | operators.emplace_back(op2, xnn_delete_operator); |
| 269 | |
| 270 | xnn_operator_t op3 = nullptr; |
| 271 | status = xnn_create_convolution2d_nhwc_qs8( |
| 272 | 0 /* top padding */, 1 /* right padding */, |
| 273 | 1 /* bottom padding */, 0 /* left padding */, |
| 274 | 3 /* kernel height */, 3 /* kernel width */, |
| 275 | 2 /* subsampling height */, 2 /* subsampling width */, |
| 276 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 277 | 64 /* groups */, |
| 278 | 1 /* input channels per group */, |
| 279 | 1 /* output_channels_per_group */, |
| 280 | 64 /* input pixel stride */, |
| 281 | 64 /* output pixel stride */, |
| 282 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 283 | w36.data(), w37.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 284 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 285 | 0 /* flags */, |
| 286 | &op3); |
| 287 | if (status != xnn_status_success) { |
| 288 | std::cerr << "failed to create operation #3" << std::endl; |
| 289 | return ExecutionPlan(); |
| 290 | } |
| 291 | operators.emplace_back(op3, xnn_delete_operator); |
| 292 | |
| 293 | xnn_operator_t op4 = nullptr; |
| 294 | status = xnn_create_convolution2d_nhwc_qs8( |
| 295 | 0 /* top padding */, 0 /* right padding */, |
| 296 | 0 /* bottom padding */, 0 /* left padding */, |
| 297 | 1 /* kernel height */, 1 /* kernel width */, |
| 298 | 1 /* subsampling height */, 1 /* subsampling width */, |
| 299 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 300 | 1 /* groups */, |
| 301 | 64 /* input channels per group */, |
| 302 | 128 /* output_channels_per_group */, |
| 303 | 64 /* input pixel stride */, |
| 304 | 128 /* output pixel stride */, |
| 305 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 306 | w38.data(), w39.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 307 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 308 | 0 /* flags */, |
| 309 | &op4); |
| 310 | if (status != xnn_status_success) { |
| 311 | std::cerr << "failed to create operation #4" << std::endl; |
| 312 | return ExecutionPlan(); |
| 313 | } |
| 314 | operators.emplace_back(op4, xnn_delete_operator); |
| 315 | |
| 316 | xnn_operator_t op5 = nullptr; |
| 317 | status = xnn_create_convolution2d_nhwc_qs8( |
| 318 | 1 /* top padding */, 1 /* right padding */, |
| 319 | 1 /* bottom padding */, 1 /* left padding */, |
| 320 | 3 /* kernel height */, 3 /* kernel width */, |
| 321 | 1 /* subsampling height */, 1 /* subsampling width */, |
| 322 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 323 | 128 /* groups */, |
| 324 | 1 /* input channels per group */, |
| 325 | 1 /* output_channels_per_group */, |
| 326 | 128 /* input pixel stride */, |
| 327 | 128 /* output pixel stride */, |
| 328 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 329 | w40.data(), w41.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 330 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 331 | 0 /* flags */, |
| 332 | &op5); |
| 333 | if (status != xnn_status_success) { |
| 334 | std::cerr << "failed to create operation #5" << std::endl; |
| 335 | return ExecutionPlan(); |
| 336 | } |
| 337 | operators.emplace_back(op5, xnn_delete_operator); |
| 338 | |
| 339 | xnn_operator_t op6 = nullptr; |
| 340 | status = xnn_create_convolution2d_nhwc_qs8( |
| 341 | 0 /* top padding */, 0 /* right padding */, |
| 342 | 0 /* bottom padding */, 0 /* left padding */, |
| 343 | 1 /* kernel height */, 1 /* kernel width */, |
| 344 | 1 /* subsampling height */, 1 /* subsampling width */, |
| 345 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 346 | 1 /* groups */, |
| 347 | 128 /* input channels per group */, |
| 348 | 128 /* output_channels_per_group */, |
| 349 | 128 /* input pixel stride */, |
| 350 | 128 /* output pixel stride */, |
| 351 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 352 | w42.data(), w43.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 353 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 354 | 0 /* flags */, |
| 355 | &op6); |
| 356 | if (status != xnn_status_success) { |
| 357 | std::cerr << "failed to create operation #6" << std::endl; |
| 358 | return ExecutionPlan(); |
| 359 | } |
| 360 | operators.emplace_back(op6, xnn_delete_operator); |
| 361 | |
| 362 | xnn_operator_t op7 = nullptr; |
| 363 | status = xnn_create_convolution2d_nhwc_qs8( |
| 364 | 0 /* top padding */, 1 /* right padding */, |
| 365 | 1 /* bottom padding */, 0 /* left padding */, |
| 366 | 3 /* kernel height */, 3 /* kernel width */, |
| 367 | 2 /* subsampling height */, 2 /* subsampling width */, |
| 368 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 369 | 128 /* groups */, |
| 370 | 1 /* input channels per group */, |
| 371 | 1 /* output_channels_per_group */, |
| 372 | 128 /* input pixel stride */, |
| 373 | 128 /* output pixel stride */, |
| 374 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 375 | w44.data(), w45.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 376 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 377 | 0 /* flags */, |
| 378 | &op7); |
| 379 | if (status != xnn_status_success) { |
| 380 | std::cerr << "failed to create operation #7" << std::endl; |
| 381 | return ExecutionPlan(); |
| 382 | } |
| 383 | operators.emplace_back(op7, xnn_delete_operator); |
| 384 | |
| 385 | xnn_operator_t op8 = nullptr; |
| 386 | status = xnn_create_convolution2d_nhwc_qs8( |
| 387 | 0 /* top padding */, 0 /* right padding */, |
| 388 | 0 /* bottom padding */, 0 /* left padding */, |
| 389 | 1 /* kernel height */, 1 /* kernel width */, |
| 390 | 1 /* subsampling height */, 1 /* subsampling width */, |
| 391 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 392 | 1 /* groups */, |
| 393 | 128 /* input channels per group */, |
| 394 | 256 /* output_channels_per_group */, |
| 395 | 128 /* input pixel stride */, |
| 396 | 256 /* output pixel stride */, |
| 397 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 398 | w46.data(), w47.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 399 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 400 | 0 /* flags */, |
| 401 | &op8); |
| 402 | if (status != xnn_status_success) { |
| 403 | std::cerr << "failed to create operation #8" << std::endl; |
| 404 | return ExecutionPlan(); |
| 405 | } |
| 406 | operators.emplace_back(op8, xnn_delete_operator); |
| 407 | |
| 408 | xnn_operator_t op9 = nullptr; |
| 409 | status = xnn_create_convolution2d_nhwc_qs8( |
| 410 | 1 /* top padding */, 1 /* right padding */, |
| 411 | 1 /* bottom padding */, 1 /* left padding */, |
| 412 | 3 /* kernel height */, 3 /* kernel width */, |
| 413 | 1 /* subsampling height */, 1 /* subsampling width */, |
| 414 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 415 | 256 /* groups */, |
| 416 | 1 /* input channels per group */, |
| 417 | 1 /* output_channels_per_group */, |
| 418 | 256 /* input pixel stride */, |
| 419 | 256 /* output pixel stride */, |
| 420 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 421 | w48.data(), w49.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 422 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 423 | 0 /* flags */, |
| 424 | &op9); |
| 425 | if (status != xnn_status_success) { |
| 426 | std::cerr << "failed to create operation #9" << std::endl; |
| 427 | return ExecutionPlan(); |
| 428 | } |
| 429 | operators.emplace_back(op9, xnn_delete_operator); |
| 430 | |
| 431 | xnn_operator_t op10 = nullptr; |
| 432 | status = xnn_create_convolution2d_nhwc_qs8( |
| 433 | 0 /* top padding */, 0 /* right padding */, |
| 434 | 0 /* bottom padding */, 0 /* left padding */, |
| 435 | 1 /* kernel height */, 1 /* kernel width */, |
| 436 | 1 /* subsampling height */, 1 /* subsampling width */, |
| 437 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 438 | 1 /* groups */, |
| 439 | 256 /* input channels per group */, |
| 440 | 256 /* output_channels_per_group */, |
| 441 | 256 /* input pixel stride */, |
| 442 | 256 /* output pixel stride */, |
| 443 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 444 | w50.data(), w51.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 445 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 446 | 0 /* flags */, |
| 447 | &op10); |
| 448 | if (status != xnn_status_success) { |
| 449 | std::cerr << "failed to create operation #10" << std::endl; |
| 450 | return ExecutionPlan(); |
| 451 | } |
| 452 | operators.emplace_back(op10, xnn_delete_operator); |
| 453 | |
| 454 | xnn_operator_t op11 = nullptr; |
| 455 | status = xnn_create_convolution2d_nhwc_qs8( |
| 456 | 0 /* top padding */, 1 /* right padding */, |
| 457 | 1 /* bottom padding */, 0 /* left padding */, |
| 458 | 3 /* kernel height */, 3 /* kernel width */, |
| 459 | 2 /* subsampling height */, 2 /* subsampling width */, |
| 460 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 461 | 256 /* groups */, |
| 462 | 1 /* input channels per group */, |
| 463 | 1 /* output_channels_per_group */, |
| 464 | 256 /* input pixel stride */, |
| 465 | 256 /* output pixel stride */, |
| 466 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 467 | w52.data(), w53.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 468 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 469 | 0 /* flags */, |
| 470 | &op11); |
| 471 | if (status != xnn_status_success) { |
| 472 | std::cerr << "failed to create operation #11" << std::endl; |
| 473 | return ExecutionPlan(); |
| 474 | } |
| 475 | operators.emplace_back(op11, xnn_delete_operator); |
| 476 | |
| 477 | xnn_operator_t op12 = nullptr; |
| 478 | status = xnn_create_convolution2d_nhwc_qs8( |
| 479 | 0 /* top padding */, 0 /* right padding */, |
| 480 | 0 /* bottom padding */, 0 /* left padding */, |
| 481 | 1 /* kernel height */, 1 /* kernel width */, |
| 482 | 1 /* subsampling height */, 1 /* subsampling width */, |
| 483 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 484 | 1 /* groups */, |
| 485 | 256 /* input channels per group */, |
| 486 | 512 /* output_channels_per_group */, |
| 487 | 256 /* input pixel stride */, |
| 488 | 512 /* output pixel stride */, |
| 489 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 490 | w54.data(), w55.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 491 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 492 | 0 /* flags */, |
| 493 | &op12); |
| 494 | if (status != xnn_status_success) { |
| 495 | std::cerr << "failed to create operation #12" << std::endl; |
| 496 | return ExecutionPlan(); |
| 497 | } |
| 498 | operators.emplace_back(op12, xnn_delete_operator); |
| 499 | |
| 500 | xnn_operator_t op13 = nullptr; |
| 501 | status = xnn_create_convolution2d_nhwc_qs8( |
| 502 | 1 /* top padding */, 1 /* right padding */, |
| 503 | 1 /* bottom padding */, 1 /* left padding */, |
| 504 | 3 /* kernel height */, 3 /* kernel width */, |
| 505 | 1 /* subsampling height */, 1 /* subsampling width */, |
| 506 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 507 | 512 /* groups */, |
| 508 | 1 /* input channels per group */, |
| 509 | 1 /* output_channels_per_group */, |
| 510 | 512 /* input pixel stride */, |
| 511 | 512 /* output pixel stride */, |
| 512 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 513 | w56.data(), w57.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 514 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 515 | 0 /* flags */, |
| 516 | &op13); |
| 517 | if (status != xnn_status_success) { |
| 518 | std::cerr << "failed to create operation #13" << std::endl; |
| 519 | return ExecutionPlan(); |
| 520 | } |
| 521 | operators.emplace_back(op13, xnn_delete_operator); |
| 522 | |
| 523 | xnn_operator_t op14 = nullptr; |
| 524 | status = xnn_create_convolution2d_nhwc_qs8( |
| 525 | 0 /* top padding */, 0 /* right padding */, |
| 526 | 0 /* bottom padding */, 0 /* left padding */, |
| 527 | 1 /* kernel height */, 1 /* kernel width */, |
| 528 | 1 /* subsampling height */, 1 /* subsampling width */, |
| 529 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 530 | 1 /* groups */, |
| 531 | 512 /* input channels per group */, |
| 532 | 512 /* output_channels_per_group */, |
| 533 | 512 /* input pixel stride */, |
| 534 | 512 /* output pixel stride */, |
| 535 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 536 | w58.data(), w59.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 537 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 538 | 0 /* flags */, |
| 539 | &op14); |
| 540 | if (status != xnn_status_success) { |
| 541 | std::cerr << "failed to create operation #14" << std::endl; |
| 542 | return ExecutionPlan(); |
| 543 | } |
| 544 | operators.emplace_back(op14, xnn_delete_operator); |
| 545 | |
| 546 | xnn_operator_t op15 = nullptr; |
| 547 | status = xnn_create_convolution2d_nhwc_qs8( |
| 548 | 1 /* top padding */, 1 /* right padding */, |
| 549 | 1 /* bottom padding */, 1 /* left padding */, |
| 550 | 3 /* kernel height */, 3 /* kernel width */, |
| 551 | 1 /* subsampling height */, 1 /* subsampling width */, |
| 552 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 553 | 512 /* groups */, |
| 554 | 1 /* input channels per group */, |
| 555 | 1 /* output_channels_per_group */, |
| 556 | 512 /* input pixel stride */, |
| 557 | 512 /* output pixel stride */, |
| 558 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 559 | w60.data(), w61.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 560 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 561 | 0 /* flags */, |
| 562 | &op15); |
| 563 | if (status != xnn_status_success) { |
| 564 | std::cerr << "failed to create operation #15" << std::endl; |
| 565 | return ExecutionPlan(); |
| 566 | } |
| 567 | operators.emplace_back(op15, xnn_delete_operator); |
| 568 | |
| 569 | xnn_operator_t op16 = nullptr; |
| 570 | status = xnn_create_convolution2d_nhwc_qs8( |
| 571 | 0 /* top padding */, 0 /* right padding */, |
| 572 | 0 /* bottom padding */, 0 /* left padding */, |
| 573 | 1 /* kernel height */, 1 /* kernel width */, |
| 574 | 1 /* subsampling height */, 1 /* subsampling width */, |
| 575 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 576 | 1 /* groups */, |
| 577 | 512 /* input channels per group */, |
| 578 | 512 /* output_channels_per_group */, |
| 579 | 512 /* input pixel stride */, |
| 580 | 512 /* output pixel stride */, |
| 581 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 582 | w62.data(), w63.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 583 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 584 | 0 /* flags */, |
| 585 | &op16); |
| 586 | if (status != xnn_status_success) { |
| 587 | std::cerr << "failed to create operation #16" << std::endl; |
| 588 | return ExecutionPlan(); |
| 589 | } |
| 590 | operators.emplace_back(op16, xnn_delete_operator); |
| 591 | |
| 592 | xnn_operator_t op17 = nullptr; |
| 593 | status = xnn_create_convolution2d_nhwc_qs8( |
| 594 | 1 /* top padding */, 1 /* right padding */, |
| 595 | 1 /* bottom padding */, 1 /* left padding */, |
| 596 | 3 /* kernel height */, 3 /* kernel width */, |
| 597 | 1 /* subsampling height */, 1 /* subsampling width */, |
| 598 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 599 | 512 /* groups */, |
| 600 | 1 /* input channels per group */, |
| 601 | 1 /* output_channels_per_group */, |
| 602 | 512 /* input pixel stride */, |
| 603 | 512 /* output pixel stride */, |
| 604 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 605 | w64.data(), w65.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 606 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 607 | 0 /* flags */, |
| 608 | &op17); |
| 609 | if (status != xnn_status_success) { |
| 610 | std::cerr << "failed to create operation #17" << std::endl; |
| 611 | return ExecutionPlan(); |
| 612 | } |
| 613 | operators.emplace_back(op17, xnn_delete_operator); |
| 614 | |
| 615 | xnn_operator_t op18 = nullptr; |
| 616 | status = xnn_create_convolution2d_nhwc_qs8( |
| 617 | 0 /* top padding */, 0 /* right padding */, |
| 618 | 0 /* bottom padding */, 0 /* left padding */, |
| 619 | 1 /* kernel height */, 1 /* kernel width */, |
| 620 | 1 /* subsampling height */, 1 /* subsampling width */, |
| 621 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 622 | 1 /* groups */, |
| 623 | 512 /* input channels per group */, |
| 624 | 512 /* output_channels_per_group */, |
| 625 | 512 /* input pixel stride */, |
| 626 | 512 /* output pixel stride */, |
| 627 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 628 | w66.data(), w67.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 629 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 630 | 0 /* flags */, |
| 631 | &op18); |
| 632 | if (status != xnn_status_success) { |
| 633 | std::cerr << "failed to create operation #18" << std::endl; |
| 634 | return ExecutionPlan(); |
| 635 | } |
| 636 | operators.emplace_back(op18, xnn_delete_operator); |
| 637 | |
| 638 | xnn_operator_t op19 = nullptr; |
| 639 | status = xnn_create_convolution2d_nhwc_qs8( |
| 640 | 1 /* top padding */, 1 /* right padding */, |
| 641 | 1 /* bottom padding */, 1 /* left padding */, |
| 642 | 3 /* kernel height */, 3 /* kernel width */, |
| 643 | 1 /* subsampling height */, 1 /* subsampling width */, |
| 644 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 645 | 512 /* groups */, |
| 646 | 1 /* input channels per group */, |
| 647 | 1 /* output_channels_per_group */, |
| 648 | 512 /* input pixel stride */, |
| 649 | 512 /* output pixel stride */, |
| 650 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 651 | w68.data(), w69.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 652 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 653 | 0 /* flags */, |
| 654 | &op19); |
| 655 | if (status != xnn_status_success) { |
| 656 | std::cerr << "failed to create operation #19" << std::endl; |
| 657 | return ExecutionPlan(); |
| 658 | } |
| 659 | operators.emplace_back(op19, xnn_delete_operator); |
| 660 | |
| 661 | xnn_operator_t op20 = nullptr; |
| 662 | status = xnn_create_convolution2d_nhwc_qs8( |
| 663 | 0 /* top padding */, 0 /* right padding */, |
| 664 | 0 /* bottom padding */, 0 /* left padding */, |
| 665 | 1 /* kernel height */, 1 /* kernel width */, |
| 666 | 1 /* subsampling height */, 1 /* subsampling width */, |
| 667 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 668 | 1 /* groups */, |
| 669 | 512 /* input channels per group */, |
| 670 | 512 /* output_channels_per_group */, |
| 671 | 512 /* input pixel stride */, |
| 672 | 512 /* output pixel stride */, |
| 673 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 674 | w70.data(), w71.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 675 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 676 | 0 /* flags */, |
| 677 | &op20); |
| 678 | if (status != xnn_status_success) { |
| 679 | std::cerr << "failed to create operation #20" << std::endl; |
| 680 | return ExecutionPlan(); |
| 681 | } |
| 682 | operators.emplace_back(op20, xnn_delete_operator); |
| 683 | |
| 684 | xnn_operator_t op21 = nullptr; |
| 685 | status = xnn_create_convolution2d_nhwc_qs8( |
| 686 | 1 /* top padding */, 1 /* right padding */, |
| 687 | 1 /* bottom padding */, 1 /* left padding */, |
| 688 | 3 /* kernel height */, 3 /* kernel width */, |
| 689 | 1 /* subsampling height */, 1 /* subsampling width */, |
| 690 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 691 | 512 /* groups */, |
| 692 | 1 /* input channels per group */, |
| 693 | 1 /* output_channels_per_group */, |
| 694 | 512 /* input pixel stride */, |
| 695 | 512 /* output pixel stride */, |
| 696 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 697 | w72.data(), w73.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 698 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 699 | 0 /* flags */, |
| 700 | &op21); |
| 701 | if (status != xnn_status_success) { |
| 702 | std::cerr << "failed to create operation #21" << std::endl; |
| 703 | return ExecutionPlan(); |
| 704 | } |
| 705 | operators.emplace_back(op21, xnn_delete_operator); |
| 706 | |
| 707 | xnn_operator_t op22 = nullptr; |
| 708 | status = xnn_create_convolution2d_nhwc_qs8( |
| 709 | 0 /* top padding */, 0 /* right padding */, |
| 710 | 0 /* bottom padding */, 0 /* left padding */, |
| 711 | 1 /* kernel height */, 1 /* kernel width */, |
| 712 | 1 /* subsampling height */, 1 /* subsampling width */, |
| 713 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 714 | 1 /* groups */, |
| 715 | 512 /* input channels per group */, |
| 716 | 512 /* output_channels_per_group */, |
| 717 | 512 /* input pixel stride */, |
| 718 | 512 /* output pixel stride */, |
| 719 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 720 | w74.data(), w75.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 721 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 722 | 0 /* flags */, |
| 723 | &op22); |
| 724 | if (status != xnn_status_success) { |
| 725 | std::cerr << "failed to create operation #22" << std::endl; |
| 726 | return ExecutionPlan(); |
| 727 | } |
| 728 | operators.emplace_back(op22, xnn_delete_operator); |
| 729 | |
| 730 | xnn_operator_t op23 = nullptr; |
| 731 | status = xnn_create_convolution2d_nhwc_qs8( |
| 732 | 0 /* top padding */, 1 /* right padding */, |
| 733 | 1 /* bottom padding */, 0 /* left padding */, |
| 734 | 3 /* kernel height */, 3 /* kernel width */, |
| 735 | 2 /* subsampling height */, 2 /* subsampling width */, |
| 736 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 737 | 512 /* groups */, |
| 738 | 1 /* input channels per group */, |
| 739 | 1 /* output_channels_per_group */, |
| 740 | 512 /* input pixel stride */, |
| 741 | 512 /* output pixel stride */, |
| 742 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 743 | w76.data(), w77.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 744 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 745 | 0 /* flags */, |
| 746 | &op23); |
| 747 | if (status != xnn_status_success) { |
| 748 | std::cerr << "failed to create operation #23" << std::endl; |
| 749 | return ExecutionPlan(); |
| 750 | } |
| 751 | operators.emplace_back(op23, xnn_delete_operator); |
| 752 | |
| 753 | xnn_operator_t op24 = nullptr; |
| 754 | status = xnn_create_convolution2d_nhwc_qs8( |
| 755 | 0 /* top padding */, 0 /* right padding */, |
| 756 | 0 /* bottom padding */, 0 /* left padding */, |
| 757 | 1 /* kernel height */, 1 /* kernel width */, |
| 758 | 1 /* subsampling height */, 1 /* subsampling width */, |
| 759 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 760 | 1 /* groups */, |
| 761 | 512 /* input channels per group */, |
| 762 | 1024 /* output_channels_per_group */, |
| 763 | 512 /* input pixel stride */, |
| 764 | 1024 /* output pixel stride */, |
| 765 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 766 | w78.data(), w79.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 767 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 768 | 0 /* flags */, |
| 769 | &op24); |
| 770 | if (status != xnn_status_success) { |
| 771 | std::cerr << "failed to create operation #24" << std::endl; |
| 772 | return ExecutionPlan(); |
| 773 | } |
| 774 | operators.emplace_back(op24, xnn_delete_operator); |
| 775 | |
| 776 | xnn_operator_t op25 = nullptr; |
| 777 | status = xnn_create_convolution2d_nhwc_qs8( |
| 778 | 1 /* top padding */, 1 /* right padding */, |
| 779 | 1 /* bottom padding */, 1 /* left padding */, |
| 780 | 3 /* kernel height */, 3 /* kernel width */, |
| 781 | 1 /* subsampling height */, 1 /* subsampling width */, |
| 782 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 783 | 1024 /* groups */, |
| 784 | 1 /* input channels per group */, |
| 785 | 1 /* output_channels_per_group */, |
| 786 | 1024 /* input pixel stride */, |
| 787 | 1024 /* output pixel stride */, |
| 788 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 789 | w80.data(), w81.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 790 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 791 | 0 /* flags */, |
| 792 | &op25); |
| 793 | if (status != xnn_status_success) { |
| 794 | std::cerr << "failed to create operation #25" << std::endl; |
| 795 | return ExecutionPlan(); |
| 796 | } |
| 797 | operators.emplace_back(op25, xnn_delete_operator); |
| 798 | |
| 799 | xnn_operator_t op26 = nullptr; |
| 800 | status = xnn_create_convolution2d_nhwc_qs8( |
| 801 | 0 /* top padding */, 0 /* right padding */, |
| 802 | 0 /* bottom padding */, 0 /* left padding */, |
| 803 | 1 /* kernel height */, 1 /* kernel width */, |
| 804 | 1 /* subsampling height */, 1 /* subsampling width */, |
| 805 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 806 | 1 /* groups */, |
| 807 | 1024 /* input channels per group */, |
| 808 | 1024 /* output_channels_per_group */, |
| 809 | 1024 /* input pixel stride */, |
| 810 | 1024 /* output pixel stride */, |
| 811 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 812 | w82.data(), w83.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 813 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 814 | 0 /* flags */, |
| 815 | &op26); |
| 816 | if (status != xnn_status_success) { |
| 817 | std::cerr << "failed to create operation #26" << std::endl; |
| 818 | return ExecutionPlan(); |
| 819 | } |
| 820 | operators.emplace_back(op26, xnn_delete_operator); |
| 821 | |
| 822 | xnn_operator_t op27 = nullptr; |
Marat Dukhan | 9e0b539 | 2020-08-07 02:29:34 -0700 | [diff] [blame] | 823 | status = xnn_create_global_average_pooling_nwc_qs8( |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 824 | 1024 /* channels */, 1024 /* input stride */, 1024 /* output stride */, |
Marat Dukhan | 9e0b539 | 2020-08-07 02:29:34 -0700 | [diff] [blame] | 825 | -1 /* input zero point */, 0.5f /* input scale */, |
| 826 | -1 /* output zero point */, 0.5f /* output scale */, |
| 827 | -126 /* output min */, 126 /* output max */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 828 | 0 /* flags */, |
| 829 | &op27); |
| 830 | if (status != xnn_status_success) { |
| 831 | std::cerr << "failed to create operation #27" << std::endl; |
| 832 | return ExecutionPlan(); |
| 833 | } |
| 834 | operators.emplace_back(op27, xnn_delete_operator); |
| 835 | |
| 836 | xnn_operator_t op28 = nullptr; |
| 837 | status = xnn_create_convolution2d_nhwc_qs8( |
| 838 | 0 /* top padding */, 0 /* right padding */, |
| 839 | 0 /* bottom padding */, 0 /* left padding */, |
| 840 | 1 /* kernel height */, 1 /* kernel width */, |
| 841 | 1 /* subsampling height */, 1 /* subsampling width */, |
| 842 | 1 /* dilation_height */, 1 /* dilation_width */, |
| 843 | 1 /* groups */, |
| 844 | 1024 /* input channels per group */, |
| 845 | 1001 /* output_channels_per_group */, |
| 846 | 1024 /* input pixel stride */, |
| 847 | 1001 /* output pixel stride */, |
| 848 | -1 /* input zero point */, 0.5f /* input scale */, 0.5f /* kernel scale */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 849 | w84.data(), w85.data(), |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 850 | -1 /* output zero point */, 0.5f /* output scale */, -126 /* output min */, 126 /* output max */, |
| 851 | 0 /* flags */, |
| 852 | &op28); |
| 853 | if (status != xnn_status_success) { |
| 854 | std::cerr << "failed to create operation #28" << std::endl; |
| 855 | return ExecutionPlan(); |
| 856 | } |
| 857 | operators.emplace_back(op28, xnn_delete_operator); |
| 858 | |
| 859 | |
| 860 | |
| 861 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 862 | op0, |
| 863 | 1 /* batch size */, 224 /* input height */, 224 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 864 | v0.data() /* input */, v1.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 865 | threadpool /* threadpool */); |
| 866 | if (status != xnn_status_success) { |
| 867 | std::cerr << "failed to setup operation #0" << std::endl; |
| 868 | return ExecutionPlan(); |
| 869 | } |
| 870 | |
| 871 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 872 | op1, |
| 873 | 1 /* batch size */, 112 /* input height */, 112 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 874 | v1.data() /* input */, v2.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 875 | threadpool /* threadpool */); |
| 876 | if (status != xnn_status_success) { |
| 877 | std::cerr << "failed to setup operation #1" << std::endl; |
| 878 | return ExecutionPlan(); |
| 879 | } |
| 880 | |
| 881 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 882 | op2, |
| 883 | 1 /* batch size */, 112 /* input height */, 112 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 884 | v2.data() /* input */, v3.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 885 | threadpool /* threadpool */); |
| 886 | if (status != xnn_status_success) { |
| 887 | std::cerr << "failed to setup operation #2" << std::endl; |
| 888 | return ExecutionPlan(); |
| 889 | } |
| 890 | |
| 891 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 892 | op3, |
| 893 | 1 /* batch size */, 112 /* input height */, 112 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 894 | v3.data() /* input */, v4.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 895 | threadpool /* threadpool */); |
| 896 | if (status != xnn_status_success) { |
| 897 | std::cerr << "failed to setup operation #3" << std::endl; |
| 898 | return ExecutionPlan(); |
| 899 | } |
| 900 | |
| 901 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 902 | op4, |
| 903 | 1 /* batch size */, 56 /* input height */, 56 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 904 | v4.data() /* input */, v5.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 905 | threadpool /* threadpool */); |
| 906 | if (status != xnn_status_success) { |
| 907 | std::cerr << "failed to setup operation #4" << std::endl; |
| 908 | return ExecutionPlan(); |
| 909 | } |
| 910 | |
| 911 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 912 | op5, |
| 913 | 1 /* batch size */, 56 /* input height */, 56 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 914 | v5.data() /* input */, v6.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 915 | threadpool /* threadpool */); |
| 916 | if (status != xnn_status_success) { |
| 917 | std::cerr << "failed to setup operation #5" << std::endl; |
| 918 | return ExecutionPlan(); |
| 919 | } |
| 920 | |
| 921 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 922 | op6, |
| 923 | 1 /* batch size */, 56 /* input height */, 56 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 924 | v6.data() /* input */, v7.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 925 | threadpool /* threadpool */); |
| 926 | if (status != xnn_status_success) { |
| 927 | std::cerr << "failed to setup operation #6" << std::endl; |
| 928 | return ExecutionPlan(); |
| 929 | } |
| 930 | |
| 931 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 932 | op7, |
| 933 | 1 /* batch size */, 56 /* input height */, 56 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 934 | v7.data() /* input */, v8.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 935 | threadpool /* threadpool */); |
| 936 | if (status != xnn_status_success) { |
| 937 | std::cerr << "failed to setup operation #7" << std::endl; |
| 938 | return ExecutionPlan(); |
| 939 | } |
| 940 | |
| 941 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 942 | op8, |
| 943 | 1 /* batch size */, 28 /* input height */, 28 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 944 | v8.data() /* input */, v9.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 945 | threadpool /* threadpool */); |
| 946 | if (status != xnn_status_success) { |
| 947 | std::cerr << "failed to setup operation #8" << std::endl; |
| 948 | return ExecutionPlan(); |
| 949 | } |
| 950 | |
| 951 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 952 | op9, |
| 953 | 1 /* batch size */, 28 /* input height */, 28 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 954 | v9.data() /* input */, v10.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 955 | threadpool /* threadpool */); |
| 956 | if (status != xnn_status_success) { |
| 957 | std::cerr << "failed to setup operation #9" << std::endl; |
| 958 | return ExecutionPlan(); |
| 959 | } |
| 960 | |
| 961 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 962 | op10, |
| 963 | 1 /* batch size */, 28 /* input height */, 28 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 964 | v10.data() /* input */, v11.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 965 | threadpool /* threadpool */); |
| 966 | if (status != xnn_status_success) { |
| 967 | std::cerr << "failed to setup operation #10" << std::endl; |
| 968 | return ExecutionPlan(); |
| 969 | } |
| 970 | |
| 971 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 972 | op11, |
| 973 | 1 /* batch size */, 28 /* input height */, 28 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 974 | v11.data() /* input */, v12.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 975 | threadpool /* threadpool */); |
| 976 | if (status != xnn_status_success) { |
| 977 | std::cerr << "failed to setup operation #11" << std::endl; |
| 978 | return ExecutionPlan(); |
| 979 | } |
| 980 | |
| 981 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 982 | op12, |
| 983 | 1 /* batch size */, 14 /* input height */, 14 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 984 | v12.data() /* input */, v13.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 985 | threadpool /* threadpool */); |
| 986 | if (status != xnn_status_success) { |
| 987 | std::cerr << "failed to setup operation #12" << std::endl; |
| 988 | return ExecutionPlan(); |
| 989 | } |
| 990 | |
| 991 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 992 | op13, |
| 993 | 1 /* batch size */, 14 /* input height */, 14 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 994 | v13.data() /* input */, v14.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 995 | threadpool /* threadpool */); |
| 996 | if (status != xnn_status_success) { |
| 997 | std::cerr << "failed to setup operation #13" << std::endl; |
| 998 | return ExecutionPlan(); |
| 999 | } |
| 1000 | |
| 1001 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 1002 | op14, |
| 1003 | 1 /* batch size */, 14 /* input height */, 14 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 1004 | v14.data() /* input */, v15.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 1005 | threadpool /* threadpool */); |
| 1006 | if (status != xnn_status_success) { |
| 1007 | std::cerr << "failed to setup operation #14" << std::endl; |
| 1008 | return ExecutionPlan(); |
| 1009 | } |
| 1010 | |
| 1011 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 1012 | op15, |
| 1013 | 1 /* batch size */, 14 /* input height */, 14 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 1014 | v15.data() /* input */, v16.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 1015 | threadpool /* threadpool */); |
| 1016 | if (status != xnn_status_success) { |
| 1017 | std::cerr << "failed to setup operation #15" << std::endl; |
| 1018 | return ExecutionPlan(); |
| 1019 | } |
| 1020 | |
| 1021 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 1022 | op16, |
| 1023 | 1 /* batch size */, 14 /* input height */, 14 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 1024 | v16.data() /* input */, v17.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 1025 | threadpool /* threadpool */); |
| 1026 | if (status != xnn_status_success) { |
| 1027 | std::cerr << "failed to setup operation #16" << std::endl; |
| 1028 | return ExecutionPlan(); |
| 1029 | } |
| 1030 | |
| 1031 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 1032 | op17, |
| 1033 | 1 /* batch size */, 14 /* input height */, 14 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 1034 | v17.data() /* input */, v18.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 1035 | threadpool /* threadpool */); |
| 1036 | if (status != xnn_status_success) { |
| 1037 | std::cerr << "failed to setup operation #17" << std::endl; |
| 1038 | return ExecutionPlan(); |
| 1039 | } |
| 1040 | |
| 1041 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 1042 | op18, |
| 1043 | 1 /* batch size */, 14 /* input height */, 14 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 1044 | v18.data() /* input */, v19.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 1045 | threadpool /* threadpool */); |
| 1046 | if (status != xnn_status_success) { |
| 1047 | std::cerr << "failed to setup operation #18" << std::endl; |
| 1048 | return ExecutionPlan(); |
| 1049 | } |
| 1050 | |
| 1051 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 1052 | op19, |
| 1053 | 1 /* batch size */, 14 /* input height */, 14 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 1054 | v19.data() /* input */, v20.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 1055 | threadpool /* threadpool */); |
| 1056 | if (status != xnn_status_success) { |
| 1057 | std::cerr << "failed to setup operation #19" << std::endl; |
| 1058 | return ExecutionPlan(); |
| 1059 | } |
| 1060 | |
| 1061 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 1062 | op20, |
| 1063 | 1 /* batch size */, 14 /* input height */, 14 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 1064 | v20.data() /* input */, v21.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 1065 | threadpool /* threadpool */); |
| 1066 | if (status != xnn_status_success) { |
| 1067 | std::cerr << "failed to setup operation #20" << std::endl; |
| 1068 | return ExecutionPlan(); |
| 1069 | } |
| 1070 | |
| 1071 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 1072 | op21, |
| 1073 | 1 /* batch size */, 14 /* input height */, 14 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 1074 | v21.data() /* input */, v22.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 1075 | threadpool /* threadpool */); |
| 1076 | if (status != xnn_status_success) { |
| 1077 | std::cerr << "failed to setup operation #21" << std::endl; |
| 1078 | return ExecutionPlan(); |
| 1079 | } |
| 1080 | |
| 1081 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 1082 | op22, |
| 1083 | 1 /* batch size */, 14 /* input height */, 14 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 1084 | v22.data() /* input */, v23.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 1085 | threadpool /* threadpool */); |
| 1086 | if (status != xnn_status_success) { |
| 1087 | std::cerr << "failed to setup operation #22" << std::endl; |
| 1088 | return ExecutionPlan(); |
| 1089 | } |
| 1090 | |
| 1091 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 1092 | op23, |
| 1093 | 1 /* batch size */, 14 /* input height */, 14 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 1094 | v23.data() /* input */, v24.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 1095 | threadpool /* threadpool */); |
| 1096 | if (status != xnn_status_success) { |
| 1097 | std::cerr << "failed to setup operation #23" << std::endl; |
| 1098 | return ExecutionPlan(); |
| 1099 | } |
| 1100 | |
| 1101 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 1102 | op24, |
| 1103 | 1 /* batch size */, 7 /* input height */, 7 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 1104 | v24.data() /* input */, v25.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 1105 | threadpool /* threadpool */); |
| 1106 | if (status != xnn_status_success) { |
| 1107 | std::cerr << "failed to setup operation #24" << std::endl; |
| 1108 | return ExecutionPlan(); |
| 1109 | } |
| 1110 | |
| 1111 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 1112 | op25, |
| 1113 | 1 /* batch size */, 7 /* input height */, 7 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 1114 | v25.data() /* input */, v26.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 1115 | threadpool /* threadpool */); |
| 1116 | if (status != xnn_status_success) { |
| 1117 | std::cerr << "failed to setup operation #25" << std::endl; |
| 1118 | return ExecutionPlan(); |
| 1119 | } |
| 1120 | |
| 1121 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 1122 | op26, |
| 1123 | 1 /* batch size */, 7 /* input height */, 7 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 1124 | v26.data() /* input */, v27.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 1125 | threadpool /* threadpool */); |
| 1126 | if (status != xnn_status_success) { |
| 1127 | std::cerr << "failed to setup operation #26" << std::endl; |
| 1128 | return ExecutionPlan(); |
| 1129 | } |
| 1130 | |
Marat Dukhan | 9e0b539 | 2020-08-07 02:29:34 -0700 | [diff] [blame] | 1131 | status = xnn_setup_global_average_pooling_nwc_qs8( |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 1132 | op27, |
| 1133 | 1 /* batch size */, 49 /* width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 1134 | v27.data() /* input */, v28.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 1135 | threadpool /* threadpool */); |
| 1136 | if (status != xnn_status_success) { |
| 1137 | std::cerr << "failed to setup operation #27" << std::endl; |
| 1138 | return ExecutionPlan(); |
| 1139 | } |
| 1140 | |
| 1141 | status = xnn_setup_convolution2d_nhwc_qs8( |
| 1142 | op28, |
| 1143 | 1 /* batch size */, 1 /* input height */, 1 /* input width */, |
Marat Dukhan | 52e061d | 2021-03-09 00:02:44 -0800 | [diff] [blame^] | 1144 | v28.data() /* input */, v29.data() /* output */, |
Marat Dukhan | 0743cdf | 2020-08-04 18:52:07 -0700 | [diff] [blame] | 1145 | threadpool /* threadpool */); |
| 1146 | if (status != xnn_status_success) { |
| 1147 | std::cerr << "failed to setup operation #28" << std::endl; |
| 1148 | return ExecutionPlan(); |
| 1149 | } |
| 1150 | |
| 1151 | #pragma clang diagnostic push |
| 1152 | #pragma clang diagnostic ignored "-Wpessimizing-move" |
| 1153 | return operators; |
| 1154 | #pragma clang diagnostic pop |
| 1155 | } |
| 1156 | |
| 1157 | } // namespace models |