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