1 // Copyright 2019 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 <gtest/gtest.h>
7
8 #include "convolution-operator-tester.h"
9
10
11 /**************************** SPMM path ****************************/
12
13 TEST(CONVOLUTION_NCHW_F32, 1x1) {
14 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
15 ConvolutionOperatorTester()
16 .input_size(27, 29)
17 .kernel_size(1, 1)
18 .group_input_channels(23)
19 .group_output_channels(19)
20 .sparsity(0.5f)
21 .iterations(3)
22 .TestNCHWxF32();
23 }
24
25 TEST(CONVOLUTION_NCHW_F32, 1x1_zero_weights) {
26 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
27 ConvolutionOperatorTester()
28 .input_size(27, 29)
29 .kernel_size(1, 1)
30 .group_input_channels(23)
31 .group_output_channels(19)
32 .sparsity(1.0f)
33 .iterations(3)
34 .TestNCHWxF32();
35 }
36
37 TEST(CONVOLUTION_NCHW_F32, 1x1_varying_input_height) {
38 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
39 for (size_t input_height = 25; input_height <= 31; input_height++) {
40 ConvolutionOperatorTester()
41 .input_size(input_height, 29)
42 .kernel_size(1, 1)
43 .group_input_channels(23)
44 .group_output_channels(19)
45 .sparsity(0.5f)
46 .iterations(1)
47 .TestNCHWxF32();
48 }
49 }
50
51 TEST(CONVOLUTION_NCHW_F32, 1x1_varying_input_width) {
52 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
53 for (size_t input_width = 27; input_width <= 33; input_width++) {
54 ConvolutionOperatorTester()
55 .input_size(27, input_width)
56 .kernel_size(1, 1)
57 .group_input_channels(23)
58 .group_output_channels(19)
59 .sparsity(0.5f)
60 .iterations(1)
61 .TestNCHWxF32();
62 }
63 }
64
65 TEST(CONVOLUTION_NCHW_F32, 1x1_varying_input_channels) {
66 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
67 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
68 ConvolutionOperatorTester()
69 .input_size(27, 29)
70 .kernel_size(1, 1)
71 .group_input_channels(input_channels)
72 .group_output_channels(19)
73 .sparsity(0.5f)
74 .iterations(1)
75 .TestNCHWxF32();
76 }
77 }
78
79 TEST(CONVOLUTION_NCHW_F32, 1x1_varying_output_channels) {
80 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
81 for (size_t output_channels = 1; output_channels < 19; output_channels *= 2) {
82 ConvolutionOperatorTester()
83 .input_size(27, 29)
84 .kernel_size(1, 1)
85 .group_input_channels(23)
86 .group_output_channels(output_channels)
87 .sparsity(0.5f)
88 .iterations(1)
89 .TestNCHWxF32();
90 }
91 }
92
93 TEST(CONVOLUTION_NCHW_F32, 1x1_with_qmin) {
94 ConvolutionOperatorTester()
95 .input_size(27, 29)
96 .kernel_size(1, 1)
97 .group_input_channels(23)
98 .group_output_channels(19)
99 .sparsity(0.5f)
100 .qmin(128)
101 .iterations(3)
102 .TestNCHWxF32();
103 }
104
105 TEST(CONVOLUTION_NCHW_F32, 1x1_with_qmax) {
106 ConvolutionOperatorTester()
107 .input_size(27, 29)
108 .kernel_size(1, 1)
109 .group_input_channels(23)
110 .group_output_channels(19)
111 .sparsity(0.5f)
112 .qmax(128)
113 .iterations(3)
114 .TestNCHWxF32();
115 }
116
117 TEST(CONVOLUTION_NCHW_F32, 1x1_without_bias) {
118 ConvolutionOperatorTester()
119 .has_bias(false)
120 .input_size(27, 29)
121 .kernel_size(1, 1)
122 .group_input_channels(23)
123 .group_output_channels(19)
124 .sparsity(0.5f)
125 .iterations(3)
126 .TestNCHWxF32();
127 }
128
129 /**************************** SPMM path, batched ****************************/
130
TEST(CONVOLUTION_NCHW_F32,batched_1x1)131 TEST(CONVOLUTION_NCHW_F32, batched_1x1) {
132 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
133 ConvolutionOperatorTester()
134 .batch_size(2)
135 .input_size(27, 29)
136 .kernel_size(1, 1)
137 .group_input_channels(23)
138 .group_output_channels(19)
139 .sparsity(0.5f)
140 .iterations(3)
141 .TestNCHWxF32();
142 }
143
TEST(CONVOLUTION_NCHW_F32,batched_1x1_zero_weights)144 TEST(CONVOLUTION_NCHW_F32, batched_1x1_zero_weights) {
145 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
146 ConvolutionOperatorTester()
147 .batch_size(2)
148 .input_size(27, 29)
149 .kernel_size(1, 1)
150 .group_input_channels(23)
151 .group_output_channels(19)
152 .sparsity(1.0f)
153 .iterations(3)
154 .TestNCHWxF32();
155 }
156
TEST(CONVOLUTION_NCHW_F32,batched_1x1_varying_input_height)157 TEST(CONVOLUTION_NCHW_F32, batched_1x1_varying_input_height) {
158 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
159 for (size_t input_height = 25; input_height <= 31; input_height++) {
160 ConvolutionOperatorTester()
161 .batch_size(2)
162 .input_size(input_height, 29)
163 .kernel_size(1, 1)
164 .group_input_channels(23)
165 .group_output_channels(19)
166 .sparsity(0.5f)
167 .iterations(1)
168 .TestNCHWxF32();
169 }
170 }
171
TEST(CONVOLUTION_NCHW_F32,batched_1x1_varying_input_width)172 TEST(CONVOLUTION_NCHW_F32, batched_1x1_varying_input_width) {
173 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
174 for (size_t input_width = 27; input_width <= 33; input_width++) {
175 ConvolutionOperatorTester()
176 .batch_size(2)
177 .input_size(27, input_width)
178 .kernel_size(1, 1)
179 .group_input_channels(23)
180 .group_output_channels(19)
181 .sparsity(0.5f)
182 .iterations(1)
183 .TestNCHWxF32();
184 }
185 }
186
TEST(CONVOLUTION_NCHW_F32,batched_1x1_varying_input_channels)187 TEST(CONVOLUTION_NCHW_F32, batched_1x1_varying_input_channels) {
188 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
189 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
190 ConvolutionOperatorTester()
191 .batch_size(2)
192 .input_size(27, 29)
193 .kernel_size(1, 1)
194 .group_input_channels(input_channels)
195 .group_output_channels(19)
196 .sparsity(0.5f)
197 .iterations(1)
198 .TestNCHWxF32();
199 }
200 }
201
TEST(CONVOLUTION_NCHW_F32,batched_1x1_varying_output_channels)202 TEST(CONVOLUTION_NCHW_F32, batched_1x1_varying_output_channels) {
203 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
204 for (size_t output_channels = 1; output_channels < 19; output_channels *= 2) {
205 ConvolutionOperatorTester()
206 .batch_size(2)
207 .input_size(27, 29)
208 .kernel_size(1, 1)
209 .group_input_channels(23)
210 .group_output_channels(output_channels)
211 .sparsity(0.5f)
212 .iterations(1)
213 .TestNCHWxF32();
214 }
215 }
216
TEST(CONVOLUTION_NCHW_F32,batched_1x1_with_input_stride)217 TEST(CONVOLUTION_NCHW_F32, batched_1x1_with_input_stride) {
218 ConvolutionOperatorTester()
219 .batch_size(2)
220 .input_size(27, 29)
221 .kernel_size(1, 1)
222 .input_channel_stride(25)
223 .group_input_channels(23)
224 .group_output_channels(19)
225 .sparsity(0.5f)
226 .iterations(3)
227 .TestNCHWxF32();
228 }
229
TEST(CONVOLUTION_NCHW_F32,batched_1x1_with_output_stride)230 TEST(CONVOLUTION_NCHW_F32, batched_1x1_with_output_stride) {
231 ConvolutionOperatorTester()
232 .batch_size(2)
233 .input_size(27, 29)
234 .kernel_size(1, 1)
235 .output_channel_stride(21)
236 .group_input_channels(23)
237 .group_output_channels(19)
238 .sparsity(0.5f)
239 .iterations(3)
240 .TestNCHWxF32();
241 }
242
TEST(CONVOLUTION_NCHW_F32,batched_1x1_with_qmin)243 TEST(CONVOLUTION_NCHW_F32, batched_1x1_with_qmin) {
244 ConvolutionOperatorTester()
245 .batch_size(2)
246 .input_size(27, 29)
247 .kernel_size(1, 1)
248 .group_input_channels(23)
249 .group_output_channels(19)
250 .sparsity(0.5f)
251 .qmin(128)
252 .iterations(3)
253 .TestNCHWxF32();
254 }
255
TEST(CONVOLUTION_NCHW_F32,batched_1x1_with_qmax)256 TEST(CONVOLUTION_NCHW_F32, batched_1x1_with_qmax) {
257 ConvolutionOperatorTester()
258 .batch_size(2)
259 .input_size(27, 29)
260 .kernel_size(1, 1)
261 .group_input_channels(23)
262 .group_output_channels(19)
263 .sparsity(0.5f)
264 .qmax(128)
265 .iterations(3)
266 .TestNCHWxF32();
267 }
268
TEST(CONVOLUTION_NCHW_F32,batched_1x1_without_bias)269 TEST(CONVOLUTION_NCHW_F32, batched_1x1_without_bias) {
270 ConvolutionOperatorTester()
271 .has_bias(false)
272 .batch_size(2)
273 .input_size(27, 29)
274 .kernel_size(1, 1)
275 .group_input_channels(23)
276 .group_output_channels(19)
277 .sparsity(0.5f)
278 .iterations(3)
279 .TestNCHWxF32();
280 }
281
282 /**************************** DConv 3x3c3s2 HWC->CHW path ****************************/
283
284 TEST(CONVOLUTION_NHWC2NCHW_OP_F32, 3x3c3s2) {
285 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
286 ConvolutionOperatorTester()
287 .input_size(27, 29)
288 .padding(1)
289 .kernel_size(3, 3)
290 .subsampling(2)
291 .group_input_channels(3)
292 .group_output_channels(19)
293 .force_nhwc_input(true)
294 .iterations(3)
295 .TestNCHWxF32();
296 }
297
298 TEST(CONVOLUTION_NHWC2NCHW_OP_F32, 3x3c3s2_varying_input_height) {
299 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
300 for (size_t input_height = 25; input_height <= 31; input_height++) {
301 ConvolutionOperatorTester()
302 .input_size(input_height, 29)
303 .padding(1)
304 .kernel_size(3, 3)
305 .subsampling(2)
306 .group_input_channels(3)
307 .group_output_channels(19)
308 .force_nhwc_input(true)
309 .iterations(1)
310 .TestNCHWxF32();
311 }
312 }
313
314 TEST(CONVOLUTION_NHWC2NCHW_OP_F32, 3x3c3s2_varying_input_width) {
315 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
316 for (size_t input_width = 27; input_width <= 33; input_width++) {
317 ConvolutionOperatorTester()
318 .input_size(27, input_width)
319 .padding(1)
320 .kernel_size(3, 3)
321 .subsampling(2)
322 .group_input_channels(3)
323 .group_output_channels(19)
324 .force_nhwc_input(true)
325 .iterations(1)
326 .TestNCHWxF32();
327 }
328 }
329
330 TEST(CONVOLUTION_NHWC2NCHW_OP_F32, 3x3c3s2_varying_output_channels) {
331 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
332 for (size_t output_channels = 1; output_channels < 19; output_channels *= 2) {
333 ConvolutionOperatorTester()
334 .input_size(27, 29)
335 .padding(1)
336 .kernel_size(3, 3)
337 .subsampling(2)
338 .group_input_channels(3)
339 .group_output_channels(output_channels)
340 .force_nhwc_input(true)
341 .iterations(1)
342 .TestNCHWxF32();
343 }
344 }
345
346 TEST(CONVOLUTION_NHWC2NCHW_OP_F32, 3x3c3s2_with_qmin) {
347 ConvolutionOperatorTester()
348 .input_size(27, 29)
349 .padding(1)
350 .kernel_size(3, 3)
351 .subsampling(2)
352 .group_input_channels(3)
353 .group_output_channels(19)
354 .force_nhwc_input(true)
355 .qmin(128)
356 .iterations(3)
357 .TestNCHWxF32();
358 }
359
360 TEST(CONVOLUTION_NHWC2NCHW_OP_F32, 3x3c3s2_with_qmax) {
361 ConvolutionOperatorTester()
362 .input_size(27, 29)
363 .padding(1)
364 .kernel_size(3, 3)
365 .subsampling(2)
366 .group_input_channels(3)
367 .group_output_channels(19)
368 .force_nhwc_input(true)
369 .qmax(128)
370 .iterations(3)
371 .TestNCHWxF32();
372 }
373
374 TEST(CONVOLUTION_NHWC2NCHW_OP_F32, 3x3c3s2_without_bias) {
375 ConvolutionOperatorTester()
376 .has_bias(false)
377 .input_size(27, 29)
378 .padding(1)
379 .kernel_size(3, 3)
380 .subsampling(2)
381 .group_input_channels(3)
382 .group_output_channels(19)
383 .force_nhwc_input(true)
384 .iterations(3)
385 .TestNCHWxF32();
386 }
387
388 /**************************** DConv 3x3c3s2 HWC->CHW path, batched ****************************/
389
TEST(CONVOLUTION_NHWC2NCHW_OP_F32,batched_3x3c3s2)390 TEST(CONVOLUTION_NHWC2NCHW_OP_F32, batched_3x3c3s2) {
391 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
392 ConvolutionOperatorTester()
393 .batch_size(2)
394 .input_size(27, 29)
395 .padding(1)
396 .kernel_size(3, 3)
397 .subsampling(2)
398 .group_input_channels(3)
399 .group_output_channels(19)
400 .force_nhwc_input(true)
401 .iterations(3)
402 .TestNCHWxF32();
403 }
404
TEST(CONVOLUTION_NHWC2NCHW_OP_F32,batched_3x3c3s2_varying_input_height)405 TEST(CONVOLUTION_NHWC2NCHW_OP_F32, batched_3x3c3s2_varying_input_height) {
406 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
407 for (size_t input_height = 25; input_height <= 31; input_height++) {
408 ConvolutionOperatorTester()
409 .batch_size(2)
410 .input_size(input_height, 29)
411 .padding(1)
412 .kernel_size(3, 3)
413 .subsampling(2)
414 .group_input_channels(3)
415 .group_output_channels(19)
416 .force_nhwc_input(true)
417 .iterations(1)
418 .TestNCHWxF32();
419 }
420 }
421
TEST(CONVOLUTION_NHWC2NCHW_OP_F32,batched_3x3c3s2_varying_input_width)422 TEST(CONVOLUTION_NHWC2NCHW_OP_F32, batched_3x3c3s2_varying_input_width) {
423 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
424 for (size_t input_width = 27; input_width <= 33; input_width++) {
425 ConvolutionOperatorTester()
426 .batch_size(2)
427 .input_size(27, input_width)
428 .padding(1)
429 .kernel_size(3, 3)
430 .subsampling(2)
431 .group_input_channels(3)
432 .group_output_channels(19)
433 .force_nhwc_input(true)
434 .iterations(1)
435 .TestNCHWxF32();
436 }
437 }
438
TEST(CONVOLUTION_NHWC2NCHW_OP_F32,batched_3x3c3s2_varying_output_channels)439 TEST(CONVOLUTION_NHWC2NCHW_OP_F32, batched_3x3c3s2_varying_output_channels) {
440 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
441 for (size_t output_channels = 1; output_channels < 19; output_channels *= 2) {
442 ConvolutionOperatorTester()
443 .batch_size(2)
444 .input_size(27, 29)
445 .padding(1)
446 .kernel_size(3, 3)
447 .subsampling(2)
448 .group_input_channels(3)
449 .group_output_channels(output_channels)
450 .force_nhwc_input(true)
451 .iterations(1)
452 .TestNCHWxF32();
453 }
454 }
455
TEST(CONVOLUTION_NHWC2NCHW_OP_F32,batched_3x3c3s2_with_output_stride)456 TEST(CONVOLUTION_NHWC2NCHW_OP_F32, batched_3x3c3s2_with_output_stride) {
457 ConvolutionOperatorTester()
458 .batch_size(2)
459 .input_size(27, 29)
460 .padding(1)
461 .kernel_size(3, 3)
462 .subsampling(2)
463 .output_channel_stride(21)
464 .group_input_channels(3)
465 .group_output_channels(19)
466 .force_nhwc_input(true)
467 .iterations(3)
468 .TestNCHWxF32();
469 }
470
TEST(CONVOLUTION_NHWC2NCHW_OP_F32,batched_3x3c3s2_with_qmin)471 TEST(CONVOLUTION_NHWC2NCHW_OP_F32, batched_3x3c3s2_with_qmin) {
472 ConvolutionOperatorTester()
473 .batch_size(2)
474 .input_size(27, 29)
475 .padding(1)
476 .kernel_size(3, 3)
477 .subsampling(2)
478 .group_input_channels(3)
479 .group_output_channels(19)
480 .force_nhwc_input(true)
481 .qmin(128)
482 .iterations(3)
483 .TestNCHWxF32();
484 }
485
TEST(CONVOLUTION_NHWC2NCHW_OP_F32,batched_3x3c3s2_with_qmax)486 TEST(CONVOLUTION_NHWC2NCHW_OP_F32, batched_3x3c3s2_with_qmax) {
487 ConvolutionOperatorTester()
488 .batch_size(2)
489 .input_size(27, 29)
490 .padding(1)
491 .kernel_size(3, 3)
492 .subsampling(2)
493 .group_input_channels(3)
494 .group_output_channels(19)
495 .force_nhwc_input(true)
496 .qmax(128)
497 .iterations(3)
498 .TestNCHWxF32();
499 }
500
TEST(CONVOLUTION_NHWC2NCHW_OP_F32,batched_3x3c3s2_without_bias)501 TEST(CONVOLUTION_NHWC2NCHW_OP_F32, batched_3x3c3s2_without_bias) {
502 ConvolutionOperatorTester()
503 .has_bias(false)
504 .batch_size(2)
505 .input_size(27, 29)
506 .padding(1)
507 .kernel_size(3, 3)
508 .subsampling(2)
509 .group_input_channels(3)
510 .group_output_channels(19)
511 .force_nhwc_input(true)
512 .iterations(3)
513 .TestNCHWxF32();
514 }
515
516 /**************************** DWCONV 3x3 path ****************************/
517
TEST(CONVOLUTION_NCHW_F32,depthwise_3x3)518 TEST(CONVOLUTION_NCHW_F32, depthwise_3x3) {
519 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
520 ConvolutionOperatorTester()
521 .input_size(27, 29)
522 .kernel_size(3, 3)
523 .padding(1)
524 .groups(19)
525 .iterations(3)
526 .TestNCHWxF32();
527 }
528
TEST(CONVOLUTION_NCHW_F32,depthwise_3x3_zero_weights)529 TEST(CONVOLUTION_NCHW_F32, depthwise_3x3_zero_weights) {
530 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
531 ConvolutionOperatorTester()
532 .input_size(27, 29)
533 .kernel_size(3, 3)
534 .padding(1)
535 .groups(19)
536 .sparsity(1.0f)
537 .iterations(3)
538 .TestNCHWxF32();
539 }
540
TEST(CONVOLUTION_NCHW_F32,depthwise_3x3_varying_input_height)541 TEST(CONVOLUTION_NCHW_F32, depthwise_3x3_varying_input_height) {
542 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
543 for (size_t input_height = 25; input_height <= 31; input_height++) {
544 ConvolutionOperatorTester()
545 .input_size(input_height, 29)
546 .kernel_size(3, 3)
547 .padding(1)
548 .groups(19)
549 .iterations(1)
550 .TestNCHWxF32();
551 }
552 }
553
TEST(CONVOLUTION_NCHW_F32,depthwise_3x3_varying_input_width)554 TEST(CONVOLUTION_NCHW_F32, depthwise_3x3_varying_input_width) {
555 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
556 for (size_t input_width = 27; input_width <= 33; input_width++) {
557 ConvolutionOperatorTester()
558 .input_size(27, input_width)
559 .kernel_size(3, 3)
560 .padding(1)
561 .groups(19)
562 .iterations(1)
563 .TestNCHWxF32();
564 }
565 }
566
TEST(CONVOLUTION_NCHW_F32,depthwise_3x3_varying_channels)567 TEST(CONVOLUTION_NCHW_F32, depthwise_3x3_varying_channels) {
568 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
569 for (size_t channels = 1; channels <= 16; channels *= 4) {
570 ConvolutionOperatorTester()
571 .input_size(27, 29)
572 .kernel_size(3, 3)
573 .padding(1)
574 .groups(channels)
575 .iterations(1)
576 .TestNCHWxF32();
577 }
578 }
579
TEST(CONVOLUTION_NCHW_F32,depthwise_3x3_with_qmin)580 TEST(CONVOLUTION_NCHW_F32, depthwise_3x3_with_qmin) {
581 ConvolutionOperatorTester()
582 .input_size(27, 29)
583 .kernel_size(3, 3)
584 .padding(1)
585 .groups(19)
586 .qmin(128)
587 .iterations(3)
588 .TestNCHWxF32();
589 }
590
TEST(CONVOLUTION_NCHW_F32,depthwise_3x3_with_qmax)591 TEST(CONVOLUTION_NCHW_F32, depthwise_3x3_with_qmax) {
592 ConvolutionOperatorTester()
593 .input_size(27, 29)
594 .kernel_size(3, 3)
595 .padding(1)
596 .groups(19)
597 .qmax(128)
598 .iterations(3)
599 .TestNCHWxF32();
600 }
601
TEST(CONVOLUTION_NCHW_F32,depthwise_3x3_without_bias)602 TEST(CONVOLUTION_NCHW_F32, depthwise_3x3_without_bias) {
603 ConvolutionOperatorTester()
604 .has_bias(false)
605 .input_size(27, 29)
606 .kernel_size(3, 3)
607 .padding(1)
608 .groups(19)
609 .iterations(3)
610 .TestNCHWxF32();
611 }
612
613 /**************************** DWCONV 3x3 path, batched ****************************/
614
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_3x3)615 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_3x3) {
616 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
617 ConvolutionOperatorTester()
618 .batch_size(2)
619 .input_size(27, 29)
620 .kernel_size(3, 3)
621 .padding(1)
622 .groups(19)
623 .iterations(3)
624 .TestNCHWxF32();
625 }
626
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_3x3_zero_weights)627 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_3x3_zero_weights) {
628 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
629 ConvolutionOperatorTester()
630 .batch_size(2)
631 .input_size(27, 29)
632 .kernel_size(3, 3)
633 .padding(1)
634 .groups(19)
635 .sparsity(1.0f)
636 .iterations(3)
637 .TestNCHWxF32();
638 }
639
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_3x3_varying_input_height)640 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_3x3_varying_input_height) {
641 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
642 for (size_t input_height = 25; input_height <= 31; input_height++) {
643 ConvolutionOperatorTester()
644 .batch_size(2)
645 .input_size(input_height, 29)
646 .kernel_size(3, 3)
647 .padding(1)
648 .groups(19)
649 .iterations(1)
650 .TestNCHWxF32();
651 }
652 }
653
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_3x3_varying_input_width)654 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_3x3_varying_input_width) {
655 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
656 for (size_t input_width = 27; input_width <= 33; input_width++) {
657 ConvolutionOperatorTester()
658 .batch_size(2)
659 .input_size(27, input_width)
660 .kernel_size(3, 3)
661 .padding(1)
662 .groups(19)
663 .iterations(1)
664 .TestNCHWxF32();
665 }
666 }
667
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_3x3_varying_channels)668 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_3x3_varying_channels) {
669 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
670 for (size_t channels = 1; channels <= 16; channels *= 4) {
671 ConvolutionOperatorTester()
672 .batch_size(2)
673 .input_size(27, 29)
674 .kernel_size(3, 3)
675 .padding(1)
676 .groups(channels)
677 .iterations(1)
678 .TestNCHWxF32();
679 }
680 }
681
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_3x3_with_input_stride)682 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_3x3_with_input_stride) {
683 ConvolutionOperatorTester()
684 .batch_size(2)
685 .input_size(27, 29)
686 .kernel_size(3, 3)
687 .padding(1)
688 .input_channel_stride(21)
689 .groups(19)
690 .iterations(3)
691 .TestNCHWxF32();
692 }
693
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_3x3_with_output_stride)694 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_3x3_with_output_stride) {
695 ConvolutionOperatorTester()
696 .batch_size(2)
697 .input_size(27, 29)
698 .kernel_size(3, 3)
699 .padding(1)
700 .output_channel_stride(23)
701 .groups(19)
702 .iterations(3)
703 .TestNCHWxF32();
704 }
705
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_3x3_with_qmin)706 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_3x3_with_qmin) {
707 ConvolutionOperatorTester()
708 .batch_size(2)
709 .input_size(27, 29)
710 .kernel_size(3, 3)
711 .padding(1)
712 .groups(19)
713 .qmin(128)
714 .iterations(3)
715 .TestNCHWxF32();
716 }
717
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_3x3_with_qmax)718 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_3x3_with_qmax) {
719 ConvolutionOperatorTester()
720 .batch_size(2)
721 .input_size(27, 29)
722 .kernel_size(3, 3)
723 .padding(1)
724 .groups(19)
725 .qmax(128)
726 .iterations(3)
727 .TestNCHWxF32();
728 }
729
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_3x3_without_bias)730 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_3x3_without_bias) {
731 ConvolutionOperatorTester()
732 .has_bias(false)
733 .batch_size(2)
734 .input_size(27, 29)
735 .kernel_size(3, 3)
736 .padding(1)
737 .groups(19)
738 .iterations(3)
739 .TestNCHWxF32();
740 }
741
742 /**************************** DWCONV 3x3 stride-2 path ****************************/
743
TEST(CONVOLUTION_NCHW_F32,depthwise_3x3s2)744 TEST(CONVOLUTION_NCHW_F32, depthwise_3x3s2) {
745 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
746 ConvolutionOperatorTester()
747 .input_size(27, 29)
748 .kernel_size(3, 3)
749 .padding(1)
750 .subsampling(2)
751 .groups(19)
752 .iterations(3)
753 .TestNCHWxF32();
754 }
755
TEST(CONVOLUTION_NCHW_F32,depthwise_3x3s2_zero_weights)756 TEST(CONVOLUTION_NCHW_F32, depthwise_3x3s2_zero_weights) {
757 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
758 ConvolutionOperatorTester()
759 .input_size(27, 29)
760 .kernel_size(3, 3)
761 .padding(1)
762 .subsampling(2)
763 .groups(19)
764 .sparsity(1.0f)
765 .iterations(3)
766 .TestNCHWxF32();
767 }
768
TEST(CONVOLUTION_NCHW_F32,depthwise_3x3s2_varying_input_height)769 TEST(CONVOLUTION_NCHW_F32, depthwise_3x3s2_varying_input_height) {
770 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
771 for (size_t input_height = 25; input_height <= 31; input_height++) {
772 ConvolutionOperatorTester()
773 .input_size(input_height, 29)
774 .kernel_size(3, 3)
775 .padding(1)
776 .subsampling(2)
777 .groups(19)
778 .iterations(1)
779 .TestNCHWxF32();
780 }
781 }
782
TEST(CONVOLUTION_NCHW_F32,depthwise_3x3s2_varying_input_width)783 TEST(CONVOLUTION_NCHW_F32, depthwise_3x3s2_varying_input_width) {
784 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
785 for (size_t input_width = 27; input_width <= 33; input_width++) {
786 ConvolutionOperatorTester()
787 .input_size(27, input_width)
788 .kernel_size(3, 3)
789 .padding(1)
790 .subsampling(2)
791 .groups(19)
792 .iterations(1)
793 .TestNCHWxF32();
794 }
795 }
796
TEST(CONVOLUTION_NCHW_F32,depthwise_3x3s2_varying_channels)797 TEST(CONVOLUTION_NCHW_F32, depthwise_3x3s2_varying_channels) {
798 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
799 for (size_t channels = 1; channels <= 16; channels *= 4) {
800 ConvolutionOperatorTester()
801 .input_size(27, 29)
802 .kernel_size(3, 3)
803 .padding(1)
804 .subsampling(2)
805 .groups(channels)
806 .iterations(1)
807 .TestNCHWxF32();
808 }
809 }
810
TEST(CONVOLUTION_NCHW_F32,depthwise_3x3s2_with_qmin)811 TEST(CONVOLUTION_NCHW_F32, depthwise_3x3s2_with_qmin) {
812 ConvolutionOperatorTester()
813 .input_size(27, 29)
814 .kernel_size(3, 3)
815 .padding(1)
816 .subsampling(2)
817 .groups(19)
818 .qmin(128)
819 .iterations(3)
820 .TestNCHWxF32();
821 }
822
TEST(CONVOLUTION_NCHW_F32,depthwise_3x3s2_with_qmax)823 TEST(CONVOLUTION_NCHW_F32, depthwise_3x3s2_with_qmax) {
824 ConvolutionOperatorTester()
825 .input_size(27, 29)
826 .kernel_size(3, 3)
827 .padding(1)
828 .subsampling(2)
829 .groups(19)
830 .qmax(128)
831 .iterations(3)
832 .TestNCHWxF32();
833 }
834
TEST(CONVOLUTION_NCHW_F32,depthwise_3x3s2_without_bias)835 TEST(CONVOLUTION_NCHW_F32, depthwise_3x3s2_without_bias) {
836 ConvolutionOperatorTester()
837 .has_bias(false)
838 .input_size(27, 29)
839 .kernel_size(3, 3)
840 .padding(1)
841 .subsampling(2)
842 .groups(19)
843 .iterations(3)
844 .TestNCHWxF32();
845 }
846
847 /**************************** DWCONV 3x3 stride-2 path, batched ****************************/
848
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_3x3s2)849 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_3x3s2) {
850 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
851 ConvolutionOperatorTester()
852 .batch_size(2)
853 .input_size(27, 29)
854 .kernel_size(3, 3)
855 .padding(1)
856 .subsampling(2)
857 .groups(19)
858 .iterations(3)
859 .TestNCHWxF32();
860 }
861
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_3x3s2_zero_weights)862 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_3x3s2_zero_weights) {
863 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
864 ConvolutionOperatorTester()
865 .batch_size(2)
866 .input_size(27, 29)
867 .kernel_size(3, 3)
868 .padding(1)
869 .subsampling(2)
870 .groups(19)
871 .sparsity(1.0f)
872 .iterations(3)
873 .TestNCHWxF32();
874 }
875
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_3x3s2_varying_input_height)876 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_3x3s2_varying_input_height) {
877 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
878 for (size_t input_height = 25; input_height <= 31; input_height++) {
879 ConvolutionOperatorTester()
880 .batch_size(2)
881 .input_size(input_height, 29)
882 .kernel_size(3, 3)
883 .padding(1)
884 .subsampling(2)
885 .groups(19)
886 .iterations(1)
887 .TestNCHWxF32();
888 }
889 }
890
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_3x3s2_varying_input_width)891 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_3x3s2_varying_input_width) {
892 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
893 for (size_t input_width = 27; input_width <= 33; input_width++) {
894 ConvolutionOperatorTester()
895 .batch_size(2)
896 .input_size(27, input_width)
897 .kernel_size(3, 3)
898 .padding(1)
899 .subsampling(2)
900 .groups(19)
901 .iterations(1)
902 .TestNCHWxF32();
903 }
904 }
905
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_3x3s2_varying_channels)906 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_3x3s2_varying_channels) {
907 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
908 for (size_t channels = 1; channels <= 16; channels *= 4) {
909 ConvolutionOperatorTester()
910 .batch_size(2)
911 .input_size(27, 29)
912 .kernel_size(3, 3)
913 .padding(1)
914 .subsampling(2)
915 .groups(channels)
916 .iterations(1)
917 .TestNCHWxF32();
918 }
919 }
920
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_3x3s2_with_input_stride)921 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_3x3s2_with_input_stride) {
922 ConvolutionOperatorTester()
923 .batch_size(2)
924 .input_size(27, 29)
925 .kernel_size(3, 3)
926 .padding(1)
927 .subsampling(2)
928 .input_channel_stride(21)
929 .groups(19)
930 .iterations(3)
931 .TestNCHWxF32();
932 }
933
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_3x3s2_with_output_stride)934 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_3x3s2_with_output_stride) {
935 ConvolutionOperatorTester()
936 .batch_size(2)
937 .input_size(27, 29)
938 .kernel_size(3, 3)
939 .padding(1)
940 .subsampling(2)
941 .output_channel_stride(23)
942 .groups(19)
943 .iterations(3)
944 .TestNCHWxF32();
945 }
946
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_3x3s2_with_qmin)947 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_3x3s2_with_qmin) {
948 ConvolutionOperatorTester()
949 .batch_size(2)
950 .input_size(27, 29)
951 .kernel_size(3, 3)
952 .padding(1)
953 .subsampling(2)
954 .groups(19)
955 .qmin(128)
956 .iterations(3)
957 .TestNCHWxF32();
958 }
959
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_3x3s2_with_qmax)960 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_3x3s2_with_qmax) {
961 ConvolutionOperatorTester()
962 .batch_size(2)
963 .input_size(27, 29)
964 .kernel_size(3, 3)
965 .padding(1)
966 .subsampling(2)
967 .groups(19)
968 .qmax(128)
969 .iterations(3)
970 .TestNCHWxF32();
971 }
972
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_3x3s2_without_bias)973 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_3x3s2_without_bias) {
974 ConvolutionOperatorTester()
975 .has_bias(false)
976 .batch_size(2)
977 .input_size(27, 29)
978 .kernel_size(3, 3)
979 .padding(1)
980 .subsampling(2)
981 .groups(19)
982 .iterations(3)
983 .TestNCHWxF32();
984 }
985
986 /**************************** DWCONV 5x5 path ****************************/
987
TEST(CONVOLUTION_NCHW_F32,depthwise_5x5)988 TEST(CONVOLUTION_NCHW_F32, depthwise_5x5) {
989 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
990 ConvolutionOperatorTester()
991 .input_size(27, 29)
992 .kernel_size(5, 5)
993 .padding(2)
994 .groups(19)
995 .iterations(3)
996 .TestNCHWxF32();
997 }
998
TEST(CONVOLUTION_NCHW_F32,depthwise_5x5_zero_weights)999 TEST(CONVOLUTION_NCHW_F32, depthwise_5x5_zero_weights) {
1000 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1001 ConvolutionOperatorTester()
1002 .input_size(27, 29)
1003 .kernel_size(5, 5)
1004 .padding(2)
1005 .groups(19)
1006 .sparsity(1.0f)
1007 .iterations(3)
1008 .TestNCHWxF32();
1009 }
1010
TEST(CONVOLUTION_NCHW_F32,depthwise_5x5_varying_input_height)1011 TEST(CONVOLUTION_NCHW_F32, depthwise_5x5_varying_input_height) {
1012 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1013 for (size_t input_height = 25; input_height <= 31; input_height++) {
1014 ConvolutionOperatorTester()
1015 .input_size(input_height, 29)
1016 .kernel_size(5, 5)
1017 .padding(2)
1018 .groups(19)
1019 .iterations(1)
1020 .TestNCHWxF32();
1021 }
1022 }
1023
TEST(CONVOLUTION_NCHW_F32,depthwise_5x5_varying_input_width)1024 TEST(CONVOLUTION_NCHW_F32, depthwise_5x5_varying_input_width) {
1025 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1026 for (size_t input_width = 27; input_width <= 33; input_width++) {
1027 ConvolutionOperatorTester()
1028 .input_size(27, input_width)
1029 .kernel_size(5, 5)
1030 .padding(2)
1031 .groups(19)
1032 .iterations(1)
1033 .TestNCHWxF32();
1034 }
1035 }
1036
TEST(CONVOLUTION_NCHW_F32,depthwise_5x5_varying_channels)1037 TEST(CONVOLUTION_NCHW_F32, depthwise_5x5_varying_channels) {
1038 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1039 for (size_t channels = 1; channels <= 16; channels *= 4) {
1040 ConvolutionOperatorTester()
1041 .input_size(27, 29)
1042 .kernel_size(5, 5)
1043 .padding(2)
1044 .groups(channels)
1045 .iterations(1)
1046 .TestNCHWxF32();
1047 }
1048 }
1049
TEST(CONVOLUTION_NCHW_F32,depthwise_5x5_with_qmin)1050 TEST(CONVOLUTION_NCHW_F32, depthwise_5x5_with_qmin) {
1051 ConvolutionOperatorTester()
1052 .input_size(27, 29)
1053 .kernel_size(5, 5)
1054 .padding(2)
1055 .groups(19)
1056 .qmin(128)
1057 .iterations(3)
1058 .TestNCHWxF32();
1059 }
1060
TEST(CONVOLUTION_NCHW_F32,depthwise_5x5_with_qmax)1061 TEST(CONVOLUTION_NCHW_F32, depthwise_5x5_with_qmax) {
1062 ConvolutionOperatorTester()
1063 .input_size(27, 29)
1064 .kernel_size(5, 5)
1065 .padding(2)
1066 .groups(19)
1067 .qmax(128)
1068 .iterations(3)
1069 .TestNCHWxF32();
1070 }
1071
TEST(CONVOLUTION_NCHW_F32,depthwise_5x5_without_bias)1072 TEST(CONVOLUTION_NCHW_F32, depthwise_5x5_without_bias) {
1073 ConvolutionOperatorTester()
1074 .has_bias(false)
1075 .input_size(27, 29)
1076 .kernel_size(5, 5)
1077 .padding(2)
1078 .groups(19)
1079 .iterations(3)
1080 .TestNCHWxF32();
1081 }
1082
1083 /**************************** DWCONV 5x5 path, batched ****************************/
1084
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_5x5)1085 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_5x5) {
1086 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1087 ConvolutionOperatorTester()
1088 .batch_size(2)
1089 .input_size(27, 29)
1090 .kernel_size(5, 5)
1091 .padding(2)
1092 .groups(19)
1093 .iterations(3)
1094 .TestNCHWxF32();
1095 }
1096
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_5x5_zero_weights)1097 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_5x5_zero_weights) {
1098 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1099 ConvolutionOperatorTester()
1100 .batch_size(2)
1101 .input_size(27, 29)
1102 .kernel_size(5, 5)
1103 .padding(2)
1104 .groups(19)
1105 .sparsity(1.0f)
1106 .iterations(3)
1107 .TestNCHWxF32();
1108 }
1109
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_5x5_varying_input_height)1110 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_5x5_varying_input_height) {
1111 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1112 for (size_t input_height = 25; input_height <= 31; input_height++) {
1113 ConvolutionOperatorTester()
1114 .batch_size(2)
1115 .input_size(input_height, 29)
1116 .kernel_size(5, 5)
1117 .padding(2)
1118 .groups(19)
1119 .iterations(1)
1120 .TestNCHWxF32();
1121 }
1122 }
1123
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_5x5_varying_input_width)1124 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_5x5_varying_input_width) {
1125 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1126 for (size_t input_width = 27; input_width <= 33; input_width++) {
1127 ConvolutionOperatorTester()
1128 .batch_size(2)
1129 .input_size(27, input_width)
1130 .kernel_size(5, 5)
1131 .padding(2)
1132 .groups(19)
1133 .iterations(1)
1134 .TestNCHWxF32();
1135 }
1136 }
1137
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_5x5_varying_channels)1138 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_5x5_varying_channels) {
1139 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1140 for (size_t channels = 1; channels <= 16; channels *= 4) {
1141 ConvolutionOperatorTester()
1142 .batch_size(2)
1143 .input_size(27, 29)
1144 .kernel_size(5, 5)
1145 .padding(2)
1146 .groups(channels)
1147 .iterations(1)
1148 .TestNCHWxF32();
1149 }
1150 }
1151
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_5x5_with_input_stride)1152 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_5x5_with_input_stride) {
1153 ConvolutionOperatorTester()
1154 .batch_size(2)
1155 .input_size(27, 29)
1156 .kernel_size(5, 5)
1157 .padding(2)
1158 .input_channel_stride(21)
1159 .groups(19)
1160 .iterations(3)
1161 .TestNCHWxF32();
1162 }
1163
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_5x5_with_output_stride)1164 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_5x5_with_output_stride) {
1165 ConvolutionOperatorTester()
1166 .batch_size(2)
1167 .input_size(27, 29)
1168 .kernel_size(5, 5)
1169 .padding(2)
1170 .output_channel_stride(23)
1171 .groups(19)
1172 .iterations(3)
1173 .TestNCHWxF32();
1174 }
1175
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_5x5_with_qmin)1176 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_5x5_with_qmin) {
1177 ConvolutionOperatorTester()
1178 .batch_size(2)
1179 .input_size(27, 29)
1180 .kernel_size(5, 5)
1181 .padding(2)
1182 .groups(19)
1183 .qmin(128)
1184 .iterations(3)
1185 .TestNCHWxF32();
1186 }
1187
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_5x5_with_qmax)1188 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_5x5_with_qmax) {
1189 ConvolutionOperatorTester()
1190 .batch_size(2)
1191 .input_size(27, 29)
1192 .kernel_size(5, 5)
1193 .padding(2)
1194 .groups(19)
1195 .qmax(128)
1196 .iterations(3)
1197 .TestNCHWxF32();
1198 }
1199
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_5x5_without_bias)1200 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_5x5_without_bias) {
1201 ConvolutionOperatorTester()
1202 .has_bias(false)
1203 .batch_size(2)
1204 .input_size(27, 29)
1205 .kernel_size(5, 5)
1206 .padding(2)
1207 .groups(19)
1208 .iterations(3)
1209 .TestNCHWxF32();
1210 }
1211
1212 /**************************** DWCONV 5x5 stride-2 path ****************************/
1213
TEST(CONVOLUTION_NCHW_F32,depthwise_5x5s2)1214 TEST(CONVOLUTION_NCHW_F32, depthwise_5x5s2) {
1215 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1216 ConvolutionOperatorTester()
1217 .input_size(27, 29)
1218 .kernel_size(5, 5)
1219 .padding(2)
1220 .subsampling(2)
1221 .groups(19)
1222 .iterations(3)
1223 .TestNCHWxF32();
1224 }
1225
TEST(CONVOLUTION_NCHW_F32,depthwise_5x5s2_zero_weights)1226 TEST(CONVOLUTION_NCHW_F32, depthwise_5x5s2_zero_weights) {
1227 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1228 ConvolutionOperatorTester()
1229 .input_size(27, 29)
1230 .kernel_size(5, 5)
1231 .padding(2)
1232 .subsampling(2)
1233 .groups(19)
1234 .sparsity(1.0f)
1235 .iterations(3)
1236 .TestNCHWxF32();
1237 }
1238
TEST(CONVOLUTION_NCHW_F32,depthwise_5x5s2_varying_input_height)1239 TEST(CONVOLUTION_NCHW_F32, depthwise_5x5s2_varying_input_height) {
1240 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1241 for (size_t input_height = 25; input_height <= 31; input_height++) {
1242 ConvolutionOperatorTester()
1243 .input_size(input_height, 29)
1244 .kernel_size(5, 5)
1245 .padding(2)
1246 .subsampling(2)
1247 .groups(19)
1248 .iterations(1)
1249 .TestNCHWxF32();
1250 }
1251 }
1252
TEST(CONVOLUTION_NCHW_F32,depthwise_5x5s2_varying_input_width)1253 TEST(CONVOLUTION_NCHW_F32, depthwise_5x5s2_varying_input_width) {
1254 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1255 for (size_t input_width = 27; input_width <= 33; input_width++) {
1256 ConvolutionOperatorTester()
1257 .input_size(27, input_width)
1258 .kernel_size(5, 5)
1259 .padding(2)
1260 .subsampling(2)
1261 .groups(19)
1262 .iterations(1)
1263 .TestNCHWxF32();
1264 }
1265 }
1266
TEST(CONVOLUTION_NCHW_F32,depthwise_5x5s2_varying_channels)1267 TEST(CONVOLUTION_NCHW_F32, depthwise_5x5s2_varying_channels) {
1268 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1269 for (size_t channels = 1; channels <= 16; channels *= 4) {
1270 ConvolutionOperatorTester()
1271 .input_size(27, 29)
1272 .kernel_size(5, 5)
1273 .padding(2)
1274 .subsampling(2)
1275 .groups(channels)
1276 .iterations(1)
1277 .TestNCHWxF32();
1278 }
1279 }
1280
TEST(CONVOLUTION_NCHW_F32,depthwise_5x5s2_with_qmin)1281 TEST(CONVOLUTION_NCHW_F32, depthwise_5x5s2_with_qmin) {
1282 ConvolutionOperatorTester()
1283 .input_size(27, 29)
1284 .kernel_size(5, 5)
1285 .padding(2)
1286 .subsampling(2)
1287 .groups(19)
1288 .qmin(128)
1289 .iterations(3)
1290 .TestNCHWxF32();
1291 }
1292
TEST(CONVOLUTION_NCHW_F32,depthwise_5x5s2_with_qmax)1293 TEST(CONVOLUTION_NCHW_F32, depthwise_5x5s2_with_qmax) {
1294 ConvolutionOperatorTester()
1295 .input_size(27, 29)
1296 .kernel_size(5, 5)
1297 .padding(2)
1298 .subsampling(2)
1299 .groups(19)
1300 .qmax(128)
1301 .iterations(3)
1302 .TestNCHWxF32();
1303 }
1304
TEST(CONVOLUTION_NCHW_F32,depthwise_5x5s2_without_bias)1305 TEST(CONVOLUTION_NCHW_F32, depthwise_5x5s2_without_bias) {
1306 ConvolutionOperatorTester()
1307 .has_bias(false)
1308 .input_size(27, 29)
1309 .kernel_size(5, 5)
1310 .padding(2)
1311 .subsampling(2)
1312 .groups(19)
1313 .iterations(3)
1314 .TestNCHWxF32();
1315 }
1316
1317 /**************************** DWCONV 5x5 stride-2 path, batched ****************************/
1318
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_5x5s2)1319 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_5x5s2) {
1320 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1321 ConvolutionOperatorTester()
1322 .batch_size(2)
1323 .input_size(27, 29)
1324 .kernel_size(5, 5)
1325 .padding(2)
1326 .subsampling(2)
1327 .groups(19)
1328 .iterations(3)
1329 .TestNCHWxF32();
1330 }
1331
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_5x5s2_zero_weights)1332 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_5x5s2_zero_weights) {
1333 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1334 ConvolutionOperatorTester()
1335 .batch_size(2)
1336 .input_size(27, 29)
1337 .kernel_size(5, 5)
1338 .padding(2)
1339 .subsampling(2)
1340 .groups(19)
1341 .sparsity(1.0f)
1342 .iterations(3)
1343 .TestNCHWxF32();
1344 }
1345
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_5x5s2_varying_input_height)1346 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_5x5s2_varying_input_height) {
1347 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1348 for (size_t input_height = 25; input_height <= 31; input_height++) {
1349 ConvolutionOperatorTester()
1350 .batch_size(2)
1351 .input_size(input_height, 29)
1352 .kernel_size(5, 5)
1353 .padding(2)
1354 .subsampling(2)
1355 .groups(19)
1356 .iterations(1)
1357 .TestNCHWxF32();
1358 }
1359 }
1360
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_5x5s2_varying_input_width)1361 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_5x5s2_varying_input_width) {
1362 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1363 for (size_t input_width = 27; input_width <= 33; input_width++) {
1364 ConvolutionOperatorTester()
1365 .batch_size(2)
1366 .input_size(27, input_width)
1367 .kernel_size(5, 5)
1368 .padding(2)
1369 .subsampling(2)
1370 .groups(19)
1371 .iterations(1)
1372 .TestNCHWxF32();
1373 }
1374 }
1375
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_5x5s2_varying_channels)1376 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_5x5s2_varying_channels) {
1377 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1378 for (size_t channels = 1; channels <= 16; channels *= 4) {
1379 ConvolutionOperatorTester()
1380 .batch_size(2)
1381 .input_size(27, 29)
1382 .kernel_size(5, 5)
1383 .padding(2)
1384 .subsampling(2)
1385 .groups(channels)
1386 .iterations(1)
1387 .TestNCHWxF32();
1388 }
1389 }
1390
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_5x5s2_with_input_stride)1391 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_5x5s2_with_input_stride) {
1392 ConvolutionOperatorTester()
1393 .batch_size(2)
1394 .input_size(27, 29)
1395 .kernel_size(5, 5)
1396 .padding(2)
1397 .subsampling(2)
1398 .input_channel_stride(21)
1399 .groups(19)
1400 .iterations(3)
1401 .TestNCHWxF32();
1402 }
1403
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_5x5s2_with_output_stride)1404 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_5x5s2_with_output_stride) {
1405 ConvolutionOperatorTester()
1406 .batch_size(2)
1407 .input_size(27, 29)
1408 .kernel_size(5, 5)
1409 .padding(2)
1410 .subsampling(2)
1411 .output_channel_stride(23)
1412 .groups(19)
1413 .iterations(3)
1414 .TestNCHWxF32();
1415 }
1416
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_5x5s2_with_qmin)1417 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_5x5s2_with_qmin) {
1418 ConvolutionOperatorTester()
1419 .batch_size(2)
1420 .input_size(27, 29)
1421 .kernel_size(5, 5)
1422 .padding(2)
1423 .subsampling(2)
1424 .groups(19)
1425 .qmin(128)
1426 .iterations(3)
1427 .TestNCHWxF32();
1428 }
1429
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_5x5s2_with_qmax)1430 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_5x5s2_with_qmax) {
1431 ConvolutionOperatorTester()
1432 .batch_size(2)
1433 .input_size(27, 29)
1434 .kernel_size(5, 5)
1435 .padding(2)
1436 .subsampling(2)
1437 .groups(19)
1438 .qmax(128)
1439 .iterations(3)
1440 .TestNCHWxF32();
1441 }
1442
TEST(CONVOLUTION_NCHW_F32,batched_depthwise_5x5s2_without_bias)1443 TEST(CONVOLUTION_NCHW_F32, batched_depthwise_5x5s2_without_bias) {
1444 ConvolutionOperatorTester()
1445 .has_bias(false)
1446 .batch_size(2)
1447 .input_size(27, 29)
1448 .kernel_size(5, 5)
1449 .padding(2)
1450 .subsampling(2)
1451 .groups(19)
1452 .iterations(3)
1453 .TestNCHWxF32();
1454 }
1455
1456 /**************************** DWCONV 3x3 path ****************************/
1457
1458 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, 3x3) {
1459 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1460 ConvolutionOperatorTester()
1461 .depthwise_layout(true)
1462 .input_size(27, 29)
1463 .kernel_size(3, 3)
1464 .padding(1)
1465 .groups(19)
1466 .iterations(3)
1467 .TestNCHWxF32();
1468 }
1469
1470 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, 3x3_varying_channels) {
1471 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1472 for (size_t channels = 1; channels <= 16; channels *= 4) {
1473 ConvolutionOperatorTester()
1474 .depthwise_layout(true)
1475 .input_size(27, 29)
1476 .kernel_size(3, 3)
1477 .padding(1)
1478 .groups(channels)
1479 .iterations(1)
1480 .TestNCHWxF32();
1481 }
1482 }
1483
1484 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, 3x3_without_bias) {
1485 ConvolutionOperatorTester()
1486 .depthwise_layout(true)
1487 .has_bias(false)
1488 .input_size(27, 29)
1489 .kernel_size(3, 3)
1490 .padding(1)
1491 .groups(19)
1492 .iterations(3)
1493 .TestNCHWxF32();
1494 }
1495
1496 /**************************** DWCONV 3x3 path, batched ****************************/
1497
TEST(DEPTHWISE_CONVOLUTION_NCHW_F32,batched_3x3)1498 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, batched_3x3) {
1499 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1500 ConvolutionOperatorTester()
1501 .depthwise_layout(true)
1502 .batch_size(2)
1503 .input_size(27, 29)
1504 .kernel_size(3, 3)
1505 .padding(1)
1506 .groups(19)
1507 .iterations(3)
1508 .TestNCHWxF32();
1509 }
1510
TEST(DEPTHWISE_CONVOLUTION_NCHW_F32,batched_3x3_varying_channels)1511 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, batched_3x3_varying_channels) {
1512 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1513 for (size_t channels = 1; channels <= 16; channels *= 4) {
1514 ConvolutionOperatorTester()
1515 .depthwise_layout(true)
1516 .batch_size(2)
1517 .input_size(27, 29)
1518 .kernel_size(3, 3)
1519 .padding(1)
1520 .groups(channels)
1521 .iterations(1)
1522 .TestNCHWxF32();
1523 }
1524 }
1525
TEST(DEPTHWISE_CONVOLUTION_NCHW_F32,batched_3x3_without_bias)1526 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, batched_3x3_without_bias) {
1527 ConvolutionOperatorTester()
1528 .depthwise_layout(true)
1529 .has_bias(false)
1530 .batch_size(2)
1531 .input_size(27, 29)
1532 .kernel_size(3, 3)
1533 .padding(1)
1534 .groups(19)
1535 .iterations(3)
1536 .TestNCHWxF32();
1537 }
1538
1539 /**************************** DWCONV 3x3 stride-2 path ****************************/
1540
1541 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, 3x3s2) {
1542 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1543 ConvolutionOperatorTester()
1544 .depthwise_layout(true)
1545 .input_size(27, 29)
1546 .kernel_size(3, 3)
1547 .padding(1)
1548 .subsampling(2)
1549 .groups(19)
1550 .iterations(3)
1551 .TestNCHWxF32();
1552 }
1553
1554 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, 3x3s2_varying_channels) {
1555 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1556 for (size_t channels = 1; channels <= 16; channels *= 4) {
1557 ConvolutionOperatorTester()
1558 .depthwise_layout(true)
1559 .input_size(27, 29)
1560 .kernel_size(3, 3)
1561 .padding(1)
1562 .subsampling(2)
1563 .groups(channels)
1564 .iterations(1)
1565 .TestNCHWxF32();
1566 }
1567 }
1568
1569 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, 3x3s2_without_bias) {
1570 ConvolutionOperatorTester()
1571 .depthwise_layout(true)
1572 .has_bias(false)
1573 .input_size(27, 29)
1574 .kernel_size(3, 3)
1575 .padding(1)
1576 .subsampling(2)
1577 .groups(19)
1578 .iterations(3)
1579 .TestNCHWxF32();
1580 }
1581
1582 /**************************** DWCONV 3x3 stride-2 path, batched ****************************/
1583
TEST(DEPTHWISE_CONVOLUTION_NCHW_F32,batched_3x3s2)1584 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, batched_3x3s2) {
1585 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1586 ConvolutionOperatorTester()
1587 .depthwise_layout(true)
1588 .batch_size(2)
1589 .input_size(27, 29)
1590 .kernel_size(3, 3)
1591 .padding(1)
1592 .subsampling(2)
1593 .groups(19)
1594 .iterations(3)
1595 .TestNCHWxF32();
1596 }
1597
TEST(DEPTHWISE_CONVOLUTION_NCHW_F32,batched_3x3s2_varying_channels)1598 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, batched_3x3s2_varying_channels) {
1599 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1600 for (size_t channels = 1; channels <= 16; channels *= 4) {
1601 ConvolutionOperatorTester()
1602 .depthwise_layout(true)
1603 .batch_size(2)
1604 .input_size(27, 29)
1605 .kernel_size(3, 3)
1606 .padding(1)
1607 .subsampling(2)
1608 .groups(channels)
1609 .iterations(1)
1610 .TestNCHWxF32();
1611 }
1612 }
1613
TEST(DEPTHWISE_CONVOLUTION_NCHW_F32,batched_3x3s2_without_bias)1614 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, batched_3x3s2_without_bias) {
1615 ConvolutionOperatorTester()
1616 .depthwise_layout(true)
1617 .has_bias(false)
1618 .batch_size(2)
1619 .input_size(27, 29)
1620 .kernel_size(3, 3)
1621 .padding(1)
1622 .subsampling(2)
1623 .groups(19)
1624 .iterations(3)
1625 .TestNCHWxF32();
1626 }
1627
1628 /**************************** DWCONV 5x5 path ****************************/
1629
1630 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, 5x5) {
1631 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1632 ConvolutionOperatorTester()
1633 .depthwise_layout(true)
1634 .input_size(27, 29)
1635 .kernel_size(5, 5)
1636 .padding(2)
1637 .groups(19)
1638 .iterations(3)
1639 .TestNCHWxF32();
1640 }
1641
1642 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, 5x5_varying_channels) {
1643 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1644 for (size_t channels = 1; channels <= 16; channels *= 4) {
1645 ConvolutionOperatorTester()
1646 .depthwise_layout(true)
1647 .input_size(27, 29)
1648 .kernel_size(5, 5)
1649 .padding(2)
1650 .groups(channels)
1651 .iterations(1)
1652 .TestNCHWxF32();
1653 }
1654 }
1655
1656 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, 5x5_without_bias) {
1657 ConvolutionOperatorTester()
1658 .depthwise_layout(true)
1659 .has_bias(false)
1660 .input_size(27, 29)
1661 .kernel_size(5, 5)
1662 .padding(2)
1663 .groups(19)
1664 .iterations(3)
1665 .TestNCHWxF32();
1666 }
1667
1668 /**************************** DWCONV 5x5 path, batched ****************************/
1669
TEST(DEPTHWISE_CONVOLUTION_NCHW_F32,batched_5x5)1670 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, batched_5x5) {
1671 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1672 ConvolutionOperatorTester()
1673 .depthwise_layout(true)
1674 .batch_size(2)
1675 .input_size(27, 29)
1676 .kernel_size(5, 5)
1677 .padding(2)
1678 .groups(19)
1679 .iterations(3)
1680 .TestNCHWxF32();
1681 }
1682
TEST(DEPTHWISE_CONVOLUTION_NCHW_F32,batched_5x5_varying_channels)1683 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, batched_5x5_varying_channels) {
1684 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1685 for (size_t channels = 1; channels <= 16; channels *= 4) {
1686 ConvolutionOperatorTester()
1687 .depthwise_layout(true)
1688 .batch_size(2)
1689 .input_size(27, 29)
1690 .kernel_size(5, 5)
1691 .padding(2)
1692 .groups(channels)
1693 .iterations(1)
1694 .TestNCHWxF32();
1695 }
1696 }
1697
TEST(DEPTHWISE_CONVOLUTION_NCHW_F32,batched_5x5_without_bias)1698 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, batched_5x5_without_bias) {
1699 ConvolutionOperatorTester()
1700 .depthwise_layout(true)
1701 .has_bias(false)
1702 .batch_size(2)
1703 .input_size(27, 29)
1704 .kernel_size(5, 5)
1705 .padding(2)
1706 .groups(19)
1707 .iterations(3)
1708 .TestNCHWxF32();
1709 }
1710
1711 /**************************** DWCONV 5x5 stride-2 path ****************************/
1712
1713 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, 5x5s2) {
1714 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1715 ConvolutionOperatorTester()
1716 .depthwise_layout(true)
1717 .input_size(27, 29)
1718 .kernel_size(5, 5)
1719 .padding(2)
1720 .subsampling(2)
1721 .groups(19)
1722 .iterations(3)
1723 .TestNCHWxF32();
1724 }
1725
1726 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, 5x5s2_varying_channels) {
1727 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1728 for (size_t channels = 1; channels <= 16; channels *= 4) {
1729 ConvolutionOperatorTester()
1730 .depthwise_layout(true)
1731 .input_size(27, 29)
1732 .kernel_size(5, 5)
1733 .padding(2)
1734 .subsampling(2)
1735 .groups(channels)
1736 .iterations(1)
1737 .TestNCHWxF32();
1738 }
1739 }
1740
1741 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, 5x5s2_without_bias) {
1742 ConvolutionOperatorTester()
1743 .depthwise_layout(true)
1744 .has_bias(false)
1745 .input_size(27, 29)
1746 .kernel_size(5, 5)
1747 .padding(2)
1748 .subsampling(2)
1749 .groups(19)
1750 .iterations(3)
1751 .TestNCHWxF32();
1752 }
1753
1754 /**************************** DWCONV 5x5 stride-2 path, batched ****************************/
1755
TEST(DEPTHWISE_CONVOLUTION_NCHW_F32,batched_5x5s2)1756 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, batched_5x5s2) {
1757 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1758 ConvolutionOperatorTester()
1759 .depthwise_layout(true)
1760 .batch_size(2)
1761 .input_size(27, 29)
1762 .kernel_size(5, 5)
1763 .padding(2)
1764 .subsampling(2)
1765 .groups(19)
1766 .iterations(3)
1767 .TestNCHWxF32();
1768 }
1769
TEST(DEPTHWISE_CONVOLUTION_NCHW_F32,batched_5x5s2_varying_channels)1770 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, batched_5x5s2_varying_channels) {
1771 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1772 for (size_t channels = 1; channels <= 16; channels *= 4) {
1773 ConvolutionOperatorTester()
1774 .depthwise_layout(true)
1775 .batch_size(2)
1776 .input_size(27, 29)
1777 .kernel_size(5, 5)
1778 .padding(2)
1779 .subsampling(2)
1780 .groups(channels)
1781 .iterations(1)
1782 .TestNCHWxF32();
1783 }
1784 }
1785
TEST(DEPTHWISE_CONVOLUTION_NCHW_F32,batched_5x5s2_without_bias)1786 TEST(DEPTHWISE_CONVOLUTION_NCHW_F32, batched_5x5s2_without_bias) {
1787 ConvolutionOperatorTester()
1788 .depthwise_layout(true)
1789 .has_bias(false)
1790 .batch_size(2)
1791 .input_size(27, 29)
1792 .kernel_size(5, 5)
1793 .padding(2)
1794 .subsampling(2)
1795 .groups(19)
1796 .iterations(3)
1797 .TestNCHWxF32();
1798 }
1799