blob: 688b79940daf4c8219e1a042eb693163f51e7d69 [file] [log] [blame]
XNNPACK Teamb455b122019-09-27 18:10:33 -07001// 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 <xnnpack/params.h>
9
10#include "deconvolution-operator-tester.h"
11
12
Marat Dukhana41533d2019-11-04 10:40:51 -080013constexpr size_t kUnstridedInputHeight = 8;
14constexpr size_t kUnstridedInputWidth = 7;
15constexpr size_t kStridedInputHeight = 6;
16constexpr size_t kStridedInputWidth = 5;
17
18
XNNPACK Teamb455b122019-09-27 18:10:33 -070019/**************************** Future GEMM path ****************************/
20
Marat Dukhan08b7a972020-07-14 18:17:29 -070021TEST(DECONVOLUTION_NHWC_QU8, 1x1) {
Marat Dukhan04f03be2019-11-19 12:36:47 -080022 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -070023 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -080024 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -070025 .kernel_size(1, 1)
26 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -070027 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -070028 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -070029 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -070030}
31
Marat Dukhan08b7a972020-07-14 18:17:29 -070032TEST(DECONVOLUTION_NHWC_QU8, 1x1_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -080033 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -080034 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -070035 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -080036 .input_size(input_height, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -070037 .kernel_size(1, 1)
38 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -070039 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -070040 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -070041 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -070042 }
43}
44
Marat Dukhan08b7a972020-07-14 18:17:29 -070045TEST(DECONVOLUTION_NHWC_QU8, 1x1_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -080046 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -080047 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -070048 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -080049 .input_size(kUnstridedInputHeight, input_width)
XNNPACK Teamb455b122019-09-27 18:10:33 -070050 .kernel_size(1, 1)
51 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -070052 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -070053 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -070054 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -070055 }
56}
57
Marat Dukhan08b7a972020-07-14 18:17:29 -070058TEST(DECONVOLUTION_NHWC_QU8, 1x1_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -080059 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -070060 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
61 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -080062 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -070063 .kernel_size(1, 1)
64 .group_input_channels(input_channels)
Marat Dukhan08b7a972020-07-14 18:17:29 -070065 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -070066 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -070067 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -070068 }
69}
70
Marat Dukhan08b7a972020-07-14 18:17:29 -070071TEST(DECONVOLUTION_NHWC_QU8, 1x1_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -080072 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan08b7a972020-07-14 18:17:29 -070073 for (size_t output_channels = 1; output_channels <= xnn_params.qu8.gemm.nr * 2; output_channels *= 2) {
XNNPACK Teamb455b122019-09-27 18:10:33 -070074 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -080075 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -070076 .kernel_size(1, 1)
77 .group_input_channels(23)
78 .group_output_channels(output_channels)
79 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -070080 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -070081 }
82}
83
Marat Dukhan08b7a972020-07-14 18:17:29 -070084TEST(DECONVOLUTION_NHWC_QU8, 1x1_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -080085 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -070086 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -080087 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -070088 .kernel_size(1, 1)
89 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -070090 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -070091 .input_pixel_stride(28)
92 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -070093 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -070094}
95
Marat Dukhan08b7a972020-07-14 18:17:29 -070096TEST(DECONVOLUTION_NHWC_QU8, 1x1_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -080097 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -070098 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -080099 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700100 .kernel_size(1, 1)
101 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700102 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
103 .output_pixel_stride(xnn_params.qu8.gemm.nr * 2 + 13)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700104 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700105 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700106}
107
Marat Dukhan08b7a972020-07-14 18:17:29 -0700108TEST(DECONVOLUTION_NHWC_QU8, 1x1_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800109 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700110 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800111 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700112 .kernel_size(1, 1)
113 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700114 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700115 .qmin(128)
116 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700117 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700118}
119
Marat Dukhan08b7a972020-07-14 18:17:29 -0700120TEST(DECONVOLUTION_NHWC_QU8, 1x1_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800121 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700122 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800123 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700124 .kernel_size(1, 1)
125 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700126 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -0700127 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700128 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700129 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700130}
131
Marat Dukhan08b7a972020-07-14 18:17:29 -0700132TEST(DECONVOLUTION_NHWC_QU8, 1x1_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800133 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -0700134 DeconvolutionOperatorTester()
135 .has_bias(false)
Marat Dukhana41533d2019-11-04 10:40:51 -0800136 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -0700137 .kernel_size(1, 1)
138 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700139 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanf568f082019-10-30 09:47:07 -0700140 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700141 .TestQU8();
Marat Dukhanf568f082019-10-30 09:47:07 -0700142}
143
XNNPACK Teamb455b122019-09-27 18:10:33 -0700144/**************************** Future GEMM path, grouped ****************************/
145
Marat Dukhan08b7a972020-07-14 18:17:29 -0700146TEST(DECONVOLUTION_NHWC_QU8, grouped_1x1) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800147 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700148 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800149 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700150 .kernel_size(1, 1)
151 .groups(2)
152 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700153 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700154 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700155 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700156}
157
Marat Dukhan08b7a972020-07-14 18:17:29 -0700158TEST(DECONVOLUTION_NHWC_QU8, grouped_1x1_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800159 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -0800160 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -0700161 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800162 .input_size(input_height, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700163 .kernel_size(1, 1)
164 .groups(2)
165 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700166 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700167 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700168 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700169 }
170}
171
Marat Dukhan08b7a972020-07-14 18:17:29 -0700172TEST(DECONVOLUTION_NHWC_QU8, grouped_1x1_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800173 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -0800174 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -0700175 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800176 .input_size(kUnstridedInputHeight, input_width)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700177 .kernel_size(1, 1)
178 .groups(2)
179 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700180 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700181 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700182 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700183 }
184}
185
Marat Dukhan08b7a972020-07-14 18:17:29 -0700186TEST(DECONVOLUTION_NHWC_QU8, grouped_1x1_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800187 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700188 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
189 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800190 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700191 .kernel_size(1, 1)
192 .groups(2)
193 .group_input_channels(input_channels)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700194 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700195 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700196 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700197 }
198}
199
Marat Dukhan08b7a972020-07-14 18:17:29 -0700200TEST(DECONVOLUTION_NHWC_QU8, grouped_1x1_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800201 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan08b7a972020-07-14 18:17:29 -0700202 for (size_t output_channels = 1; output_channels <= xnn_params.qu8.gemm.nr * 2; output_channels *= 2) {
XNNPACK Teamb455b122019-09-27 18:10:33 -0700203 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800204 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700205 .kernel_size(1, 1)
206 .groups(2)
207 .group_input_channels(23)
208 .group_output_channels(output_channels)
209 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700210 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700211 }
212}
213
Marat Dukhan08b7a972020-07-14 18:17:29 -0700214TEST(DECONVOLUTION_NHWC_QU8, grouped_1x1_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800215 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700216 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800217 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700218 .kernel_size(1, 1)
219 .groups(2)
220 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700221 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700222 .input_pixel_stride(47)
223 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700224 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700225}
226
Marat Dukhan08b7a972020-07-14 18:17:29 -0700227TEST(DECONVOLUTION_NHWC_QU8, grouped_1x1_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800228 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700229 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800230 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700231 .kernel_size(1, 1)
232 .groups(2)
233 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700234 .group_output_channels(xnn_params.qu8.gemm.nr + 3)
235 .output_pixel_stride(xnn_params.qu8.gemm.nr * 2 + 13)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700236 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700237 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700238}
239
Marat Dukhan08b7a972020-07-14 18:17:29 -0700240TEST(DECONVOLUTION_NHWC_QU8, grouped_1x1_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800241 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700242 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800243 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700244 .kernel_size(1, 1)
245 .groups(2)
246 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700247 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700248 .qmin(128)
249 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700250 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700251}
252
Marat Dukhan08b7a972020-07-14 18:17:29 -0700253TEST(DECONVOLUTION_NHWC_QU8, grouped_1x1_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800254 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700255 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800256 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700257 .kernel_size(1, 1)
258 .groups(2)
259 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700260 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -0700261 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700262 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700263 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700264}
265
Marat Dukhan08b7a972020-07-14 18:17:29 -0700266TEST(DECONVOLUTION_NHWC_QU8, grouped_1x1_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800267 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -0700268 DeconvolutionOperatorTester()
269 .has_bias(false)
Marat Dukhana41533d2019-11-04 10:40:51 -0800270 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -0700271 .kernel_size(1, 1)
272 .groups(2)
273 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700274 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanf568f082019-10-30 09:47:07 -0700275 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700276 .TestQU8();
Marat Dukhanf568f082019-10-30 09:47:07 -0700277}
278
XNNPACK Teamb455b122019-09-27 18:10:33 -0700279/**************************** Future GEMM path, batched ****************************/
280
Marat Dukhan08b7a972020-07-14 18:17:29 -0700281TEST(DECONVOLUTION_NHWC_QU8, batched_1x1) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800282 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700283 DeconvolutionOperatorTester()
284 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -0800285 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700286 .kernel_size(1, 1)
287 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700288 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700289 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700290 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700291}
292
Marat Dukhan08b7a972020-07-14 18:17:29 -0700293TEST(DECONVOLUTION_NHWC_QU8, batched_1x1_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800294 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -0800295 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -0700296 DeconvolutionOperatorTester()
297 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -0800298 .input_size(input_height, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700299 .kernel_size(1, 1)
300 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700301 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700302 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700303 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700304 }
305}
306
Marat Dukhan08b7a972020-07-14 18:17:29 -0700307TEST(DECONVOLUTION_NHWC_QU8, batched_1x1_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800308 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -0800309 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -0700310 DeconvolutionOperatorTester()
311 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -0800312 .input_size(kUnstridedInputHeight, input_width)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700313 .kernel_size(1, 1)
314 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700315 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700316 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700317 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700318 }
319}
320
Marat Dukhan08b7a972020-07-14 18:17:29 -0700321TEST(DECONVOLUTION_NHWC_QU8, batched_1x1_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800322 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700323 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
324 DeconvolutionOperatorTester()
325 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -0800326 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700327 .kernel_size(1, 1)
328 .group_input_channels(input_channels)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700329 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700330 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700331 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700332 }
333}
334
Marat Dukhan08b7a972020-07-14 18:17:29 -0700335TEST(DECONVOLUTION_NHWC_QU8, batched_1x1_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800336 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan08b7a972020-07-14 18:17:29 -0700337 for (size_t output_channels = 1; output_channels <= xnn_params.qu8.gemm.nr * 2; output_channels *= 2) {
XNNPACK Teamb455b122019-09-27 18:10:33 -0700338 DeconvolutionOperatorTester()
339 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -0800340 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700341 .kernel_size(1, 1)
342 .group_input_channels(23)
343 .group_output_channels(output_channels)
344 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700345 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700346 }
347}
348
Marat Dukhan08b7a972020-07-14 18:17:29 -0700349TEST(DECONVOLUTION_NHWC_QU8, batched_1x1_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800350 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700351 DeconvolutionOperatorTester()
352 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -0800353 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700354 .kernel_size(1, 1)
355 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700356 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700357 .input_pixel_stride(28)
358 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700359 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700360}
361
Marat Dukhan08b7a972020-07-14 18:17:29 -0700362TEST(DECONVOLUTION_NHWC_QU8, batched_1x1_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800363 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700364 DeconvolutionOperatorTester()
365 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -0800366 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700367 .kernel_size(1, 1)
368 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700369 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
370 .output_pixel_stride(xnn_params.qu8.gemm.nr * 2 + 13)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700371 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700372 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700373}
374
Marat Dukhan08b7a972020-07-14 18:17:29 -0700375TEST(DECONVOLUTION_NHWC_QU8, batched_1x1_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800376 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700377 DeconvolutionOperatorTester()
378 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -0800379 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700380 .kernel_size(1, 1)
381 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700382 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700383 .qmin(128)
384 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700385 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700386}
387
Marat Dukhan08b7a972020-07-14 18:17:29 -0700388TEST(DECONVOLUTION_NHWC_QU8, batched_1x1_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800389 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700390 DeconvolutionOperatorTester()
391 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -0800392 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700393 .kernel_size(1, 1)
394 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700395 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -0700396 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700397 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700398 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700399}
400
Marat Dukhan08b7a972020-07-14 18:17:29 -0700401TEST(DECONVOLUTION_NHWC_QU8, batched_1x1_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800402 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -0700403 DeconvolutionOperatorTester()
404 .has_bias(false)
405 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -0800406 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -0700407 .kernel_size(1, 1)
408 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700409 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanf568f082019-10-30 09:47:07 -0700410 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700411 .TestQU8();
Marat Dukhanf568f082019-10-30 09:47:07 -0700412}
413
XNNPACK Teamb455b122019-09-27 18:10:33 -0700414/**************************** Future GEMM path, batched, grouped ****************************/
415
Marat Dukhan08b7a972020-07-14 18:17:29 -0700416TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_1x1) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800417 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700418 DeconvolutionOperatorTester()
419 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -0800420 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700421 .kernel_size(1, 1)
422 .groups(2)
423 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700424 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700425 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700426 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700427}
428
Marat Dukhan08b7a972020-07-14 18:17:29 -0700429TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_1x1_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800430 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -0800431 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -0700432 DeconvolutionOperatorTester()
433 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -0800434 .input_size(input_height, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700435 .kernel_size(1, 1)
436 .groups(2)
437 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700438 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700439 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700440 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700441 }
442}
443
Marat Dukhan08b7a972020-07-14 18:17:29 -0700444TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_1x1_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800445 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -0800446 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -0700447 DeconvolutionOperatorTester()
448 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -0800449 .input_size(kUnstridedInputHeight, input_width)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700450 .kernel_size(1, 1)
451 .groups(2)
452 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700453 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700454 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700455 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700456 }
457}
458
Marat Dukhan08b7a972020-07-14 18:17:29 -0700459TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_1x1_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800460 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700461 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
462 DeconvolutionOperatorTester()
463 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -0800464 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700465 .kernel_size(1, 1)
466 .groups(2)
467 .group_input_channels(input_channels)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700468 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700469 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700470 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700471 }
472}
473
Marat Dukhan08b7a972020-07-14 18:17:29 -0700474TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_1x1_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800475 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan08b7a972020-07-14 18:17:29 -0700476 for (size_t output_channels = 1; output_channels <= xnn_params.qu8.gemm.nr * 2; output_channels *= 2) {
XNNPACK Teamb455b122019-09-27 18:10:33 -0700477 DeconvolutionOperatorTester()
478 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -0800479 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700480 .kernel_size(1, 1)
481 .groups(2)
482 .group_input_channels(23)
483 .group_output_channels(output_channels)
484 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700485 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700486 }
487}
488
Marat Dukhan08b7a972020-07-14 18:17:29 -0700489TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_1x1_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800490 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700491 DeconvolutionOperatorTester()
492 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -0800493 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700494 .kernel_size(1, 1)
495 .groups(2)
496 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700497 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700498 .input_pixel_stride(47)
499 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700500 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700501}
502
Marat Dukhan08b7a972020-07-14 18:17:29 -0700503TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_1x1_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800504 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700505 DeconvolutionOperatorTester()
506 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -0800507 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700508 .kernel_size(1, 1)
509 .groups(2)
510 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700511 .group_output_channels(xnn_params.qu8.gemm.nr + 3)
512 .output_pixel_stride(xnn_params.qu8.gemm.nr * 2 + 13)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700513 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700514 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700515}
516
Marat Dukhan08b7a972020-07-14 18:17:29 -0700517TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_1x1_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800518 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700519 DeconvolutionOperatorTester()
520 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -0800521 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700522 .kernel_size(1, 1)
523 .groups(2)
524 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700525 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700526 .qmin(128)
527 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700528 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700529}
530
Marat Dukhan08b7a972020-07-14 18:17:29 -0700531TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_1x1_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800532 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700533 DeconvolutionOperatorTester()
534 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -0800535 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700536 .kernel_size(1, 1)
537 .groups(2)
538 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700539 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -0700540 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700541 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700542 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700543}
544
Marat Dukhan08b7a972020-07-14 18:17:29 -0700545TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_1x1_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800546 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -0700547 DeconvolutionOperatorTester()
548 .has_bias(false)
549 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -0800550 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -0700551 .kernel_size(1, 1)
552 .groups(2)
553 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700554 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanf568f082019-10-30 09:47:07 -0700555 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700556 .TestQU8();
Marat Dukhanf568f082019-10-30 09:47:07 -0700557}
558
XNNPACK Teamb455b122019-09-27 18:10:33 -0700559/**************************** CONV path ****************************/
560
Marat Dukhan08b7a972020-07-14 18:17:29 -0700561TEST(DECONVOLUTION_NHWC_QU8, 3x3) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800562 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700563 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800564 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700565 .padding(1)
566 .kernel_size(3, 3)
567 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700568 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700569 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700570 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700571}
572
Marat Dukhan08b7a972020-07-14 18:17:29 -0700573TEST(DECONVOLUTION_NHWC_QU8, Kx3) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800574 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700575 for (size_t kernel_height = 1; kernel_height <= 4; kernel_height *= 2) {
576 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800577 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700578 .padding_width(1)
579 .kernel_size(kernel_height, 3)
580 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700581 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700582 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700583 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700584 }
585}
586
Marat Dukhan08b7a972020-07-14 18:17:29 -0700587TEST(DECONVOLUTION_NHWC_QU8, 3xK) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800588 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700589 for (size_t kernel_width = 1; kernel_width <= 4; kernel_width *= 2) {
590 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800591 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700592 .padding_height(1)
593 .kernel_size(3, kernel_width)
594 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700595 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700596 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700597 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700598 }
599}
600
Marat Dukhan08b7a972020-07-14 18:17:29 -0700601TEST(DECONVOLUTION_NHWC_QU8, 3x3_varying_height_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800602 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700603 for (size_t padding_top = 0; padding_top <= 2; padding_top++) {
604 for (size_t padding_bottom = 0; padding_bottom <= 2; padding_bottom++) {
605 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800606 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700607 .padding_width(1)
608 .padding_top(padding_top)
609 .padding_bottom(padding_bottom)
610 .kernel_size(3, 3)
611 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700612 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700613 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700614 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700615 }
616 }
617}
618
Marat Dukhan08b7a972020-07-14 18:17:29 -0700619TEST(DECONVOLUTION_NHWC_QU8, 3x3_varying_width_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800620 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700621 for (size_t padding_left = 0; padding_left <= 2; padding_left++) {
622 for (size_t padding_right = 0; padding_right <= 2; padding_right++) {
623 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800624 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700625 .padding_height(1)
626 .padding_left(padding_left)
627 .padding_right(padding_right)
628 .kernel_size(3, 3)
629 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700630 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700631 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700632 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700633 }
634 }
635}
636
Marat Dukhan08b7a972020-07-14 18:17:29 -0700637TEST(DECONVOLUTION_NHWC_QU8, 3x3_varying_height_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800638 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700639 for (size_t adjustment_height = 1; adjustment_height <= 2; adjustment_height++) {
640 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800641 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700642 .padding(1)
Marat Dukhan1898b912019-11-05 12:25:18 -0800643 .stride_height(adjustment_height + 1)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700644 .adjustment_height(adjustment_height)
645 .kernel_size(3, 3)
646 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700647 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700648 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700649 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700650 }
651}
652
Marat Dukhan08b7a972020-07-14 18:17:29 -0700653TEST(DECONVOLUTION_NHWC_QU8, 3x3_varying_width_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800654 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700655 for (size_t adjustment_width = 1; adjustment_width <= 2; adjustment_width++) {
656 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800657 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700658 .padding(1)
Marat Dukhan1898b912019-11-05 12:25:18 -0800659 .stride_width(adjustment_width + 1)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700660 .adjustment_width(adjustment_width)
661 .kernel_size(3, 3)
662 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700663 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700664 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700665 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700666 }
667}
668
Marat Dukhan08b7a972020-07-14 18:17:29 -0700669TEST(DECONVOLUTION_NHWC_QU8, 3x3_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800670 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -0800671 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -0700672 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800673 .input_size(input_height, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700674 .padding(1)
675 .kernel_size(3, 3)
676 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700677 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700678 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700679 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700680 }
681}
682
Marat Dukhan08b7a972020-07-14 18:17:29 -0700683TEST(DECONVOLUTION_NHWC_QU8, 3x3_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800684 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -0800685 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -0700686 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800687 .input_size(kUnstridedInputHeight, input_width)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700688 .padding(1)
689 .kernel_size(3, 3)
690 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700691 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700692 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700693 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700694 }
695}
696
Marat Dukhan08b7a972020-07-14 18:17:29 -0700697TEST(DECONVOLUTION_NHWC_QU8, 3x3_varying_input_height_with_tf_same_padding) {
Marat Dukhan58717032020-04-28 15:03:28 -0700698 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
699 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
700 DeconvolutionOperatorTester()
701 .input_size(input_height, kUnstridedInputWidth)
702 .padding_tf_same(true)
703 .kernel_size(3, 3)
704 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700705 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan58717032020-04-28 15:03:28 -0700706 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700707 .TestQU8();
Marat Dukhan58717032020-04-28 15:03:28 -0700708 }
709}
710
Marat Dukhan08b7a972020-07-14 18:17:29 -0700711TEST(DECONVOLUTION_NHWC_QU8, 3x3_varying_input_width_with_tf_same_padding) {
Marat Dukhan58717032020-04-28 15:03:28 -0700712 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
713 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
714 DeconvolutionOperatorTester()
715 .input_size(kUnstridedInputHeight, input_width)
716 .padding_tf_same(true)
717 .kernel_size(3, 3)
718 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700719 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan58717032020-04-28 15:03:28 -0700720 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700721 .TestQU8();
Marat Dukhan58717032020-04-28 15:03:28 -0700722 }
723}
724
Marat Dukhan08b7a972020-07-14 18:17:29 -0700725TEST(DECONVOLUTION_NHWC_QU8, 3x3_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800726 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700727 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
728 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800729 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700730 .padding(1)
731 .kernel_size(3, 3)
732 .group_input_channels(input_channels)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700733 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700734 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700735 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700736 }
737}
738
Marat Dukhan08b7a972020-07-14 18:17:29 -0700739TEST(DECONVOLUTION_NHWC_QU8, 3x3_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800740 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan08b7a972020-07-14 18:17:29 -0700741 for (size_t output_channels = 1; output_channels <= xnn_params.qu8.gemm.nr * 2; output_channels *= 2) {
XNNPACK Teamb455b122019-09-27 18:10:33 -0700742 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800743 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700744 .padding(1)
745 .kernel_size(3, 3)
746 .group_input_channels(23)
747 .group_output_channels(output_channels)
748 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700749 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700750 }
751}
752
Marat Dukhan08b7a972020-07-14 18:17:29 -0700753TEST(DECONVOLUTION_NHWC_QU8, 3x3_with_height_dilation) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800754 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700755 for (size_t dilation_height = 2; dilation_height <= 3; dilation_height++) {
756 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800757 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700758 .padding(1)
759 .kernel_size(3, 3)
760 .dilation_height(dilation_height)
761 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700762 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700763 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700764 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700765 }
766}
767
Marat Dukhan08b7a972020-07-14 18:17:29 -0700768TEST(DECONVOLUTION_NHWC_QU8, 3x3_with_width_dilation) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800769 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700770 for (size_t dilation_width = 2; dilation_width <= 3; dilation_width++) {
771 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800772 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700773 .padding(1)
774 .kernel_size(3, 3)
775 .dilation_width(dilation_width)
776 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700777 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700778 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700779 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700780 }
781}
782
Marat Dukhan08b7a972020-07-14 18:17:29 -0700783TEST(DECONVOLUTION_NHWC_QU8, 3x3_with_height_dilation_and_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800784 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700785 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800786 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700787 .padding(1)
788 .kernel_size(3, 3)
789 .dilation_height(3)
790 .stride_height(2)
791 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700792 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700793 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700794 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700795}
796
Marat Dukhan08b7a972020-07-14 18:17:29 -0700797TEST(DECONVOLUTION_NHWC_QU8, 3x3_with_width_dilation_and_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800798 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700799 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800800 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700801 .padding(1)
802 .kernel_size(3, 3)
803 .dilation_width(3)
804 .stride_width(2)
805 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700806 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700807 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700808 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700809}
810
Marat Dukhan08b7a972020-07-14 18:17:29 -0700811TEST(DECONVOLUTION_NHWC_QU8, 3x3_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800812 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700813 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800814 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700815 .padding(1)
816 .kernel_size(3, 3)
817 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700818 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700819 .input_pixel_stride(28)
820 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700821 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700822}
823
Marat Dukhan08b7a972020-07-14 18:17:29 -0700824TEST(DECONVOLUTION_NHWC_QU8, 3x3_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800825 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700826 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800827 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700828 .padding(1)
829 .kernel_size(3, 3)
830 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700831 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
832 .output_pixel_stride(xnn_params.qu8.gemm.nr * 2 + 13)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700833 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700834 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700835}
836
Marat Dukhan08b7a972020-07-14 18:17:29 -0700837TEST(DECONVOLUTION_NHWC_QU8, 3x3_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800838 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700839 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800840 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700841 .padding(1)
842 .kernel_size(3, 3)
843 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700844 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700845 .qmin(128)
846 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700847 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700848}
849
Marat Dukhan08b7a972020-07-14 18:17:29 -0700850TEST(DECONVOLUTION_NHWC_QU8, 3x3_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800851 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700852 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800853 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700854 .padding(1)
855 .kernel_size(3, 3)
856 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700857 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -0700858 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700859 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700860 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700861}
862
Marat Dukhan08b7a972020-07-14 18:17:29 -0700863TEST(DECONVOLUTION_NHWC_QU8, 3x3_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800864 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -0700865 DeconvolutionOperatorTester()
866 .has_bias(false)
Marat Dukhana41533d2019-11-04 10:40:51 -0800867 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -0700868 .padding(1)
869 .kernel_size(3, 3)
870 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700871 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanf568f082019-10-30 09:47:07 -0700872 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700873 .TestQU8();
Marat Dukhanf568f082019-10-30 09:47:07 -0700874}
875
XNNPACK Teamb455b122019-09-27 18:10:33 -0700876/**************************** CONV path, grouped ****************************/
877
Marat Dukhan08b7a972020-07-14 18:17:29 -0700878TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800879 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700880 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800881 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700882 .padding(1)
883 .kernel_size(3, 3)
884 .groups(2)
885 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700886 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700887 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700888 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700889}
890
Marat Dukhan08b7a972020-07-14 18:17:29 -0700891TEST(DECONVOLUTION_NHWC_QU8, grouped_Kx3) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800892 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700893 for (size_t kernel_height = 1; kernel_height <= 4; kernel_height *= 2) {
894 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800895 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700896 .padding_width(1)
897 .kernel_size(kernel_height, 3)
898 .groups(2)
899 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700900 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700901 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700902 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700903 }
904}
905
Marat Dukhan08b7a972020-07-14 18:17:29 -0700906TEST(DECONVOLUTION_NHWC_QU8, grouped_3xK) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800907 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700908 for (size_t kernel_width = 1; kernel_width <= 4; kernel_width *= 2) {
909 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800910 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700911 .padding_height(1)
912 .kernel_size(3, kernel_width)
913 .groups(2)
914 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700915 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700916 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700917 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700918 }
919}
920
Marat Dukhan08b7a972020-07-14 18:17:29 -0700921TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3_varying_height_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800922 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700923 for (size_t padding_top = 0; padding_top <= 2; padding_top++) {
924 for (size_t padding_bottom = 0; padding_bottom <= 2; padding_bottom++) {
925 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800926 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700927 .padding_width(1)
928 .padding_top(padding_top)
929 .padding_bottom(padding_bottom)
930 .kernel_size(3, 3)
931 .groups(2)
932 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700933 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700934 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700935 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700936 }
937 }
938}
939
Marat Dukhan08b7a972020-07-14 18:17:29 -0700940TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3_varying_width_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800941 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700942 for (size_t padding_left = 0; padding_left <= 2; padding_left++) {
943 for (size_t padding_right = 0; padding_right <= 2; padding_right++) {
944 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800945 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700946 .padding_height(1)
947 .padding_left(padding_left)
948 .padding_right(padding_right)
949 .kernel_size(3, 3)
950 .groups(2)
951 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700952 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700953 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700954 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700955 }
956 }
957}
958
Marat Dukhan08b7a972020-07-14 18:17:29 -0700959TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3_varying_height_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800960 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700961 for (size_t adjustment_height = 1; adjustment_height <= 2; adjustment_height++) {
962 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800963 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700964 .padding(1)
Marat Dukhan1898b912019-11-05 12:25:18 -0800965 .stride_height(adjustment_height + 1)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700966 .adjustment_height(adjustment_height)
967 .kernel_size(3, 3)
968 .groups(2)
969 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700970 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700971 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700972 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700973 }
974}
975
Marat Dukhan08b7a972020-07-14 18:17:29 -0700976TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3_varying_width_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800977 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700978 for (size_t adjustment_width = 1; adjustment_width <= 2; adjustment_width++) {
979 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800980 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700981 .padding(1)
Marat Dukhan1898b912019-11-05 12:25:18 -0800982 .stride_width(adjustment_width + 1)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700983 .adjustment_width(adjustment_width)
984 .kernel_size(3, 3)
985 .groups(2)
986 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700987 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700988 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -0700989 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -0700990 }
991}
992
Marat Dukhan08b7a972020-07-14 18:17:29 -0700993TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -0800994 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -0800995 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -0700996 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -0800997 .input_size(input_height, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700998 .padding(1)
999 .kernel_size(3, 3)
1000 .groups(2)
1001 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001002 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001003 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001004 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001005 }
1006}
1007
Marat Dukhan08b7a972020-07-14 18:17:29 -07001008TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001009 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08001010 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07001011 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08001012 .input_size(kUnstridedInputHeight, input_width)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001013 .padding(1)
1014 .kernel_size(3, 3)
1015 .groups(2)
1016 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001017 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001018 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001019 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001020 }
1021}
1022
Marat Dukhan08b7a972020-07-14 18:17:29 -07001023TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3_varying_input_height_with_tf_same_padding) {
Marat Dukhan58717032020-04-28 15:03:28 -07001024 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1025 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
1026 DeconvolutionOperatorTester()
1027 .input_size(input_height, kUnstridedInputWidth)
1028 .padding_tf_same(true)
1029 .kernel_size(3, 3)
1030 .groups(2)
1031 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001032 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan58717032020-04-28 15:03:28 -07001033 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001034 .TestQU8();
Marat Dukhan58717032020-04-28 15:03:28 -07001035 }
1036}
1037
Marat Dukhan08b7a972020-07-14 18:17:29 -07001038TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3_varying_input_width_with_tf_same_padding) {
Marat Dukhan58717032020-04-28 15:03:28 -07001039 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1040 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
1041 DeconvolutionOperatorTester()
1042 .input_size(kUnstridedInputHeight, input_width)
1043 .padding_tf_same(true)
1044 .kernel_size(3, 3)
1045 .groups(2)
1046 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001047 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan58717032020-04-28 15:03:28 -07001048 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001049 .TestQU8();
Marat Dukhan58717032020-04-28 15:03:28 -07001050 }
1051}
1052
Marat Dukhan08b7a972020-07-14 18:17:29 -07001053TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001054 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001055 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
1056 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08001057 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001058 .padding(1)
1059 .kernel_size(3, 3)
1060 .groups(2)
1061 .group_input_channels(input_channels)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001062 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001063 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001064 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001065 }
1066}
1067
Marat Dukhan08b7a972020-07-14 18:17:29 -07001068TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001069 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan08b7a972020-07-14 18:17:29 -07001070 for (size_t output_channels = 1; output_channels <= xnn_params.qu8.gemm.nr * 2; output_channels *= 2) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07001071 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08001072 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001073 .padding(1)
1074 .kernel_size(3, 3)
1075 .groups(2)
1076 .group_input_channels(23)
1077 .group_output_channels(output_channels)
1078 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001079 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001080 }
1081}
1082
Marat Dukhan08b7a972020-07-14 18:17:29 -07001083TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3_with_height_dilation) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001084 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001085 for (size_t dilation_height = 2; dilation_height <= 3; dilation_height++) {
1086 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08001087 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001088 .padding(1)
1089 .kernel_size(3, 3)
1090 .dilation_height(dilation_height)
1091 .groups(2)
1092 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001093 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001094 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001095 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001096 }
1097}
1098
Marat Dukhan08b7a972020-07-14 18:17:29 -07001099TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3_with_width_dilation) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001100 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001101 for (size_t dilation_width = 2; dilation_width <= 3; dilation_width++) {
1102 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08001103 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001104 .padding(1)
1105 .kernel_size(3, 3)
1106 .dilation_width(dilation_width)
1107 .groups(2)
1108 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001109 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001110 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001111 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001112 }
1113}
1114
Marat Dukhan08b7a972020-07-14 18:17:29 -07001115TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3_with_height_dilation_and_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001116 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001117 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08001118 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001119 .padding(1)
1120 .kernel_size(3, 3)
1121 .dilation_height(3)
1122 .stride_height(2)
1123 .groups(2)
1124 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001125 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001126 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001127 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001128}
1129
Marat Dukhan08b7a972020-07-14 18:17:29 -07001130TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3_with_width_dilation_and_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001131 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001132 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08001133 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001134 .padding(1)
1135 .kernel_size(3, 3)
1136 .dilation_width(3)
1137 .stride_width(2)
1138 .groups(2)
1139 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001140 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001141 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001142 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001143}
1144
Marat Dukhan08b7a972020-07-14 18:17:29 -07001145TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001146 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001147 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08001148 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001149 .padding(1)
1150 .kernel_size(3, 3)
1151 .groups(2)
1152 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001153 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001154 .input_pixel_stride(47)
1155 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001156 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001157}
1158
Marat Dukhan08b7a972020-07-14 18:17:29 -07001159TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001160 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001161 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08001162 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001163 .padding(1)
1164 .kernel_size(3, 3)
1165 .groups(2)
1166 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001167 .group_output_channels(xnn_params.qu8.gemm.nr + 3)
1168 .output_pixel_stride(xnn_params.qu8.gemm.nr * 2 + 13)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001169 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001170 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001171}
1172
Marat Dukhan08b7a972020-07-14 18:17:29 -07001173TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001174 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001175 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08001176 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001177 .padding(1)
1178 .kernel_size(3, 3)
1179 .groups(2)
1180 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001181 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001182 .qmin(128)
1183 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001184 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001185}
1186
Marat Dukhan08b7a972020-07-14 18:17:29 -07001187TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001188 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001189 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08001190 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001191 .padding(1)
1192 .kernel_size(3, 3)
1193 .groups(2)
1194 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001195 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -07001196 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001197 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001198 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001199}
1200
Marat Dukhan08b7a972020-07-14 18:17:29 -07001201TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001202 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -07001203 DeconvolutionOperatorTester()
1204 .has_bias(false)
Marat Dukhana41533d2019-11-04 10:40:51 -08001205 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -07001206 .padding(1)
1207 .kernel_size(3, 3)
1208 .groups(2)
1209 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001210 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanf568f082019-10-30 09:47:07 -07001211 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001212 .TestQU8();
Marat Dukhanf568f082019-10-30 09:47:07 -07001213}
1214
XNNPACK Teamb455b122019-09-27 18:10:33 -07001215/**************************** CONV path, batched ****************************/
1216
Marat Dukhan08b7a972020-07-14 18:17:29 -07001217TEST(DECONVOLUTION_NHWC_QU8, batched_3x3) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001218 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001219 DeconvolutionOperatorTester()
1220 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001221 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001222 .padding(1)
1223 .kernel_size(3, 3)
1224 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001225 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001226 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001227 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001228}
1229
Marat Dukhan08b7a972020-07-14 18:17:29 -07001230TEST(DECONVOLUTION_NHWC_QU8, batched_Kx3) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001231 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001232 for (size_t kernel_height = 1; kernel_height <= 4; kernel_height *= 2) {
1233 DeconvolutionOperatorTester()
1234 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001235 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001236 .padding_width(1)
1237 .kernel_size(kernel_height, 3)
1238 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001239 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001240 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001241 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001242 }
1243}
1244
Marat Dukhan08b7a972020-07-14 18:17:29 -07001245TEST(DECONVOLUTION_NHWC_QU8, batched_3xK) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001246 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001247 for (size_t kernel_width = 1; kernel_width <= 4; kernel_width *= 2) {
1248 DeconvolutionOperatorTester()
1249 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001250 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001251 .padding_height(1)
1252 .kernel_size(3, kernel_width)
1253 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001254 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001255 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001256 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001257 }
1258}
1259
Marat Dukhan08b7a972020-07-14 18:17:29 -07001260TEST(DECONVOLUTION_NHWC_QU8, batched_3x3_varying_height_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001261 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001262 for (size_t padding_top = 0; padding_top <= 2; padding_top++) {
1263 for (size_t padding_bottom = 0; padding_bottom <= 2; padding_bottom++) {
1264 DeconvolutionOperatorTester()
1265 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001266 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001267 .padding_width(1)
1268 .padding_top(padding_top)
1269 .padding_bottom(padding_bottom)
1270 .kernel_size(3, 3)
1271 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001272 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001273 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001274 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001275 }
1276 }
1277}
1278
Marat Dukhan08b7a972020-07-14 18:17:29 -07001279TEST(DECONVOLUTION_NHWC_QU8, batched_3x3_varying_width_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001280 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001281 for (size_t padding_left = 0; padding_left <= 2; padding_left++) {
1282 for (size_t padding_right = 0; padding_right <= 2; padding_right++) {
1283 DeconvolutionOperatorTester()
1284 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001285 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001286 .padding_height(1)
1287 .padding_left(padding_left)
1288 .padding_right(padding_right)
1289 .kernel_size(3, 3)
1290 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001291 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001292 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001293 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001294 }
1295 }
1296}
1297
Marat Dukhan08b7a972020-07-14 18:17:29 -07001298TEST(DECONVOLUTION_NHWC_QU8, batched_3x3_varying_height_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001299 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001300 for (size_t adjustment_height = 1; adjustment_height <= 2; adjustment_height++) {
1301 DeconvolutionOperatorTester()
1302 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001303 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001304 .padding(1)
Marat Dukhan1898b912019-11-05 12:25:18 -08001305 .stride_height(adjustment_height + 1)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001306 .adjustment_height(adjustment_height)
1307 .kernel_size(3, 3)
1308 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001309 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001310 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001311 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001312 }
1313}
1314
Marat Dukhan08b7a972020-07-14 18:17:29 -07001315TEST(DECONVOLUTION_NHWC_QU8, batched_3x3_varying_width_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001316 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001317 for (size_t adjustment_width = 1; adjustment_width <= 2; adjustment_width++) {
1318 DeconvolutionOperatorTester()
1319 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001320 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001321 .padding(1)
Marat Dukhan1898b912019-11-05 12:25:18 -08001322 .stride_width(adjustment_width + 1)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001323 .adjustment_width(adjustment_width)
1324 .kernel_size(3, 3)
1325 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001326 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001327 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001328 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001329 }
1330}
1331
Marat Dukhan08b7a972020-07-14 18:17:29 -07001332TEST(DECONVOLUTION_NHWC_QU8, batched_3x3_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001333 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08001334 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07001335 DeconvolutionOperatorTester()
1336 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001337 .input_size(input_height, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001338 .padding(1)
1339 .kernel_size(3, 3)
1340 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001341 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001342 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001343 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001344 }
1345}
1346
Marat Dukhan08b7a972020-07-14 18:17:29 -07001347TEST(DECONVOLUTION_NHWC_QU8, batched_3x3_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001348 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08001349 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07001350 DeconvolutionOperatorTester()
1351 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001352 .input_size(kUnstridedInputHeight, input_width)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001353 .padding(1)
1354 .kernel_size(3, 3)
1355 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001356 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001357 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001358 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001359 }
1360}
1361
Marat Dukhan08b7a972020-07-14 18:17:29 -07001362TEST(DECONVOLUTION_NHWC_QU8, batched_3x3_varying_input_height_with_tf_same_padding) {
Marat Dukhan58717032020-04-28 15:03:28 -07001363 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1364 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
1365 DeconvolutionOperatorTester()
1366 .batch_size(2)
1367 .input_size(input_height, kUnstridedInputWidth)
1368 .padding_tf_same(true)
1369 .kernel_size(3, 3)
1370 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001371 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan58717032020-04-28 15:03:28 -07001372 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001373 .TestQU8();
Marat Dukhan58717032020-04-28 15:03:28 -07001374 }
1375}
1376
Marat Dukhan08b7a972020-07-14 18:17:29 -07001377TEST(DECONVOLUTION_NHWC_QU8, batched_3x3_varying_input_width_with_tf_same_padding) {
Marat Dukhan58717032020-04-28 15:03:28 -07001378 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1379 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
1380 DeconvolutionOperatorTester()
1381 .batch_size(2)
1382 .input_size(kUnstridedInputHeight, input_width)
1383 .padding_tf_same(true)
1384 .kernel_size(3, 3)
1385 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001386 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan58717032020-04-28 15:03:28 -07001387 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001388 .TestQU8();
Marat Dukhan58717032020-04-28 15:03:28 -07001389 }
1390}
1391
Marat Dukhan08b7a972020-07-14 18:17:29 -07001392TEST(DECONVOLUTION_NHWC_QU8, batched_3x3_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001393 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001394 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
1395 DeconvolutionOperatorTester()
1396 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001397 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001398 .padding(1)
1399 .kernel_size(3, 3)
1400 .group_input_channels(input_channels)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001401 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001402 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001403 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001404 }
1405}
1406
Marat Dukhan08b7a972020-07-14 18:17:29 -07001407TEST(DECONVOLUTION_NHWC_QU8, batched_3x3_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001408 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan08b7a972020-07-14 18:17:29 -07001409 for (size_t output_channels = 1; output_channels <= xnn_params.qu8.gemm.nr * 2; output_channels *= 2) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07001410 DeconvolutionOperatorTester()
1411 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001412 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001413 .padding(1)
1414 .kernel_size(3, 3)
1415 .group_input_channels(23)
1416 .group_output_channels(output_channels)
1417 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001418 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001419 }
1420}
1421
Marat Dukhan08b7a972020-07-14 18:17:29 -07001422TEST(DECONVOLUTION_NHWC_QU8, batched_3x3_with_height_dilation) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001423 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001424 for (size_t dilation_height = 2; dilation_height <= 3; dilation_height++) {
1425 DeconvolutionOperatorTester()
1426 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001427 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001428 .padding(1)
1429 .kernel_size(3, 3)
1430 .dilation_height(dilation_height)
1431 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001432 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001433 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001434 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001435 }
1436}
1437
Marat Dukhan08b7a972020-07-14 18:17:29 -07001438TEST(DECONVOLUTION_NHWC_QU8, batched_3x3_with_width_dilation) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001439 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001440 for (size_t dilation_width = 2; dilation_width <= 3; dilation_width++) {
1441 DeconvolutionOperatorTester()
1442 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001443 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001444 .padding(1)
1445 .kernel_size(3, 3)
1446 .dilation_width(dilation_width)
1447 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001448 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001449 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001450 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001451 }
1452}
1453
Marat Dukhan08b7a972020-07-14 18:17:29 -07001454TEST(DECONVOLUTION_NHWC_QU8, batched_3x3_with_height_dilation_and_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001455 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001456 DeconvolutionOperatorTester()
1457 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001458 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001459 .padding(1)
1460 .kernel_size(3, 3)
1461 .dilation_height(3)
1462 .stride_height(2)
1463 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001464 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001465 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001466 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001467}
1468
Marat Dukhan08b7a972020-07-14 18:17:29 -07001469TEST(DECONVOLUTION_NHWC_QU8, batched_3x3_with_width_dilation_and_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001470 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001471 DeconvolutionOperatorTester()
1472 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001473 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001474 .padding(1)
1475 .kernel_size(3, 3)
1476 .dilation_width(3)
1477 .stride_width(2)
1478 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001479 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001480 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001481 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001482}
1483
Marat Dukhan08b7a972020-07-14 18:17:29 -07001484TEST(DECONVOLUTION_NHWC_QU8, batched_3x3_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001485 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001486 DeconvolutionOperatorTester()
1487 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001488 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001489 .padding(1)
1490 .kernel_size(3, 3)
1491 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001492 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001493 .input_pixel_stride(28)
1494 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001495 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001496}
1497
Marat Dukhan08b7a972020-07-14 18:17:29 -07001498TEST(DECONVOLUTION_NHWC_QU8, batched_3x3_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001499 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001500 DeconvolutionOperatorTester()
1501 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001502 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001503 .padding(1)
1504 .kernel_size(3, 3)
1505 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001506 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
1507 .output_pixel_stride(xnn_params.qu8.gemm.nr * 2 + 13)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001508 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001509 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001510}
1511
Marat Dukhan08b7a972020-07-14 18:17:29 -07001512TEST(DECONVOLUTION_NHWC_QU8, batched_3x3_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001513 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001514 DeconvolutionOperatorTester()
1515 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001516 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001517 .padding(1)
1518 .kernel_size(3, 3)
1519 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001520 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001521 .qmin(128)
1522 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001523 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001524}
1525
Marat Dukhan08b7a972020-07-14 18:17:29 -07001526TEST(DECONVOLUTION_NHWC_QU8, batched_3x3_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001527 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001528 DeconvolutionOperatorTester()
1529 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001530 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001531 .padding(1)
1532 .kernel_size(3, 3)
1533 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001534 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -07001535 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001536 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001537 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001538}
1539
Marat Dukhan08b7a972020-07-14 18:17:29 -07001540TEST(DECONVOLUTION_NHWC_QU8, batched_3x3_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001541 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -07001542 DeconvolutionOperatorTester()
1543 .has_bias(false)
1544 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001545 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -07001546 .padding(1)
1547 .kernel_size(3, 3)
1548 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001549 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanf568f082019-10-30 09:47:07 -07001550 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001551 .TestQU8();
Marat Dukhanf568f082019-10-30 09:47:07 -07001552}
1553
XNNPACK Teamb455b122019-09-27 18:10:33 -07001554/**************************** CONV path, grouped, batched ****************************/
1555
Marat Dukhan08b7a972020-07-14 18:17:29 -07001556TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001557 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001558 DeconvolutionOperatorTester()
1559 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001560 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001561 .padding(1)
1562 .kernel_size(3, 3)
1563 .groups(2)
1564 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001565 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001566 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001567 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001568}
1569
Marat Dukhan08b7a972020-07-14 18:17:29 -07001570TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_Kx3) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001571 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001572 for (size_t kernel_height = 1; kernel_height <= 4; kernel_height *= 2) {
1573 DeconvolutionOperatorTester()
1574 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001575 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001576 .padding_width(1)
1577 .kernel_size(kernel_height, 3)
1578 .groups(2)
1579 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001580 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001581 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001582 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001583 }
1584}
1585
Marat Dukhan08b7a972020-07-14 18:17:29 -07001586TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3xK) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001587 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001588 for (size_t kernel_width = 1; kernel_width <= 4; kernel_width *= 2) {
1589 DeconvolutionOperatorTester()
1590 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001591 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001592 .padding_height(1)
1593 .kernel_size(3, kernel_width)
1594 .groups(2)
1595 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001596 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001597 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001598 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001599 }
1600}
1601
Marat Dukhan08b7a972020-07-14 18:17:29 -07001602TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3_varying_height_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001603 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001604 for (size_t padding_top = 0; padding_top <= 2; padding_top++) {
1605 for (size_t padding_bottom = 0; padding_bottom <= 2; padding_bottom++) {
1606 DeconvolutionOperatorTester()
1607 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001608 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001609 .padding_width(1)
1610 .padding_top(padding_top)
1611 .padding_bottom(padding_bottom)
1612 .kernel_size(3, 3)
1613 .groups(2)
1614 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001615 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001616 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001617 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001618 }
1619 }
1620}
1621
Marat Dukhan08b7a972020-07-14 18:17:29 -07001622TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3_varying_width_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001623 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001624 for (size_t padding_left = 0; padding_left <= 2; padding_left++) {
1625 for (size_t padding_right = 0; padding_right <= 2; padding_right++) {
1626 DeconvolutionOperatorTester()
1627 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001628 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001629 .padding_height(1)
1630 .padding_left(padding_left)
1631 .padding_right(padding_right)
1632 .kernel_size(3, 3)
1633 .groups(2)
1634 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001635 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001636 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001637 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001638 }
1639 }
1640}
1641
Marat Dukhan08b7a972020-07-14 18:17:29 -07001642TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3_varying_height_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001643 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001644 for (size_t adjustment_height = 1; adjustment_height <= 2; adjustment_height++) {
1645 DeconvolutionOperatorTester()
1646 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001647 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001648 .padding(1)
Marat Dukhan1898b912019-11-05 12:25:18 -08001649 .stride_height(adjustment_height + 1)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001650 .adjustment_height(adjustment_height)
1651 .kernel_size(3, 3)
1652 .groups(2)
1653 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001654 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001655 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001656 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001657 }
1658}
1659
Marat Dukhan08b7a972020-07-14 18:17:29 -07001660TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3_varying_width_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001661 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001662 for (size_t adjustment_width = 1; adjustment_width <= 2; adjustment_width++) {
1663 DeconvolutionOperatorTester()
1664 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001665 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001666 .padding(1)
Marat Dukhan1898b912019-11-05 12:25:18 -08001667 .stride_width(adjustment_width + 1)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001668 .adjustment_width(adjustment_width)
1669 .kernel_size(3, 3)
1670 .groups(2)
1671 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001672 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001673 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001674 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001675 }
1676}
1677
Marat Dukhan08b7a972020-07-14 18:17:29 -07001678TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001679 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08001680 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07001681 DeconvolutionOperatorTester()
1682 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001683 .input_size(input_height, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001684 .padding(1)
1685 .kernel_size(3, 3)
1686 .groups(2)
1687 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001688 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001689 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001690 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001691 }
1692}
1693
Marat Dukhan08b7a972020-07-14 18:17:29 -07001694TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001695 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08001696 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07001697 DeconvolutionOperatorTester()
1698 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001699 .input_size(kUnstridedInputHeight, input_width)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001700 .padding(1)
1701 .kernel_size(3, 3)
1702 .groups(2)
1703 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001704 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001705 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001706 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001707 }
1708}
1709
Marat Dukhan08b7a972020-07-14 18:17:29 -07001710TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3_varying_input_height_with_tf_same_padding) {
Marat Dukhan58717032020-04-28 15:03:28 -07001711 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1712 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
1713 DeconvolutionOperatorTester()
1714 .batch_size(2)
1715 .input_size(input_height, kUnstridedInputWidth)
1716 .padding_tf_same(true)
1717 .kernel_size(3, 3)
1718 .groups(2)
1719 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001720 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan58717032020-04-28 15:03:28 -07001721 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001722 .TestQU8();
Marat Dukhan58717032020-04-28 15:03:28 -07001723 }
1724}
1725
Marat Dukhan08b7a972020-07-14 18:17:29 -07001726TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3_varying_input_width_with_tf_same_padding) {
Marat Dukhan58717032020-04-28 15:03:28 -07001727 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
1728 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
1729 DeconvolutionOperatorTester()
1730 .batch_size(2)
1731 .input_size(kUnstridedInputHeight, input_width)
1732 .padding_tf_same(true)
1733 .kernel_size(3, 3)
1734 .groups(2)
1735 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001736 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan58717032020-04-28 15:03:28 -07001737 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001738 .TestQU8();
Marat Dukhan58717032020-04-28 15:03:28 -07001739 }
1740}
1741
Marat Dukhan08b7a972020-07-14 18:17:29 -07001742TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001743 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001744 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
1745 DeconvolutionOperatorTester()
1746 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001747 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001748 .padding(1)
1749 .kernel_size(3, 3)
1750 .groups(2)
1751 .group_input_channels(input_channels)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001752 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001753 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001754 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001755 }
1756}
1757
Marat Dukhan08b7a972020-07-14 18:17:29 -07001758TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001759 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan08b7a972020-07-14 18:17:29 -07001760 for (size_t output_channels = 1; output_channels <= xnn_params.qu8.gemm.nr * 2; output_channels *= 2) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07001761 DeconvolutionOperatorTester()
1762 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001763 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001764 .padding(1)
1765 .kernel_size(3, 3)
1766 .groups(2)
1767 .group_input_channels(23)
1768 .group_output_channels(output_channels)
1769 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001770 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001771 }
1772}
1773
Marat Dukhan08b7a972020-07-14 18:17:29 -07001774TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3_with_height_dilation) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001775 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001776 for (size_t dilation_height = 2; dilation_height <= 3; dilation_height++) {
1777 DeconvolutionOperatorTester()
1778 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001779 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001780 .padding(1)
1781 .kernel_size(3, 3)
1782 .dilation_height(dilation_height)
1783 .groups(2)
1784 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001785 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001786 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001787 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001788 }
1789}
1790
Marat Dukhan08b7a972020-07-14 18:17:29 -07001791TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3_with_width_dilation) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001792 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001793 for (size_t dilation_width = 2; dilation_width <= 3; dilation_width++) {
1794 DeconvolutionOperatorTester()
1795 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001796 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001797 .padding(1)
1798 .kernel_size(3, 3)
1799 .dilation_width(dilation_width)
1800 .groups(2)
1801 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001802 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001803 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001804 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001805 }
1806}
1807
Marat Dukhan08b7a972020-07-14 18:17:29 -07001808TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3_with_height_dilation_and_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001809 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001810 DeconvolutionOperatorTester()
1811 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001812 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001813 .padding(1)
1814 .kernel_size(3, 3)
1815 .dilation_height(3)
1816 .stride_width(2)
1817 .groups(2)
1818 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001819 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001820 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001821 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001822}
1823
Marat Dukhan08b7a972020-07-14 18:17:29 -07001824TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3_with_width_dilation_and_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001825 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001826 DeconvolutionOperatorTester()
1827 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001828 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001829 .padding(1)
1830 .kernel_size(3, 3)
1831 .dilation_width(3)
1832 .stride_width(2)
1833 .groups(2)
1834 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001835 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001836 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001837 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001838}
1839
Marat Dukhan08b7a972020-07-14 18:17:29 -07001840TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001841 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001842 DeconvolutionOperatorTester()
1843 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001844 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001845 .padding(1)
1846 .kernel_size(3, 3)
1847 .groups(2)
1848 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001849 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001850 .input_pixel_stride(47)
1851 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001852 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001853}
1854
Marat Dukhan08b7a972020-07-14 18:17:29 -07001855TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001856 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001857 DeconvolutionOperatorTester()
1858 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001859 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001860 .padding(1)
1861 .kernel_size(3, 3)
1862 .groups(2)
1863 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001864 .group_output_channels(xnn_params.qu8.gemm.nr + 3)
1865 .output_pixel_stride(xnn_params.qu8.gemm.nr * 2 + 13)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001866 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001867 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001868}
1869
Marat Dukhan08b7a972020-07-14 18:17:29 -07001870TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001871 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001872 DeconvolutionOperatorTester()
1873 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001874 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001875 .padding(1)
1876 .kernel_size(3, 3)
1877 .groups(2)
1878 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001879 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001880 .qmin(128)
1881 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001882 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001883}
1884
Marat Dukhan08b7a972020-07-14 18:17:29 -07001885TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001886 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001887 DeconvolutionOperatorTester()
1888 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001889 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001890 .padding(1)
1891 .kernel_size(3, 3)
1892 .groups(2)
1893 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001894 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -07001895 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001896 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001897 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001898}
1899
Marat Dukhan08b7a972020-07-14 18:17:29 -07001900TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001901 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -07001902 DeconvolutionOperatorTester()
1903 .has_bias(false)
1904 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001905 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -07001906 .padding(1)
1907 .kernel_size(3, 3)
1908 .groups(2)
1909 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001910 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanf568f082019-10-30 09:47:07 -07001911 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001912 .TestQU8();
Marat Dukhanf568f082019-10-30 09:47:07 -07001913}
1914
XNNPACK Teamb455b122019-09-27 18:10:33 -07001915/**************************** CONV path, setup ****************************/
1916
Marat Dukhan08b7a972020-07-14 18:17:29 -07001917TEST(DECONVOLUTION_NHWC_QU8, 3x3_setup_changing_batch) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001918 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001919 DeconvolutionOperatorTester()
1920 .batch_size(2)
1921 .next_batch_size(5)
Marat Dukhana41533d2019-11-04 10:40:51 -08001922 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001923 .kernel_height(3)
1924 .kernel_width(5)
1925 .groups(2)
1926 .group_input_channels(15)
1927 .group_output_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001928 .TestSetupQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001929}
1930
Marat Dukhan08b7a972020-07-14 18:17:29 -07001931TEST(DECONVOLUTION_NHWC_QU8, 3x3_setup_changing_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001932 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001933 DeconvolutionOperatorTester()
1934 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001935 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
1936 .next_input_height(kUnstridedInputHeight + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001937 .kernel_height(3)
1938 .kernel_width(5)
1939 .groups(2)
1940 .group_input_channels(15)
1941 .group_output_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001942 .TestSetupQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001943}
1944
Marat Dukhan08b7a972020-07-14 18:17:29 -07001945TEST(DECONVOLUTION_NHWC_QU8, 3x3_setup_changing_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001946 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001947 DeconvolutionOperatorTester()
1948 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08001949 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
1950 .next_input_width(kUnstridedInputWidth + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001951 .kernel_height(3)
1952 .kernel_width(5)
1953 .groups(2)
1954 .group_input_channels(15)
1955 .group_output_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001956 .TestSetupQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001957}
1958
Marat Dukhan29954272020-02-13 17:56:11 -08001959/**************************** SUBCONV2D/IGEMM path ****************************/
XNNPACK Teamb455b122019-09-27 18:10:33 -07001960
Marat Dukhan08b7a972020-07-14 18:17:29 -07001961TEST(DECONVOLUTION_NHWC_QU8, 3x3s2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001962 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001963 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08001964 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001965 .padding(1)
1966 .kernel_size(3, 3)
1967 .stride(2)
1968 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001969 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001970 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001971 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001972}
1973
Marat Dukhan08b7a972020-07-14 18:17:29 -07001974TEST(DECONVOLUTION_NHWC_QU8, Kx3s2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001975 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001976 for (size_t kernel_height = 2; kernel_height <= 5; kernel_height++) {
1977 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08001978 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001979 .padding_width(1)
1980 .kernel_size(kernel_height, 3)
1981 .stride(2)
1982 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001983 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001984 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001985 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07001986 }
1987}
1988
Marat Dukhan08b7a972020-07-14 18:17:29 -07001989TEST(DECONVOLUTION_NHWC_QU8, 3xKs2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08001990 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07001991 for (size_t kernel_width = 2; kernel_width <= 5; kernel_width++) {
1992 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08001993 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001994 .padding_height(1)
1995 .kernel_size(3, kernel_width)
1996 .stride(2)
1997 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07001998 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07001999 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002000 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002001 }
2002}
2003
Marat Dukhan08b7a972020-07-14 18:17:29 -07002004TEST(DECONVOLUTION_NHWC_QU8, 3x3sSx1) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002005 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002006 for (size_t stride_height = 2; stride_height <= 3; stride_height++) {
2007 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002008 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002009 .padding(1)
2010 .padding_width(1)
2011 .kernel_size(3, 3)
2012 .stride_height(stride_height)
2013 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002014 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002015 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002016 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002017 }
2018}
2019
Marat Dukhan08b7a972020-07-14 18:17:29 -07002020TEST(DECONVOLUTION_NHWC_QU8, 3x3s1xS) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002021 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002022 for (size_t stride_width = 2; stride_width <= 3; stride_width++) {
2023 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002024 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002025 .padding(1)
2026 .padding_width(1)
2027 .kernel_size(3, 3)
2028 .stride_width(stride_width)
2029 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002030 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002031 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002032 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002033 }
2034}
2035
Marat Dukhan08b7a972020-07-14 18:17:29 -07002036TEST(DECONVOLUTION_NHWC_QU8, 3x3s2_varying_height_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002037 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002038 for (size_t padding_top = 0; padding_top <= 2; padding_top++) {
2039 for (size_t padding_bottom = 0; padding_bottom <= 2; padding_bottom++) {
2040 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002041 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002042 .padding_width(1)
2043 .padding_top(padding_top)
2044 .padding_bottom(padding_bottom)
2045 .kernel_size(3, 3)
2046 .stride(2)
2047 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002048 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002049 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002050 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002051 }
2052 }
2053}
2054
Marat Dukhan08b7a972020-07-14 18:17:29 -07002055TEST(DECONVOLUTION_NHWC_QU8, 3x3s2_varying_width_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002056 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002057 for (size_t padding_left = 0; padding_left <= 2; padding_left++) {
2058 for (size_t padding_right = 0; padding_right <= 2; padding_right++) {
2059 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002060 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002061 .padding_height(1)
2062 .padding_left(padding_left)
2063 .padding_right(padding_right)
2064 .kernel_size(3, 3)
2065 .stride(2)
2066 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002067 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002068 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002069 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002070 }
2071 }
2072}
2073
Marat Dukhan08b7a972020-07-14 18:17:29 -07002074TEST(DECONVOLUTION_NHWC_QU8, 3x3s2_varying_height_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002075 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan1898b912019-11-05 12:25:18 -08002076 for (size_t adjustment_height = 0; adjustment_height <= 1; adjustment_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07002077 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002078 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002079 .padding(1)
2080 .adjustment_height(adjustment_height)
2081 .kernel_size(3, 3)
2082 .stride(2)
2083 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002084 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002085 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002086 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002087 }
2088}
2089
Marat Dukhan08b7a972020-07-14 18:17:29 -07002090TEST(DECONVOLUTION_NHWC_QU8, 3x3s2_varying_width_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002091 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan1898b912019-11-05 12:25:18 -08002092 for (size_t adjustment_width = 0; adjustment_width <= 1; adjustment_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07002093 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002094 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002095 .padding(1)
2096 .adjustment_width(adjustment_width)
2097 .kernel_size(3, 3)
2098 .stride(2)
2099 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002100 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002101 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002102 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002103 }
2104}
2105
Marat Dukhan08b7a972020-07-14 18:17:29 -07002106TEST(DECONVOLUTION_NHWC_QU8, 3x3s2_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002107 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08002108 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07002109 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002110 .input_size(input_height, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002111 .padding(1)
2112 .kernel_size(3, 3)
2113 .stride(2)
2114 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002115 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002116 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002117 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002118 }
2119}
2120
Marat Dukhan08b7a972020-07-14 18:17:29 -07002121TEST(DECONVOLUTION_NHWC_QU8, 3x3s2_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002122 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08002123 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07002124 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002125 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002126 .padding(1)
2127 .kernel_size(3, 3)
2128 .stride(2)
2129 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002130 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002131 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002132 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002133 }
2134}
2135
Marat Dukhan08b7a972020-07-14 18:17:29 -07002136TEST(DECONVOLUTION_NHWC_QU8, 3x3s2_varying_input_height_with_tf_same_padding) {
Marat Dukhan58717032020-04-28 15:03:28 -07002137 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2138 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
2139 DeconvolutionOperatorTester()
2140 .input_size(input_height, kStridedInputWidth)
2141 .padding_tf_same(true)
2142 .kernel_size(3, 3)
2143 .stride(2)
2144 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002145 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan58717032020-04-28 15:03:28 -07002146 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002147 .TestQU8();
Marat Dukhan58717032020-04-28 15:03:28 -07002148 }
2149}
2150
Marat Dukhan08b7a972020-07-14 18:17:29 -07002151TEST(DECONVOLUTION_NHWC_QU8, 3x3s2_varying_input_width_with_tf_same_padding) {
Marat Dukhan58717032020-04-28 15:03:28 -07002152 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2153 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
2154 DeconvolutionOperatorTester()
2155 .input_size(kStridedInputHeight, kStridedInputWidth)
2156 .padding_tf_same(true)
2157 .kernel_size(3, 3)
2158 .stride(2)
2159 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002160 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan58717032020-04-28 15:03:28 -07002161 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002162 .TestQU8();
Marat Dukhan58717032020-04-28 15:03:28 -07002163 }
2164}
2165
Marat Dukhan08b7a972020-07-14 18:17:29 -07002166TEST(DECONVOLUTION_NHWC_QU8, 3x3s2_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002167 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002168 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
2169 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002170 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002171 .padding(1)
2172 .kernel_size(3, 3)
2173 .stride(2)
2174 .group_input_channels(input_channels)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002175 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002176 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002177 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002178 }
2179}
2180
Marat Dukhan08b7a972020-07-14 18:17:29 -07002181TEST(DECONVOLUTION_NHWC_QU8, 3x3s2_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002182 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan08b7a972020-07-14 18:17:29 -07002183 for (size_t output_channels = 1; output_channels <= xnn_params.qu8.gemm.nr * 2; output_channels *= 2) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07002184 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002185 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002186 .padding(1)
2187 .kernel_size(3, 3)
2188 .stride(2)
2189 .group_input_channels(23)
2190 .group_output_channels(output_channels)
2191 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002192 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002193 }
2194}
2195
Marat Dukhan08b7a972020-07-14 18:17:29 -07002196TEST(DECONVOLUTION_NHWC_QU8, 3x3s2_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002197 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002198 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002199 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002200 .padding(1)
2201 .kernel_size(3, 3)
2202 .stride(2)
2203 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002204 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002205 .input_pixel_stride(28)
2206 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002207 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002208}
2209
Marat Dukhan08b7a972020-07-14 18:17:29 -07002210TEST(DECONVOLUTION_NHWC_QU8, 3x3s2_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002211 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002212 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002213 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002214 .padding(1)
2215 .kernel_size(3, 3)
2216 .stride(2)
2217 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002218 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
2219 .output_pixel_stride(xnn_params.qu8.gemm.nr * 2 + 13)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002220 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002221 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002222}
2223
Marat Dukhan08b7a972020-07-14 18:17:29 -07002224TEST(DECONVOLUTION_NHWC_QU8, 3x3s2_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002225 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002226 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002227 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002228 .padding(1)
2229 .kernel_size(3, 3)
2230 .stride(2)
2231 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002232 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002233 .qmin(128)
2234 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002235 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002236}
2237
Marat Dukhan08b7a972020-07-14 18:17:29 -07002238TEST(DECONVOLUTION_NHWC_QU8, 3x3s2_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002239 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002240 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002241 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002242 .padding(1)
2243 .kernel_size(3, 3)
2244 .stride(2)
2245 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002246 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -07002247 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002248 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002249 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002250}
2251
Marat Dukhan08b7a972020-07-14 18:17:29 -07002252TEST(DECONVOLUTION_NHWC_QU8, 3x3s2_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002253 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -07002254 DeconvolutionOperatorTester()
2255 .has_bias(false)
Marat Dukhana41533d2019-11-04 10:40:51 -08002256 .input_size(kStridedInputHeight, kStridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -07002257 .padding(1)
2258 .kernel_size(3, 3)
2259 .stride(2)
2260 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002261 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanf568f082019-10-30 09:47:07 -07002262 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002263 .TestQU8();
Marat Dukhanf568f082019-10-30 09:47:07 -07002264}
2265
Marat Dukhan29954272020-02-13 17:56:11 -08002266/**************************** SUBCONV2D/IGEMM path, grouped ****************************/
XNNPACK Teamb455b122019-09-27 18:10:33 -07002267
Marat Dukhan08b7a972020-07-14 18:17:29 -07002268TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3s2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002269 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002270 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002271 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002272 .padding(1)
2273 .kernel_size(3, 3)
2274 .stride(2)
2275 .groups(2)
2276 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002277 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002278 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002279 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002280}
2281
Marat Dukhan08b7a972020-07-14 18:17:29 -07002282TEST(DECONVOLUTION_NHWC_QU8, grouped_Kx3s2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002283 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002284 for (size_t kernel_height = 2; kernel_height <= 5; kernel_height++) {
2285 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002286 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002287 .padding_width(1)
2288 .kernel_size(kernel_height, 3)
2289 .stride(2)
2290 .groups(2)
2291 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002292 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002293 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002294 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002295 }
2296}
2297
Marat Dukhan08b7a972020-07-14 18:17:29 -07002298TEST(DECONVOLUTION_NHWC_QU8, grouped_3xKs2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002299 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002300 for (size_t kernel_width = 2; kernel_width <= 5; kernel_width++) {
2301 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002302 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002303 .padding_height(1)
2304 .kernel_size(3, kernel_width)
2305 .stride(2)
2306 .groups(2)
2307 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002308 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002309 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002310 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002311 }
2312}
2313
Marat Dukhan08b7a972020-07-14 18:17:29 -07002314TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3sSx1) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002315 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002316 for (size_t stride_height = 2; stride_height <= 3; stride_height++) {
2317 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002318 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002319 .padding(1)
2320 .padding_width(1)
2321 .kernel_size(3, 3)
2322 .stride_height(stride_height)
2323 .groups(2)
2324 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002325 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002326 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002327 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002328 }
2329}
2330
Marat Dukhan08b7a972020-07-14 18:17:29 -07002331TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3s1xS) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002332 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002333 for (size_t stride_width = 2; stride_width <= 3; stride_width++) {
2334 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002335 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002336 .padding(1)
2337 .padding_width(1)
2338 .kernel_size(3, 3)
2339 .stride_width(stride_width)
2340 .groups(2)
2341 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002342 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002343 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002344 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002345 }
2346}
2347
Marat Dukhan08b7a972020-07-14 18:17:29 -07002348TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3s2_varying_height_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002349 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002350 for (size_t padding_top = 0; padding_top <= 2; padding_top++) {
2351 for (size_t padding_bottom = 0; padding_bottom <= 2; padding_bottom++) {
2352 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002353 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002354 .padding_width(1)
2355 .padding_top(padding_top)
2356 .padding_bottom(padding_bottom)
2357 .kernel_size(3, 3)
2358 .stride(2)
2359 .groups(2)
2360 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002361 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002362 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002363 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002364 }
2365 }
2366}
2367
Marat Dukhan08b7a972020-07-14 18:17:29 -07002368TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3s2_varying_width_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002369 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002370 for (size_t padding_left = 0; padding_left <= 2; padding_left++) {
2371 for (size_t padding_right = 0; padding_right <= 2; padding_right++) {
2372 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002373 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002374 .padding_height(1)
2375 .padding_left(padding_left)
2376 .padding_right(padding_right)
2377 .kernel_size(3, 3)
2378 .stride(2)
2379 .groups(2)
2380 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002381 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002382 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002383 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002384 }
2385 }
2386}
2387
Marat Dukhan08b7a972020-07-14 18:17:29 -07002388TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3s2_varying_height_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002389 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan1898b912019-11-05 12:25:18 -08002390 for (size_t adjustment_height = 0; adjustment_height <= 1; adjustment_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07002391 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002392 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002393 .padding(1)
2394 .adjustment_height(adjustment_height)
2395 .kernel_size(3, 3)
2396 .stride(2)
2397 .groups(2)
2398 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002399 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002400 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002401 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002402 }
2403}
2404
Marat Dukhan08b7a972020-07-14 18:17:29 -07002405TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3s2_varying_width_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002406 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan1898b912019-11-05 12:25:18 -08002407 for (size_t adjustment_width = 0; adjustment_width <= 1; adjustment_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07002408 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002409 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002410 .padding(1)
2411 .adjustment_width(adjustment_width)
2412 .kernel_size(3, 3)
2413 .stride(2)
2414 .groups(2)
2415 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002416 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002417 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002418 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002419 }
2420}
2421
Marat Dukhan08b7a972020-07-14 18:17:29 -07002422TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3s2_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002423 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08002424 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07002425 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002426 .input_size(input_height, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002427 .padding(1)
2428 .kernel_size(3, 3)
2429 .stride(2)
2430 .groups(2)
2431 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002432 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002433 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002434 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002435 }
2436}
2437
Marat Dukhan08b7a972020-07-14 18:17:29 -07002438TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3s2_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002439 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08002440 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07002441 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002442 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002443 .padding(1)
2444 .kernel_size(3, 3)
2445 .stride(2)
2446 .groups(2)
2447 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002448 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002449 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002450 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002451 }
2452}
2453
Marat Dukhan08b7a972020-07-14 18:17:29 -07002454TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3s2_varying_input_height_with_tf_same_padding) {
Marat Dukhan58717032020-04-28 15:03:28 -07002455 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2456 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
2457 DeconvolutionOperatorTester()
2458 .input_size(input_height, kStridedInputWidth)
2459 .padding_tf_same(true)
2460 .kernel_size(3, 3)
2461 .stride(2)
2462 .groups(2)
2463 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002464 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan58717032020-04-28 15:03:28 -07002465 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002466 .TestQU8();
Marat Dukhan58717032020-04-28 15:03:28 -07002467 }
2468}
2469
Marat Dukhan08b7a972020-07-14 18:17:29 -07002470TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3s2_varying_input_width_with_tf_same_padding) {
Marat Dukhan58717032020-04-28 15:03:28 -07002471 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2472 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
2473 DeconvolutionOperatorTester()
2474 .input_size(kStridedInputHeight, kStridedInputWidth)
2475 .padding_tf_same(true)
2476 .kernel_size(3, 3)
2477 .stride(2)
2478 .groups(2)
2479 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002480 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan58717032020-04-28 15:03:28 -07002481 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002482 .TestQU8();
Marat Dukhan58717032020-04-28 15:03:28 -07002483 }
2484}
2485
Marat Dukhan08b7a972020-07-14 18:17:29 -07002486TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3s2_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002487 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002488 for (size_t input_channels = 14; input_channels <= 20; input_channels++) {
2489 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002490 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002491 .padding(1)
2492 .kernel_size(3, 3)
2493 .stride(2)
2494 .groups(2)
2495 .group_input_channels(input_channels)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002496 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002497 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002498 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002499 }
2500}
2501
Marat Dukhan08b7a972020-07-14 18:17:29 -07002502TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3s2_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002503 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan08b7a972020-07-14 18:17:29 -07002504 for (size_t output_channels = 1; output_channels <= xnn_params.qu8.gemm.nr * 2; output_channels *= 2) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07002505 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002506 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002507 .padding(1)
2508 .kernel_size(3, 3)
2509 .stride(2)
2510 .groups(2)
2511 .group_input_channels(17)
2512 .group_output_channels(output_channels)
2513 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002514 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002515 }
2516}
2517
Marat Dukhan08b7a972020-07-14 18:17:29 -07002518TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3s2_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002519 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002520 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002521 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002522 .padding(1)
2523 .kernel_size(3, 3)
2524 .stride(2)
2525 .groups(2)
2526 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002527 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002528 .input_pixel_stride(37)
2529 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002530 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002531}
2532
Marat Dukhan08b7a972020-07-14 18:17:29 -07002533TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3s2_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002534 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002535 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002536 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002537 .padding(1)
2538 .kernel_size(3, 3)
2539 .stride(2)
2540 .groups(2)
2541 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002542 .group_output_channels(xnn_params.qu8.gemm.nr + 3)
2543 .output_pixel_stride(xnn_params.qu8.gemm.nr * 2 + 13)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002544 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002545 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002546}
2547
Marat Dukhan08b7a972020-07-14 18:17:29 -07002548TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3s2_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002549 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002550 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002551 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002552 .padding(1)
2553 .kernel_size(3, 3)
2554 .stride(2)
2555 .groups(2)
2556 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002557 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002558 .qmin(128)
2559 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002560 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002561}
2562
Marat Dukhan08b7a972020-07-14 18:17:29 -07002563TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3s2_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002564 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002565 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08002566 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002567 .padding(1)
2568 .kernel_size(3, 3)
2569 .stride(2)
2570 .groups(2)
2571 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002572 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -07002573 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002574 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002575 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002576}
2577
Marat Dukhan08b7a972020-07-14 18:17:29 -07002578TEST(DECONVOLUTION_NHWC_QU8, grouped_3x3s2_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002579 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -07002580 DeconvolutionOperatorTester()
2581 .has_bias(false)
Marat Dukhana41533d2019-11-04 10:40:51 -08002582 .input_size(kStridedInputHeight, kStridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -07002583 .padding(1)
2584 .kernel_size(3, 3)
2585 .stride(2)
2586 .groups(2)
2587 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002588 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanf568f082019-10-30 09:47:07 -07002589 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002590 .TestQU8();
Marat Dukhanf568f082019-10-30 09:47:07 -07002591}
2592
Marat Dukhan29954272020-02-13 17:56:11 -08002593/**************************** SUBCONV2D/IGEMM path, batched ****************************/
XNNPACK Teamb455b122019-09-27 18:10:33 -07002594
Marat Dukhan08b7a972020-07-14 18:17:29 -07002595TEST(DECONVOLUTION_NHWC_QU8, batched_3x3s2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002596 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002597 DeconvolutionOperatorTester()
2598 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08002599 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002600 .padding(1)
2601 .kernel_size(3, 3)
2602 .stride(2)
2603 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002604 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002605 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002606 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002607}
2608
Marat Dukhan08b7a972020-07-14 18:17:29 -07002609TEST(DECONVOLUTION_NHWC_QU8, batched_Kx3s2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002610 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002611 for (size_t kernel_height = 2; kernel_height <= 5; kernel_height++) {
2612 DeconvolutionOperatorTester()
2613 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08002614 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002615 .padding_width(1)
2616 .kernel_size(kernel_height, 3)
2617 .stride(2)
2618 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002619 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002620 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002621 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002622 }
2623}
2624
Marat Dukhan08b7a972020-07-14 18:17:29 -07002625TEST(DECONVOLUTION_NHWC_QU8, batched_3xKs2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002626 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002627 for (size_t kernel_width = 2; kernel_width <= 5; kernel_width++) {
2628 DeconvolutionOperatorTester()
2629 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08002630 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002631 .padding_height(1)
2632 .kernel_size(3, kernel_width)
2633 .stride(2)
2634 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002635 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002636 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002637 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002638 }
2639}
2640
Marat Dukhan08b7a972020-07-14 18:17:29 -07002641TEST(DECONVOLUTION_NHWC_QU8, batched_3x3sSx1) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002642 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002643 for (size_t stride_height = 2; stride_height <= 3; stride_height++) {
2644 DeconvolutionOperatorTester()
2645 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08002646 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002647 .padding(1)
2648 .padding_width(1)
2649 .kernel_size(3, 3)
2650 .stride_height(stride_height)
2651 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002652 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002653 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002654 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002655 }
2656}
2657
Marat Dukhan08b7a972020-07-14 18:17:29 -07002658TEST(DECONVOLUTION_NHWC_QU8, batched_3x3s1xS) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002659 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002660 for (size_t stride_width = 2; stride_width <= 3; stride_width++) {
2661 DeconvolutionOperatorTester()
2662 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08002663 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002664 .padding(1)
2665 .padding_width(1)
2666 .kernel_size(3, 3)
2667 .stride_width(stride_width)
2668 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002669 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002670 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002671 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002672 }
2673}
2674
Marat Dukhan08b7a972020-07-14 18:17:29 -07002675TEST(DECONVOLUTION_NHWC_QU8, batched_3x3s2_varying_height_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002676 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002677 for (size_t padding_top = 0; padding_top <= 2; padding_top++) {
2678 for (size_t padding_bottom = 0; padding_bottom <= 2; padding_bottom++) {
2679 DeconvolutionOperatorTester()
2680 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08002681 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002682 .padding_width(1)
2683 .padding_top(padding_top)
2684 .padding_bottom(padding_bottom)
2685 .kernel_size(3, 3)
2686 .stride(2)
2687 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002688 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002689 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002690 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002691 }
2692 }
2693}
2694
Marat Dukhan08b7a972020-07-14 18:17:29 -07002695TEST(DECONVOLUTION_NHWC_QU8, batched_3x3s2_varying_width_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002696 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002697 for (size_t padding_left = 0; padding_left <= 2; padding_left++) {
2698 for (size_t padding_right = 0; padding_right <= 2; padding_right++) {
2699 DeconvolutionOperatorTester()
2700 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08002701 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002702 .padding_height(1)
2703 .padding_left(padding_left)
2704 .padding_right(padding_right)
2705 .kernel_size(3, 3)
2706 .stride(2)
2707 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002708 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002709 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002710 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002711 }
2712 }
2713}
2714
Marat Dukhan08b7a972020-07-14 18:17:29 -07002715TEST(DECONVOLUTION_NHWC_QU8, batched_3x3s2_varying_height_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002716 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan1898b912019-11-05 12:25:18 -08002717 for (size_t adjustment_height = 0; adjustment_height <= 1; adjustment_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07002718 DeconvolutionOperatorTester()
2719 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08002720 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002721 .padding(1)
2722 .adjustment_height(adjustment_height)
2723 .kernel_size(3, 3)
2724 .stride(2)
2725 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002726 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002727 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002728 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002729 }
2730}
2731
Marat Dukhan08b7a972020-07-14 18:17:29 -07002732TEST(DECONVOLUTION_NHWC_QU8, batched_3x3s2_varying_width_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002733 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan1898b912019-11-05 12:25:18 -08002734 for (size_t adjustment_width = 0; adjustment_width <= 1; adjustment_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07002735 DeconvolutionOperatorTester()
2736 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08002737 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002738 .padding(1)
2739 .adjustment_width(adjustment_width)
2740 .kernel_size(3, 3)
2741 .stride(2)
2742 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002743 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002744 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002745 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002746 }
2747}
2748
Marat Dukhan08b7a972020-07-14 18:17:29 -07002749TEST(DECONVOLUTION_NHWC_QU8, batched_3x3s2_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002750 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08002751 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07002752 DeconvolutionOperatorTester()
2753 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08002754 .input_size(input_height, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002755 .padding(1)
2756 .kernel_size(3, 3)
2757 .stride(2)
2758 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002759 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002760 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002761 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002762 }
2763}
2764
Marat Dukhan08b7a972020-07-14 18:17:29 -07002765TEST(DECONVOLUTION_NHWC_QU8, batched_3x3s2_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002766 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08002767 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07002768 DeconvolutionOperatorTester()
2769 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08002770 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002771 .padding(1)
2772 .kernel_size(3, 3)
2773 .stride(2)
2774 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002775 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002776 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002777 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002778 }
2779}
2780
Marat Dukhan08b7a972020-07-14 18:17:29 -07002781TEST(DECONVOLUTION_NHWC_QU8, batched_3x3s2_varying_input_height_with_tf_same_padding) {
Marat Dukhan58717032020-04-28 15:03:28 -07002782 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2783 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
2784 DeconvolutionOperatorTester()
2785 .batch_size(2)
2786 .input_size(input_height, kStridedInputWidth)
2787 .padding_tf_same(true)
2788 .kernel_size(3, 3)
2789 .stride(2)
2790 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002791 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan58717032020-04-28 15:03:28 -07002792 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002793 .TestQU8();
Marat Dukhan58717032020-04-28 15:03:28 -07002794 }
2795}
2796
Marat Dukhan08b7a972020-07-14 18:17:29 -07002797TEST(DECONVOLUTION_NHWC_QU8, batched_3x3s2_varying_input_width_with_tf_same_padding) {
Marat Dukhan58717032020-04-28 15:03:28 -07002798 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
2799 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
2800 DeconvolutionOperatorTester()
2801 .batch_size(2)
2802 .input_size(kStridedInputHeight, kStridedInputWidth)
2803 .padding_tf_same(true)
2804 .kernel_size(3, 3)
2805 .stride(2)
2806 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002807 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan58717032020-04-28 15:03:28 -07002808 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002809 .TestQU8();
Marat Dukhan58717032020-04-28 15:03:28 -07002810 }
2811}
2812
Marat Dukhan08b7a972020-07-14 18:17:29 -07002813TEST(DECONVOLUTION_NHWC_QU8, batched_3x3s2_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002814 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002815 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
2816 DeconvolutionOperatorTester()
2817 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08002818 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002819 .padding(1)
2820 .kernel_size(3, 3)
2821 .stride(2)
2822 .group_input_channels(input_channels)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002823 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002824 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002825 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002826 }
2827}
2828
Marat Dukhan08b7a972020-07-14 18:17:29 -07002829TEST(DECONVOLUTION_NHWC_QU8, batched_3x3s2_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002830 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan08b7a972020-07-14 18:17:29 -07002831 for (size_t output_channels = 1; output_channels <= xnn_params.qu8.gemm.nr * 2; output_channels *= 2) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07002832 DeconvolutionOperatorTester()
2833 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08002834 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002835 .padding(1)
2836 .kernel_size(3, 3)
2837 .stride(2)
2838 .group_input_channels(23)
2839 .group_output_channels(output_channels)
2840 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002841 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002842 }
2843}
2844
Marat Dukhan08b7a972020-07-14 18:17:29 -07002845TEST(DECONVOLUTION_NHWC_QU8, batched_3x3s2_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002846 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002847 DeconvolutionOperatorTester()
2848 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08002849 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002850 .padding(1)
2851 .kernel_size(3, 3)
2852 .stride(2)
2853 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002854 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002855 .input_pixel_stride(28)
2856 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002857 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002858}
2859
Marat Dukhan08b7a972020-07-14 18:17:29 -07002860TEST(DECONVOLUTION_NHWC_QU8, batched_3x3s2_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002861 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002862 DeconvolutionOperatorTester()
2863 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08002864 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002865 .padding(1)
2866 .kernel_size(3, 3)
2867 .stride(2)
2868 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002869 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
2870 .output_pixel_stride(xnn_params.qu8.gemm.nr * 2 + 13)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002871 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002872 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002873}
2874
Marat Dukhan08b7a972020-07-14 18:17:29 -07002875TEST(DECONVOLUTION_NHWC_QU8, batched_3x3s2_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002876 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002877 DeconvolutionOperatorTester()
2878 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08002879 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002880 .padding(1)
2881 .kernel_size(3, 3)
2882 .stride(2)
2883 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002884 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002885 .qmin(128)
2886 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002887 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002888}
2889
Marat Dukhan08b7a972020-07-14 18:17:29 -07002890TEST(DECONVOLUTION_NHWC_QU8, batched_3x3s2_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002891 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002892 DeconvolutionOperatorTester()
2893 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08002894 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002895 .padding(1)
2896 .kernel_size(3, 3)
2897 .stride(2)
2898 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002899 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -07002900 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002901 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002902 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002903}
2904
Marat Dukhan08b7a972020-07-14 18:17:29 -07002905TEST(DECONVOLUTION_NHWC_QU8, batched_3x3s2_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002906 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -07002907 DeconvolutionOperatorTester()
2908 .has_bias(false)
2909 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08002910 .input_size(kStridedInputHeight, kStridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -07002911 .padding(1)
2912 .kernel_size(3, 3)
2913 .stride(2)
2914 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002915 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanf568f082019-10-30 09:47:07 -07002916 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002917 .TestQU8();
Marat Dukhanf568f082019-10-30 09:47:07 -07002918}
2919
Marat Dukhan29954272020-02-13 17:56:11 -08002920/**************************** SUBCONV2D/IGEMM path, grouped, batched ****************************/
XNNPACK Teamb455b122019-09-27 18:10:33 -07002921
Marat Dukhan08b7a972020-07-14 18:17:29 -07002922TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3s2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002923 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002924 DeconvolutionOperatorTester()
2925 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08002926 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002927 .padding(1)
2928 .kernel_size(3, 3)
2929 .stride(2)
2930 .groups(2)
2931 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002932 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002933 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002934 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002935}
2936
Marat Dukhan08b7a972020-07-14 18:17:29 -07002937TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_Kx3s2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002938 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002939 for (size_t kernel_height = 2; kernel_height <= 5; kernel_height++) {
2940 DeconvolutionOperatorTester()
2941 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08002942 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002943 .padding_width(1)
2944 .kernel_size(kernel_height, 3)
2945 .stride(2)
2946 .groups(2)
2947 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002948 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002949 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002950 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002951 }
2952}
2953
Marat Dukhan08b7a972020-07-14 18:17:29 -07002954TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3xKs2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002955 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002956 for (size_t kernel_width = 2; kernel_width <= 5; kernel_width++) {
2957 DeconvolutionOperatorTester()
2958 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08002959 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002960 .padding_height(1)
2961 .kernel_size(3, kernel_width)
2962 .stride(2)
2963 .groups(2)
2964 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002965 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002966 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002967 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002968 }
2969}
2970
Marat Dukhan08b7a972020-07-14 18:17:29 -07002971TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3sSx1) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002972 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002973 for (size_t stride_height = 2; stride_height <= 3; stride_height++) {
2974 DeconvolutionOperatorTester()
2975 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08002976 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002977 .padding(1)
2978 .padding_width(1)
2979 .kernel_size(3, 3)
2980 .stride_height(stride_height)
2981 .groups(2)
2982 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002983 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002984 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07002985 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07002986 }
2987}
2988
Marat Dukhan08b7a972020-07-14 18:17:29 -07002989TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3s1xS) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08002990 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07002991 for (size_t stride_width = 2; stride_width <= 3; stride_width++) {
2992 DeconvolutionOperatorTester()
2993 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08002994 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07002995 .padding(1)
2996 .padding_width(1)
2997 .kernel_size(3, 3)
2998 .stride_width(stride_width)
2999 .groups(2)
3000 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003001 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003002 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003003 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07003004 }
3005}
3006
Marat Dukhan08b7a972020-07-14 18:17:29 -07003007TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3s2_varying_height_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08003008 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07003009 for (size_t padding_top = 0; padding_top <= 2; padding_top++) {
3010 for (size_t padding_bottom = 0; padding_bottom <= 2; padding_bottom++) {
3011 DeconvolutionOperatorTester()
3012 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08003013 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003014 .padding_width(1)
3015 .padding_top(padding_top)
3016 .padding_bottom(padding_bottom)
3017 .kernel_size(3, 3)
3018 .stride(2)
3019 .groups(2)
3020 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003021 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003022 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003023 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07003024 }
3025 }
3026}
3027
Marat Dukhan08b7a972020-07-14 18:17:29 -07003028TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3s2_varying_width_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08003029 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07003030 for (size_t padding_left = 0; padding_left <= 2; padding_left++) {
3031 for (size_t padding_right = 0; padding_right <= 2; padding_right++) {
3032 DeconvolutionOperatorTester()
3033 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08003034 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003035 .padding_height(1)
3036 .padding_left(padding_left)
3037 .padding_right(padding_right)
3038 .kernel_size(3, 3)
3039 .stride(2)
3040 .groups(2)
3041 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003042 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003043 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003044 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07003045 }
3046 }
3047}
3048
Marat Dukhan08b7a972020-07-14 18:17:29 -07003049TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3s2_varying_height_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08003050 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan1898b912019-11-05 12:25:18 -08003051 for (size_t adjustment_height = 0; adjustment_height <= 1; adjustment_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07003052 DeconvolutionOperatorTester()
3053 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08003054 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003055 .padding(1)
3056 .adjustment_height(adjustment_height)
3057 .kernel_size(3, 3)
3058 .stride(2)
3059 .groups(2)
3060 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003061 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003062 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003063 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07003064 }
3065}
3066
Marat Dukhan08b7a972020-07-14 18:17:29 -07003067TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3s2_varying_width_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08003068 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan1898b912019-11-05 12:25:18 -08003069 for (size_t adjustment_width = 0; adjustment_width <= 1; adjustment_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07003070 DeconvolutionOperatorTester()
3071 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08003072 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003073 .padding(1)
3074 .adjustment_width(adjustment_width)
3075 .kernel_size(3, 3)
3076 .stride(2)
3077 .groups(2)
3078 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003079 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003080 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003081 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07003082 }
3083}
3084
Marat Dukhan08b7a972020-07-14 18:17:29 -07003085TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3s2_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08003086 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08003087 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07003088 DeconvolutionOperatorTester()
3089 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08003090 .input_size(input_height, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003091 .padding(1)
3092 .kernel_size(3, 3)
3093 .stride(2)
3094 .groups(2)
3095 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003096 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003097 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003098 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07003099 }
3100}
3101
Marat Dukhan08b7a972020-07-14 18:17:29 -07003102TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3s2_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08003103 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08003104 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07003105 DeconvolutionOperatorTester()
3106 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08003107 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003108 .padding(1)
3109 .kernel_size(3, 3)
3110 .stride(2)
3111 .groups(2)
3112 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003113 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003114 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003115 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07003116 }
3117}
3118
Marat Dukhan08b7a972020-07-14 18:17:29 -07003119TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3s2_varying_input_height_with_tf_same_padding) {
Marat Dukhan58717032020-04-28 15:03:28 -07003120 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3121 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
3122 DeconvolutionOperatorTester()
3123 .batch_size(2)
3124 .input_size(input_height, kStridedInputWidth)
3125 .padding_tf_same(true)
3126 .kernel_size(3, 3)
3127 .stride(2)
3128 .groups(2)
3129 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003130 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan58717032020-04-28 15:03:28 -07003131 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003132 .TestQU8();
Marat Dukhan58717032020-04-28 15:03:28 -07003133 }
3134}
3135
Marat Dukhan08b7a972020-07-14 18:17:29 -07003136TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3s2_varying_input_width_with_tf_same_padding) {
Marat Dukhan58717032020-04-28 15:03:28 -07003137 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3138 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
3139 DeconvolutionOperatorTester()
3140 .batch_size(2)
3141 .input_size(kStridedInputHeight, kStridedInputWidth)
3142 .padding_tf_same(true)
3143 .kernel_size(3, 3)
3144 .stride(2)
3145 .groups(2)
3146 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003147 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan58717032020-04-28 15:03:28 -07003148 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003149 .TestQU8();
Marat Dukhan58717032020-04-28 15:03:28 -07003150 }
3151}
3152
Marat Dukhan08b7a972020-07-14 18:17:29 -07003153TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3s2_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08003154 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07003155 for (size_t input_channels = 14; input_channels <= 20; input_channels++) {
3156 DeconvolutionOperatorTester()
3157 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08003158 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003159 .padding(1)
3160 .kernel_size(3, 3)
3161 .stride(2)
3162 .groups(2)
3163 .group_input_channels(input_channels)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003164 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003165 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003166 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07003167 }
3168}
3169
Marat Dukhan08b7a972020-07-14 18:17:29 -07003170TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3s2_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08003171 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan08b7a972020-07-14 18:17:29 -07003172 for (size_t output_channels = 1; output_channels <= xnn_params.qu8.gemm.nr * 2; output_channels *= 2) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07003173 DeconvolutionOperatorTester()
3174 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08003175 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003176 .padding(1)
3177 .kernel_size(3, 3)
3178 .stride(2)
3179 .groups(2)
3180 .group_input_channels(17)
3181 .group_output_channels(output_channels)
3182 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003183 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07003184 }
3185}
3186
Marat Dukhan08b7a972020-07-14 18:17:29 -07003187TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3s2_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08003188 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07003189 DeconvolutionOperatorTester()
3190 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08003191 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003192 .padding(1)
3193 .kernel_size(3, 3)
3194 .stride(2)
3195 .groups(2)
3196 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003197 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003198 .input_pixel_stride(37)
3199 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003200 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07003201}
3202
Marat Dukhan08b7a972020-07-14 18:17:29 -07003203TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3s2_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08003204 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07003205 DeconvolutionOperatorTester()
3206 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08003207 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003208 .padding(1)
3209 .kernel_size(3, 3)
3210 .stride(2)
3211 .groups(2)
3212 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003213 .group_output_channels(xnn_params.qu8.gemm.nr + 3)
3214 .output_pixel_stride(xnn_params.qu8.gemm.nr * 2 + 13)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003215 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003216 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07003217}
3218
Marat Dukhan08b7a972020-07-14 18:17:29 -07003219TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3s2_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08003220 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07003221 DeconvolutionOperatorTester()
3222 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08003223 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003224 .padding(1)
3225 .kernel_size(3, 3)
3226 .stride(2)
3227 .groups(2)
3228 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003229 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003230 .qmin(128)
3231 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003232 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07003233}
3234
Marat Dukhan08b7a972020-07-14 18:17:29 -07003235TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3s2_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08003236 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07003237 DeconvolutionOperatorTester()
3238 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08003239 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003240 .padding(1)
3241 .kernel_size(3, 3)
3242 .stride(2)
3243 .groups(2)
3244 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003245 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -07003246 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003247 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003248 .TestQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07003249}
3250
Marat Dukhan08b7a972020-07-14 18:17:29 -07003251TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_3x3s2_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08003252 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -07003253 DeconvolutionOperatorTester()
3254 .has_bias(false)
3255 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08003256 .input_size(kStridedInputHeight, kStridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -07003257 .padding(1)
3258 .kernel_size(3, 3)
3259 .stride(2)
3260 .groups(2)
3261 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003262 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhanf568f082019-10-30 09:47:07 -07003263 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003264 .TestQU8();
Marat Dukhanf568f082019-10-30 09:47:07 -07003265}
3266
Marat Dukhan29954272020-02-13 17:56:11 -08003267/**************************** SUBCONV2D/IGEMM path, setup ****************************/
XNNPACK Teamb455b122019-09-27 18:10:33 -07003268
Marat Dukhan08b7a972020-07-14 18:17:29 -07003269TEST(DECONVOLUTION_NHWC_QU8, 3x3s2_setup_changing_batch) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08003270 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07003271 DeconvolutionOperatorTester()
3272 .batch_size(2)
3273 .next_batch_size(5)
Marat Dukhana41533d2019-11-04 10:40:51 -08003274 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003275 .kernel_height(3)
3276 .kernel_width(5)
3277 .stride(2)
3278 .groups(2)
3279 .group_input_channels(15)
3280 .group_output_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003281 .TestSetupQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07003282}
3283
Marat Dukhan08b7a972020-07-14 18:17:29 -07003284TEST(DECONVOLUTION_NHWC_QU8, 3x3s2_setup_changing_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08003285 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07003286 DeconvolutionOperatorTester()
3287 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08003288 .input_size(kStridedInputHeight, kStridedInputWidth)
3289 .next_input_height(kStridedInputHeight + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003290 .kernel_height(3)
3291 .kernel_width(5)
3292 .stride(2)
3293 .groups(2)
3294 .group_input_channels(15)
3295 .group_output_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003296 .TestSetupQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07003297}
3298
Marat Dukhan08b7a972020-07-14 18:17:29 -07003299TEST(DECONVOLUTION_NHWC_QU8, 3x3s2_setup_changing_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08003300 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07003301 DeconvolutionOperatorTester()
3302 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08003303 .input_size(kStridedInputHeight, kStridedInputWidth)
3304 .next_input_width(kStridedInputWidth + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07003305 .kernel_height(3)
3306 .kernel_width(5)
3307 .stride(2)
3308 .groups(2)
3309 .group_input_channels(15)
3310 .group_output_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003311 .TestSetupQU8();
XNNPACK Teamb455b122019-09-27 18:10:33 -07003312}
3313
Marat Dukhan29954272020-02-13 17:56:11 -08003314/**************************** SUBCONV2D/GEMM path ****************************/
3315
Marat Dukhan08b7a972020-07-14 18:17:29 -07003316TEST(DECONVOLUTION_NHWC_QU8, 2x2s2) {
Marat Dukhan29954272020-02-13 17:56:11 -08003317 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3318 DeconvolutionOperatorTester()
3319 .input_size(kStridedInputHeight, kStridedInputWidth)
3320 .kernel_size(2, 2)
3321 .stride(2)
3322 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003323 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003324 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003325 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003326}
3327
Marat Dukhan08b7a972020-07-14 18:17:29 -07003328TEST(DECONVOLUTION_NHWC_QU8, Kx2sKx2) {
Marat Dukhan29954272020-02-13 17:56:11 -08003329 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3330 for (size_t kernel_height = 3; kernel_height <= 5; kernel_height++) {
3331 DeconvolutionOperatorTester()
3332 .input_size(kStridedInputHeight, kStridedInputWidth)
3333 .kernel_size(kernel_height, 2)
3334 .stride(kernel_height, 2)
3335 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003336 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003337 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003338 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003339 }
3340}
3341
Marat Dukhan08b7a972020-07-14 18:17:29 -07003342TEST(DECONVOLUTION_NHWC_QU8, 2xKs2xK) {
Marat Dukhan29954272020-02-13 17:56:11 -08003343 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3344 for (size_t kernel_width = 3; kernel_width <= 5; kernel_width++) {
3345 DeconvolutionOperatorTester()
3346 .input_size(kStridedInputHeight, kStridedInputWidth)
3347 .kernel_size(2, kernel_width)
3348 .stride(2, kernel_width)
3349 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003350 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003351 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003352 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003353 }
3354}
3355
Marat Dukhan08b7a972020-07-14 18:17:29 -07003356TEST(DECONVOLUTION_NHWC_QU8, 2x2s2_height_adjustment) {
Marat Dukhan29954272020-02-13 17:56:11 -08003357 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3358 DeconvolutionOperatorTester()
3359 .input_size(kStridedInputHeight, kStridedInputWidth)
3360 .adjustment_height(1)
3361 .kernel_size(2, 2)
3362 .stride(2)
3363 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003364 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003365 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003366 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003367}
3368
Marat Dukhan08b7a972020-07-14 18:17:29 -07003369TEST(DECONVOLUTION_NHWC_QU8, 2x2s2_width_adjustment) {
Marat Dukhan29954272020-02-13 17:56:11 -08003370 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3371 DeconvolutionOperatorTester()
3372 .input_size(kStridedInputHeight, kStridedInputWidth)
3373 .adjustment_width(1)
3374 .kernel_size(2, 2)
3375 .stride(2)
3376 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003377 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003378 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003379 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003380}
3381
Marat Dukhan08b7a972020-07-14 18:17:29 -07003382TEST(DECONVOLUTION_NHWC_QU8, 2x2s2_varying_input_height) {
Marat Dukhan29954272020-02-13 17:56:11 -08003383 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3384 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
3385 DeconvolutionOperatorTester()
3386 .input_size(input_height, kStridedInputWidth)
3387 .kernel_size(2, 2)
3388 .stride(2)
3389 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003390 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003391 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003392 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003393 }
3394}
3395
Marat Dukhan08b7a972020-07-14 18:17:29 -07003396TEST(DECONVOLUTION_NHWC_QU8, 2x2s2_varying_input_width) {
Marat Dukhan29954272020-02-13 17:56:11 -08003397 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3398 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
3399 DeconvolutionOperatorTester()
3400 .input_size(kStridedInputHeight, kStridedInputWidth)
3401 .kernel_size(2, 2)
3402 .stride(2)
3403 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003404 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003405 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003406 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003407 }
3408}
3409
Marat Dukhan08b7a972020-07-14 18:17:29 -07003410TEST(DECONVOLUTION_NHWC_QU8, 2x2s2_varying_input_channels) {
Marat Dukhan29954272020-02-13 17:56:11 -08003411 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3412 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
3413 DeconvolutionOperatorTester()
3414 .input_size(kStridedInputHeight, kStridedInputWidth)
3415 .kernel_size(2, 2)
3416 .stride(2)
3417 .group_input_channels(input_channels)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003418 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003419 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003420 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003421 }
3422}
3423
Marat Dukhan08b7a972020-07-14 18:17:29 -07003424TEST(DECONVOLUTION_NHWC_QU8, 2x2s2_varying_output_channels) {
Marat Dukhan29954272020-02-13 17:56:11 -08003425 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan08b7a972020-07-14 18:17:29 -07003426 for (size_t output_channels = 1; output_channels <= xnn_params.qu8.gemm.nr * 2; output_channels *= 2) {
Marat Dukhan29954272020-02-13 17:56:11 -08003427 DeconvolutionOperatorTester()
3428 .input_size(kStridedInputHeight, kStridedInputWidth)
3429 .kernel_size(2, 2)
3430 .stride(2)
3431 .group_input_channels(23)
3432 .group_output_channels(output_channels)
3433 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003434 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003435 }
3436}
3437
Marat Dukhan08b7a972020-07-14 18:17:29 -07003438TEST(DECONVOLUTION_NHWC_QU8, 2x2s2_with_input_stride) {
Marat Dukhan29954272020-02-13 17:56:11 -08003439 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3440 DeconvolutionOperatorTester()
3441 .input_size(kStridedInputHeight, kStridedInputWidth)
3442 .kernel_size(2, 2)
3443 .stride(2)
3444 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003445 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003446 .input_pixel_stride(28)
3447 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003448 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003449}
3450
Marat Dukhan08b7a972020-07-14 18:17:29 -07003451TEST(DECONVOLUTION_NHWC_QU8, 2x2s2_with_output_stride) {
Marat Dukhan29954272020-02-13 17:56:11 -08003452 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3453 DeconvolutionOperatorTester()
3454 .input_size(kStridedInputHeight, kStridedInputWidth)
3455 .kernel_size(2, 2)
3456 .stride(2)
3457 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003458 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
3459 .output_pixel_stride(xnn_params.qu8.gemm.nr * 2 + 13)
Marat Dukhan29954272020-02-13 17:56:11 -08003460 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003461 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003462}
3463
Marat Dukhan08b7a972020-07-14 18:17:29 -07003464TEST(DECONVOLUTION_NHWC_QU8, 2x2s2_with_qmin) {
Marat Dukhan29954272020-02-13 17:56:11 -08003465 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3466 DeconvolutionOperatorTester()
3467 .input_size(kStridedInputHeight, kStridedInputWidth)
3468 .kernel_size(2, 2)
3469 .stride(2)
3470 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003471 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003472 .qmin(128)
3473 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003474 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003475}
3476
Marat Dukhan08b7a972020-07-14 18:17:29 -07003477TEST(DECONVOLUTION_NHWC_QU8, 2x2s2_with_qmax) {
Marat Dukhan29954272020-02-13 17:56:11 -08003478 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3479 DeconvolutionOperatorTester()
3480 .input_size(kStridedInputHeight, kStridedInputWidth)
3481 .kernel_size(2, 2)
3482 .stride(2)
3483 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003484 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003485 .qmax(128)
3486 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003487 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003488}
3489
Marat Dukhan08b7a972020-07-14 18:17:29 -07003490TEST(DECONVOLUTION_NHWC_QU8, 2x2s2_without_bias) {
Marat Dukhan29954272020-02-13 17:56:11 -08003491 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3492 DeconvolutionOperatorTester()
3493 .has_bias(false)
3494 .input_size(kStridedInputHeight, kStridedInputWidth)
3495 .kernel_size(2, 2)
3496 .stride(2)
3497 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003498 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003499 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003500 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003501}
3502
3503/**************************** SUBCONV2D/GEMM path, grouped ****************************/
3504
Marat Dukhan08b7a972020-07-14 18:17:29 -07003505TEST(DECONVOLUTION_NHWC_QU8, grouped_2x2s2) {
Marat Dukhan29954272020-02-13 17:56:11 -08003506 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3507 DeconvolutionOperatorTester()
3508 .input_size(kStridedInputHeight, kStridedInputWidth)
3509 .kernel_size(2, 2)
3510 .stride(2)
3511 .groups(2)
3512 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003513 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003514 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003515 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003516}
3517
Marat Dukhan08b7a972020-07-14 18:17:29 -07003518TEST(DECONVOLUTION_NHWC_QU8, grouped_Kx2sKx2) {
Marat Dukhan29954272020-02-13 17:56:11 -08003519 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3520 for (size_t kernel_height = 3; kernel_height <= 5; kernel_height++) {
3521 DeconvolutionOperatorTester()
3522 .input_size(kStridedInputHeight, kStridedInputWidth)
3523 .kernel_size(kernel_height, 2)
3524 .stride(kernel_height, 2)
3525 .groups(2)
3526 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003527 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003528 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003529 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003530 }
3531}
3532
Marat Dukhan08b7a972020-07-14 18:17:29 -07003533TEST(DECONVOLUTION_NHWC_QU8, grouped_2xKs2xK) {
Marat Dukhan29954272020-02-13 17:56:11 -08003534 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3535 for (size_t kernel_width = 3; kernel_width <= 5; kernel_width++) {
3536 DeconvolutionOperatorTester()
3537 .input_size(kStridedInputHeight, kStridedInputWidth)
3538 .kernel_size(2, kernel_width)
3539 .stride(2, kernel_width)
3540 .groups(2)
3541 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003542 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003543 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003544 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003545 }
3546}
3547
Marat Dukhan08b7a972020-07-14 18:17:29 -07003548TEST(DECONVOLUTION_NHWC_QU8, grouped_2x2s2_height_adjustment) {
Marat Dukhan29954272020-02-13 17:56:11 -08003549 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3550 DeconvolutionOperatorTester()
3551 .input_size(kStridedInputHeight, kStridedInputWidth)
3552 .adjustment_height(1)
3553 .kernel_size(2, 2)
3554 .stride(2)
3555 .groups(2)
3556 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003557 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003558 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003559 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003560}
3561
Marat Dukhan08b7a972020-07-14 18:17:29 -07003562TEST(DECONVOLUTION_NHWC_QU8, grouped_2x2s2_width_adjustment) {
Marat Dukhan29954272020-02-13 17:56:11 -08003563 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3564 DeconvolutionOperatorTester()
3565 .input_size(kStridedInputHeight, kStridedInputWidth)
3566 .adjustment_width(1)
3567 .kernel_size(2, 2)
3568 .stride(2)
3569 .groups(2)
3570 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003571 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003572 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003573 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003574}
3575
Marat Dukhan08b7a972020-07-14 18:17:29 -07003576TEST(DECONVOLUTION_NHWC_QU8, grouped_2x2s2_varying_input_height) {
Marat Dukhan29954272020-02-13 17:56:11 -08003577 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3578 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
3579 DeconvolutionOperatorTester()
3580 .input_size(input_height, kStridedInputWidth)
3581 .kernel_size(2, 2)
3582 .stride(2)
3583 .groups(2)
3584 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003585 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003586 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003587 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003588 }
3589}
3590
Marat Dukhan08b7a972020-07-14 18:17:29 -07003591TEST(DECONVOLUTION_NHWC_QU8, grouped_2x2s2_varying_input_width) {
Marat Dukhan29954272020-02-13 17:56:11 -08003592 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3593 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
3594 DeconvolutionOperatorTester()
3595 .input_size(kStridedInputHeight, kStridedInputWidth)
3596 .kernel_size(2, 2)
3597 .stride(2)
3598 .groups(2)
3599 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003600 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003601 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003602 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003603 }
3604}
3605
Marat Dukhan08b7a972020-07-14 18:17:29 -07003606TEST(DECONVOLUTION_NHWC_QU8, grouped_2x2s2_varying_input_channels) {
Marat Dukhan29954272020-02-13 17:56:11 -08003607 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3608 for (size_t input_channels = 14; input_channels <= 20; input_channels++) {
3609 DeconvolutionOperatorTester()
3610 .input_size(kStridedInputHeight, kStridedInputWidth)
3611 .kernel_size(2, 2)
3612 .stride(2)
3613 .groups(2)
3614 .group_input_channels(input_channels)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003615 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003616 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003617 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003618 }
3619}
3620
Marat Dukhan08b7a972020-07-14 18:17:29 -07003621TEST(DECONVOLUTION_NHWC_QU8, grouped_2x2s2_varying_output_channels) {
Marat Dukhan29954272020-02-13 17:56:11 -08003622 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan08b7a972020-07-14 18:17:29 -07003623 for (size_t output_channels = 1; output_channels <= xnn_params.qu8.gemm.nr * 2; output_channels *= 2) {
Marat Dukhan29954272020-02-13 17:56:11 -08003624 DeconvolutionOperatorTester()
3625 .input_size(kStridedInputHeight, kStridedInputWidth)
3626 .kernel_size(2, 2)
3627 .stride(2)
3628 .groups(2)
3629 .group_input_channels(17)
3630 .group_output_channels(output_channels)
3631 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003632 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003633 }
3634}
3635
Marat Dukhan08b7a972020-07-14 18:17:29 -07003636TEST(DECONVOLUTION_NHWC_QU8, grouped_2x2s2_with_input_stride) {
Marat Dukhan29954272020-02-13 17:56:11 -08003637 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3638 DeconvolutionOperatorTester()
3639 .input_size(kStridedInputHeight, kStridedInputWidth)
3640 .kernel_size(2, 2)
3641 .stride(2)
3642 .groups(2)
3643 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003644 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003645 .input_pixel_stride(37)
3646 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003647 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003648}
3649
Marat Dukhan08b7a972020-07-14 18:17:29 -07003650TEST(DECONVOLUTION_NHWC_QU8, grouped_2x2s2_with_output_stride) {
Marat Dukhan29954272020-02-13 17:56:11 -08003651 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3652 DeconvolutionOperatorTester()
3653 .input_size(kStridedInputHeight, kStridedInputWidth)
3654 .kernel_size(2, 2)
3655 .stride(2)
3656 .groups(2)
3657 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003658 .group_output_channels(xnn_params.qu8.gemm.nr + 3)
3659 .output_pixel_stride(xnn_params.qu8.gemm.nr * 2 + 13)
Marat Dukhan29954272020-02-13 17:56:11 -08003660 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003661 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003662}
3663
Marat Dukhan08b7a972020-07-14 18:17:29 -07003664TEST(DECONVOLUTION_NHWC_QU8, grouped_2x2s2_with_qmin) {
Marat Dukhan29954272020-02-13 17:56:11 -08003665 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3666 DeconvolutionOperatorTester()
3667 .input_size(kStridedInputHeight, kStridedInputWidth)
3668 .kernel_size(2, 2)
3669 .stride(2)
3670 .groups(2)
3671 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003672 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003673 .qmin(128)
3674 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003675 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003676}
3677
Marat Dukhan08b7a972020-07-14 18:17:29 -07003678TEST(DECONVOLUTION_NHWC_QU8, grouped_2x2s2_with_qmax) {
Marat Dukhan29954272020-02-13 17:56:11 -08003679 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3680 DeconvolutionOperatorTester()
3681 .input_size(kStridedInputHeight, kStridedInputWidth)
3682 .kernel_size(2, 2)
3683 .stride(2)
3684 .groups(2)
3685 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003686 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003687 .qmax(128)
3688 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003689 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003690}
3691
Marat Dukhan08b7a972020-07-14 18:17:29 -07003692TEST(DECONVOLUTION_NHWC_QU8, grouped_2x2s2_without_bias) {
Marat Dukhan29954272020-02-13 17:56:11 -08003693 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3694 DeconvolutionOperatorTester()
3695 .has_bias(false)
3696 .input_size(kStridedInputHeight, kStridedInputWidth)
3697 .kernel_size(2, 2)
3698 .stride(2)
3699 .groups(2)
3700 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003701 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003702 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003703 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003704}
3705
3706/**************************** SUBCONV2D/GEMM path, batched ****************************/
3707
Marat Dukhan08b7a972020-07-14 18:17:29 -07003708TEST(DECONVOLUTION_NHWC_QU8, batched_2x2s2) {
Marat Dukhan29954272020-02-13 17:56:11 -08003709 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3710 DeconvolutionOperatorTester()
3711 .batch_size(2)
3712 .input_size(kStridedInputHeight, kStridedInputWidth)
3713 .kernel_size(2, 2)
3714 .stride(2)
3715 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003716 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003717 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003718 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003719}
3720
Marat Dukhan08b7a972020-07-14 18:17:29 -07003721TEST(DECONVOLUTION_NHWC_QU8, batched_Kx2sKx2) {
Marat Dukhan29954272020-02-13 17:56:11 -08003722 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3723 for (size_t kernel_height = 3; kernel_height <= 5; kernel_height++) {
3724 DeconvolutionOperatorTester()
3725 .batch_size(2)
3726 .input_size(kStridedInputHeight, kStridedInputWidth)
3727 .kernel_size(kernel_height, 2)
3728 .stride(kernel_height, 2)
3729 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003730 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003731 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003732 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003733 }
3734}
3735
Marat Dukhan08b7a972020-07-14 18:17:29 -07003736TEST(DECONVOLUTION_NHWC_QU8, batched_2xKs2xK) {
Marat Dukhan29954272020-02-13 17:56:11 -08003737 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3738 for (size_t kernel_width = 3; kernel_width <= 5; kernel_width++) {
3739 DeconvolutionOperatorTester()
3740 .batch_size(2)
3741 .input_size(kStridedInputHeight, kStridedInputWidth)
3742 .kernel_size(2, kernel_width)
3743 .stride(2, kernel_width)
3744 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003745 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003746 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003747 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003748 }
3749}
3750
Marat Dukhan08b7a972020-07-14 18:17:29 -07003751TEST(DECONVOLUTION_NHWC_QU8, batched_2x2s2_height_adjustment) {
Marat Dukhan29954272020-02-13 17:56:11 -08003752 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3753 DeconvolutionOperatorTester()
3754 .batch_size(2)
3755 .input_size(kStridedInputHeight, kStridedInputWidth)
3756 .adjustment_height(1)
3757 .kernel_size(2, 2)
3758 .stride(2)
3759 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003760 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003761 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003762 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003763}
3764
Marat Dukhan08b7a972020-07-14 18:17:29 -07003765TEST(DECONVOLUTION_NHWC_QU8, batched_2x2s2_width_adjustment) {
Marat Dukhan29954272020-02-13 17:56:11 -08003766 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3767 DeconvolutionOperatorTester()
3768 .batch_size(2)
3769 .input_size(kStridedInputHeight, kStridedInputWidth)
3770 .adjustment_width(1)
3771 .kernel_size(2, 2)
3772 .stride(2)
3773 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003774 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003775 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003776 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003777}
3778
Marat Dukhan08b7a972020-07-14 18:17:29 -07003779TEST(DECONVOLUTION_NHWC_QU8, batched_2x2s2_varying_input_height) {
Marat Dukhan29954272020-02-13 17:56:11 -08003780 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3781 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
3782 DeconvolutionOperatorTester()
3783 .batch_size(2)
3784 .input_size(input_height, kStridedInputWidth)
3785 .kernel_size(2, 2)
3786 .stride(2)
3787 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003788 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003789 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003790 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003791 }
3792}
3793
Marat Dukhan08b7a972020-07-14 18:17:29 -07003794TEST(DECONVOLUTION_NHWC_QU8, batched_2x2s2_varying_input_width) {
Marat Dukhan29954272020-02-13 17:56:11 -08003795 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3796 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
3797 DeconvolutionOperatorTester()
3798 .batch_size(2)
3799 .input_size(kStridedInputHeight, kStridedInputWidth)
3800 .kernel_size(2, 2)
3801 .stride(2)
3802 .group_input_channels(15)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003803 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003804 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003805 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003806 }
3807}
3808
Marat Dukhan08b7a972020-07-14 18:17:29 -07003809TEST(DECONVOLUTION_NHWC_QU8, batched_2x2s2_varying_input_channels) {
Marat Dukhan29954272020-02-13 17:56:11 -08003810 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3811 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
3812 DeconvolutionOperatorTester()
3813 .batch_size(2)
3814 .input_size(kStridedInputHeight, kStridedInputWidth)
3815 .kernel_size(2, 2)
3816 .stride(2)
3817 .group_input_channels(input_channels)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003818 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003819 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003820 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003821 }
3822}
3823
Marat Dukhan08b7a972020-07-14 18:17:29 -07003824TEST(DECONVOLUTION_NHWC_QU8, batched_2x2s2_varying_output_channels) {
Marat Dukhan29954272020-02-13 17:56:11 -08003825 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan08b7a972020-07-14 18:17:29 -07003826 for (size_t output_channels = 1; output_channels <= xnn_params.qu8.gemm.nr * 2; output_channels *= 2) {
Marat Dukhan29954272020-02-13 17:56:11 -08003827 DeconvolutionOperatorTester()
3828 .batch_size(2)
3829 .input_size(kStridedInputHeight, kStridedInputWidth)
3830 .kernel_size(2, 2)
3831 .stride(2)
3832 .group_input_channels(23)
3833 .group_output_channels(output_channels)
3834 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003835 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003836 }
3837}
3838
Marat Dukhan08b7a972020-07-14 18:17:29 -07003839TEST(DECONVOLUTION_NHWC_QU8, batched_2x2s2_with_input_stride) {
Marat Dukhan29954272020-02-13 17:56:11 -08003840 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3841 DeconvolutionOperatorTester()
3842 .batch_size(2)
3843 .input_size(kStridedInputHeight, kStridedInputWidth)
3844 .kernel_size(2, 2)
3845 .stride(2)
3846 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003847 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003848 .input_pixel_stride(28)
3849 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003850 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003851}
3852
Marat Dukhan08b7a972020-07-14 18:17:29 -07003853TEST(DECONVOLUTION_NHWC_QU8, batched_2x2s2_with_output_stride) {
Marat Dukhan29954272020-02-13 17:56:11 -08003854 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3855 DeconvolutionOperatorTester()
3856 .batch_size(2)
3857 .input_size(kStridedInputHeight, kStridedInputWidth)
3858 .kernel_size(2, 2)
3859 .stride(2)
3860 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003861 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
3862 .output_pixel_stride(xnn_params.qu8.gemm.nr * 2 + 13)
Marat Dukhan29954272020-02-13 17:56:11 -08003863 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003864 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003865}
3866
Marat Dukhan08b7a972020-07-14 18:17:29 -07003867TEST(DECONVOLUTION_NHWC_QU8, batched_2x2s2_with_qmin) {
Marat Dukhan29954272020-02-13 17:56:11 -08003868 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3869 DeconvolutionOperatorTester()
3870 .batch_size(2)
3871 .input_size(kStridedInputHeight, kStridedInputWidth)
3872 .kernel_size(2, 2)
3873 .stride(2)
3874 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003875 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003876 .qmin(128)
3877 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003878 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003879}
3880
Marat Dukhan08b7a972020-07-14 18:17:29 -07003881TEST(DECONVOLUTION_NHWC_QU8, batched_2x2s2_with_qmax) {
Marat Dukhan29954272020-02-13 17:56:11 -08003882 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3883 DeconvolutionOperatorTester()
3884 .batch_size(2)
3885 .input_size(kStridedInputHeight, kStridedInputWidth)
3886 .kernel_size(2, 2)
3887 .stride(2)
3888 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003889 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003890 .qmax(128)
3891 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003892 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003893}
3894
Marat Dukhan08b7a972020-07-14 18:17:29 -07003895TEST(DECONVOLUTION_NHWC_QU8, batched_2x2s2_without_bias) {
Marat Dukhan29954272020-02-13 17:56:11 -08003896 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3897 DeconvolutionOperatorTester()
3898 .has_bias(false)
3899 .batch_size(2)
3900 .input_size(kStridedInputHeight, kStridedInputWidth)
3901 .kernel_size(2, 2)
3902 .stride(2)
3903 .group_input_channels(23)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003904 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003905 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003906 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003907}
3908
3909/**************************** SUBCONV2D/GEMM path, grouped, batched ****************************/
3910
Marat Dukhan08b7a972020-07-14 18:17:29 -07003911TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_2x2s2) {
Marat Dukhan29954272020-02-13 17:56:11 -08003912 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3913 DeconvolutionOperatorTester()
3914 .batch_size(2)
3915 .input_size(kStridedInputHeight, kStridedInputWidth)
3916 .kernel_size(2, 2)
3917 .stride(2)
3918 .groups(2)
3919 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003920 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003921 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003922 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003923}
3924
Marat Dukhan08b7a972020-07-14 18:17:29 -07003925TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_Kx2sKx2) {
Marat Dukhan29954272020-02-13 17:56:11 -08003926 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3927 for (size_t kernel_height = 3; kernel_height <= 5; kernel_height++) {
3928 DeconvolutionOperatorTester()
3929 .batch_size(2)
3930 .input_size(kStridedInputHeight, kStridedInputWidth)
3931 .kernel_size(kernel_height, 2)
3932 .stride(kernel_height, 2)
3933 .groups(2)
3934 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003935 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003936 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003937 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003938 }
3939}
3940
Marat Dukhan08b7a972020-07-14 18:17:29 -07003941TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_2xKs2xK) {
Marat Dukhan29954272020-02-13 17:56:11 -08003942 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3943 for (size_t kernel_width = 3; kernel_width <= 5; kernel_width++) {
3944 DeconvolutionOperatorTester()
3945 .batch_size(2)
3946 .input_size(kStridedInputHeight, kStridedInputWidth)
3947 .kernel_size(2, kernel_width)
3948 .stride(2, kernel_width)
3949 .groups(2)
3950 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003951 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003952 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003953 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003954 }
3955}
3956
Marat Dukhan08b7a972020-07-14 18:17:29 -07003957TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_2x2s2_height_adjustment) {
Marat Dukhan29954272020-02-13 17:56:11 -08003958 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3959 DeconvolutionOperatorTester()
3960 .batch_size(2)
3961 .input_size(kStridedInputHeight, kStridedInputWidth)
3962 .adjustment_height(1)
3963 .kernel_size(2, 2)
3964 .stride(2)
3965 .groups(2)
3966 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003967 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003968 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003969 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003970}
3971
Marat Dukhan08b7a972020-07-14 18:17:29 -07003972TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_2x2s2_width_adjustment) {
Marat Dukhan29954272020-02-13 17:56:11 -08003973 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3974 DeconvolutionOperatorTester()
3975 .batch_size(2)
3976 .input_size(kStridedInputHeight, kStridedInputWidth)
3977 .adjustment_width(1)
3978 .kernel_size(2, 2)
3979 .stride(2)
3980 .groups(2)
3981 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003982 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003983 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003984 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08003985}
3986
Marat Dukhan08b7a972020-07-14 18:17:29 -07003987TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_2x2s2_varying_input_height) {
Marat Dukhan29954272020-02-13 17:56:11 -08003988 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
3989 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
3990 DeconvolutionOperatorTester()
3991 .batch_size(2)
3992 .input_size(input_height, kStridedInputWidth)
3993 .kernel_size(2, 2)
3994 .stride(2)
3995 .groups(2)
3996 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003997 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08003998 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07003999 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08004000 }
4001}
4002
Marat Dukhan08b7a972020-07-14 18:17:29 -07004003TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_2x2s2_varying_input_width) {
Marat Dukhan29954272020-02-13 17:56:11 -08004004 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
4005 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
4006 DeconvolutionOperatorTester()
4007 .batch_size(2)
4008 .input_size(kStridedInputHeight, kStridedInputWidth)
4009 .kernel_size(2, 2)
4010 .stride(2)
4011 .groups(2)
4012 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07004013 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08004014 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07004015 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08004016 }
4017}
4018
Marat Dukhan08b7a972020-07-14 18:17:29 -07004019TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_2x2s2_varying_input_channels) {
Marat Dukhan29954272020-02-13 17:56:11 -08004020 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
4021 for (size_t input_channels = 14; input_channels <= 20; input_channels++) {
4022 DeconvolutionOperatorTester()
4023 .batch_size(2)
4024 .input_size(kStridedInputHeight, kStridedInputWidth)
4025 .kernel_size(2, 2)
4026 .stride(2)
4027 .groups(2)
4028 .group_input_channels(input_channels)
Marat Dukhan08b7a972020-07-14 18:17:29 -07004029 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08004030 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07004031 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08004032 }
4033}
4034
Marat Dukhan08b7a972020-07-14 18:17:29 -07004035TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_2x2s2_varying_output_channels) {
Marat Dukhan29954272020-02-13 17:56:11 -08004036 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan08b7a972020-07-14 18:17:29 -07004037 for (size_t output_channels = 1; output_channels <= xnn_params.qu8.gemm.nr * 2; output_channels *= 2) {
Marat Dukhan29954272020-02-13 17:56:11 -08004038 DeconvolutionOperatorTester()
4039 .batch_size(2)
4040 .input_size(kStridedInputHeight, kStridedInputWidth)
4041 .kernel_size(2, 2)
4042 .stride(2)
4043 .groups(2)
4044 .group_input_channels(17)
4045 .group_output_channels(output_channels)
4046 .iterations(1)
Marat Dukhan08b7a972020-07-14 18:17:29 -07004047 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08004048 }
4049}
4050
Marat Dukhan08b7a972020-07-14 18:17:29 -07004051TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_2x2s2_with_input_stride) {
Marat Dukhan29954272020-02-13 17:56:11 -08004052 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
4053 DeconvolutionOperatorTester()
4054 .batch_size(2)
4055 .input_size(kStridedInputHeight, kStridedInputWidth)
4056 .kernel_size(2, 2)
4057 .stride(2)
4058 .groups(2)
4059 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07004060 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08004061 .input_pixel_stride(37)
4062 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07004063 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08004064}
4065
Marat Dukhan08b7a972020-07-14 18:17:29 -07004066TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_2x2s2_with_output_stride) {
Marat Dukhan29954272020-02-13 17:56:11 -08004067 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
4068 DeconvolutionOperatorTester()
4069 .batch_size(2)
4070 .input_size(kStridedInputHeight, kStridedInputWidth)
4071 .kernel_size(2, 2)
4072 .stride(2)
4073 .groups(2)
4074 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07004075 .group_output_channels(xnn_params.qu8.gemm.nr + 3)
4076 .output_pixel_stride(xnn_params.qu8.gemm.nr * 2 + 13)
Marat Dukhan29954272020-02-13 17:56:11 -08004077 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07004078 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08004079}
4080
Marat Dukhan08b7a972020-07-14 18:17:29 -07004081TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_2x2s2_with_qmin) {
Marat Dukhan29954272020-02-13 17:56:11 -08004082 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
4083 DeconvolutionOperatorTester()
4084 .batch_size(2)
4085 .input_size(kStridedInputHeight, kStridedInputWidth)
4086 .kernel_size(2, 2)
4087 .stride(2)
4088 .groups(2)
4089 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07004090 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08004091 .qmin(128)
4092 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07004093 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08004094}
4095
Marat Dukhan08b7a972020-07-14 18:17:29 -07004096TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_2x2s2_with_qmax) {
Marat Dukhan29954272020-02-13 17:56:11 -08004097 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
4098 DeconvolutionOperatorTester()
4099 .batch_size(2)
4100 .input_size(kStridedInputHeight, kStridedInputWidth)
4101 .kernel_size(2, 2)
4102 .stride(2)
4103 .groups(2)
4104 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07004105 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08004106 .qmax(128)
4107 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07004108 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08004109}
4110
Marat Dukhan08b7a972020-07-14 18:17:29 -07004111TEST(DECONVOLUTION_NHWC_QU8, batched_grouped_2x2s2_without_bias) {
Marat Dukhan29954272020-02-13 17:56:11 -08004112 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
4113 DeconvolutionOperatorTester()
4114 .has_bias(false)
4115 .batch_size(2)
4116 .input_size(kStridedInputHeight, kStridedInputWidth)
4117 .kernel_size(2, 2)
4118 .stride(2)
4119 .groups(2)
4120 .group_input_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07004121 .group_output_channels(xnn_params.qu8.gemm.nr * 2 + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08004122 .iterations(3)
Marat Dukhan08b7a972020-07-14 18:17:29 -07004123 .TestQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08004124}
4125
4126/**************************** SUBCONV2D/GEMM path, setup ****************************/
4127
Marat Dukhan08b7a972020-07-14 18:17:29 -07004128TEST(DECONVOLUTION_NHWC_QU8, 2x2s2_setup_changing_batch) {
Marat Dukhan29954272020-02-13 17:56:11 -08004129 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
4130 DeconvolutionOperatorTester()
4131 .batch_size(2)
4132 .next_batch_size(5)
4133 .input_size(kStridedInputHeight, kStridedInputWidth)
4134 .kernel_size(2, 2)
4135 .stride(2)
4136 .groups(2)
4137 .group_input_channels(15)
4138 .group_output_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07004139 .TestSetupQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08004140}
4141
Marat Dukhan08b7a972020-07-14 18:17:29 -07004142TEST(DECONVOLUTION_NHWC_QU8, 2x2s2_setup_changing_height) {
Marat Dukhan29954272020-02-13 17:56:11 -08004143 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
4144 DeconvolutionOperatorTester()
4145 .batch_size(2)
4146 .input_size(kStridedInputHeight, kStridedInputWidth)
4147 .next_input_height(kStridedInputHeight + 3)
4148 .kernel_size(2, 2)
4149 .stride(2)
4150 .groups(2)
4151 .group_input_channels(15)
4152 .group_output_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07004153 .TestSetupQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08004154}
4155
Marat Dukhan08b7a972020-07-14 18:17:29 -07004156TEST(DECONVOLUTION_NHWC_QU8, 2x2s2_setup_changing_width) {
Marat Dukhan29954272020-02-13 17:56:11 -08004157 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
4158 DeconvolutionOperatorTester()
4159 .batch_size(2)
4160 .input_size(kStridedInputHeight, kStridedInputWidth)
4161 .next_input_width(kStridedInputWidth + 3)
4162 .kernel_size(2, 2)
4163 .stride(2)
4164 .groups(2)
4165 .group_input_channels(15)
4166 .group_output_channels(17)
Marat Dukhan08b7a972020-07-14 18:17:29 -07004167 .TestSetupQU8();
Marat Dukhan29954272020-02-13 17:56:11 -08004168}
4169
XNNPACK Teamb455b122019-09-27 18:10:33 -07004170/**************************** Future GEMM path ****************************/
4171
Marat Dukhanefc47b82019-11-18 09:25:38 -08004172TEST(DECONVOLUTION_NHWC_F32, 1x1) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004173 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004174 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004175 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004176 .kernel_size(1, 1)
4177 .group_input_channels(23)
4178 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4179 .iterations(3)
4180 .TestF32();
4181}
4182
Marat Dukhanefc47b82019-11-18 09:25:38 -08004183TEST(DECONVOLUTION_NHWC_F32, 1x1_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004184 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08004185 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07004186 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004187 .input_size(input_height, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004188 .kernel_size(1, 1)
4189 .group_input_channels(23)
4190 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4191 .iterations(1)
4192 .TestF32();
4193 }
4194}
4195
Marat Dukhanefc47b82019-11-18 09:25:38 -08004196TEST(DECONVOLUTION_NHWC_F32, 1x1_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004197 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08004198 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07004199 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004200 .input_size(kUnstridedInputHeight, input_width)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004201 .kernel_size(1, 1)
4202 .group_input_channels(23)
4203 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4204 .iterations(1)
4205 .TestF32();
4206 }
4207}
4208
Marat Dukhanefc47b82019-11-18 09:25:38 -08004209TEST(DECONVOLUTION_NHWC_F32, 1x1_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004210 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004211 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
4212 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004213 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004214 .kernel_size(1, 1)
4215 .group_input_channels(input_channels)
4216 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4217 .iterations(1)
4218 .TestF32();
4219 }
4220}
4221
Marat Dukhanefc47b82019-11-18 09:25:38 -08004222TEST(DECONVOLUTION_NHWC_F32, 1x1_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004223 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004224 for (size_t output_channels = 1; output_channels <= xnn_params.f32.gemm.nr * 2; output_channels *= 2) {
4225 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004226 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004227 .kernel_size(1, 1)
4228 .group_input_channels(23)
4229 .group_output_channels(output_channels)
4230 .iterations(1)
4231 .TestF32();
4232 }
4233}
4234
Marat Dukhanefc47b82019-11-18 09:25:38 -08004235TEST(DECONVOLUTION_NHWC_F32, 1x1_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004236 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004237 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004238 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004239 .kernel_size(1, 1)
4240 .group_input_channels(23)
4241 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4242 .input_pixel_stride(28)
4243 .iterations(3)
4244 .TestF32();
4245}
4246
Marat Dukhanefc47b82019-11-18 09:25:38 -08004247TEST(DECONVOLUTION_NHWC_F32, 1x1_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004248 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004249 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004250 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004251 .kernel_size(1, 1)
4252 .group_input_channels(23)
4253 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4254 .output_pixel_stride(xnn_params.f32.gemm.nr * 2 + 13)
4255 .iterations(3)
4256 .TestF32();
4257}
4258
Marat Dukhanefc47b82019-11-18 09:25:38 -08004259TEST(DECONVOLUTION_NHWC_F32, 1x1_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004260 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004261 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004262 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004263 .kernel_size(1, 1)
4264 .group_input_channels(23)
4265 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4266 .qmin(128)
4267 .iterations(3)
4268 .TestF32();
4269}
4270
Marat Dukhanefc47b82019-11-18 09:25:38 -08004271TEST(DECONVOLUTION_NHWC_F32, 1x1_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004272 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004273 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004274 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004275 .kernel_size(1, 1)
4276 .group_input_channels(23)
4277 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -07004278 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004279 .iterations(3)
4280 .TestF32();
4281}
4282
Marat Dukhanefc47b82019-11-18 09:25:38 -08004283TEST(DECONVOLUTION_NHWC_F32, 1x1_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004284 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -07004285 DeconvolutionOperatorTester()
4286 .has_bias(false)
Marat Dukhana41533d2019-11-04 10:40:51 -08004287 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -07004288 .kernel_size(1, 1)
4289 .group_input_channels(23)
4290 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4291 .iterations(3)
4292 .TestF32();
4293}
4294
XNNPACK Teamb455b122019-09-27 18:10:33 -07004295/**************************** Future GEMM path, grouped ****************************/
4296
Marat Dukhanefc47b82019-11-18 09:25:38 -08004297TEST(DECONVOLUTION_NHWC_F32, grouped_1x1) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004298 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004299 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004300 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004301 .kernel_size(1, 1)
4302 .groups(2)
4303 .group_input_channels(23)
4304 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4305 .iterations(3)
4306 .TestF32();
4307}
4308
Marat Dukhanefc47b82019-11-18 09:25:38 -08004309TEST(DECONVOLUTION_NHWC_F32, grouped_1x1_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004310 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08004311 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07004312 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004313 .input_size(input_height, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004314 .kernel_size(1, 1)
4315 .groups(2)
4316 .group_input_channels(23)
4317 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4318 .iterations(1)
4319 .TestF32();
4320 }
4321}
4322
Marat Dukhanefc47b82019-11-18 09:25:38 -08004323TEST(DECONVOLUTION_NHWC_F32, grouped_1x1_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004324 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08004325 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07004326 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004327 .input_size(kUnstridedInputHeight, input_width)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004328 .kernel_size(1, 1)
4329 .groups(2)
4330 .group_input_channels(23)
4331 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4332 .iterations(1)
4333 .TestF32();
4334 }
4335}
4336
Marat Dukhanefc47b82019-11-18 09:25:38 -08004337TEST(DECONVOLUTION_NHWC_F32, grouped_1x1_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004338 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004339 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
4340 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004341 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004342 .kernel_size(1, 1)
4343 .groups(2)
4344 .group_input_channels(input_channels)
4345 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4346 .iterations(1)
4347 .TestF32();
4348 }
4349}
4350
Marat Dukhanefc47b82019-11-18 09:25:38 -08004351TEST(DECONVOLUTION_NHWC_F32, grouped_1x1_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004352 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004353 for (size_t output_channels = 1; output_channels <= xnn_params.f32.gemm.nr * 2; output_channels *= 2) {
4354 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004355 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004356 .kernel_size(1, 1)
4357 .groups(2)
4358 .group_input_channels(23)
4359 .group_output_channels(output_channels)
4360 .iterations(1)
4361 .TestF32();
4362 }
4363}
4364
Marat Dukhanefc47b82019-11-18 09:25:38 -08004365TEST(DECONVOLUTION_NHWC_F32, grouped_1x1_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004366 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004367 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004368 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004369 .kernel_size(1, 1)
4370 .groups(2)
4371 .group_input_channels(23)
4372 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4373 .input_pixel_stride(47)
4374 .iterations(3)
4375 .TestF32();
4376}
4377
Marat Dukhanefc47b82019-11-18 09:25:38 -08004378TEST(DECONVOLUTION_NHWC_F32, grouped_1x1_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004379 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004380 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004381 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004382 .kernel_size(1, 1)
4383 .groups(2)
4384 .group_input_channels(23)
4385 .group_output_channels(xnn_params.f32.gemm.nr + 3)
4386 .output_pixel_stride(xnn_params.f32.gemm.nr * 2 + 13)
4387 .iterations(3)
4388 .TestF32();
4389}
4390
Marat Dukhanefc47b82019-11-18 09:25:38 -08004391TEST(DECONVOLUTION_NHWC_F32, grouped_1x1_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004392 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004393 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004394 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004395 .kernel_size(1, 1)
4396 .groups(2)
4397 .group_input_channels(23)
4398 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4399 .qmin(128)
4400 .iterations(3)
4401 .TestF32();
4402}
4403
Marat Dukhanefc47b82019-11-18 09:25:38 -08004404TEST(DECONVOLUTION_NHWC_F32, grouped_1x1_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004405 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004406 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004407 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004408 .kernel_size(1, 1)
4409 .groups(2)
4410 .group_input_channels(23)
4411 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -07004412 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004413 .iterations(3)
4414 .TestF32();
4415}
4416
Marat Dukhanefc47b82019-11-18 09:25:38 -08004417TEST(DECONVOLUTION_NHWC_F32, grouped_1x1_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004418 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -07004419 DeconvolutionOperatorTester()
4420 .has_bias(false)
Marat Dukhana41533d2019-11-04 10:40:51 -08004421 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -07004422 .kernel_size(1, 1)
4423 .groups(2)
4424 .group_input_channels(23)
4425 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4426 .iterations(3)
4427 .TestF32();
4428}
4429
XNNPACK Teamb455b122019-09-27 18:10:33 -07004430/**************************** Future GEMM path, batched ****************************/
4431
Marat Dukhanefc47b82019-11-18 09:25:38 -08004432TEST(DECONVOLUTION_NHWC_F32, batched_1x1) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004433 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004434 DeconvolutionOperatorTester()
4435 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08004436 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004437 .kernel_size(1, 1)
4438 .group_input_channels(23)
4439 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4440 .iterations(3)
4441 .TestF32();
4442}
4443
Marat Dukhanefc47b82019-11-18 09:25:38 -08004444TEST(DECONVOLUTION_NHWC_F32, batched_1x1_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004445 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08004446 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07004447 DeconvolutionOperatorTester()
4448 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08004449 .input_size(input_height, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004450 .kernel_size(1, 1)
4451 .group_input_channels(23)
4452 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4453 .iterations(1)
4454 .TestF32();
4455 }
4456}
4457
Marat Dukhanefc47b82019-11-18 09:25:38 -08004458TEST(DECONVOLUTION_NHWC_F32, batched_1x1_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004459 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08004460 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07004461 DeconvolutionOperatorTester()
4462 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08004463 .input_size(kUnstridedInputHeight, input_width)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004464 .kernel_size(1, 1)
4465 .group_input_channels(23)
4466 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4467 .iterations(1)
4468 .TestF32();
4469 }
4470}
4471
Marat Dukhanefc47b82019-11-18 09:25:38 -08004472TEST(DECONVOLUTION_NHWC_F32, batched_1x1_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004473 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004474 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
4475 DeconvolutionOperatorTester()
4476 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08004477 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004478 .kernel_size(1, 1)
4479 .group_input_channels(input_channels)
4480 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4481 .iterations(1)
4482 .TestF32();
4483 }
4484}
4485
Marat Dukhanefc47b82019-11-18 09:25:38 -08004486TEST(DECONVOLUTION_NHWC_F32, batched_1x1_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004487 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004488 for (size_t output_channels = 1; output_channels <= xnn_params.f32.gemm.nr * 2; output_channels *= 2) {
4489 DeconvolutionOperatorTester()
4490 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08004491 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004492 .kernel_size(1, 1)
4493 .group_input_channels(23)
4494 .group_output_channels(output_channels)
4495 .iterations(1)
4496 .TestF32();
4497 }
4498}
4499
Marat Dukhanefc47b82019-11-18 09:25:38 -08004500TEST(DECONVOLUTION_NHWC_F32, batched_1x1_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004501 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004502 DeconvolutionOperatorTester()
4503 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08004504 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004505 .kernel_size(1, 1)
4506 .group_input_channels(23)
4507 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4508 .input_pixel_stride(28)
4509 .iterations(3)
4510 .TestF32();
4511}
4512
Marat Dukhanefc47b82019-11-18 09:25:38 -08004513TEST(DECONVOLUTION_NHWC_F32, batched_1x1_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004514 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004515 DeconvolutionOperatorTester()
4516 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08004517 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004518 .kernel_size(1, 1)
4519 .group_input_channels(23)
4520 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4521 .output_pixel_stride(xnn_params.f32.gemm.nr * 2 + 13)
4522 .iterations(3)
4523 .TestF32();
4524}
4525
Marat Dukhanefc47b82019-11-18 09:25:38 -08004526TEST(DECONVOLUTION_NHWC_F32, batched_1x1_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004527 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004528 DeconvolutionOperatorTester()
4529 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08004530 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004531 .kernel_size(1, 1)
4532 .group_input_channels(23)
4533 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4534 .qmin(128)
4535 .iterations(3)
4536 .TestF32();
4537}
4538
Marat Dukhanefc47b82019-11-18 09:25:38 -08004539TEST(DECONVOLUTION_NHWC_F32, batched_1x1_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004540 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004541 DeconvolutionOperatorTester()
4542 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08004543 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004544 .kernel_size(1, 1)
4545 .group_input_channels(23)
4546 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -07004547 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004548 .iterations(3)
4549 .TestF32();
4550}
4551
Marat Dukhanefc47b82019-11-18 09:25:38 -08004552TEST(DECONVOLUTION_NHWC_F32, batched_1x1_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004553 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -07004554 DeconvolutionOperatorTester()
4555 .has_bias(false)
4556 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08004557 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -07004558 .kernel_size(1, 1)
4559 .group_input_channels(23)
4560 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4561 .iterations(3)
4562 .TestF32();
4563}
4564
XNNPACK Teamb455b122019-09-27 18:10:33 -07004565/**************************** Future GEMM path, batched, grouped ****************************/
4566
Marat Dukhanefc47b82019-11-18 09:25:38 -08004567TEST(DECONVOLUTION_NHWC_F32, batched_grouped_1x1) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004568 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004569 DeconvolutionOperatorTester()
4570 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08004571 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004572 .kernel_size(1, 1)
4573 .groups(2)
4574 .group_input_channels(23)
4575 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4576 .iterations(3)
4577 .TestF32();
4578}
4579
Marat Dukhanefc47b82019-11-18 09:25:38 -08004580TEST(DECONVOLUTION_NHWC_F32, batched_grouped_1x1_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004581 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08004582 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07004583 DeconvolutionOperatorTester()
4584 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08004585 .input_size(input_height, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004586 .kernel_size(1, 1)
4587 .groups(2)
4588 .group_input_channels(23)
4589 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4590 .iterations(1)
4591 .TestF32();
4592 }
4593}
4594
Marat Dukhanefc47b82019-11-18 09:25:38 -08004595TEST(DECONVOLUTION_NHWC_F32, batched_grouped_1x1_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004596 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08004597 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07004598 DeconvolutionOperatorTester()
4599 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08004600 .input_size(kUnstridedInputHeight, input_width)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004601 .kernel_size(1, 1)
4602 .groups(2)
4603 .group_input_channels(23)
4604 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4605 .iterations(1)
4606 .TestF32();
4607 }
4608}
4609
Marat Dukhanefc47b82019-11-18 09:25:38 -08004610TEST(DECONVOLUTION_NHWC_F32, batched_grouped_1x1_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004611 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004612 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
4613 DeconvolutionOperatorTester()
4614 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08004615 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004616 .kernel_size(1, 1)
4617 .groups(2)
4618 .group_input_channels(input_channels)
4619 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4620 .iterations(1)
4621 .TestF32();
4622 }
4623}
4624
Marat Dukhanefc47b82019-11-18 09:25:38 -08004625TEST(DECONVOLUTION_NHWC_F32, batched_grouped_1x1_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004626 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004627 for (size_t output_channels = 1; output_channels <= xnn_params.f32.gemm.nr * 2; output_channels *= 2) {
4628 DeconvolutionOperatorTester()
4629 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08004630 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004631 .kernel_size(1, 1)
4632 .groups(2)
4633 .group_input_channels(23)
4634 .group_output_channels(output_channels)
4635 .iterations(1)
4636 .TestF32();
4637 }
4638}
4639
Marat Dukhanefc47b82019-11-18 09:25:38 -08004640TEST(DECONVOLUTION_NHWC_F32, batched_grouped_1x1_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004641 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004642 DeconvolutionOperatorTester()
4643 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08004644 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004645 .kernel_size(1, 1)
4646 .groups(2)
4647 .group_input_channels(23)
4648 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4649 .input_pixel_stride(47)
4650 .iterations(3)
4651 .TestF32();
4652}
4653
Marat Dukhanefc47b82019-11-18 09:25:38 -08004654TEST(DECONVOLUTION_NHWC_F32, batched_grouped_1x1_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004655 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004656 DeconvolutionOperatorTester()
4657 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08004658 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004659 .kernel_size(1, 1)
4660 .groups(2)
4661 .group_input_channels(23)
4662 .group_output_channels(xnn_params.f32.gemm.nr + 3)
4663 .output_pixel_stride(xnn_params.f32.gemm.nr * 2 + 13)
4664 .iterations(3)
4665 .TestF32();
4666}
4667
Marat Dukhanefc47b82019-11-18 09:25:38 -08004668TEST(DECONVOLUTION_NHWC_F32, batched_grouped_1x1_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004669 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004670 DeconvolutionOperatorTester()
4671 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08004672 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004673 .kernel_size(1, 1)
4674 .groups(2)
4675 .group_input_channels(23)
4676 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4677 .qmin(128)
4678 .iterations(3)
4679 .TestF32();
4680}
4681
Marat Dukhanefc47b82019-11-18 09:25:38 -08004682TEST(DECONVOLUTION_NHWC_F32, batched_grouped_1x1_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004683 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004684 DeconvolutionOperatorTester()
4685 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08004686 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004687 .kernel_size(1, 1)
4688 .groups(2)
4689 .group_input_channels(23)
4690 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -07004691 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004692 .iterations(3)
4693 .TestF32();
4694}
4695
Marat Dukhanefc47b82019-11-18 09:25:38 -08004696TEST(DECONVOLUTION_NHWC_F32, batched_grouped_1x1_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004697 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -07004698 DeconvolutionOperatorTester()
4699 .has_bias(false)
4700 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08004701 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -07004702 .kernel_size(1, 1)
4703 .groups(2)
4704 .group_input_channels(23)
4705 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4706 .iterations(3)
4707 .TestF32();
4708}
4709
XNNPACK Teamb455b122019-09-27 18:10:33 -07004710/**************************** CONV path ****************************/
4711
Marat Dukhanefc47b82019-11-18 09:25:38 -08004712TEST(DECONVOLUTION_NHWC_F32, 3x3) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004713 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004714 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004715 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004716 .padding(1)
4717 .kernel_size(3, 3)
4718 .group_input_channels(15)
4719 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4720 .iterations(3)
4721 .TestF32();
4722}
4723
Marat Dukhanefc47b82019-11-18 09:25:38 -08004724TEST(DECONVOLUTION_NHWC_F32, Kx3) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004725 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004726 for (size_t kernel_height = 1; kernel_height <= 4; kernel_height *= 2) {
4727 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004728 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004729 .padding_width(1)
4730 .kernel_size(kernel_height, 3)
4731 .group_input_channels(17)
4732 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4733 .iterations(3)
4734 .TestF32();
4735 }
4736}
4737
Marat Dukhanefc47b82019-11-18 09:25:38 -08004738TEST(DECONVOLUTION_NHWC_F32, 3xK) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004739 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004740 for (size_t kernel_width = 1; kernel_width <= 4; kernel_width *= 2) {
4741 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004742 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004743 .padding_height(1)
4744 .kernel_size(3, kernel_width)
4745 .group_input_channels(17)
4746 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4747 .iterations(3)
4748 .TestF32();
4749 }
4750}
4751
Marat Dukhanefc47b82019-11-18 09:25:38 -08004752TEST(DECONVOLUTION_NHWC_F32, 3x3_varying_height_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004753 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004754 for (size_t padding_top = 0; padding_top <= 2; padding_top++) {
4755 for (size_t padding_bottom = 0; padding_bottom <= 2; padding_bottom++) {
4756 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004757 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004758 .padding_width(1)
4759 .padding_top(padding_top)
4760 .padding_bottom(padding_bottom)
4761 .kernel_size(3, 3)
4762 .group_input_channels(15)
4763 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4764 .iterations(1)
4765 .TestF32();
4766 }
4767 }
4768}
4769
Marat Dukhanefc47b82019-11-18 09:25:38 -08004770TEST(DECONVOLUTION_NHWC_F32, 3x3_varying_width_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004771 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004772 for (size_t padding_left = 0; padding_left <= 2; padding_left++) {
4773 for (size_t padding_right = 0; padding_right <= 2; padding_right++) {
4774 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004775 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004776 .padding_height(1)
4777 .padding_left(padding_left)
4778 .padding_right(padding_right)
4779 .kernel_size(3, 3)
4780 .group_input_channels(15)
4781 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4782 .iterations(1)
4783 .TestF32();
4784 }
4785 }
4786}
4787
Marat Dukhanefc47b82019-11-18 09:25:38 -08004788TEST(DECONVOLUTION_NHWC_F32, 3x3_varying_height_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004789 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004790 for (size_t adjustment_height = 1; adjustment_height <= 2; adjustment_height++) {
4791 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004792 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004793 .padding(1)
Marat Dukhan1898b912019-11-05 12:25:18 -08004794 .stride_height(adjustment_height + 1)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004795 .adjustment_height(adjustment_height)
4796 .kernel_size(3, 3)
4797 .group_input_channels(15)
4798 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4799 .iterations(1)
4800 .TestF32();
4801 }
4802}
4803
Marat Dukhanefc47b82019-11-18 09:25:38 -08004804TEST(DECONVOLUTION_NHWC_F32, 3x3_varying_width_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004805 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004806 for (size_t adjustment_width = 1; adjustment_width <= 2; adjustment_width++) {
4807 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004808 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004809 .padding(1)
Marat Dukhan1898b912019-11-05 12:25:18 -08004810 .stride_width(adjustment_width + 1)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004811 .adjustment_width(adjustment_width)
4812 .kernel_size(3, 3)
4813 .group_input_channels(15)
4814 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4815 .iterations(1)
4816 .TestF32();
4817 }
4818}
4819
Marat Dukhanefc47b82019-11-18 09:25:38 -08004820TEST(DECONVOLUTION_NHWC_F32, 3x3_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004821 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08004822 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07004823 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004824 .input_size(input_height, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004825 .padding(1)
4826 .kernel_size(3, 3)
4827 .group_input_channels(15)
4828 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4829 .iterations(1)
4830 .TestF32();
4831 }
4832}
4833
Marat Dukhanefc47b82019-11-18 09:25:38 -08004834TEST(DECONVOLUTION_NHWC_F32, 3x3_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004835 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08004836 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07004837 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004838 .input_size(kUnstridedInputHeight, input_width)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004839 .padding(1)
4840 .kernel_size(3, 3)
4841 .group_input_channels(15)
4842 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4843 .iterations(1)
4844 .TestF32();
4845 }
4846}
4847
Marat Dukhan58717032020-04-28 15:03:28 -07004848TEST(DECONVOLUTION_NHWC_F32, 3x3_varying_input_height_with_tf_same_padding) {
4849 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
4850 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
4851 DeconvolutionOperatorTester()
4852 .input_size(input_height, kUnstridedInputWidth)
4853 .padding_tf_same(true)
4854 .kernel_size(3, 3)
4855 .group_input_channels(15)
4856 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4857 .iterations(1)
4858 .TestF32();
4859 }
4860}
4861
4862TEST(DECONVOLUTION_NHWC_F32, 3x3_varying_input_width_with_tf_same_padding) {
4863 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
4864 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
4865 DeconvolutionOperatorTester()
4866 .input_size(kUnstridedInputHeight, input_width)
4867 .padding_tf_same(true)
4868 .kernel_size(3, 3)
4869 .group_input_channels(15)
4870 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4871 .iterations(1)
4872 .TestF32();
4873 }
4874}
4875
Marat Dukhanefc47b82019-11-18 09:25:38 -08004876TEST(DECONVOLUTION_NHWC_F32, 3x3_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004877 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004878 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
4879 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004880 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004881 .padding(1)
4882 .kernel_size(3, 3)
4883 .group_input_channels(input_channels)
4884 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4885 .iterations(1)
4886 .TestF32();
4887 }
4888}
4889
Marat Dukhanefc47b82019-11-18 09:25:38 -08004890TEST(DECONVOLUTION_NHWC_F32, 3x3_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004891 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004892 for (size_t output_channels = 1; output_channels <= xnn_params.f32.gemm.nr * 2; output_channels *= 2) {
4893 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004894 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004895 .padding(1)
4896 .kernel_size(3, 3)
4897 .group_input_channels(23)
4898 .group_output_channels(output_channels)
4899 .iterations(1)
4900 .TestF32();
4901 }
4902}
4903
Marat Dukhanefc47b82019-11-18 09:25:38 -08004904TEST(DECONVOLUTION_NHWC_F32, 3x3_with_height_dilation) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004905 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004906 for (size_t dilation_height = 2; dilation_height <= 3; dilation_height++) {
4907 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004908 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004909 .padding(1)
4910 .kernel_size(3, 3)
4911 .dilation_height(dilation_height)
4912 .group_input_channels(23)
4913 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4914 .iterations(3)
4915 .TestF32();
4916 }
4917}
4918
Marat Dukhanefc47b82019-11-18 09:25:38 -08004919TEST(DECONVOLUTION_NHWC_F32, 3x3_with_width_dilation) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004920 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004921 for (size_t dilation_width = 2; dilation_width <= 3; dilation_width++) {
4922 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004923 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004924 .padding(1)
4925 .kernel_size(3, 3)
4926 .dilation_width(dilation_width)
4927 .group_input_channels(23)
4928 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4929 .iterations(3)
4930 .TestF32();
4931 }
4932}
4933
Marat Dukhanefc47b82019-11-18 09:25:38 -08004934TEST(DECONVOLUTION_NHWC_F32, 3x3_with_height_dilation_and_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004935 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004936 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004937 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004938 .padding(1)
4939 .kernel_size(3, 3)
4940 .dilation_height(3)
4941 .stride_height(2)
4942 .group_input_channels(23)
4943 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4944 .iterations(3)
4945 .TestF32();
4946}
4947
Marat Dukhanefc47b82019-11-18 09:25:38 -08004948TEST(DECONVOLUTION_NHWC_F32, 3x3_with_width_dilation_and_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004949 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004950 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004951 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004952 .padding(1)
4953 .kernel_size(3, 3)
4954 .dilation_width(3)
4955 .stride_width(2)
4956 .group_input_channels(23)
4957 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4958 .iterations(3)
4959 .TestF32();
4960}
4961
Marat Dukhanefc47b82019-11-18 09:25:38 -08004962TEST(DECONVOLUTION_NHWC_F32, 3x3_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004963 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004964 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004965 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004966 .padding(1)
4967 .kernel_size(3, 3)
4968 .group_input_channels(23)
4969 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4970 .input_pixel_stride(28)
4971 .iterations(3)
4972 .TestF32();
4973}
4974
Marat Dukhanefc47b82019-11-18 09:25:38 -08004975TEST(DECONVOLUTION_NHWC_F32, 3x3_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004976 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004977 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004978 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004979 .padding(1)
4980 .kernel_size(3, 3)
4981 .group_input_channels(23)
4982 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4983 .output_pixel_stride(xnn_params.f32.gemm.nr * 2 + 13)
4984 .iterations(3)
4985 .TestF32();
4986}
4987
Marat Dukhanefc47b82019-11-18 09:25:38 -08004988TEST(DECONVOLUTION_NHWC_F32, 3x3_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08004989 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07004990 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08004991 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07004992 .padding(1)
4993 .kernel_size(3, 3)
4994 .group_input_channels(23)
4995 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
4996 .qmin(128)
4997 .iterations(3)
4998 .TestF32();
4999}
5000
Marat Dukhanefc47b82019-11-18 09:25:38 -08005001TEST(DECONVOLUTION_NHWC_F32, 3x3_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005002 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005003 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08005004 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005005 .padding(1)
5006 .kernel_size(3, 3)
5007 .group_input_channels(23)
5008 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -07005009 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005010 .iterations(3)
5011 .TestF32();
5012}
5013
Marat Dukhanefc47b82019-11-18 09:25:38 -08005014TEST(DECONVOLUTION_NHWC_F32, 3x3_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005015 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -07005016 DeconvolutionOperatorTester()
5017 .has_bias(false)
Marat Dukhana41533d2019-11-04 10:40:51 -08005018 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -07005019 .padding(1)
5020 .kernel_size(3, 3)
5021 .group_input_channels(23)
5022 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5023 .iterations(3)
5024 .TestF32();
5025}
5026
XNNPACK Teamb455b122019-09-27 18:10:33 -07005027/**************************** CONV path, grouped ****************************/
5028
Marat Dukhanefc47b82019-11-18 09:25:38 -08005029TEST(DECONVOLUTION_NHWC_F32, grouped_3x3) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005030 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005031 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08005032 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005033 .padding(1)
5034 .kernel_size(3, 3)
5035 .groups(2)
5036 .group_input_channels(15)
5037 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5038 .iterations(3)
5039 .TestF32();
5040}
5041
Marat Dukhanefc47b82019-11-18 09:25:38 -08005042TEST(DECONVOLUTION_NHWC_F32, grouped_Kx3) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005043 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005044 for (size_t kernel_height = 1; kernel_height <= 4; kernel_height *= 2) {
5045 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08005046 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005047 .padding_width(1)
5048 .kernel_size(kernel_height, 3)
5049 .groups(2)
5050 .group_input_channels(17)
5051 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5052 .iterations(3)
5053 .TestF32();
5054 }
5055}
5056
Marat Dukhanefc47b82019-11-18 09:25:38 -08005057TEST(DECONVOLUTION_NHWC_F32, grouped_3xK) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005058 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005059 for (size_t kernel_width = 1; kernel_width <= 4; kernel_width *= 2) {
5060 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08005061 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005062 .padding_height(1)
5063 .kernel_size(3, kernel_width)
5064 .groups(2)
5065 .group_input_channels(17)
5066 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5067 .iterations(3)
5068 .TestF32();
5069 }
5070}
5071
Marat Dukhanefc47b82019-11-18 09:25:38 -08005072TEST(DECONVOLUTION_NHWC_F32, grouped_3x3_varying_height_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005073 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005074 for (size_t padding_top = 0; padding_top <= 2; padding_top++) {
5075 for (size_t padding_bottom = 0; padding_bottom <= 2; padding_bottom++) {
5076 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08005077 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005078 .padding_width(1)
5079 .padding_top(padding_top)
5080 .padding_bottom(padding_bottom)
5081 .kernel_size(3, 3)
5082 .groups(2)
5083 .group_input_channels(15)
5084 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5085 .iterations(1)
5086 .TestF32();
5087 }
5088 }
5089}
5090
Marat Dukhanefc47b82019-11-18 09:25:38 -08005091TEST(DECONVOLUTION_NHWC_F32, grouped_3x3_varying_width_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005092 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005093 for (size_t padding_left = 0; padding_left <= 2; padding_left++) {
5094 for (size_t padding_right = 0; padding_right <= 2; padding_right++) {
5095 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08005096 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005097 .padding_height(1)
5098 .padding_left(padding_left)
5099 .padding_right(padding_right)
5100 .kernel_size(3, 3)
5101 .groups(2)
5102 .group_input_channels(15)
5103 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5104 .iterations(1)
5105 .TestF32();
5106 }
5107 }
5108}
5109
Marat Dukhanefc47b82019-11-18 09:25:38 -08005110TEST(DECONVOLUTION_NHWC_F32, grouped_3x3_varying_height_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005111 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005112 for (size_t adjustment_height = 1; adjustment_height <= 2; adjustment_height++) {
5113 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08005114 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005115 .padding(1)
Marat Dukhan1898b912019-11-05 12:25:18 -08005116 .stride_height(adjustment_height + 1)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005117 .adjustment_height(adjustment_height)
5118 .kernel_size(3, 3)
5119 .groups(2)
5120 .group_input_channels(15)
5121 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5122 .iterations(1)
5123 .TestF32();
5124 }
5125}
5126
Marat Dukhanefc47b82019-11-18 09:25:38 -08005127TEST(DECONVOLUTION_NHWC_F32, grouped_3x3_varying_width_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005128 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005129 for (size_t adjustment_width = 1; adjustment_width <= 2; adjustment_width++) {
5130 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08005131 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005132 .padding(1)
Marat Dukhan1898b912019-11-05 12:25:18 -08005133 .stride_width(adjustment_width + 1)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005134 .adjustment_width(adjustment_width)
5135 .kernel_size(3, 3)
5136 .groups(2)
5137 .group_input_channels(15)
5138 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5139 .iterations(1)
5140 .TestF32();
5141 }
5142}
5143
Marat Dukhanefc47b82019-11-18 09:25:38 -08005144TEST(DECONVOLUTION_NHWC_F32, grouped_3x3_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005145 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08005146 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07005147 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08005148 .input_size(input_height, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005149 .padding(1)
5150 .kernel_size(3, 3)
5151 .groups(2)
5152 .group_input_channels(15)
5153 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5154 .iterations(1)
5155 .TestF32();
5156 }
5157}
5158
Marat Dukhanefc47b82019-11-18 09:25:38 -08005159TEST(DECONVOLUTION_NHWC_F32, grouped_3x3_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005160 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08005161 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07005162 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08005163 .input_size(kUnstridedInputHeight, input_width)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005164 .padding(1)
5165 .kernel_size(3, 3)
5166 .groups(2)
5167 .group_input_channels(15)
5168 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5169 .iterations(1)
5170 .TestF32();
5171 }
5172}
5173
Marat Dukhan58717032020-04-28 15:03:28 -07005174TEST(DECONVOLUTION_NHWC_F32, grouped_3x3_varying_input_height_with_tf_same_padding) {
5175 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
5176 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
5177 DeconvolutionOperatorTester()
5178 .input_size(input_height, kUnstridedInputWidth)
5179 .padding_tf_same(true)
5180 .kernel_size(3, 3)
5181 .groups(2)
5182 .group_input_channels(15)
5183 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5184 .iterations(1)
5185 .TestF32();
5186 }
5187}
5188
5189TEST(DECONVOLUTION_NHWC_F32, grouped_3x3_varying_input_width_with_tf_same_padding) {
5190 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
5191 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
5192 DeconvolutionOperatorTester()
5193 .input_size(kUnstridedInputHeight, input_width)
5194 .padding_tf_same(true)
5195 .kernel_size(3, 3)
5196 .groups(2)
5197 .group_input_channels(15)
5198 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5199 .iterations(1)
5200 .TestF32();
5201 }
5202}
5203
Marat Dukhanefc47b82019-11-18 09:25:38 -08005204TEST(DECONVOLUTION_NHWC_F32, grouped_3x3_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005205 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005206 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
5207 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08005208 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005209 .padding(1)
5210 .kernel_size(3, 3)
5211 .groups(2)
5212 .group_input_channels(input_channels)
5213 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5214 .iterations(1)
5215 .TestF32();
5216 }
5217}
5218
Marat Dukhanefc47b82019-11-18 09:25:38 -08005219TEST(DECONVOLUTION_NHWC_F32, grouped_3x3_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005220 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005221 for (size_t output_channels = 1; output_channels <= xnn_params.f32.gemm.nr * 2; output_channels *= 2) {
5222 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08005223 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005224 .padding(1)
5225 .kernel_size(3, 3)
5226 .groups(2)
5227 .group_input_channels(23)
5228 .group_output_channels(output_channels)
5229 .iterations(1)
5230 .TestF32();
5231 }
5232}
5233
Marat Dukhanefc47b82019-11-18 09:25:38 -08005234TEST(DECONVOLUTION_NHWC_F32, grouped_3x3_with_height_dilation) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005235 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005236 for (size_t dilation_height = 2; dilation_height <= 3; dilation_height++) {
5237 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08005238 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005239 .padding(1)
5240 .kernel_size(3, 3)
5241 .dilation_height(dilation_height)
5242 .groups(2)
5243 .group_input_channels(23)
5244 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5245 .iterations(3)
5246 .TestF32();
5247 }
5248}
5249
Marat Dukhanefc47b82019-11-18 09:25:38 -08005250TEST(DECONVOLUTION_NHWC_F32, grouped_3x3_with_width_dilation) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005251 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005252 for (size_t dilation_width = 2; dilation_width <= 3; dilation_width++) {
5253 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08005254 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005255 .padding(1)
5256 .kernel_size(3, 3)
5257 .dilation_width(dilation_width)
5258 .groups(2)
5259 .group_input_channels(23)
5260 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5261 .iterations(3)
5262 .TestF32();
5263 }
5264}
5265
Marat Dukhanefc47b82019-11-18 09:25:38 -08005266TEST(DECONVOLUTION_NHWC_F32, grouped_3x3_with_height_dilation_and_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005267 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005268 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08005269 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005270 .padding(1)
5271 .kernel_size(3, 3)
5272 .dilation_height(3)
5273 .stride_height(2)
5274 .groups(2)
5275 .group_input_channels(23)
5276 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5277 .iterations(3)
5278 .TestF32();
5279}
5280
Marat Dukhanefc47b82019-11-18 09:25:38 -08005281TEST(DECONVOLUTION_NHWC_F32, grouped_3x3_with_width_dilation_and_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005282 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005283 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08005284 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005285 .padding(1)
5286 .kernel_size(3, 3)
5287 .dilation_width(3)
5288 .stride_width(2)
5289 .groups(2)
5290 .group_input_channels(23)
5291 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5292 .iterations(3)
5293 .TestF32();
5294}
5295
Marat Dukhanefc47b82019-11-18 09:25:38 -08005296TEST(DECONVOLUTION_NHWC_F32, grouped_3x3_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005297 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005298 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08005299 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005300 .padding(1)
5301 .kernel_size(3, 3)
5302 .groups(2)
5303 .group_input_channels(23)
5304 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5305 .input_pixel_stride(47)
5306 .iterations(3)
5307 .TestF32();
5308}
5309
Marat Dukhanefc47b82019-11-18 09:25:38 -08005310TEST(DECONVOLUTION_NHWC_F32, grouped_3x3_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005311 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005312 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08005313 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005314 .padding(1)
5315 .kernel_size(3, 3)
5316 .groups(2)
5317 .group_input_channels(23)
5318 .group_output_channels(xnn_params.f32.gemm.nr + 3)
5319 .output_pixel_stride(xnn_params.f32.gemm.nr * 2 + 13)
5320 .iterations(3)
5321 .TestF32();
5322}
5323
Marat Dukhanefc47b82019-11-18 09:25:38 -08005324TEST(DECONVOLUTION_NHWC_F32, grouped_3x3_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005325 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005326 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08005327 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005328 .padding(1)
5329 .kernel_size(3, 3)
5330 .groups(2)
5331 .group_input_channels(23)
5332 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5333 .qmin(128)
5334 .iterations(3)
5335 .TestF32();
5336}
5337
Marat Dukhanefc47b82019-11-18 09:25:38 -08005338TEST(DECONVOLUTION_NHWC_F32, grouped_3x3_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005339 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005340 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08005341 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005342 .padding(1)
5343 .kernel_size(3, 3)
5344 .groups(2)
5345 .group_input_channels(23)
5346 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -07005347 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005348 .iterations(3)
5349 .TestF32();
5350}
5351
Marat Dukhanefc47b82019-11-18 09:25:38 -08005352TEST(DECONVOLUTION_NHWC_F32, grouped_3x3_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005353 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -07005354 DeconvolutionOperatorTester()
5355 .has_bias(false)
Marat Dukhana41533d2019-11-04 10:40:51 -08005356 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -07005357 .padding(1)
5358 .kernel_size(3, 3)
5359 .groups(2)
5360 .group_input_channels(23)
5361 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5362 .iterations(3)
5363 .TestF32();
5364}
5365
XNNPACK Teamb455b122019-09-27 18:10:33 -07005366/**************************** CONV path, batched ****************************/
5367
Marat Dukhanefc47b82019-11-18 09:25:38 -08005368TEST(DECONVOLUTION_NHWC_F32, batched_3x3) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005369 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005370 DeconvolutionOperatorTester()
5371 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005372 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005373 .padding(1)
5374 .kernel_size(3, 3)
5375 .group_input_channels(15)
5376 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5377 .iterations(3)
5378 .TestF32();
5379}
5380
Marat Dukhanefc47b82019-11-18 09:25:38 -08005381TEST(DECONVOLUTION_NHWC_F32, batched_Kx3) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005382 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005383 for (size_t kernel_height = 1; kernel_height <= 4; kernel_height *= 2) {
5384 DeconvolutionOperatorTester()
5385 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005386 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005387 .padding_width(1)
5388 .kernel_size(kernel_height, 3)
5389 .group_input_channels(17)
5390 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5391 .iterations(3)
5392 .TestF32();
5393 }
5394}
5395
Marat Dukhanefc47b82019-11-18 09:25:38 -08005396TEST(DECONVOLUTION_NHWC_F32, batched_3xK) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005397 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005398 for (size_t kernel_width = 1; kernel_width <= 4; kernel_width *= 2) {
5399 DeconvolutionOperatorTester()
5400 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005401 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005402 .padding_height(1)
5403 .kernel_size(3, kernel_width)
5404 .group_input_channels(17)
5405 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5406 .iterations(3)
5407 .TestF32();
5408 }
5409}
5410
Marat Dukhanefc47b82019-11-18 09:25:38 -08005411TEST(DECONVOLUTION_NHWC_F32, batched_3x3_varying_height_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005412 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005413 for (size_t padding_top = 0; padding_top <= 2; padding_top++) {
5414 for (size_t padding_bottom = 0; padding_bottom <= 2; padding_bottom++) {
5415 DeconvolutionOperatorTester()
5416 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005417 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005418 .padding_width(1)
5419 .padding_top(padding_top)
5420 .padding_bottom(padding_bottom)
5421 .kernel_size(3, 3)
5422 .group_input_channels(15)
5423 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5424 .iterations(1)
5425 .TestF32();
5426 }
5427 }
5428}
5429
Marat Dukhanefc47b82019-11-18 09:25:38 -08005430TEST(DECONVOLUTION_NHWC_F32, batched_3x3_varying_width_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005431 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005432 for (size_t padding_left = 0; padding_left <= 2; padding_left++) {
5433 for (size_t padding_right = 0; padding_right <= 2; padding_right++) {
5434 DeconvolutionOperatorTester()
5435 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005436 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005437 .padding_height(1)
5438 .padding_left(padding_left)
5439 .padding_right(padding_right)
5440 .kernel_size(3, 3)
5441 .group_input_channels(15)
5442 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5443 .iterations(1)
5444 .TestF32();
5445 }
5446 }
5447}
5448
Marat Dukhanefc47b82019-11-18 09:25:38 -08005449TEST(DECONVOLUTION_NHWC_F32, batched_3x3_varying_height_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005450 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005451 for (size_t adjustment_height = 1; adjustment_height <= 2; adjustment_height++) {
5452 DeconvolutionOperatorTester()
5453 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005454 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005455 .padding(1)
Marat Dukhan1898b912019-11-05 12:25:18 -08005456 .stride_height(adjustment_height + 1)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005457 .adjustment_height(adjustment_height)
5458 .kernel_size(3, 3)
5459 .group_input_channels(15)
5460 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5461 .iterations(1)
5462 .TestF32();
5463 }
5464}
5465
Marat Dukhanefc47b82019-11-18 09:25:38 -08005466TEST(DECONVOLUTION_NHWC_F32, batched_3x3_varying_width_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005467 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005468 for (size_t adjustment_width = 1; adjustment_width <= 2; adjustment_width++) {
5469 DeconvolutionOperatorTester()
5470 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005471 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005472 .padding(1)
Marat Dukhan1898b912019-11-05 12:25:18 -08005473 .stride_width(adjustment_width + 1)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005474 .adjustment_width(adjustment_width)
5475 .kernel_size(3, 3)
5476 .group_input_channels(15)
5477 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5478 .iterations(1)
5479 .TestF32();
5480 }
5481}
5482
Marat Dukhanefc47b82019-11-18 09:25:38 -08005483TEST(DECONVOLUTION_NHWC_F32, batched_3x3_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005484 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08005485 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07005486 DeconvolutionOperatorTester()
5487 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005488 .input_size(input_height, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005489 .padding(1)
5490 .kernel_size(3, 3)
5491 .group_input_channels(15)
5492 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5493 .iterations(1)
5494 .TestF32();
5495 }
5496}
5497
Marat Dukhanefc47b82019-11-18 09:25:38 -08005498TEST(DECONVOLUTION_NHWC_F32, batched_3x3_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005499 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08005500 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07005501 DeconvolutionOperatorTester()
5502 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005503 .input_size(kUnstridedInputHeight, input_width)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005504 .padding(1)
5505 .kernel_size(3, 3)
5506 .group_input_channels(15)
5507 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5508 .iterations(1)
5509 .TestF32();
5510 }
5511}
5512
Marat Dukhan58717032020-04-28 15:03:28 -07005513TEST(DECONVOLUTION_NHWC_F32, batched_3x3_varying_input_height_with_tf_same_padding) {
5514 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
5515 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
5516 DeconvolutionOperatorTester()
5517 .batch_size(2)
5518 .input_size(input_height, kUnstridedInputWidth)
5519 .padding_tf_same(true)
5520 .kernel_size(3, 3)
5521 .group_input_channels(15)
5522 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5523 .iterations(1)
5524 .TestF32();
5525 }
5526}
5527
5528TEST(DECONVOLUTION_NHWC_F32, batched_3x3_varying_input_width_with_tf_same_padding) {
5529 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
5530 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
5531 DeconvolutionOperatorTester()
5532 .batch_size(2)
5533 .input_size(kUnstridedInputHeight, input_width)
5534 .padding_tf_same(true)
5535 .kernel_size(3, 3)
5536 .group_input_channels(15)
5537 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5538 .iterations(1)
5539 .TestF32();
5540 }
5541}
5542
Marat Dukhanefc47b82019-11-18 09:25:38 -08005543TEST(DECONVOLUTION_NHWC_F32, batched_3x3_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005544 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005545 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
5546 DeconvolutionOperatorTester()
5547 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005548 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005549 .padding(1)
5550 .kernel_size(3, 3)
5551 .group_input_channels(input_channels)
5552 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5553 .iterations(1)
5554 .TestF32();
5555 }
5556}
5557
Marat Dukhanefc47b82019-11-18 09:25:38 -08005558TEST(DECONVOLUTION_NHWC_F32, batched_3x3_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005559 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005560 for (size_t output_channels = 1; output_channels <= xnn_params.f32.gemm.nr * 2; output_channels *= 2) {
5561 DeconvolutionOperatorTester()
5562 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005563 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005564 .padding(1)
5565 .kernel_size(3, 3)
5566 .group_input_channels(23)
5567 .group_output_channels(output_channels)
5568 .iterations(1)
5569 .TestF32();
5570 }
5571}
5572
Marat Dukhanefc47b82019-11-18 09:25:38 -08005573TEST(DECONVOLUTION_NHWC_F32, batched_3x3_with_height_dilation) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005574 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005575 for (size_t dilation_height = 2; dilation_height <= 3; dilation_height++) {
5576 DeconvolutionOperatorTester()
5577 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005578 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005579 .padding(1)
5580 .kernel_size(3, 3)
5581 .dilation_height(dilation_height)
5582 .group_input_channels(23)
5583 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5584 .iterations(3)
5585 .TestF32();
5586 }
5587}
5588
Marat Dukhanefc47b82019-11-18 09:25:38 -08005589TEST(DECONVOLUTION_NHWC_F32, batched_3x3_with_width_dilation) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005590 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005591 for (size_t dilation_width = 2; dilation_width <= 3; dilation_width++) {
5592 DeconvolutionOperatorTester()
5593 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005594 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005595 .padding(1)
5596 .kernel_size(3, 3)
5597 .dilation_width(dilation_width)
5598 .group_input_channels(23)
5599 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5600 .iterations(3)
5601 .TestF32();
5602 }
5603}
5604
Marat Dukhanefc47b82019-11-18 09:25:38 -08005605TEST(DECONVOLUTION_NHWC_F32, batched_3x3_with_height_dilation_and_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005606 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005607 DeconvolutionOperatorTester()
5608 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005609 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005610 .padding(1)
5611 .kernel_size(3, 3)
5612 .dilation_height(3)
5613 .stride_height(2)
5614 .group_input_channels(23)
5615 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5616 .iterations(3)
5617 .TestF32();
5618}
5619
Marat Dukhanefc47b82019-11-18 09:25:38 -08005620TEST(DECONVOLUTION_NHWC_F32, batched_3x3_with_width_dilation_and_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005621 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005622 DeconvolutionOperatorTester()
5623 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005624 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005625 .padding(1)
5626 .kernel_size(3, 3)
5627 .dilation_width(3)
5628 .stride_width(2)
5629 .group_input_channels(23)
5630 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5631 .iterations(3)
5632 .TestF32();
5633}
5634
Marat Dukhanefc47b82019-11-18 09:25:38 -08005635TEST(DECONVOLUTION_NHWC_F32, batched_3x3_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005636 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005637 DeconvolutionOperatorTester()
5638 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005639 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005640 .padding(1)
5641 .kernel_size(3, 3)
5642 .group_input_channels(23)
5643 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5644 .input_pixel_stride(28)
5645 .iterations(3)
5646 .TestF32();
5647}
5648
Marat Dukhanefc47b82019-11-18 09:25:38 -08005649TEST(DECONVOLUTION_NHWC_F32, batched_3x3_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005650 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005651 DeconvolutionOperatorTester()
5652 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005653 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005654 .padding(1)
5655 .kernel_size(3, 3)
5656 .group_input_channels(23)
5657 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5658 .output_pixel_stride(xnn_params.f32.gemm.nr * 2 + 13)
5659 .iterations(3)
5660 .TestF32();
5661}
5662
Marat Dukhanefc47b82019-11-18 09:25:38 -08005663TEST(DECONVOLUTION_NHWC_F32, batched_3x3_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005664 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005665 DeconvolutionOperatorTester()
5666 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005667 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005668 .padding(1)
5669 .kernel_size(3, 3)
5670 .group_input_channels(23)
5671 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5672 .qmin(128)
5673 .iterations(3)
5674 .TestF32();
5675}
5676
Marat Dukhanefc47b82019-11-18 09:25:38 -08005677TEST(DECONVOLUTION_NHWC_F32, batched_3x3_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005678 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005679 DeconvolutionOperatorTester()
5680 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005681 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005682 .padding(1)
5683 .kernel_size(3, 3)
5684 .group_input_channels(23)
5685 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -07005686 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005687 .iterations(3)
5688 .TestF32();
5689}
5690
Marat Dukhanefc47b82019-11-18 09:25:38 -08005691TEST(DECONVOLUTION_NHWC_F32, batched_3x3_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005692 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -07005693 DeconvolutionOperatorTester()
5694 .has_bias(false)
5695 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005696 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -07005697 .padding(1)
5698 .kernel_size(3, 3)
5699 .group_input_channels(23)
5700 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5701 .iterations(3)
5702 .TestF32();
5703}
5704
XNNPACK Teamb455b122019-09-27 18:10:33 -07005705/**************************** CONV path, grouped, batched ****************************/
5706
Marat Dukhanefc47b82019-11-18 09:25:38 -08005707TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005708 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005709 DeconvolutionOperatorTester()
5710 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005711 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005712 .padding(1)
5713 .kernel_size(3, 3)
5714 .groups(2)
5715 .group_input_channels(15)
5716 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5717 .iterations(3)
5718 .TestF32();
5719}
5720
Marat Dukhanefc47b82019-11-18 09:25:38 -08005721TEST(DECONVOLUTION_NHWC_F32, batched_grouped_Kx3) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005722 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005723 for (size_t kernel_height = 1; kernel_height <= 4; kernel_height *= 2) {
5724 DeconvolutionOperatorTester()
5725 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005726 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005727 .padding_width(1)
5728 .kernel_size(kernel_height, 3)
5729 .groups(2)
5730 .group_input_channels(17)
5731 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5732 .iterations(3)
5733 .TestF32();
5734 }
5735}
5736
Marat Dukhanefc47b82019-11-18 09:25:38 -08005737TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3xK) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005738 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005739 for (size_t kernel_width = 1; kernel_width <= 4; kernel_width *= 2) {
5740 DeconvolutionOperatorTester()
5741 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005742 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005743 .padding_height(1)
5744 .kernel_size(3, kernel_width)
5745 .groups(2)
5746 .group_input_channels(17)
5747 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5748 .iterations(3)
5749 .TestF32();
5750 }
5751}
5752
Marat Dukhanefc47b82019-11-18 09:25:38 -08005753TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3_varying_height_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005754 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005755 for (size_t padding_top = 0; padding_top <= 2; padding_top++) {
5756 for (size_t padding_bottom = 0; padding_bottom <= 2; padding_bottom++) {
5757 DeconvolutionOperatorTester()
5758 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005759 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005760 .padding_width(1)
5761 .padding_top(padding_top)
5762 .padding_bottom(padding_bottom)
5763 .kernel_size(3, 3)
5764 .groups(2)
5765 .group_input_channels(15)
5766 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5767 .iterations(1)
5768 .TestF32();
5769 }
5770 }
5771}
5772
Marat Dukhanefc47b82019-11-18 09:25:38 -08005773TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3_varying_width_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005774 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005775 for (size_t padding_left = 0; padding_left <= 2; padding_left++) {
5776 for (size_t padding_right = 0; padding_right <= 2; padding_right++) {
5777 DeconvolutionOperatorTester()
5778 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005779 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005780 .padding_height(1)
5781 .padding_left(padding_left)
5782 .padding_right(padding_right)
5783 .kernel_size(3, 3)
5784 .groups(2)
5785 .group_input_channels(15)
5786 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5787 .iterations(1)
5788 .TestF32();
5789 }
5790 }
5791}
5792
Marat Dukhanefc47b82019-11-18 09:25:38 -08005793TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3_varying_height_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005794 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005795 for (size_t adjustment_height = 1; adjustment_height <= 2; adjustment_height++) {
5796 DeconvolutionOperatorTester()
5797 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005798 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005799 .padding(1)
Marat Dukhan1898b912019-11-05 12:25:18 -08005800 .stride_height(adjustment_height + 1)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005801 .adjustment_height(adjustment_height)
5802 .kernel_size(3, 3)
5803 .groups(2)
5804 .group_input_channels(15)
5805 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5806 .iterations(1)
5807 .TestF32();
5808 }
5809}
5810
Marat Dukhanefc47b82019-11-18 09:25:38 -08005811TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3_varying_width_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005812 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005813 for (size_t adjustment_width = 1; adjustment_width <= 2; adjustment_width++) {
5814 DeconvolutionOperatorTester()
5815 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005816 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005817 .padding(1)
Marat Dukhan1898b912019-11-05 12:25:18 -08005818 .stride_width(adjustment_width + 1)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005819 .adjustment_width(adjustment_width)
5820 .kernel_size(3, 3)
5821 .groups(2)
5822 .group_input_channels(15)
5823 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5824 .iterations(1)
5825 .TestF32();
5826 }
5827}
5828
Marat Dukhanefc47b82019-11-18 09:25:38 -08005829TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005830 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08005831 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07005832 DeconvolutionOperatorTester()
5833 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005834 .input_size(input_height, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005835 .padding(1)
5836 .kernel_size(3, 3)
5837 .groups(2)
5838 .group_input_channels(15)
5839 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5840 .iterations(1)
5841 .TestF32();
5842 }
5843}
5844
Marat Dukhanefc47b82019-11-18 09:25:38 -08005845TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005846 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08005847 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07005848 DeconvolutionOperatorTester()
5849 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005850 .input_size(kUnstridedInputHeight, input_width)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005851 .padding(1)
5852 .kernel_size(3, 3)
5853 .groups(2)
5854 .group_input_channels(15)
5855 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5856 .iterations(1)
5857 .TestF32();
5858 }
5859}
5860
Marat Dukhan58717032020-04-28 15:03:28 -07005861TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3_varying_input_height_with_tf_same_padding) {
5862 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
5863 for (size_t input_height = kUnstridedInputHeight - 2; input_height <= kUnstridedInputHeight + 2; input_height++) {
5864 DeconvolutionOperatorTester()
5865 .batch_size(2)
5866 .input_size(input_height, kUnstridedInputWidth)
5867 .padding_tf_same(true)
5868 .kernel_size(3, 3)
5869 .groups(2)
5870 .group_input_channels(15)
5871 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5872 .iterations(1)
5873 .TestF32();
5874 }
5875}
5876
5877TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3_varying_input_width_with_tf_same_padding) {
5878 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
5879 for (size_t input_width = kUnstridedInputWidth - 2; input_width <= kUnstridedInputWidth + 2; input_width++) {
5880 DeconvolutionOperatorTester()
5881 .batch_size(2)
5882 .input_size(kUnstridedInputHeight, input_width)
5883 .padding_tf_same(true)
5884 .kernel_size(3, 3)
5885 .groups(2)
5886 .group_input_channels(15)
5887 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5888 .iterations(1)
5889 .TestF32();
5890 }
5891}
5892
Marat Dukhanefc47b82019-11-18 09:25:38 -08005893TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005894 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005895 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
5896 DeconvolutionOperatorTester()
5897 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005898 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005899 .padding(1)
5900 .kernel_size(3, 3)
5901 .groups(2)
5902 .group_input_channels(input_channels)
5903 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5904 .iterations(1)
5905 .TestF32();
5906 }
5907}
5908
Marat Dukhanefc47b82019-11-18 09:25:38 -08005909TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005910 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005911 for (size_t output_channels = 1; output_channels <= xnn_params.f32.gemm.nr * 2; output_channels *= 2) {
5912 DeconvolutionOperatorTester()
5913 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005914 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005915 .padding(1)
5916 .kernel_size(3, 3)
5917 .groups(2)
5918 .group_input_channels(23)
5919 .group_output_channels(output_channels)
5920 .iterations(1)
5921 .TestF32();
5922 }
5923}
5924
Marat Dukhanefc47b82019-11-18 09:25:38 -08005925TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3_with_height_dilation) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005926 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005927 for (size_t dilation_height = 2; dilation_height <= 3; dilation_height++) {
5928 DeconvolutionOperatorTester()
5929 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005930 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005931 .padding(1)
5932 .kernel_size(3, 3)
5933 .dilation_height(dilation_height)
5934 .groups(2)
5935 .group_input_channels(23)
5936 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5937 .iterations(3)
5938 .TestF32();
5939 }
5940}
5941
Marat Dukhanefc47b82019-11-18 09:25:38 -08005942TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3_with_width_dilation) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005943 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005944 for (size_t dilation_width = 2; dilation_width <= 3; dilation_width++) {
5945 DeconvolutionOperatorTester()
5946 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005947 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005948 .padding(1)
5949 .kernel_size(3, 3)
5950 .dilation_width(dilation_width)
5951 .groups(2)
5952 .group_input_channels(23)
5953 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5954 .iterations(3)
5955 .TestF32();
5956 }
5957}
5958
Marat Dukhanefc47b82019-11-18 09:25:38 -08005959TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3_with_height_dilation_and_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005960 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005961 DeconvolutionOperatorTester()
5962 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005963 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005964 .padding(1)
5965 .kernel_size(3, 3)
5966 .dilation_height(3)
5967 .stride_width(2)
5968 .groups(2)
5969 .group_input_channels(23)
5970 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5971 .iterations(3)
5972 .TestF32();
5973}
5974
Marat Dukhanefc47b82019-11-18 09:25:38 -08005975TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3_with_width_dilation_and_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005976 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005977 DeconvolutionOperatorTester()
5978 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005979 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005980 .padding(1)
5981 .kernel_size(3, 3)
5982 .dilation_width(3)
5983 .stride_width(2)
5984 .groups(2)
5985 .group_input_channels(23)
5986 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
5987 .iterations(3)
5988 .TestF32();
5989}
5990
Marat Dukhanefc47b82019-11-18 09:25:38 -08005991TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08005992 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07005993 DeconvolutionOperatorTester()
5994 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08005995 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07005996 .padding(1)
5997 .kernel_size(3, 3)
5998 .groups(2)
5999 .group_input_channels(23)
6000 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6001 .input_pixel_stride(47)
6002 .iterations(3)
6003 .TestF32();
6004}
6005
Marat Dukhanefc47b82019-11-18 09:25:38 -08006006TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006007 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006008 DeconvolutionOperatorTester()
6009 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08006010 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006011 .padding(1)
6012 .kernel_size(3, 3)
6013 .groups(2)
6014 .group_input_channels(23)
6015 .group_output_channels(xnn_params.f32.gemm.nr + 3)
6016 .output_pixel_stride(xnn_params.f32.gemm.nr * 2 + 13)
6017 .iterations(3)
6018 .TestF32();
6019}
6020
Marat Dukhanefc47b82019-11-18 09:25:38 -08006021TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006022 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006023 DeconvolutionOperatorTester()
6024 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08006025 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006026 .padding(1)
6027 .kernel_size(3, 3)
6028 .groups(2)
6029 .group_input_channels(23)
6030 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6031 .qmin(128)
6032 .iterations(3)
6033 .TestF32();
6034}
6035
Marat Dukhanefc47b82019-11-18 09:25:38 -08006036TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006037 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006038 DeconvolutionOperatorTester()
6039 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08006040 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006041 .padding(1)
6042 .kernel_size(3, 3)
6043 .groups(2)
6044 .group_input_channels(23)
6045 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -07006046 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006047 .iterations(3)
6048 .TestF32();
6049}
6050
Marat Dukhanefc47b82019-11-18 09:25:38 -08006051TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006052 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -07006053 DeconvolutionOperatorTester()
6054 .has_bias(false)
6055 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08006056 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -07006057 .padding(1)
6058 .kernel_size(3, 3)
6059 .groups(2)
6060 .group_input_channels(23)
6061 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6062 .iterations(3)
6063 .TestF32();
6064}
6065
XNNPACK Teamb455b122019-09-27 18:10:33 -07006066/**************************** CONV path, setup ****************************/
6067
Marat Dukhanefc47b82019-11-18 09:25:38 -08006068TEST(DECONVOLUTION_NHWC_F32, 3x3_setup_changing_batch) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006069 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006070 DeconvolutionOperatorTester()
6071 .batch_size(2)
6072 .next_batch_size(5)
Marat Dukhana41533d2019-11-04 10:40:51 -08006073 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006074 .kernel_height(3)
6075 .kernel_width(5)
6076 .groups(2)
6077 .group_input_channels(15)
6078 .group_output_channels(17)
6079 .TestSetupF32();
6080}
6081
Marat Dukhanefc47b82019-11-18 09:25:38 -08006082TEST(DECONVOLUTION_NHWC_F32, 3x3_setup_changing_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006083 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006084 DeconvolutionOperatorTester()
6085 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08006086 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
6087 .next_input_height(kUnstridedInputHeight + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006088 .kernel_height(3)
6089 .kernel_width(5)
6090 .groups(2)
6091 .group_input_channels(15)
6092 .group_output_channels(17)
6093 .TestSetupF32();
6094}
6095
Marat Dukhanefc47b82019-11-18 09:25:38 -08006096TEST(DECONVOLUTION_NHWC_F32, 3x3_setup_changing_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006097 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006098 DeconvolutionOperatorTester()
6099 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08006100 .input_size(kUnstridedInputHeight, kUnstridedInputWidth)
6101 .next_input_width(kUnstridedInputWidth + 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006102 .kernel_height(3)
6103 .kernel_width(5)
6104 .groups(2)
6105 .group_input_channels(15)
6106 .group_output_channels(17)
6107 .TestSetupF32();
6108}
6109
Marat Dukhan29954272020-02-13 17:56:11 -08006110/**************************** SUBCONV2D/IGEMM path ****************************/
XNNPACK Teamb455b122019-09-27 18:10:33 -07006111
Marat Dukhanefc47b82019-11-18 09:25:38 -08006112TEST(DECONVOLUTION_NHWC_F32, 3x3s2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006113 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006114 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006115 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006116 .padding(1)
6117 .kernel_size(3, 3)
6118 .stride(2)
6119 .group_input_channels(15)
6120 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6121 .iterations(3)
6122 .TestF32();
6123}
6124
Marat Dukhanefc47b82019-11-18 09:25:38 -08006125TEST(DECONVOLUTION_NHWC_F32, Kx3s2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006126 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006127 for (size_t kernel_height = 2; kernel_height <= 5; kernel_height++) {
6128 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006129 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006130 .padding_width(1)
6131 .kernel_size(kernel_height, 3)
6132 .stride(2)
6133 .group_input_channels(17)
6134 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6135 .iterations(3)
6136 .TestF32();
6137 }
6138}
6139
Marat Dukhanefc47b82019-11-18 09:25:38 -08006140TEST(DECONVOLUTION_NHWC_F32, 3xKs2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006141 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006142 for (size_t kernel_width = 2; kernel_width <= 5; kernel_width++) {
6143 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006144 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006145 .padding_height(1)
6146 .kernel_size(3, kernel_width)
6147 .stride(2)
6148 .group_input_channels(17)
6149 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6150 .iterations(3)
6151 .TestF32();
6152 }
6153}
6154
Marat Dukhanefc47b82019-11-18 09:25:38 -08006155TEST(DECONVOLUTION_NHWC_F32, 3x3sSx1) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006156 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006157 for (size_t stride_height = 2; stride_height <= 3; stride_height++) {
6158 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006159 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006160 .padding(1)
6161 .padding_width(1)
6162 .kernel_size(3, 3)
6163 .stride_height(stride_height)
6164 .group_input_channels(17)
6165 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6166 .iterations(3)
6167 .TestF32();
6168 }
6169}
6170
Marat Dukhanefc47b82019-11-18 09:25:38 -08006171TEST(DECONVOLUTION_NHWC_F32, 3x3s1xS) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006172 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006173 for (size_t stride_width = 2; stride_width <= 3; stride_width++) {
6174 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006175 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006176 .padding(1)
6177 .padding_width(1)
6178 .kernel_size(3, 3)
6179 .stride_width(stride_width)
6180 .group_input_channels(17)
6181 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6182 .iterations(3)
6183 .TestF32();
6184 }
6185}
6186
Marat Dukhanefc47b82019-11-18 09:25:38 -08006187TEST(DECONVOLUTION_NHWC_F32, 3x3s2_varying_height_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006188 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006189 for (size_t padding_top = 0; padding_top <= 2; padding_top++) {
6190 for (size_t padding_bottom = 0; padding_bottom <= 2; padding_bottom++) {
6191 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006192 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006193 .padding_width(1)
6194 .padding_top(padding_top)
6195 .padding_bottom(padding_bottom)
6196 .kernel_size(3, 3)
6197 .stride(2)
6198 .group_input_channels(15)
6199 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6200 .iterations(1)
6201 .TestF32();
6202 }
6203 }
6204}
6205
Marat Dukhanefc47b82019-11-18 09:25:38 -08006206TEST(DECONVOLUTION_NHWC_F32, 3x3s2_varying_width_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006207 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006208 for (size_t padding_left = 0; padding_left <= 2; padding_left++) {
6209 for (size_t padding_right = 0; padding_right <= 2; padding_right++) {
6210 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006211 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006212 .padding_height(1)
6213 .padding_left(padding_left)
6214 .padding_right(padding_right)
6215 .kernel_size(3, 3)
6216 .stride(2)
6217 .group_input_channels(15)
6218 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6219 .iterations(1)
6220 .TestF32();
6221 }
6222 }
6223}
6224
Marat Dukhanefc47b82019-11-18 09:25:38 -08006225TEST(DECONVOLUTION_NHWC_F32, 3x3s2_varying_height_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006226 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan1898b912019-11-05 12:25:18 -08006227 for (size_t adjustment_height = 0; adjustment_height <= 1; adjustment_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07006228 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006229 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006230 .padding(1)
6231 .adjustment_height(adjustment_height)
6232 .kernel_size(3, 3)
6233 .stride(2)
6234 .group_input_channels(15)
6235 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6236 .iterations(1)
6237 .TestF32();
6238 }
6239}
6240
Marat Dukhanefc47b82019-11-18 09:25:38 -08006241TEST(DECONVOLUTION_NHWC_F32, 3x3s2_varying_width_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006242 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan1898b912019-11-05 12:25:18 -08006243 for (size_t adjustment_width = 0; adjustment_width <= 1; adjustment_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07006244 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006245 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006246 .padding(1)
6247 .adjustment_width(adjustment_width)
6248 .kernel_size(3, 3)
6249 .stride(2)
6250 .group_input_channels(15)
6251 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6252 .iterations(1)
6253 .TestF32();
6254 }
6255}
6256
Marat Dukhanefc47b82019-11-18 09:25:38 -08006257TEST(DECONVOLUTION_NHWC_F32, 3x3s2_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006258 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08006259 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07006260 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006261 .input_size(input_height, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006262 .padding(1)
6263 .kernel_size(3, 3)
6264 .stride(2)
6265 .group_input_channels(15)
6266 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6267 .iterations(1)
6268 .TestF32();
6269 }
6270}
6271
Marat Dukhanefc47b82019-11-18 09:25:38 -08006272TEST(DECONVOLUTION_NHWC_F32, 3x3s2_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006273 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08006274 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07006275 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006276 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006277 .padding(1)
6278 .kernel_size(3, 3)
6279 .stride(2)
6280 .group_input_channels(15)
6281 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6282 .iterations(1)
6283 .TestF32();
6284 }
6285}
6286
Marat Dukhan58717032020-04-28 15:03:28 -07006287TEST(DECONVOLUTION_NHWC_F32, 3x3s2_varying_input_height_with_tf_same_padding) {
6288 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
6289 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
6290 DeconvolutionOperatorTester()
6291 .input_size(input_height, kStridedInputWidth)
6292 .padding_tf_same(true)
6293 .kernel_size(3, 3)
6294 .stride(2)
6295 .group_input_channels(15)
6296 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6297 .iterations(1)
6298 .TestF32();
6299 }
6300}
6301
6302TEST(DECONVOLUTION_NHWC_F32, 3x3s2_varying_input_width_with_tf_same_padding) {
6303 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
6304 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
6305 DeconvolutionOperatorTester()
6306 .input_size(kStridedInputHeight, kStridedInputWidth)
6307 .padding_tf_same(true)
6308 .kernel_size(3, 3)
6309 .stride(2)
6310 .group_input_channels(15)
6311 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6312 .iterations(1)
6313 .TestF32();
6314 }
6315}
6316
Marat Dukhanefc47b82019-11-18 09:25:38 -08006317TEST(DECONVOLUTION_NHWC_F32, 3x3s2_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006318 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006319 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
6320 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006321 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006322 .padding(1)
6323 .kernel_size(3, 3)
6324 .stride(2)
6325 .group_input_channels(input_channels)
6326 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6327 .iterations(1)
6328 .TestF32();
6329 }
6330}
6331
Marat Dukhanefc47b82019-11-18 09:25:38 -08006332TEST(DECONVOLUTION_NHWC_F32, 3x3s2_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006333 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006334 for (size_t output_channels = 1; output_channels <= xnn_params.f32.gemm.nr * 2; output_channels *= 2) {
6335 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006336 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006337 .padding(1)
6338 .kernel_size(3, 3)
6339 .stride(2)
6340 .group_input_channels(23)
6341 .group_output_channels(output_channels)
6342 .iterations(1)
6343 .TestF32();
6344 }
6345}
6346
Marat Dukhanefc47b82019-11-18 09:25:38 -08006347TEST(DECONVOLUTION_NHWC_F32, 3x3s2_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006348 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006349 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006350 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006351 .padding(1)
6352 .kernel_size(3, 3)
6353 .stride(2)
6354 .group_input_channels(23)
6355 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6356 .input_pixel_stride(28)
6357 .iterations(3)
6358 .TestF32();
6359}
6360
Marat Dukhanefc47b82019-11-18 09:25:38 -08006361TEST(DECONVOLUTION_NHWC_F32, 3x3s2_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006362 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006363 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006364 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006365 .padding(1)
6366 .kernel_size(3, 3)
6367 .stride(2)
6368 .group_input_channels(23)
6369 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6370 .output_pixel_stride(xnn_params.f32.gemm.nr * 2 + 13)
6371 .iterations(3)
6372 .TestF32();
6373}
6374
Marat Dukhanefc47b82019-11-18 09:25:38 -08006375TEST(DECONVOLUTION_NHWC_F32, 3x3s2_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006376 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006377 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006378 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006379 .padding(1)
6380 .kernel_size(3, 3)
6381 .stride(2)
6382 .group_input_channels(23)
6383 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6384 .qmin(128)
6385 .iterations(3)
6386 .TestF32();
6387}
6388
Marat Dukhanefc47b82019-11-18 09:25:38 -08006389TEST(DECONVOLUTION_NHWC_F32, 3x3s2_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006390 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006391 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006392 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006393 .padding(1)
6394 .kernel_size(3, 3)
6395 .stride(2)
6396 .group_input_channels(23)
6397 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -07006398 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006399 .iterations(3)
6400 .TestF32();
6401}
6402
Marat Dukhanefc47b82019-11-18 09:25:38 -08006403TEST(DECONVOLUTION_NHWC_F32, 3x3s2_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006404 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -07006405 DeconvolutionOperatorTester()
6406 .has_bias(false)
Marat Dukhana41533d2019-11-04 10:40:51 -08006407 .input_size(kStridedInputHeight, kStridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -07006408 .padding(1)
6409 .kernel_size(3, 3)
6410 .stride(2)
6411 .group_input_channels(23)
6412 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6413 .iterations(3)
6414 .TestF32();
6415}
6416
Marat Dukhan29954272020-02-13 17:56:11 -08006417/**************************** SUBCONV2D/IGEMM path, grouped ****************************/
XNNPACK Teamb455b122019-09-27 18:10:33 -07006418
Marat Dukhanefc47b82019-11-18 09:25:38 -08006419TEST(DECONVOLUTION_NHWC_F32, grouped_3x3s2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006420 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006421 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006422 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006423 .padding(1)
6424 .kernel_size(3, 3)
6425 .stride(2)
6426 .groups(2)
6427 .group_input_channels(17)
6428 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6429 .iterations(3)
6430 .TestF32();
6431}
6432
Marat Dukhanefc47b82019-11-18 09:25:38 -08006433TEST(DECONVOLUTION_NHWC_F32, grouped_Kx3s2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006434 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006435 for (size_t kernel_height = 2; kernel_height <= 5; kernel_height++) {
6436 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006437 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006438 .padding_width(1)
6439 .kernel_size(kernel_height, 3)
6440 .stride(2)
6441 .groups(2)
6442 .group_input_channels(17)
6443 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6444 .iterations(3)
6445 .TestF32();
6446 }
6447}
6448
Marat Dukhanefc47b82019-11-18 09:25:38 -08006449TEST(DECONVOLUTION_NHWC_F32, grouped_3xKs2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006450 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006451 for (size_t kernel_width = 2; kernel_width <= 5; kernel_width++) {
6452 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006453 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006454 .padding_height(1)
6455 .kernel_size(3, kernel_width)
6456 .stride(2)
6457 .groups(2)
6458 .group_input_channels(17)
6459 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6460 .iterations(3)
6461 .TestF32();
6462 }
6463}
6464
Marat Dukhanefc47b82019-11-18 09:25:38 -08006465TEST(DECONVOLUTION_NHWC_F32, grouped_3x3sSx1) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006466 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006467 for (size_t stride_height = 2; stride_height <= 3; stride_height++) {
6468 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006469 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006470 .padding(1)
6471 .padding_width(1)
6472 .kernel_size(3, 3)
6473 .stride_height(stride_height)
6474 .groups(2)
6475 .group_input_channels(17)
6476 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6477 .iterations(3)
6478 .TestF32();
6479 }
6480}
6481
Marat Dukhanefc47b82019-11-18 09:25:38 -08006482TEST(DECONVOLUTION_NHWC_F32, grouped_3x3s1xS) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006483 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006484 for (size_t stride_width = 2; stride_width <= 3; stride_width++) {
6485 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006486 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006487 .padding(1)
6488 .padding_width(1)
6489 .kernel_size(3, 3)
6490 .stride_width(stride_width)
6491 .groups(2)
6492 .group_input_channels(17)
6493 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6494 .iterations(3)
6495 .TestF32();
6496 }
6497}
6498
Marat Dukhanefc47b82019-11-18 09:25:38 -08006499TEST(DECONVOLUTION_NHWC_F32, grouped_3x3s2_varying_height_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006500 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006501 for (size_t padding_top = 0; padding_top <= 2; padding_top++) {
6502 for (size_t padding_bottom = 0; padding_bottom <= 2; padding_bottom++) {
6503 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006504 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006505 .padding_width(1)
6506 .padding_top(padding_top)
6507 .padding_bottom(padding_bottom)
6508 .kernel_size(3, 3)
6509 .stride(2)
6510 .groups(2)
6511 .group_input_channels(17)
6512 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6513 .iterations(1)
6514 .TestF32();
6515 }
6516 }
6517}
6518
Marat Dukhanefc47b82019-11-18 09:25:38 -08006519TEST(DECONVOLUTION_NHWC_F32, grouped_3x3s2_varying_width_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006520 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006521 for (size_t padding_left = 0; padding_left <= 2; padding_left++) {
6522 for (size_t padding_right = 0; padding_right <= 2; padding_right++) {
6523 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006524 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006525 .padding_height(1)
6526 .padding_left(padding_left)
6527 .padding_right(padding_right)
6528 .kernel_size(3, 3)
6529 .stride(2)
6530 .groups(2)
6531 .group_input_channels(17)
6532 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6533 .iterations(1)
6534 .TestF32();
6535 }
6536 }
6537}
6538
Marat Dukhanefc47b82019-11-18 09:25:38 -08006539TEST(DECONVOLUTION_NHWC_F32, grouped_3x3s2_varying_height_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006540 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan1898b912019-11-05 12:25:18 -08006541 for (size_t adjustment_height = 0; adjustment_height <= 1; adjustment_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07006542 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006543 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006544 .padding(1)
6545 .adjustment_height(adjustment_height)
6546 .kernel_size(3, 3)
6547 .stride(2)
6548 .groups(2)
6549 .group_input_channels(17)
6550 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6551 .iterations(1)
6552 .TestF32();
6553 }
6554}
6555
Marat Dukhanefc47b82019-11-18 09:25:38 -08006556TEST(DECONVOLUTION_NHWC_F32, grouped_3x3s2_varying_width_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006557 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan1898b912019-11-05 12:25:18 -08006558 for (size_t adjustment_width = 0; adjustment_width <= 1; adjustment_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07006559 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006560 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006561 .padding(1)
6562 .adjustment_width(adjustment_width)
6563 .kernel_size(3, 3)
6564 .stride(2)
6565 .groups(2)
6566 .group_input_channels(17)
6567 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6568 .iterations(1)
6569 .TestF32();
6570 }
6571}
6572
Marat Dukhanefc47b82019-11-18 09:25:38 -08006573TEST(DECONVOLUTION_NHWC_F32, grouped_3x3s2_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006574 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08006575 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07006576 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006577 .input_size(input_height, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006578 .padding(1)
6579 .kernel_size(3, 3)
6580 .stride(2)
6581 .groups(2)
6582 .group_input_channels(17)
6583 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6584 .iterations(1)
6585 .TestF32();
6586 }
6587}
6588
Marat Dukhanefc47b82019-11-18 09:25:38 -08006589TEST(DECONVOLUTION_NHWC_F32, grouped_3x3s2_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006590 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08006591 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07006592 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006593 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006594 .padding(1)
6595 .kernel_size(3, 3)
6596 .stride(2)
6597 .groups(2)
6598 .group_input_channels(17)
6599 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6600 .iterations(1)
6601 .TestF32();
6602 }
6603}
6604
Marat Dukhan58717032020-04-28 15:03:28 -07006605TEST(DECONVOLUTION_NHWC_F32, grouped_3x3s2_varying_input_height_with_tf_same_padding) {
6606 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
6607 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
6608 DeconvolutionOperatorTester()
6609 .input_size(input_height, kStridedInputWidth)
6610 .padding_tf_same(true)
6611 .kernel_size(3, 3)
6612 .stride(2)
6613 .groups(2)
6614 .group_input_channels(17)
6615 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6616 .iterations(1)
6617 .TestF32();
6618 }
6619}
6620
6621TEST(DECONVOLUTION_NHWC_F32, grouped_3x3s2_varying_input_width_with_tf_same_padding) {
6622 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
6623 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
6624 DeconvolutionOperatorTester()
6625 .input_size(kStridedInputHeight, kStridedInputWidth)
6626 .padding_tf_same(true)
6627 .kernel_size(3, 3)
6628 .stride(2)
6629 .groups(2)
6630 .group_input_channels(17)
6631 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6632 .iterations(1)
6633 .TestF32();
6634 }
6635}
6636
Marat Dukhanefc47b82019-11-18 09:25:38 -08006637TEST(DECONVOLUTION_NHWC_F32, grouped_3x3s2_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006638 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006639 for (size_t input_channels = 14; input_channels <= 20; input_channels++) {
6640 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006641 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006642 .padding(1)
6643 .kernel_size(3, 3)
6644 .stride(2)
6645 .groups(2)
6646 .group_input_channels(input_channels)
6647 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6648 .iterations(1)
6649 .TestF32();
6650 }
6651}
6652
Marat Dukhanefc47b82019-11-18 09:25:38 -08006653TEST(DECONVOLUTION_NHWC_F32, grouped_3x3s2_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006654 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006655 for (size_t output_channels = 1; output_channels <= xnn_params.f32.gemm.nr * 2; output_channels *= 2) {
6656 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006657 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006658 .padding(1)
6659 .kernel_size(3, 3)
6660 .stride(2)
6661 .groups(2)
6662 .group_input_channels(17)
6663 .group_output_channels(output_channels)
6664 .iterations(1)
6665 .TestF32();
6666 }
6667}
6668
Marat Dukhanefc47b82019-11-18 09:25:38 -08006669TEST(DECONVOLUTION_NHWC_F32, grouped_3x3s2_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006670 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006671 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006672 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006673 .padding(1)
6674 .kernel_size(3, 3)
6675 .stride(2)
6676 .groups(2)
6677 .group_input_channels(17)
6678 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6679 .input_pixel_stride(37)
6680 .iterations(3)
6681 .TestF32();
6682}
6683
Marat Dukhanefc47b82019-11-18 09:25:38 -08006684TEST(DECONVOLUTION_NHWC_F32, grouped_3x3s2_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006685 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006686 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006687 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006688 .padding(1)
6689 .kernel_size(3, 3)
6690 .stride(2)
6691 .groups(2)
6692 .group_input_channels(17)
6693 .group_output_channels(xnn_params.f32.gemm.nr + 3)
6694 .output_pixel_stride(xnn_params.f32.gemm.nr * 2 + 13)
6695 .iterations(3)
6696 .TestF32();
6697}
6698
Marat Dukhanefc47b82019-11-18 09:25:38 -08006699TEST(DECONVOLUTION_NHWC_F32, grouped_3x3s2_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006700 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006701 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006702 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006703 .padding(1)
6704 .kernel_size(3, 3)
6705 .stride(2)
6706 .groups(2)
6707 .group_input_channels(17)
6708 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6709 .qmin(128)
6710 .iterations(3)
6711 .TestF32();
6712}
6713
Marat Dukhanefc47b82019-11-18 09:25:38 -08006714TEST(DECONVOLUTION_NHWC_F32, grouped_3x3s2_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006715 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006716 DeconvolutionOperatorTester()
Marat Dukhana41533d2019-11-04 10:40:51 -08006717 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006718 .padding(1)
6719 .kernel_size(3, 3)
6720 .stride(2)
6721 .groups(2)
6722 .group_input_channels(17)
6723 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -07006724 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006725 .iterations(3)
6726 .TestF32();
6727}
6728
Marat Dukhanefc47b82019-11-18 09:25:38 -08006729TEST(DECONVOLUTION_NHWC_F32, grouped_3x3s2_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006730 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -07006731 DeconvolutionOperatorTester()
6732 .has_bias(false)
Marat Dukhana41533d2019-11-04 10:40:51 -08006733 .input_size(kStridedInputHeight, kStridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -07006734 .padding(1)
6735 .kernel_size(3, 3)
6736 .stride(2)
6737 .groups(2)
6738 .group_input_channels(17)
6739 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6740 .iterations(3)
6741 .TestF32();
6742}
6743
Marat Dukhan29954272020-02-13 17:56:11 -08006744/**************************** SUBCONV2D/IGEMM path, batched ****************************/
XNNPACK Teamb455b122019-09-27 18:10:33 -07006745
Marat Dukhanefc47b82019-11-18 09:25:38 -08006746TEST(DECONVOLUTION_NHWC_F32, batched_3x3s2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006747 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006748 DeconvolutionOperatorTester()
6749 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08006750 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006751 .padding(1)
6752 .kernel_size(3, 3)
6753 .stride(2)
6754 .group_input_channels(15)
6755 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6756 .iterations(3)
6757 .TestF32();
6758}
6759
Marat Dukhanefc47b82019-11-18 09:25:38 -08006760TEST(DECONVOLUTION_NHWC_F32, batched_Kx3s2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006761 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006762 for (size_t kernel_height = 2; kernel_height <= 5; kernel_height++) {
6763 DeconvolutionOperatorTester()
6764 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08006765 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006766 .padding_width(1)
6767 .kernel_size(kernel_height, 3)
6768 .stride(2)
6769 .group_input_channels(17)
6770 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6771 .iterations(3)
6772 .TestF32();
6773 }
6774}
6775
Marat Dukhanefc47b82019-11-18 09:25:38 -08006776TEST(DECONVOLUTION_NHWC_F32, batched_3xKs2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006777 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006778 for (size_t kernel_width = 2; kernel_width <= 5; kernel_width++) {
6779 DeconvolutionOperatorTester()
6780 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08006781 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006782 .padding_height(1)
6783 .kernel_size(3, kernel_width)
6784 .stride(2)
6785 .group_input_channels(17)
6786 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6787 .iterations(3)
6788 .TestF32();
6789 }
6790}
6791
Marat Dukhanefc47b82019-11-18 09:25:38 -08006792TEST(DECONVOLUTION_NHWC_F32, batched_3x3sSx1) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006793 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006794 for (size_t stride_height = 2; stride_height <= 3; stride_height++) {
6795 DeconvolutionOperatorTester()
6796 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08006797 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006798 .padding(1)
6799 .padding_width(1)
6800 .kernel_size(3, 3)
6801 .stride_height(stride_height)
6802 .group_input_channels(17)
6803 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6804 .iterations(3)
6805 .TestF32();
6806 }
6807}
6808
Marat Dukhanefc47b82019-11-18 09:25:38 -08006809TEST(DECONVOLUTION_NHWC_F32, batched_3x3s1xS) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006810 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006811 for (size_t stride_width = 2; stride_width <= 3; stride_width++) {
6812 DeconvolutionOperatorTester()
6813 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08006814 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006815 .padding(1)
6816 .padding_width(1)
6817 .kernel_size(3, 3)
6818 .stride_width(stride_width)
6819 .group_input_channels(17)
6820 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6821 .iterations(3)
6822 .TestF32();
6823 }
6824}
6825
Marat Dukhanefc47b82019-11-18 09:25:38 -08006826TEST(DECONVOLUTION_NHWC_F32, batched_3x3s2_varying_height_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006827 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006828 for (size_t padding_top = 0; padding_top <= 2; padding_top++) {
6829 for (size_t padding_bottom = 0; padding_bottom <= 2; padding_bottom++) {
6830 DeconvolutionOperatorTester()
6831 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08006832 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006833 .padding_width(1)
6834 .padding_top(padding_top)
6835 .padding_bottom(padding_bottom)
6836 .kernel_size(3, 3)
6837 .stride(2)
6838 .group_input_channels(15)
6839 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6840 .iterations(1)
6841 .TestF32();
6842 }
6843 }
6844}
6845
Marat Dukhanefc47b82019-11-18 09:25:38 -08006846TEST(DECONVOLUTION_NHWC_F32, batched_3x3s2_varying_width_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006847 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006848 for (size_t padding_left = 0; padding_left <= 2; padding_left++) {
6849 for (size_t padding_right = 0; padding_right <= 2; padding_right++) {
6850 DeconvolutionOperatorTester()
6851 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08006852 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006853 .padding_height(1)
6854 .padding_left(padding_left)
6855 .padding_right(padding_right)
6856 .kernel_size(3, 3)
6857 .stride(2)
6858 .group_input_channels(15)
6859 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6860 .iterations(1)
6861 .TestF32();
6862 }
6863 }
6864}
6865
Marat Dukhanefc47b82019-11-18 09:25:38 -08006866TEST(DECONVOLUTION_NHWC_F32, batched_3x3s2_varying_height_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006867 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan1898b912019-11-05 12:25:18 -08006868 for (size_t adjustment_height = 0; adjustment_height <= 1; adjustment_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07006869 DeconvolutionOperatorTester()
6870 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08006871 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006872 .padding(1)
6873 .adjustment_height(adjustment_height)
6874 .kernel_size(3, 3)
6875 .stride(2)
6876 .group_input_channels(15)
6877 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6878 .iterations(1)
6879 .TestF32();
6880 }
6881}
6882
Marat Dukhanefc47b82019-11-18 09:25:38 -08006883TEST(DECONVOLUTION_NHWC_F32, batched_3x3s2_varying_width_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006884 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan1898b912019-11-05 12:25:18 -08006885 for (size_t adjustment_width = 0; adjustment_width <= 1; adjustment_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07006886 DeconvolutionOperatorTester()
6887 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08006888 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006889 .padding(1)
6890 .adjustment_width(adjustment_width)
6891 .kernel_size(3, 3)
6892 .stride(2)
6893 .group_input_channels(15)
6894 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6895 .iterations(1)
6896 .TestF32();
6897 }
6898}
6899
Marat Dukhanefc47b82019-11-18 09:25:38 -08006900TEST(DECONVOLUTION_NHWC_F32, batched_3x3s2_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006901 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08006902 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07006903 DeconvolutionOperatorTester()
6904 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08006905 .input_size(input_height, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006906 .padding(1)
6907 .kernel_size(3, 3)
6908 .stride(2)
6909 .group_input_channels(15)
6910 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6911 .iterations(1)
6912 .TestF32();
6913 }
6914}
6915
Marat Dukhanefc47b82019-11-18 09:25:38 -08006916TEST(DECONVOLUTION_NHWC_F32, batched_3x3s2_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006917 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08006918 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07006919 DeconvolutionOperatorTester()
6920 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08006921 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006922 .padding(1)
6923 .kernel_size(3, 3)
6924 .stride(2)
6925 .group_input_channels(15)
6926 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6927 .iterations(1)
6928 .TestF32();
6929 }
6930}
6931
Marat Dukhan58717032020-04-28 15:03:28 -07006932TEST(DECONVOLUTION_NHWC_F32, batched_3x3s2_varying_input_height_with_tf_same_padding) {
6933 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
6934 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
6935 DeconvolutionOperatorTester()
6936 .batch_size(2)
6937 .input_size(input_height, kStridedInputWidth)
6938 .padding_tf_same(true)
6939 .kernel_size(3, 3)
6940 .stride(2)
6941 .group_input_channels(15)
6942 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6943 .iterations(1)
6944 .TestF32();
6945 }
6946}
6947
6948TEST(DECONVOLUTION_NHWC_F32, batched_3x3s2_varying_input_width_with_tf_same_padding) {
6949 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
6950 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
6951 DeconvolutionOperatorTester()
6952 .batch_size(2)
6953 .input_size(kStridedInputHeight, kStridedInputWidth)
6954 .padding_tf_same(true)
6955 .kernel_size(3, 3)
6956 .stride(2)
6957 .group_input_channels(15)
6958 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6959 .iterations(1)
6960 .TestF32();
6961 }
6962}
6963
Marat Dukhanefc47b82019-11-18 09:25:38 -08006964TEST(DECONVOLUTION_NHWC_F32, batched_3x3s2_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006965 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006966 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
6967 DeconvolutionOperatorTester()
6968 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08006969 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006970 .padding(1)
6971 .kernel_size(3, 3)
6972 .stride(2)
6973 .group_input_channels(input_channels)
6974 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
6975 .iterations(1)
6976 .TestF32();
6977 }
6978}
6979
Marat Dukhanefc47b82019-11-18 09:25:38 -08006980TEST(DECONVOLUTION_NHWC_F32, batched_3x3s2_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006981 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006982 for (size_t output_channels = 1; output_channels <= xnn_params.f32.gemm.nr * 2; output_channels *= 2) {
6983 DeconvolutionOperatorTester()
6984 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08006985 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07006986 .padding(1)
6987 .kernel_size(3, 3)
6988 .stride(2)
6989 .group_input_channels(23)
6990 .group_output_channels(output_channels)
6991 .iterations(1)
6992 .TestF32();
6993 }
6994}
6995
Marat Dukhanefc47b82019-11-18 09:25:38 -08006996TEST(DECONVOLUTION_NHWC_F32, batched_3x3s2_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08006997 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07006998 DeconvolutionOperatorTester()
6999 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007000 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007001 .padding(1)
7002 .kernel_size(3, 3)
7003 .stride(2)
7004 .group_input_channels(23)
7005 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7006 .input_pixel_stride(28)
7007 .iterations(3)
7008 .TestF32();
7009}
7010
Marat Dukhanefc47b82019-11-18 09:25:38 -08007011TEST(DECONVOLUTION_NHWC_F32, batched_3x3s2_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007012 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07007013 DeconvolutionOperatorTester()
7014 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007015 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007016 .padding(1)
7017 .kernel_size(3, 3)
7018 .stride(2)
7019 .group_input_channels(23)
7020 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7021 .output_pixel_stride(xnn_params.f32.gemm.nr * 2 + 13)
7022 .iterations(3)
7023 .TestF32();
7024}
7025
Marat Dukhanefc47b82019-11-18 09:25:38 -08007026TEST(DECONVOLUTION_NHWC_F32, batched_3x3s2_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007027 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07007028 DeconvolutionOperatorTester()
7029 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007030 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007031 .padding(1)
7032 .kernel_size(3, 3)
7033 .stride(2)
7034 .group_input_channels(23)
7035 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7036 .qmin(128)
7037 .iterations(3)
7038 .TestF32();
7039}
7040
Marat Dukhanefc47b82019-11-18 09:25:38 -08007041TEST(DECONVOLUTION_NHWC_F32, batched_3x3s2_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007042 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07007043 DeconvolutionOperatorTester()
7044 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007045 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007046 .padding(1)
7047 .kernel_size(3, 3)
7048 .stride(2)
7049 .group_input_channels(23)
7050 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -07007051 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007052 .iterations(3)
7053 .TestF32();
7054}
7055
Marat Dukhanefc47b82019-11-18 09:25:38 -08007056TEST(DECONVOLUTION_NHWC_F32, batched_3x3s2_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007057 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -07007058 DeconvolutionOperatorTester()
7059 .has_bias(false)
7060 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007061 .input_size(kStridedInputHeight, kStridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -07007062 .padding(1)
7063 .kernel_size(3, 3)
7064 .stride(2)
7065 .group_input_channels(23)
7066 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7067 .iterations(3)
7068 .TestF32();
7069}
7070
Marat Dukhan29954272020-02-13 17:56:11 -08007071/**************************** SUBCONV2D/IGEMM path, grouped, batched ****************************/
XNNPACK Teamb455b122019-09-27 18:10:33 -07007072
Marat Dukhanefc47b82019-11-18 09:25:38 -08007073TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3s2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007074 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07007075 DeconvolutionOperatorTester()
7076 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007077 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007078 .padding(1)
7079 .kernel_size(3, 3)
7080 .stride(2)
7081 .groups(2)
7082 .group_input_channels(17)
7083 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7084 .iterations(3)
7085 .TestF32();
7086}
7087
Marat Dukhanefc47b82019-11-18 09:25:38 -08007088TEST(DECONVOLUTION_NHWC_F32, batched_grouped_Kx3s2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007089 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07007090 for (size_t kernel_height = 2; kernel_height <= 5; kernel_height++) {
7091 DeconvolutionOperatorTester()
7092 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007093 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007094 .padding_width(1)
7095 .kernel_size(kernel_height, 3)
7096 .stride(2)
7097 .groups(2)
7098 .group_input_channels(17)
7099 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7100 .iterations(3)
7101 .TestF32();
7102 }
7103}
7104
Marat Dukhanefc47b82019-11-18 09:25:38 -08007105TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3xKs2) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007106 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07007107 for (size_t kernel_width = 2; kernel_width <= 5; kernel_width++) {
7108 DeconvolutionOperatorTester()
7109 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007110 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007111 .padding_height(1)
7112 .kernel_size(3, kernel_width)
7113 .stride(2)
7114 .groups(2)
7115 .group_input_channels(17)
7116 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7117 .iterations(3)
7118 .TestF32();
7119 }
7120}
7121
Marat Dukhanefc47b82019-11-18 09:25:38 -08007122TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3sSx1) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007123 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07007124 for (size_t stride_height = 2; stride_height <= 3; stride_height++) {
7125 DeconvolutionOperatorTester()
7126 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007127 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007128 .padding(1)
7129 .padding_width(1)
7130 .kernel_size(3, 3)
7131 .stride_height(stride_height)
7132 .groups(2)
7133 .group_input_channels(17)
7134 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7135 .iterations(3)
7136 .TestF32();
7137 }
7138}
7139
Marat Dukhanefc47b82019-11-18 09:25:38 -08007140TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3s1xS) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007141 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07007142 for (size_t stride_width = 2; stride_width <= 3; stride_width++) {
7143 DeconvolutionOperatorTester()
7144 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007145 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007146 .padding(1)
7147 .padding_width(1)
7148 .kernel_size(3, 3)
7149 .stride_width(stride_width)
7150 .groups(2)
7151 .group_input_channels(17)
7152 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7153 .iterations(3)
7154 .TestF32();
7155 }
7156}
7157
Marat Dukhanefc47b82019-11-18 09:25:38 -08007158TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3s2_varying_height_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007159 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07007160 for (size_t padding_top = 0; padding_top <= 2; padding_top++) {
7161 for (size_t padding_bottom = 0; padding_bottom <= 2; padding_bottom++) {
7162 DeconvolutionOperatorTester()
7163 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007164 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007165 .padding_width(1)
7166 .padding_top(padding_top)
7167 .padding_bottom(padding_bottom)
7168 .kernel_size(3, 3)
7169 .stride(2)
7170 .groups(2)
7171 .group_input_channels(17)
7172 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7173 .iterations(1)
7174 .TestF32();
7175 }
7176 }
7177}
7178
Marat Dukhanefc47b82019-11-18 09:25:38 -08007179TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3s2_varying_width_padding) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007180 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07007181 for (size_t padding_left = 0; padding_left <= 2; padding_left++) {
7182 for (size_t padding_right = 0; padding_right <= 2; padding_right++) {
7183 DeconvolutionOperatorTester()
7184 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007185 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007186 .padding_height(1)
7187 .padding_left(padding_left)
7188 .padding_right(padding_right)
7189 .kernel_size(3, 3)
7190 .stride(2)
7191 .groups(2)
7192 .group_input_channels(17)
7193 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7194 .iterations(1)
7195 .TestF32();
7196 }
7197 }
7198}
7199
Marat Dukhanefc47b82019-11-18 09:25:38 -08007200TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3s2_varying_height_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007201 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan1898b912019-11-05 12:25:18 -08007202 for (size_t adjustment_height = 0; adjustment_height <= 1; adjustment_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07007203 DeconvolutionOperatorTester()
7204 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007205 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007206 .padding(1)
7207 .adjustment_height(adjustment_height)
7208 .kernel_size(3, 3)
7209 .stride(2)
7210 .groups(2)
7211 .group_input_channels(17)
7212 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7213 .iterations(1)
7214 .TestF32();
7215 }
7216}
7217
Marat Dukhanefc47b82019-11-18 09:25:38 -08007218TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3s2_varying_width_adjustment) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007219 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhan1898b912019-11-05 12:25:18 -08007220 for (size_t adjustment_width = 0; adjustment_width <= 1; adjustment_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07007221 DeconvolutionOperatorTester()
7222 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007223 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007224 .padding(1)
7225 .adjustment_width(adjustment_width)
7226 .kernel_size(3, 3)
7227 .stride(2)
7228 .groups(2)
7229 .group_input_channels(17)
7230 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7231 .iterations(1)
7232 .TestF32();
7233 }
7234}
7235
Marat Dukhanefc47b82019-11-18 09:25:38 -08007236TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3s2_varying_input_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007237 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08007238 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07007239 DeconvolutionOperatorTester()
7240 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007241 .input_size(input_height, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007242 .padding(1)
7243 .kernel_size(3, 3)
7244 .stride(2)
7245 .groups(2)
7246 .group_input_channels(17)
7247 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7248 .iterations(1)
7249 .TestF32();
7250 }
7251}
7252
Marat Dukhanefc47b82019-11-18 09:25:38 -08007253TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3s2_varying_input_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007254 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhana41533d2019-11-04 10:40:51 -08007255 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
XNNPACK Teamb455b122019-09-27 18:10:33 -07007256 DeconvolutionOperatorTester()
7257 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007258 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007259 .padding(1)
7260 .kernel_size(3, 3)
7261 .stride(2)
7262 .groups(2)
7263 .group_input_channels(17)
7264 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7265 .iterations(1)
7266 .TestF32();
7267 }
7268}
7269
Marat Dukhan58717032020-04-28 15:03:28 -07007270TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3s2_varying_input_height_with_tf_same_padding) {
7271 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7272 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
7273 DeconvolutionOperatorTester()
7274 .batch_size(2)
7275 .input_size(input_height, kStridedInputWidth)
7276 .padding_tf_same(true)
7277 .kernel_size(3, 3)
7278 .stride(2)
7279 .groups(2)
7280 .group_input_channels(17)
7281 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7282 .iterations(1)
7283 .TestF32();
7284 }
7285}
7286
7287TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3s2_varying_input_width_with_tf_same_padding) {
7288 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7289 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
7290 DeconvolutionOperatorTester()
7291 .batch_size(2)
7292 .input_size(kStridedInputHeight, kStridedInputWidth)
7293 .padding_tf_same(true)
7294 .kernel_size(3, 3)
7295 .stride(2)
7296 .groups(2)
7297 .group_input_channels(17)
7298 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7299 .iterations(1)
7300 .TestF32();
7301 }
7302}
7303
Marat Dukhanefc47b82019-11-18 09:25:38 -08007304TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3s2_varying_input_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007305 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07007306 for (size_t input_channels = 14; input_channels <= 20; input_channels++) {
7307 DeconvolutionOperatorTester()
7308 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007309 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007310 .padding(1)
7311 .kernel_size(3, 3)
7312 .stride(2)
7313 .groups(2)
7314 .group_input_channels(input_channels)
7315 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7316 .iterations(1)
7317 .TestF32();
7318 }
7319}
7320
Marat Dukhanefc47b82019-11-18 09:25:38 -08007321TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3s2_varying_output_channels) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007322 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07007323 for (size_t output_channels = 1; output_channels <= xnn_params.f32.gemm.nr * 2; output_channels *= 2) {
7324 DeconvolutionOperatorTester()
7325 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007326 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007327 .padding(1)
7328 .kernel_size(3, 3)
7329 .stride(2)
7330 .groups(2)
7331 .group_input_channels(17)
7332 .group_output_channels(output_channels)
7333 .iterations(1)
7334 .TestF32();
7335 }
7336}
7337
Marat Dukhanefc47b82019-11-18 09:25:38 -08007338TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3s2_with_input_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007339 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07007340 DeconvolutionOperatorTester()
7341 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007342 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007343 .padding(1)
7344 .kernel_size(3, 3)
7345 .stride(2)
7346 .groups(2)
7347 .group_input_channels(17)
7348 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7349 .input_pixel_stride(37)
7350 .iterations(3)
7351 .TestF32();
7352}
7353
Marat Dukhanefc47b82019-11-18 09:25:38 -08007354TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3s2_with_output_stride) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007355 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07007356 DeconvolutionOperatorTester()
7357 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007358 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007359 .padding(1)
7360 .kernel_size(3, 3)
7361 .stride(2)
7362 .groups(2)
7363 .group_input_channels(17)
7364 .group_output_channels(xnn_params.f32.gemm.nr + 3)
7365 .output_pixel_stride(xnn_params.f32.gemm.nr * 2 + 13)
7366 .iterations(3)
7367 .TestF32();
7368}
7369
Marat Dukhanefc47b82019-11-18 09:25:38 -08007370TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3s2_with_qmin) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007371 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07007372 DeconvolutionOperatorTester()
7373 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007374 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007375 .padding(1)
7376 .kernel_size(3, 3)
7377 .stride(2)
7378 .groups(2)
7379 .group_input_channels(17)
7380 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7381 .qmin(128)
7382 .iterations(3)
7383 .TestF32();
7384}
7385
Marat Dukhanefc47b82019-11-18 09:25:38 -08007386TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3s2_with_qmax) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007387 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07007388 DeconvolutionOperatorTester()
7389 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007390 .input_size(kStridedInputHeight, kStridedInputWidth)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007391 .padding(1)
7392 .kernel_size(3, 3)
7393 .stride(2)
7394 .groups(2)
7395 .group_input_channels(17)
7396 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
Marat Dukhanab7424a2019-10-30 10:09:50 -07007397 .qmax(128)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007398 .iterations(3)
7399 .TestF32();
7400}
7401
Marat Dukhanefc47b82019-11-18 09:25:38 -08007402TEST(DECONVOLUTION_NHWC_F32, batched_grouped_3x3s2_without_bias) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007403 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
Marat Dukhanf568f082019-10-30 09:47:07 -07007404 DeconvolutionOperatorTester()
7405 .has_bias(false)
7406 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007407 .input_size(kStridedInputHeight, kStridedInputWidth)
Marat Dukhanf568f082019-10-30 09:47:07 -07007408 .padding(1)
7409 .kernel_size(3, 3)
7410 .stride(2)
7411 .groups(2)
7412 .group_input_channels(17)
7413 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7414 .iterations(3)
7415 .TestF32();
7416}
7417
Marat Dukhan29954272020-02-13 17:56:11 -08007418/**************************** SUBCONV2D/IGEMM path, setup ****************************/
XNNPACK Teamb455b122019-09-27 18:10:33 -07007419
Marat Dukhanefc47b82019-11-18 09:25:38 -08007420TEST(DECONVOLUTION_NHWC_F32, 3x3s2_setup_changing_batch) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007421 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07007422 DeconvolutionOperatorTester()
7423 .batch_size(2)
7424 .next_batch_size(5)
Marat Dukhana41533d2019-11-04 10:40:51 -08007425 .input_size(kStridedInputHeight, kStridedInputWidth)
Marat Dukhan29954272020-02-13 17:56:11 -08007426 .kernel_size(3, 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007427 .stride(2)
7428 .groups(2)
7429 .group_input_channels(15)
7430 .group_output_channels(17)
7431 .TestSetupF32();
7432}
7433
Marat Dukhanefc47b82019-11-18 09:25:38 -08007434TEST(DECONVOLUTION_NHWC_F32, 3x3s2_setup_changing_height) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007435 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07007436 DeconvolutionOperatorTester()
7437 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007438 .input_size(kStridedInputHeight, kStridedInputWidth)
7439 .next_input_height(kStridedInputHeight + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08007440 .kernel_size(3, 3)
XNNPACK Teamb455b122019-09-27 18:10:33 -07007441 .stride(2)
7442 .groups(2)
7443 .group_input_channels(15)
7444 .group_output_channels(17)
7445 .TestSetupF32();
7446}
7447
Marat Dukhanefc47b82019-11-18 09:25:38 -08007448TEST(DECONVOLUTION_NHWC_F32, 3x3s2_setup_changing_width) {
Marat Dukhan04f03be2019-11-19 12:36:47 -08007449 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
XNNPACK Teamb455b122019-09-27 18:10:33 -07007450 DeconvolutionOperatorTester()
7451 .batch_size(2)
Marat Dukhana41533d2019-11-04 10:40:51 -08007452 .input_size(kStridedInputHeight, kStridedInputWidth)
7453 .next_input_width(kStridedInputWidth + 3)
Marat Dukhan29954272020-02-13 17:56:11 -08007454 .kernel_size(3, 3)
7455 .stride(2)
7456 .groups(2)
7457 .group_input_channels(15)
7458 .group_output_channels(17)
7459 .TestSetupF32();
7460}
7461
7462/**************************** SUBCONV2D/GEMM path ****************************/
7463
7464TEST(DECONVOLUTION_NHWC_F32, 2x2s2) {
7465 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7466 DeconvolutionOperatorTester()
7467 .input_size(kStridedInputHeight, kStridedInputWidth)
7468 .kernel_size(2, 2)
7469 .stride(2)
7470 .group_input_channels(15)
7471 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7472 .iterations(3)
7473 .TestF32();
7474}
7475
7476TEST(DECONVOLUTION_NHWC_F32, Kx2sKx2) {
7477 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7478 for (size_t kernel_height = 3; kernel_height <= 5; kernel_height++) {
7479 DeconvolutionOperatorTester()
7480 .input_size(kStridedInputHeight, kStridedInputWidth)
7481 .kernel_size(kernel_height, 2)
7482 .stride(kernel_height, 2)
7483 .group_input_channels(17)
7484 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7485 .iterations(3)
7486 .TestF32();
7487 }
7488}
7489
7490TEST(DECONVOLUTION_NHWC_F32, 2xKs2xK) {
7491 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7492 for (size_t kernel_width = 3; kernel_width <= 5; kernel_width++) {
7493 DeconvolutionOperatorTester()
7494 .input_size(kStridedInputHeight, kStridedInputWidth)
7495 .kernel_size(2, kernel_width)
7496 .stride(2, kernel_width)
7497 .group_input_channels(17)
7498 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7499 .iterations(3)
7500 .TestF32();
7501 }
7502}
7503
7504TEST(DECONVOLUTION_NHWC_F32, 2x2s2_height_adjustment) {
7505 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7506 DeconvolutionOperatorTester()
7507 .input_size(kStridedInputHeight, kStridedInputWidth)
7508 .adjustment_height(1)
7509 .kernel_size(2, 2)
7510 .stride(2)
7511 .group_input_channels(15)
7512 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7513 .iterations(1)
7514 .TestF32();
7515}
7516
7517TEST(DECONVOLUTION_NHWC_F32, 2x2s2_width_adjustment) {
7518 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7519 DeconvolutionOperatorTester()
7520 .input_size(kStridedInputHeight, kStridedInputWidth)
7521 .adjustment_width(1)
7522 .kernel_size(2, 2)
7523 .stride(2)
7524 .group_input_channels(15)
7525 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7526 .iterations(1)
7527 .TestF32();
7528}
7529
7530TEST(DECONVOLUTION_NHWC_F32, 2x2s2_varying_input_height) {
7531 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7532 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
7533 DeconvolutionOperatorTester()
7534 .input_size(input_height, kStridedInputWidth)
7535 .kernel_size(2, 2)
7536 .stride(2)
7537 .group_input_channels(15)
7538 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7539 .iterations(1)
7540 .TestF32();
7541 }
7542}
7543
7544TEST(DECONVOLUTION_NHWC_F32, 2x2s2_varying_input_width) {
7545 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7546 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
7547 DeconvolutionOperatorTester()
7548 .input_size(kStridedInputHeight, kStridedInputWidth)
7549 .kernel_size(2, 2)
7550 .stride(2)
7551 .group_input_channels(15)
7552 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7553 .iterations(1)
7554 .TestF32();
7555 }
7556}
7557
7558TEST(DECONVOLUTION_NHWC_F32, 2x2s2_varying_input_channels) {
7559 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7560 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
7561 DeconvolutionOperatorTester()
7562 .input_size(kStridedInputHeight, kStridedInputWidth)
7563 .kernel_size(2, 2)
7564 .stride(2)
7565 .group_input_channels(input_channels)
7566 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7567 .iterations(1)
7568 .TestF32();
7569 }
7570}
7571
7572TEST(DECONVOLUTION_NHWC_F32, 2x2s2_varying_output_channels) {
7573 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7574 for (size_t output_channels = 1; output_channels <= xnn_params.f32.gemm.nr * 2; output_channels *= 2) {
7575 DeconvolutionOperatorTester()
7576 .input_size(kStridedInputHeight, kStridedInputWidth)
7577 .kernel_size(2, 2)
7578 .stride(2)
7579 .group_input_channels(23)
7580 .group_output_channels(output_channels)
7581 .iterations(1)
7582 .TestF32();
7583 }
7584}
7585
7586TEST(DECONVOLUTION_NHWC_F32, 2x2s2_with_input_stride) {
7587 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7588 DeconvolutionOperatorTester()
7589 .input_size(kStridedInputHeight, kStridedInputWidth)
7590 .kernel_size(2, 2)
7591 .stride(2)
7592 .group_input_channels(23)
7593 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7594 .input_pixel_stride(28)
7595 .iterations(3)
7596 .TestF32();
7597}
7598
7599TEST(DECONVOLUTION_NHWC_F32, 2x2s2_with_output_stride) {
7600 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7601 DeconvolutionOperatorTester()
7602 .input_size(kStridedInputHeight, kStridedInputWidth)
7603 .kernel_size(2, 2)
7604 .stride(2)
7605 .group_input_channels(23)
7606 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7607 .output_pixel_stride(xnn_params.f32.gemm.nr * 2 + 13)
7608 .iterations(3)
7609 .TestF32();
7610}
7611
7612TEST(DECONVOLUTION_NHWC_F32, 2x2s2_with_qmin) {
7613 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7614 DeconvolutionOperatorTester()
7615 .input_size(kStridedInputHeight, kStridedInputWidth)
7616 .kernel_size(2, 2)
7617 .stride(2)
7618 .group_input_channels(23)
7619 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7620 .qmin(128)
7621 .iterations(3)
7622 .TestF32();
7623}
7624
7625TEST(DECONVOLUTION_NHWC_F32, 2x2s2_with_qmax) {
7626 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7627 DeconvolutionOperatorTester()
7628 .input_size(kStridedInputHeight, kStridedInputWidth)
7629 .kernel_size(2, 2)
7630 .stride(2)
7631 .group_input_channels(23)
7632 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7633 .qmax(128)
7634 .iterations(3)
7635 .TestF32();
7636}
7637
7638TEST(DECONVOLUTION_NHWC_F32, 2x2s2_without_bias) {
7639 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7640 DeconvolutionOperatorTester()
7641 .has_bias(false)
7642 .input_size(kStridedInputHeight, kStridedInputWidth)
7643 .kernel_size(2, 2)
7644 .stride(2)
7645 .group_input_channels(23)
7646 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7647 .iterations(3)
7648 .TestF32();
7649}
7650
7651/**************************** SUBCONV2D/GEMM path, grouped ****************************/
7652
7653TEST(DECONVOLUTION_NHWC_F32, grouped_2x2s2) {
7654 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7655 DeconvolutionOperatorTester()
7656 .input_size(kStridedInputHeight, kStridedInputWidth)
7657 .kernel_size(2, 2)
7658 .stride(2)
7659 .groups(2)
7660 .group_input_channels(17)
7661 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7662 .iterations(3)
7663 .TestF32();
7664}
7665
7666TEST(DECONVOLUTION_NHWC_F32, grouped_Kx2sKx2) {
7667 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7668 for (size_t kernel_height = 3; kernel_height <= 5; kernel_height++) {
7669 DeconvolutionOperatorTester()
7670 .input_size(kStridedInputHeight, kStridedInputWidth)
7671 .kernel_size(kernel_height, 2)
7672 .stride(kernel_height, 2)
7673 .groups(2)
7674 .group_input_channels(17)
7675 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7676 .iterations(3)
7677 .TestF32();
7678 }
7679}
7680
7681TEST(DECONVOLUTION_NHWC_F32, grouped_2xKs2xK) {
7682 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7683 for (size_t kernel_width = 3; kernel_width <= 5; kernel_width++) {
7684 DeconvolutionOperatorTester()
7685 .input_size(kStridedInputHeight, kStridedInputWidth)
7686 .kernel_size(2, kernel_width)
7687 .stride(2, kernel_width)
7688 .groups(2)
7689 .group_input_channels(17)
7690 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7691 .iterations(3)
7692 .TestF32();
7693 }
7694}
7695
7696TEST(DECONVOLUTION_NHWC_F32, grouped_2x2s2_height_adjustment) {
7697 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7698 DeconvolutionOperatorTester()
7699 .input_size(kStridedInputHeight, kStridedInputWidth)
7700 .adjustment_height(1)
7701 .kernel_size(2, 2)
7702 .stride(2)
7703 .groups(2)
7704 .group_input_channels(17)
7705 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7706 .iterations(1)
7707 .TestF32();
7708}
7709
7710TEST(DECONVOLUTION_NHWC_F32, grouped_2x2s2_width_adjustment) {
7711 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7712 DeconvolutionOperatorTester()
7713 .input_size(kStridedInputHeight, kStridedInputWidth)
7714 .adjustment_width(1)
7715 .kernel_size(2, 2)
7716 .stride(2)
7717 .groups(2)
7718 .group_input_channels(17)
7719 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7720 .iterations(1)
7721 .TestF32();
7722}
7723
7724TEST(DECONVOLUTION_NHWC_F32, grouped_2x2s2_varying_input_height) {
7725 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7726 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
7727 DeconvolutionOperatorTester()
7728 .input_size(input_height, kStridedInputWidth)
7729 .kernel_size(2, 2)
7730 .stride(2)
7731 .groups(2)
7732 .group_input_channels(17)
7733 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7734 .iterations(1)
7735 .TestF32();
7736 }
7737}
7738
7739TEST(DECONVOLUTION_NHWC_F32, grouped_2x2s2_varying_input_width) {
7740 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7741 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
7742 DeconvolutionOperatorTester()
7743 .input_size(kStridedInputHeight, kStridedInputWidth)
7744 .kernel_size(2, 2)
7745 .stride(2)
7746 .groups(2)
7747 .group_input_channels(17)
7748 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7749 .iterations(1)
7750 .TestF32();
7751 }
7752}
7753
7754TEST(DECONVOLUTION_NHWC_F32, grouped_2x2s2_varying_input_channels) {
7755 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7756 for (size_t input_channels = 14; input_channels <= 20; input_channels++) {
7757 DeconvolutionOperatorTester()
7758 .input_size(kStridedInputHeight, kStridedInputWidth)
7759 .kernel_size(2, 2)
7760 .stride(2)
7761 .groups(2)
7762 .group_input_channels(input_channels)
7763 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7764 .iterations(1)
7765 .TestF32();
7766 }
7767}
7768
7769TEST(DECONVOLUTION_NHWC_F32, grouped_2x2s2_varying_output_channels) {
7770 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7771 for (size_t output_channels = 1; output_channels <= xnn_params.f32.gemm.nr * 2; output_channels *= 2) {
7772 DeconvolutionOperatorTester()
7773 .input_size(kStridedInputHeight, kStridedInputWidth)
7774 .kernel_size(2, 2)
7775 .stride(2)
7776 .groups(2)
7777 .group_input_channels(17)
7778 .group_output_channels(output_channels)
7779 .iterations(1)
7780 .TestF32();
7781 }
7782}
7783
7784TEST(DECONVOLUTION_NHWC_F32, grouped_2x2s2_with_input_stride) {
7785 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7786 DeconvolutionOperatorTester()
7787 .input_size(kStridedInputHeight, kStridedInputWidth)
7788 .kernel_size(2, 2)
7789 .stride(2)
7790 .groups(2)
7791 .group_input_channels(17)
7792 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7793 .input_pixel_stride(37)
7794 .iterations(3)
7795 .TestF32();
7796}
7797
7798TEST(DECONVOLUTION_NHWC_F32, grouped_2x2s2_with_output_stride) {
7799 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7800 DeconvolutionOperatorTester()
7801 .input_size(kStridedInputHeight, kStridedInputWidth)
7802 .kernel_size(2, 2)
7803 .stride(2)
7804 .groups(2)
7805 .group_input_channels(17)
7806 .group_output_channels(xnn_params.f32.gemm.nr + 3)
7807 .output_pixel_stride(xnn_params.f32.gemm.nr * 2 + 13)
7808 .iterations(3)
7809 .TestF32();
7810}
7811
7812TEST(DECONVOLUTION_NHWC_F32, grouped_2x2s2_with_qmin) {
7813 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7814 DeconvolutionOperatorTester()
7815 .input_size(kStridedInputHeight, kStridedInputWidth)
7816 .kernel_size(2, 2)
7817 .stride(2)
7818 .groups(2)
7819 .group_input_channels(17)
7820 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7821 .qmin(128)
7822 .iterations(3)
7823 .TestF32();
7824}
7825
7826TEST(DECONVOLUTION_NHWC_F32, grouped_2x2s2_with_qmax) {
7827 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7828 DeconvolutionOperatorTester()
7829 .input_size(kStridedInputHeight, kStridedInputWidth)
7830 .kernel_size(2, 2)
7831 .stride(2)
7832 .groups(2)
7833 .group_input_channels(17)
7834 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7835 .qmax(128)
7836 .iterations(3)
7837 .TestF32();
7838}
7839
7840TEST(DECONVOLUTION_NHWC_F32, grouped_2x2s2_without_bias) {
7841 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7842 DeconvolutionOperatorTester()
7843 .has_bias(false)
7844 .input_size(kStridedInputHeight, kStridedInputWidth)
7845 .kernel_size(2, 2)
7846 .stride(2)
7847 .groups(2)
7848 .group_input_channels(17)
7849 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7850 .iterations(3)
7851 .TestF32();
7852}
7853
7854/**************************** SUBCONV2D/GEMM path, batched ****************************/
7855
7856TEST(DECONVOLUTION_NHWC_F32, batched_2x2s2) {
7857 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7858 DeconvolutionOperatorTester()
7859 .batch_size(2)
7860 .input_size(kStridedInputHeight, kStridedInputWidth)
7861 .kernel_size(2, 2)
7862 .stride(2)
7863 .group_input_channels(15)
7864 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7865 .iterations(3)
7866 .TestF32();
7867}
7868
7869TEST(DECONVOLUTION_NHWC_F32, batched_Kx2sKx2) {
7870 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7871 for (size_t kernel_height = 3; kernel_height <= 5; kernel_height++) {
7872 DeconvolutionOperatorTester()
7873 .batch_size(2)
7874 .input_size(kStridedInputHeight, kStridedInputWidth)
7875 .kernel_size(kernel_height, 2)
7876 .stride(kernel_height, 2)
7877 .group_input_channels(17)
7878 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7879 .iterations(3)
7880 .TestF32();
7881 }
7882}
7883
7884TEST(DECONVOLUTION_NHWC_F32, batched_2xKs2xK) {
7885 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7886 for (size_t kernel_width = 3; kernel_width <= 5; kernel_width++) {
7887 DeconvolutionOperatorTester()
7888 .batch_size(2)
7889 .input_size(kStridedInputHeight, kStridedInputWidth)
7890 .kernel_size(2, kernel_width)
7891 .stride(2, kernel_width)
7892 .group_input_channels(17)
7893 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7894 .iterations(3)
7895 .TestF32();
7896 }
7897}
7898
7899TEST(DECONVOLUTION_NHWC_F32, batched_2x2s2_height_adjustment) {
7900 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7901 DeconvolutionOperatorTester()
7902 .batch_size(2)
7903 .input_size(kStridedInputHeight, kStridedInputWidth)
7904 .adjustment_height(1)
7905 .kernel_size(2, 2)
7906 .stride(2)
7907 .group_input_channels(15)
7908 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7909 .iterations(1)
7910 .TestF32();
7911}
7912
7913TEST(DECONVOLUTION_NHWC_F32, batched_2x2s2_width_adjustment) {
7914 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7915 DeconvolutionOperatorTester()
7916 .batch_size(2)
7917 .input_size(kStridedInputHeight, kStridedInputWidth)
7918 .adjustment_width(1)
7919 .kernel_size(2, 2)
7920 .stride(2)
7921 .group_input_channels(15)
7922 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7923 .iterations(1)
7924 .TestF32();
7925}
7926
7927TEST(DECONVOLUTION_NHWC_F32, batched_2x2s2_varying_input_height) {
7928 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7929 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
7930 DeconvolutionOperatorTester()
7931 .batch_size(2)
7932 .input_size(input_height, kStridedInputWidth)
7933 .kernel_size(2, 2)
7934 .stride(2)
7935 .group_input_channels(15)
7936 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7937 .iterations(1)
7938 .TestF32();
7939 }
7940}
7941
7942TEST(DECONVOLUTION_NHWC_F32, batched_2x2s2_varying_input_width) {
7943 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7944 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
7945 DeconvolutionOperatorTester()
7946 .batch_size(2)
7947 .input_size(kStridedInputHeight, kStridedInputWidth)
7948 .kernel_size(2, 2)
7949 .stride(2)
7950 .group_input_channels(15)
7951 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7952 .iterations(1)
7953 .TestF32();
7954 }
7955}
7956
7957TEST(DECONVOLUTION_NHWC_F32, batched_2x2s2_varying_input_channels) {
7958 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7959 for (size_t input_channels = 1; input_channels <= 16; input_channels *= 4) {
7960 DeconvolutionOperatorTester()
7961 .batch_size(2)
7962 .input_size(kStridedInputHeight, kStridedInputWidth)
7963 .kernel_size(2, 2)
7964 .stride(2)
7965 .group_input_channels(input_channels)
7966 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7967 .iterations(1)
7968 .TestF32();
7969 }
7970}
7971
7972TEST(DECONVOLUTION_NHWC_F32, batched_2x2s2_varying_output_channels) {
7973 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7974 for (size_t output_channels = 1; output_channels <= xnn_params.f32.gemm.nr * 2; output_channels *= 2) {
7975 DeconvolutionOperatorTester()
7976 .batch_size(2)
7977 .input_size(kStridedInputHeight, kStridedInputWidth)
7978 .kernel_size(2, 2)
7979 .stride(2)
7980 .group_input_channels(23)
7981 .group_output_channels(output_channels)
7982 .iterations(1)
7983 .TestF32();
7984 }
7985}
7986
7987TEST(DECONVOLUTION_NHWC_F32, batched_2x2s2_with_input_stride) {
7988 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
7989 DeconvolutionOperatorTester()
7990 .batch_size(2)
7991 .input_size(kStridedInputHeight, kStridedInputWidth)
7992 .kernel_size(2, 2)
7993 .stride(2)
7994 .group_input_channels(23)
7995 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
7996 .input_pixel_stride(28)
7997 .iterations(3)
7998 .TestF32();
7999}
8000
8001TEST(DECONVOLUTION_NHWC_F32, batched_2x2s2_with_output_stride) {
8002 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
8003 DeconvolutionOperatorTester()
8004 .batch_size(2)
8005 .input_size(kStridedInputHeight, kStridedInputWidth)
8006 .kernel_size(2, 2)
8007 .stride(2)
8008 .group_input_channels(23)
8009 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
8010 .output_pixel_stride(xnn_params.f32.gemm.nr * 2 + 13)
8011 .iterations(3)
8012 .TestF32();
8013}
8014
8015TEST(DECONVOLUTION_NHWC_F32, batched_2x2s2_with_qmin) {
8016 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
8017 DeconvolutionOperatorTester()
8018 .batch_size(2)
8019 .input_size(kStridedInputHeight, kStridedInputWidth)
8020 .kernel_size(2, 2)
8021 .stride(2)
8022 .group_input_channels(23)
8023 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
8024 .qmin(128)
8025 .iterations(3)
8026 .TestF32();
8027}
8028
8029TEST(DECONVOLUTION_NHWC_F32, batched_2x2s2_with_qmax) {
8030 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
8031 DeconvolutionOperatorTester()
8032 .batch_size(2)
8033 .input_size(kStridedInputHeight, kStridedInputWidth)
8034 .kernel_size(2, 2)
8035 .stride(2)
8036 .group_input_channels(23)
8037 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
8038 .qmax(128)
8039 .iterations(3)
8040 .TestF32();
8041}
8042
8043TEST(DECONVOLUTION_NHWC_F32, batched_2x2s2_without_bias) {
8044 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
8045 DeconvolutionOperatorTester()
8046 .has_bias(false)
8047 .batch_size(2)
8048 .input_size(kStridedInputHeight, kStridedInputWidth)
8049 .kernel_size(2, 2)
8050 .stride(2)
8051 .group_input_channels(23)
8052 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
8053 .iterations(3)
8054 .TestF32();
8055}
8056
8057/**************************** SUBCONV2D/GEMM path, grouped, batched ****************************/
8058
8059TEST(DECONVOLUTION_NHWC_F32, batched_grouped_2x2s2) {
8060 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
8061 DeconvolutionOperatorTester()
8062 .batch_size(2)
8063 .input_size(kStridedInputHeight, kStridedInputWidth)
8064 .kernel_size(2, 2)
8065 .stride(2)
8066 .groups(2)
8067 .group_input_channels(17)
8068 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
8069 .iterations(3)
8070 .TestF32();
8071}
8072
8073TEST(DECONVOLUTION_NHWC_F32, batched_grouped_Kx2sKx2) {
8074 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
8075 for (size_t kernel_height = 3; kernel_height <= 5; kernel_height++) {
8076 DeconvolutionOperatorTester()
8077 .batch_size(2)
8078 .input_size(kStridedInputHeight, kStridedInputWidth)
8079 .kernel_size(kernel_height, 2)
8080 .stride(kernel_height, 2)
8081 .groups(2)
8082 .group_input_channels(17)
8083 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
8084 .iterations(3)
8085 .TestF32();
8086 }
8087}
8088
8089TEST(DECONVOLUTION_NHWC_F32, batched_grouped_2xKs2xK) {
8090 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
8091 for (size_t kernel_width = 3; kernel_width <= 5; kernel_width++) {
8092 DeconvolutionOperatorTester()
8093 .batch_size(2)
8094 .input_size(kStridedInputHeight, kStridedInputWidth)
8095 .kernel_size(2, kernel_width)
8096 .stride(2, kernel_width)
8097 .groups(2)
8098 .group_input_channels(17)
8099 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
8100 .iterations(3)
8101 .TestF32();
8102 }
8103}
8104
8105TEST(DECONVOLUTION_NHWC_F32, batched_grouped_2x2s2_height_adjustment) {
8106 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
8107 DeconvolutionOperatorTester()
8108 .batch_size(2)
8109 .input_size(kStridedInputHeight, kStridedInputWidth)
8110 .adjustment_height(1)
8111 .kernel_size(2, 2)
8112 .stride(2)
8113 .groups(2)
8114 .group_input_channels(17)
8115 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
8116 .iterations(1)
8117 .TestF32();
8118}
8119
8120TEST(DECONVOLUTION_NHWC_F32, batched_grouped_2x2s2_width_adjustment) {
8121 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
8122 DeconvolutionOperatorTester()
8123 .batch_size(2)
8124 .input_size(kStridedInputHeight, kStridedInputWidth)
8125 .adjustment_width(1)
8126 .kernel_size(2, 2)
8127 .stride(2)
8128 .groups(2)
8129 .group_input_channels(17)
8130 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
8131 .iterations(1)
8132 .TestF32();
8133}
8134
8135TEST(DECONVOLUTION_NHWC_F32, batched_grouped_2x2s2_varying_input_height) {
8136 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
8137 for (size_t input_height = kStridedInputHeight - 2; input_height <= kStridedInputHeight + 2; input_height++) {
8138 DeconvolutionOperatorTester()
8139 .batch_size(2)
8140 .input_size(input_height, kStridedInputWidth)
8141 .kernel_size(2, 2)
8142 .stride(2)
8143 .groups(2)
8144 .group_input_channels(17)
8145 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
8146 .iterations(1)
8147 .TestF32();
8148 }
8149}
8150
8151TEST(DECONVOLUTION_NHWC_F32, batched_grouped_2x2s2_varying_input_width) {
8152 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
8153 for (size_t input_width = kStridedInputWidth - 2; input_width <= kStridedInputWidth + 2; input_width++) {
8154 DeconvolutionOperatorTester()
8155 .batch_size(2)
8156 .input_size(kStridedInputHeight, kStridedInputWidth)
8157 .kernel_size(2, 2)
8158 .stride(2)
8159 .groups(2)
8160 .group_input_channels(17)
8161 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
8162 .iterations(1)
8163 .TestF32();
8164 }
8165}
8166
8167TEST(DECONVOLUTION_NHWC_F32, batched_grouped_2x2s2_varying_input_channels) {
8168 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
8169 for (size_t input_channels = 14; input_channels <= 20; input_channels++) {
8170 DeconvolutionOperatorTester()
8171 .batch_size(2)
8172 .input_size(kStridedInputHeight, kStridedInputWidth)
8173 .kernel_size(2, 2)
8174 .stride(2)
8175 .groups(2)
8176 .group_input_channels(input_channels)
8177 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
8178 .iterations(1)
8179 .TestF32();
8180 }
8181}
8182
8183TEST(DECONVOLUTION_NHWC_F32, batched_grouped_2x2s2_varying_output_channels) {
8184 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
8185 for (size_t output_channels = 1; output_channels <= xnn_params.f32.gemm.nr * 2; output_channels *= 2) {
8186 DeconvolutionOperatorTester()
8187 .batch_size(2)
8188 .input_size(kStridedInputHeight, kStridedInputWidth)
8189 .kernel_size(2, 2)
8190 .stride(2)
8191 .groups(2)
8192 .group_input_channels(17)
8193 .group_output_channels(output_channels)
8194 .iterations(1)
8195 .TestF32();
8196 }
8197}
8198
8199TEST(DECONVOLUTION_NHWC_F32, batched_grouped_2x2s2_with_input_stride) {
8200 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
8201 DeconvolutionOperatorTester()
8202 .batch_size(2)
8203 .input_size(kStridedInputHeight, kStridedInputWidth)
8204 .kernel_size(2, 2)
8205 .stride(2)
8206 .groups(2)
8207 .group_input_channels(17)
8208 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
8209 .input_pixel_stride(37)
8210 .iterations(3)
8211 .TestF32();
8212}
8213
8214TEST(DECONVOLUTION_NHWC_F32, batched_grouped_2x2s2_with_output_stride) {
8215 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
8216 DeconvolutionOperatorTester()
8217 .batch_size(2)
8218 .input_size(kStridedInputHeight, kStridedInputWidth)
8219 .kernel_size(2, 2)
8220 .stride(2)
8221 .groups(2)
8222 .group_input_channels(17)
8223 .group_output_channels(xnn_params.f32.gemm.nr + 3)
8224 .output_pixel_stride(xnn_params.f32.gemm.nr * 2 + 13)
8225 .iterations(3)
8226 .TestF32();
8227}
8228
8229TEST(DECONVOLUTION_NHWC_F32, batched_grouped_2x2s2_with_qmin) {
8230 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
8231 DeconvolutionOperatorTester()
8232 .batch_size(2)
8233 .input_size(kStridedInputHeight, kStridedInputWidth)
8234 .kernel_size(2, 2)
8235 .stride(2)
8236 .groups(2)
8237 .group_input_channels(17)
8238 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
8239 .qmin(128)
8240 .iterations(3)
8241 .TestF32();
8242}
8243
8244TEST(DECONVOLUTION_NHWC_F32, batched_grouped_2x2s2_with_qmax) {
8245 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
8246 DeconvolutionOperatorTester()
8247 .batch_size(2)
8248 .input_size(kStridedInputHeight, kStridedInputWidth)
8249 .kernel_size(2, 2)
8250 .stride(2)
8251 .groups(2)
8252 .group_input_channels(17)
8253 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
8254 .qmax(128)
8255 .iterations(3)
8256 .TestF32();
8257}
8258
8259TEST(DECONVOLUTION_NHWC_F32, batched_grouped_2x2s2_without_bias) {
8260 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
8261 DeconvolutionOperatorTester()
8262 .has_bias(false)
8263 .batch_size(2)
8264 .input_size(kStridedInputHeight, kStridedInputWidth)
8265 .kernel_size(2, 2)
8266 .stride(2)
8267 .groups(2)
8268 .group_input_channels(17)
8269 .group_output_channels(xnn_params.f32.gemm.nr * 2 + 3)
8270 .iterations(3)
8271 .TestF32();
8272}
8273
8274/**************************** SUBCONV2D/GEMM path, setup ****************************/
8275
8276TEST(DECONVOLUTION_NHWC_F32, 2x2s2_setup_changing_batch) {
8277 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
8278 DeconvolutionOperatorTester()
8279 .batch_size(2)
8280 .next_batch_size(5)
8281 .input_size(kStridedInputHeight, kStridedInputWidth)
8282 .kernel_size(2, 2)
8283 .stride(2)
8284 .groups(2)
8285 .group_input_channels(15)
8286 .group_output_channels(17)
8287 .TestSetupF32();
8288}
8289
8290TEST(DECONVOLUTION_NHWC_F32, 2x2s2_setup_changing_height) {
8291 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
8292 DeconvolutionOperatorTester()
8293 .batch_size(2)
8294 .input_size(kStridedInputHeight, kStridedInputWidth)
8295 .next_input_height(kStridedInputHeight + 3)
8296 .kernel_size(2, 2)
8297 .stride(2)
8298 .groups(2)
8299 .group_input_channels(15)
8300 .group_output_channels(17)
8301 .TestSetupF32();
8302}
8303
8304TEST(DECONVOLUTION_NHWC_F32, 2x2s2_setup_changing_width) {
8305 ASSERT_EQ(xnn_status_success, xnn_initialize(nullptr /* allocator */));
8306 DeconvolutionOperatorTester()
8307 .batch_size(2)
8308 .input_size(kStridedInputHeight, kStridedInputWidth)
8309 .next_input_width(kStridedInputWidth + 3)
8310 .kernel_size(2, 2)
XNNPACK Teamb455b122019-09-27 18:10:33 -07008311 .stride(2)
8312 .groups(2)
8313 .group_input_channels(15)
8314 .group_output_channels(17)
8315 .TestSetupF32();
8316}