XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 1 | // Copyright (c) Facebook, Inc. and its affiliates. |
| 2 | // All rights reserved. |
| 3 | // |
| 4 | // Copyright 2019 Google LLC |
| 5 | // |
| 6 | // This source code is licensed under the BSD-style license found in the |
| 7 | // LICENSE file in the root directory of this source tree. |
| 8 | // |
| 9 | // Auto-generated file. Do not edit! |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 10 | // Specification: test/q8-dwconv-minmax.yaml |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 11 | // Generator: tools/generate-dwconv-test.py |
| 12 | |
| 13 | |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 14 | #include <gtest/gtest.h> |
| 15 | |
Marat Dukhan | 1dadbf7 | 2019-10-01 10:46:20 -0700 | [diff] [blame] | 16 | #include <xnnpack/common.h> |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 17 | #include <xnnpack/isa-checks.h> |
| 18 | |
Marat Dukhan | 1dadbf7 | 2019-10-01 10:46:20 -0700 | [diff] [blame] | 19 | #include <xnnpack/dwconv.h> |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 20 | #include "dwconv-microkernel-tester.h" |
| 21 | |
| 22 | |
Marat Dukhan | 1dadbf7 | 2019-10-01 10:46:20 -0700 | [diff] [blame] | 23 | #if XNN_ARCH_ARM || XNN_ARCH_ARM64 |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 24 | TEST(Q8_DWCONV_MINMAX_UP8X9__NEON, c_eq_8) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 25 | TEST_REQUIRES_ARM_NEON; |
| 26 | DWConvMicrokernelTester() |
| 27 | .cr(8) |
| 28 | .kr(9) |
| 29 | .channels(8) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 30 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 31 | } |
| 32 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 33 | TEST(Q8_DWCONV_MINMAX_UP8X9__NEON, c_div_8) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 34 | TEST_REQUIRES_ARM_NEON; |
| 35 | for (uint32_t channels = 16; channels < 128; channels += 24) { |
| 36 | DWConvMicrokernelTester() |
| 37 | .cr(8) |
| 38 | .kr(9) |
| 39 | .channels(channels) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 40 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 41 | } |
| 42 | } |
| 43 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 44 | TEST(Q8_DWCONV_MINMAX_UP8X9__NEON, c_div_8_with_qmin) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 45 | TEST_REQUIRES_ARM_NEON; |
| 46 | for (uint32_t channels = 16; channels < 128; channels += 24) { |
| 47 | DWConvMicrokernelTester() |
| 48 | .cr(8) |
| 49 | .kr(9) |
| 50 | .channels(channels) |
| 51 | .qmin(128) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 52 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 53 | } |
| 54 | } |
| 55 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 56 | TEST(Q8_DWCONV_MINMAX_UP8X9__NEON, c_div_8_with_qmax) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 57 | TEST_REQUIRES_ARM_NEON; |
| 58 | for (uint32_t channels = 16; channels < 128; channels += 24) { |
| 59 | DWConvMicrokernelTester() |
| 60 | .cr(8) |
| 61 | .kr(9) |
| 62 | .channels(channels) |
| 63 | .qmax(128) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 64 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 65 | } |
| 66 | } |
| 67 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 68 | TEST(Q8_DWCONV_MINMAX_UP8X9__NEON, c_lt_8) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 69 | TEST_REQUIRES_ARM_NEON; |
| 70 | for (uint32_t channels = 1; channels < 8; channels++) { |
| 71 | DWConvMicrokernelTester() |
| 72 | .cr(8) |
| 73 | .kr(9) |
| 74 | .channels(channels) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 75 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 76 | } |
| 77 | } |
| 78 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 79 | TEST(Q8_DWCONV_MINMAX_UP8X9__NEON, c_gt_8) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 80 | TEST_REQUIRES_ARM_NEON; |
| 81 | for (uint32_t channels = 9; channels < 16; channels++) { |
| 82 | DWConvMicrokernelTester() |
| 83 | .cr(8) |
| 84 | .kr(9) |
| 85 | .channels(channels) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 86 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 87 | } |
| 88 | } |
| 89 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 90 | TEST(Q8_DWCONV_MINMAX_UP8X9__NEON, c_gt_8_with_qmin) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 91 | TEST_REQUIRES_ARM_NEON; |
| 92 | for (uint32_t channels = 9; channels < 16; channels++) { |
| 93 | DWConvMicrokernelTester() |
| 94 | .cr(8) |
| 95 | .kr(9) |
| 96 | .channels(channels) |
| 97 | .qmin(128) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 98 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 99 | } |
| 100 | } |
| 101 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 102 | TEST(Q8_DWCONV_MINMAX_UP8X9__NEON, c_gt_8_with_qmax) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 103 | TEST_REQUIRES_ARM_NEON; |
| 104 | for (uint32_t channels = 9; channels < 16; channels++) { |
| 105 | DWConvMicrokernelTester() |
| 106 | .cr(8) |
| 107 | .kr(9) |
| 108 | .channels(channels) |
| 109 | .qmax(128) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 110 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 111 | } |
| 112 | } |
| 113 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 114 | TEST(Q8_DWCONV_MINMAX_UP8X9__NEON, multipixel) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 115 | TEST_REQUIRES_ARM_NEON; |
| 116 | for (size_t channels = 1; channels <= 40; channels += 7) { |
| 117 | DWConvMicrokernelTester() |
| 118 | .cr(8) |
| 119 | .kr(9) |
| 120 | .channels(channels) |
| 121 | .width(3) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 122 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 123 | } |
| 124 | } |
| 125 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 126 | TEST(Q8_DWCONV_MINMAX_UP8X9__NEON, multipixel_with_step) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 127 | TEST_REQUIRES_ARM_NEON; |
| 128 | for (size_t channels = 1; channels <= 40; channels += 7) { |
| 129 | for (size_t step = 2; step <= 9; step++) { |
| 130 | DWConvMicrokernelTester() |
| 131 | .cr(8) |
| 132 | .kr(9) |
| 133 | .channels(channels) |
| 134 | .width(3) |
| 135 | .step(step) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 136 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 137 | } |
| 138 | } |
| 139 | } |
| 140 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 141 | TEST(Q8_DWCONV_MINMAX_UP8X9__NEON, multipixel_with_output_stride) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 142 | TEST_REQUIRES_ARM_NEON; |
| 143 | for (size_t channels = 1; channels <= 40; channels += 7) { |
| 144 | DWConvMicrokernelTester() |
| 145 | .cr(8) |
| 146 | .kr(9) |
| 147 | .channels(8) |
| 148 | .width(5) |
| 149 | .output_stride(43) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 150 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 151 | } |
| 152 | } |
| 153 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 154 | TEST(Q8_DWCONV_MINMAX_UP8X9__NEON, multipixel_with_qmin) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 155 | TEST_REQUIRES_ARM_NEON; |
| 156 | for (size_t channels = 1; channels <= 40; channels += 7) { |
| 157 | DWConvMicrokernelTester() |
| 158 | .cr(8) |
| 159 | .kr(9) |
| 160 | .channels(channels) |
| 161 | .width(3) |
| 162 | .qmin(128) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 163 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 164 | } |
| 165 | } |
| 166 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 167 | TEST(Q8_DWCONV_MINMAX_UP8X9__NEON, multipixel_with_qmax) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 168 | TEST_REQUIRES_ARM_NEON; |
| 169 | for (size_t channels = 1; channels <= 40; channels += 7) { |
| 170 | DWConvMicrokernelTester() |
| 171 | .cr(8) |
| 172 | .kr(9) |
| 173 | .channels(channels) |
| 174 | .width(3) |
| 175 | .qmax(128) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 176 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 177 | } |
| 178 | } |
| 179 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 180 | TEST(Q8_DWCONV_MINMAX_UP8X9__NEON, input_zero_point_only) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 181 | TEST_REQUIRES_ARM_NEON; |
| 182 | for (size_t channels = 1; channels <= 40; channels += 7) { |
| 183 | DWConvMicrokernelTester() |
| 184 | .cr(8) |
| 185 | .kr(9) |
| 186 | .channels(channels) |
| 187 | .width(3) |
| 188 | .input_zero_point(255) |
| 189 | .kernel_zero_point(0) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 190 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 191 | } |
| 192 | } |
| 193 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 194 | TEST(Q8_DWCONV_MINMAX_UP8X9__NEON, kernel_zero_point_only) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 195 | TEST_REQUIRES_ARM_NEON; |
| 196 | for (size_t channels = 1; channels <= 40; channels += 7) { |
| 197 | DWConvMicrokernelTester() |
| 198 | .cr(8) |
| 199 | .kr(9) |
| 200 | .channels(channels) |
| 201 | .width(3) |
| 202 | .input_zero_point(0) |
| 203 | .kernel_zero_point(255) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 204 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 205 | } |
| 206 | } |
Frank Barchard | d536072 | 2020-05-17 16:10:36 -0700 | [diff] [blame] | 207 | |
| 208 | TEST(Q8_DWCONV_MINMAX_UP8X9__NEON, input_offset) { |
| 209 | TEST_REQUIRES_ARM_NEON; |
| 210 | for (uint32_t channels = 16; channels < 128; channels += 24) { |
| 211 | DWConvMicrokernelTester() |
| 212 | .cr(8) |
| 213 | .kr(9) |
| 214 | .channels(channels) |
| 215 | .input_offset(176) |
| 216 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__neon); |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | TEST(Q8_DWCONV_MINMAX_UP8X9__NEON, zero) { |
| 221 | TEST_REQUIRES_ARM_NEON; |
| 222 | for (uint32_t mz = 0; mz < 9; mz++) { |
| 223 | for (uint32_t channels = 16; channels < 128; channels += 24) { |
| 224 | DWConvMicrokernelTester() |
| 225 | .cr(8) |
| 226 | .kr(9) |
| 227 | .channels(channels) |
| 228 | .input_offset(176) |
| 229 | .zero_index(mz) |
| 230 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__neon); |
| 231 | } |
| 232 | } |
| 233 | } |
Marat Dukhan | 1dadbf7 | 2019-10-01 10:46:20 -0700 | [diff] [blame] | 234 | #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 235 | |
| 236 | |
Marat Dukhan | 1dadbf7 | 2019-10-01 10:46:20 -0700 | [diff] [blame] | 237 | #if XNN_ARCH_X86 || XNN_ARCH_X86_64 |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 238 | TEST(Q8_DWCONV_MINMAX_UP8X9__SSE2, c_eq_8) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 239 | TEST_REQUIRES_X86_SSE2; |
| 240 | DWConvMicrokernelTester() |
| 241 | .cr(8) |
| 242 | .kr(9) |
| 243 | .channels(8) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 244 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 245 | } |
| 246 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 247 | TEST(Q8_DWCONV_MINMAX_UP8X9__SSE2, c_div_8) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 248 | TEST_REQUIRES_X86_SSE2; |
| 249 | for (uint32_t channels = 16; channels < 128; channels += 24) { |
| 250 | DWConvMicrokernelTester() |
| 251 | .cr(8) |
| 252 | .kr(9) |
| 253 | .channels(channels) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 254 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 255 | } |
| 256 | } |
| 257 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 258 | TEST(Q8_DWCONV_MINMAX_UP8X9__SSE2, c_div_8_with_qmin) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 259 | TEST_REQUIRES_X86_SSE2; |
| 260 | for (uint32_t channels = 16; channels < 128; channels += 24) { |
| 261 | DWConvMicrokernelTester() |
| 262 | .cr(8) |
| 263 | .kr(9) |
| 264 | .channels(channels) |
| 265 | .qmin(128) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 266 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 267 | } |
| 268 | } |
| 269 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 270 | TEST(Q8_DWCONV_MINMAX_UP8X9__SSE2, c_div_8_with_qmax) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 271 | TEST_REQUIRES_X86_SSE2; |
| 272 | for (uint32_t channels = 16; channels < 128; channels += 24) { |
| 273 | DWConvMicrokernelTester() |
| 274 | .cr(8) |
| 275 | .kr(9) |
| 276 | .channels(channels) |
| 277 | .qmax(128) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 278 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 279 | } |
| 280 | } |
| 281 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 282 | TEST(Q8_DWCONV_MINMAX_UP8X9__SSE2, c_lt_8) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 283 | TEST_REQUIRES_X86_SSE2; |
| 284 | for (uint32_t channels = 1; channels < 8; channels++) { |
| 285 | DWConvMicrokernelTester() |
| 286 | .cr(8) |
| 287 | .kr(9) |
| 288 | .channels(channels) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 289 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 290 | } |
| 291 | } |
| 292 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 293 | TEST(Q8_DWCONV_MINMAX_UP8X9__SSE2, c_gt_8) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 294 | TEST_REQUIRES_X86_SSE2; |
| 295 | for (uint32_t channels = 9; channels < 16; channels++) { |
| 296 | DWConvMicrokernelTester() |
| 297 | .cr(8) |
| 298 | .kr(9) |
| 299 | .channels(channels) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 300 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 301 | } |
| 302 | } |
| 303 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 304 | TEST(Q8_DWCONV_MINMAX_UP8X9__SSE2, c_gt_8_with_qmin) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 305 | TEST_REQUIRES_X86_SSE2; |
| 306 | for (uint32_t channels = 9; channels < 16; channels++) { |
| 307 | DWConvMicrokernelTester() |
| 308 | .cr(8) |
| 309 | .kr(9) |
| 310 | .channels(channels) |
| 311 | .qmin(128) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 312 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 313 | } |
| 314 | } |
| 315 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 316 | TEST(Q8_DWCONV_MINMAX_UP8X9__SSE2, c_gt_8_with_qmax) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 317 | TEST_REQUIRES_X86_SSE2; |
| 318 | for (uint32_t channels = 9; channels < 16; channels++) { |
| 319 | DWConvMicrokernelTester() |
| 320 | .cr(8) |
| 321 | .kr(9) |
| 322 | .channels(channels) |
| 323 | .qmax(128) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 324 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 325 | } |
| 326 | } |
| 327 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 328 | TEST(Q8_DWCONV_MINMAX_UP8X9__SSE2, multipixel) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 329 | TEST_REQUIRES_X86_SSE2; |
| 330 | for (size_t channels = 1; channels <= 40; channels += 7) { |
| 331 | DWConvMicrokernelTester() |
| 332 | .cr(8) |
| 333 | .kr(9) |
| 334 | .channels(channels) |
| 335 | .width(3) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 336 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 337 | } |
| 338 | } |
| 339 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 340 | TEST(Q8_DWCONV_MINMAX_UP8X9__SSE2, multipixel_with_step) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 341 | TEST_REQUIRES_X86_SSE2; |
| 342 | for (size_t channels = 1; channels <= 40; channels += 7) { |
| 343 | for (size_t step = 2; step <= 9; step++) { |
| 344 | DWConvMicrokernelTester() |
| 345 | .cr(8) |
| 346 | .kr(9) |
| 347 | .channels(channels) |
| 348 | .width(3) |
| 349 | .step(step) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 350 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 351 | } |
| 352 | } |
| 353 | } |
| 354 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 355 | TEST(Q8_DWCONV_MINMAX_UP8X9__SSE2, multipixel_with_output_stride) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 356 | TEST_REQUIRES_X86_SSE2; |
| 357 | for (size_t channels = 1; channels <= 40; channels += 7) { |
| 358 | DWConvMicrokernelTester() |
| 359 | .cr(8) |
| 360 | .kr(9) |
| 361 | .channels(8) |
| 362 | .width(5) |
| 363 | .output_stride(43) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 364 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 365 | } |
| 366 | } |
| 367 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 368 | TEST(Q8_DWCONV_MINMAX_UP8X9__SSE2, multipixel_with_qmin) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 369 | TEST_REQUIRES_X86_SSE2; |
| 370 | for (size_t channels = 1; channels <= 40; channels += 7) { |
| 371 | DWConvMicrokernelTester() |
| 372 | .cr(8) |
| 373 | .kr(9) |
| 374 | .channels(channels) |
| 375 | .width(3) |
| 376 | .qmin(128) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 377 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 378 | } |
| 379 | } |
| 380 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 381 | TEST(Q8_DWCONV_MINMAX_UP8X9__SSE2, multipixel_with_qmax) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 382 | TEST_REQUIRES_X86_SSE2; |
| 383 | for (size_t channels = 1; channels <= 40; channels += 7) { |
| 384 | DWConvMicrokernelTester() |
| 385 | .cr(8) |
| 386 | .kr(9) |
| 387 | .channels(channels) |
| 388 | .width(3) |
| 389 | .qmax(128) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 390 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 391 | } |
| 392 | } |
| 393 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 394 | TEST(Q8_DWCONV_MINMAX_UP8X9__SSE2, input_zero_point_only) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 395 | TEST_REQUIRES_X86_SSE2; |
| 396 | for (size_t channels = 1; channels <= 40; channels += 7) { |
| 397 | DWConvMicrokernelTester() |
| 398 | .cr(8) |
| 399 | .kr(9) |
| 400 | .channels(channels) |
| 401 | .width(3) |
| 402 | .input_zero_point(255) |
| 403 | .kernel_zero_point(0) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 404 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 405 | } |
| 406 | } |
| 407 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 408 | TEST(Q8_DWCONV_MINMAX_UP8X9__SSE2, kernel_zero_point_only) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 409 | TEST_REQUIRES_X86_SSE2; |
| 410 | for (size_t channels = 1; channels <= 40; channels += 7) { |
| 411 | DWConvMicrokernelTester() |
| 412 | .cr(8) |
| 413 | .kr(9) |
| 414 | .channels(channels) |
| 415 | .width(3) |
| 416 | .input_zero_point(0) |
| 417 | .kernel_zero_point(255) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 418 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 419 | } |
| 420 | } |
Frank Barchard | d536072 | 2020-05-17 16:10:36 -0700 | [diff] [blame] | 421 | |
| 422 | TEST(Q8_DWCONV_MINMAX_UP8X9__SSE2, input_offset) { |
| 423 | TEST_REQUIRES_X86_SSE2; |
| 424 | for (uint32_t channels = 16; channels < 128; channels += 24) { |
| 425 | DWConvMicrokernelTester() |
| 426 | .cr(8) |
| 427 | .kr(9) |
| 428 | .channels(channels) |
| 429 | .input_offset(176) |
| 430 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__sse2); |
| 431 | } |
| 432 | } |
| 433 | |
| 434 | TEST(Q8_DWCONV_MINMAX_UP8X9__SSE2, zero) { |
| 435 | TEST_REQUIRES_X86_SSE2; |
| 436 | for (uint32_t mz = 0; mz < 9; mz++) { |
| 437 | for (uint32_t channels = 16; channels < 128; channels += 24) { |
| 438 | DWConvMicrokernelTester() |
| 439 | .cr(8) |
| 440 | .kr(9) |
| 441 | .channels(channels) |
| 442 | .input_offset(176) |
| 443 | .zero_index(mz) |
| 444 | .Test(xnn_q8_dwconv_minmax_ukernel_up8x9__sse2); |
| 445 | } |
| 446 | } |
| 447 | } |
Marat Dukhan | 1dadbf7 | 2019-10-01 10:46:20 -0700 | [diff] [blame] | 448 | #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 449 | |
| 450 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 451 | TEST(Q8_DWCONV_MINMAX_UP1X9__SCALAR, c_eq_1) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 452 | DWConvMicrokernelTester() |
| 453 | .cr(1) |
| 454 | .kr(9) |
| 455 | .channels(1) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 456 | .Test(xnn_q8_dwconv_minmax_ukernel_up1x9__scalar, DWConvMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 457 | } |
| 458 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 459 | TEST(Q8_DWCONV_MINMAX_UP1X9__SCALAR, c_gt_1) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 460 | for (uint32_t channels = 2; channels < 10; channels++) { |
| 461 | DWConvMicrokernelTester() |
| 462 | .cr(1) |
| 463 | .kr(9) |
| 464 | .channels(channels) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 465 | .Test(xnn_q8_dwconv_minmax_ukernel_up1x9__scalar, DWConvMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 466 | } |
| 467 | } |
| 468 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 469 | TEST(Q8_DWCONV_MINMAX_UP1X9__SCALAR, c_gt_1_with_qmin) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 470 | for (uint32_t channels = 2; channels < 10; channels++) { |
| 471 | DWConvMicrokernelTester() |
| 472 | .cr(1) |
| 473 | .kr(9) |
| 474 | .channels(channels) |
| 475 | .qmin(128) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 476 | .Test(xnn_q8_dwconv_minmax_ukernel_up1x9__scalar, DWConvMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 477 | } |
| 478 | } |
| 479 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 480 | TEST(Q8_DWCONV_MINMAX_UP1X9__SCALAR, c_gt_1_with_qmax) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 481 | for (uint32_t channels = 2; channels < 10; channels++) { |
| 482 | DWConvMicrokernelTester() |
| 483 | .cr(1) |
| 484 | .kr(9) |
| 485 | .channels(channels) |
| 486 | .qmax(128) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 487 | .Test(xnn_q8_dwconv_minmax_ukernel_up1x9__scalar, DWConvMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 488 | } |
| 489 | } |
| 490 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 491 | TEST(Q8_DWCONV_MINMAX_UP1X9__SCALAR, multipixel) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 492 | for (size_t channels = 1; channels <= 5; channels += 1) { |
| 493 | DWConvMicrokernelTester() |
| 494 | .cr(1) |
| 495 | .kr(9) |
| 496 | .channels(channels) |
| 497 | .width(3) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 498 | .Test(xnn_q8_dwconv_minmax_ukernel_up1x9__scalar, DWConvMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 499 | } |
| 500 | } |
| 501 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 502 | TEST(Q8_DWCONV_MINMAX_UP1X9__SCALAR, multipixel_with_step) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 503 | for (size_t channels = 1; channels <= 5; channels += 1) { |
| 504 | for (size_t step = 2; step <= 9; step++) { |
| 505 | DWConvMicrokernelTester() |
| 506 | .cr(1) |
| 507 | .kr(9) |
| 508 | .channels(channels) |
| 509 | .width(3) |
| 510 | .step(step) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 511 | .Test(xnn_q8_dwconv_minmax_ukernel_up1x9__scalar, DWConvMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 512 | } |
| 513 | } |
| 514 | } |
| 515 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 516 | TEST(Q8_DWCONV_MINMAX_UP1X9__SCALAR, multipixel_with_output_stride) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 517 | for (size_t channels = 1; channels <= 5; channels += 1) { |
| 518 | DWConvMicrokernelTester() |
| 519 | .cr(1) |
| 520 | .kr(9) |
| 521 | .channels(1) |
| 522 | .width(5) |
| 523 | .output_stride(7) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 524 | .Test(xnn_q8_dwconv_minmax_ukernel_up1x9__scalar, DWConvMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 525 | } |
| 526 | } |
| 527 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 528 | TEST(Q8_DWCONV_MINMAX_UP1X9__SCALAR, multipixel_with_qmin) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 529 | for (size_t channels = 1; channels <= 5; channels += 1) { |
| 530 | DWConvMicrokernelTester() |
| 531 | .cr(1) |
| 532 | .kr(9) |
| 533 | .channels(channels) |
| 534 | .width(3) |
| 535 | .qmin(128) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 536 | .Test(xnn_q8_dwconv_minmax_ukernel_up1x9__scalar, DWConvMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 537 | } |
| 538 | } |
| 539 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 540 | TEST(Q8_DWCONV_MINMAX_UP1X9__SCALAR, multipixel_with_qmax) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 541 | for (size_t channels = 1; channels <= 5; channels += 1) { |
| 542 | DWConvMicrokernelTester() |
| 543 | .cr(1) |
| 544 | .kr(9) |
| 545 | .channels(channels) |
| 546 | .width(3) |
| 547 | .qmax(128) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 548 | .Test(xnn_q8_dwconv_minmax_ukernel_up1x9__scalar, DWConvMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 549 | } |
| 550 | } |
| 551 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 552 | TEST(Q8_DWCONV_MINMAX_UP1X9__SCALAR, input_zero_point_only) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 553 | for (size_t channels = 1; channels <= 5; channels += 1) { |
| 554 | DWConvMicrokernelTester() |
| 555 | .cr(1) |
| 556 | .kr(9) |
| 557 | .channels(channels) |
| 558 | .width(3) |
| 559 | .input_zero_point(255) |
| 560 | .kernel_zero_point(0) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 561 | .Test(xnn_q8_dwconv_minmax_ukernel_up1x9__scalar, DWConvMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 562 | } |
| 563 | } |
| 564 | |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 565 | TEST(Q8_DWCONV_MINMAX_UP1X9__SCALAR, kernel_zero_point_only) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 566 | for (size_t channels = 1; channels <= 5; channels += 1) { |
| 567 | DWConvMicrokernelTester() |
| 568 | .cr(1) |
| 569 | .kr(9) |
| 570 | .channels(channels) |
| 571 | .width(3) |
| 572 | .input_zero_point(0) |
| 573 | .kernel_zero_point(255) |
Marat Dukhan | de06f49 | 2020-04-09 00:19:31 -0700 | [diff] [blame] | 574 | .Test(xnn_q8_dwconv_minmax_ukernel_up1x9__scalar, DWConvMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 575 | } |
Frank Barchard | d536072 | 2020-05-17 16:10:36 -0700 | [diff] [blame] | 576 | } |
| 577 | |
| 578 | TEST(Q8_DWCONV_MINMAX_UP1X9__SCALAR, input_offset) { |
| 579 | for (uint32_t channels = 2; channels < 16; channels += 3) { |
| 580 | DWConvMicrokernelTester() |
| 581 | .cr(1) |
| 582 | .kr(9) |
| 583 | .channels(channels) |
| 584 | .input_offset(48) |
| 585 | .Test(xnn_q8_dwconv_minmax_ukernel_up1x9__scalar, DWConvMicrokernelTester::Variant::Scalar); |
| 586 | } |
| 587 | } |
| 588 | |
| 589 | TEST(Q8_DWCONV_MINMAX_UP1X9__SCALAR, zero) { |
| 590 | for (uint32_t mz = 0; mz < 9; mz++) { |
| 591 | for (uint32_t channels = 2; channels < 16; channels += 3) { |
| 592 | DWConvMicrokernelTester() |
| 593 | .cr(1) |
| 594 | .kr(9) |
| 595 | .channels(channels) |
| 596 | .input_offset(48) |
| 597 | .zero_index(mz) |
| 598 | .Test(xnn_q8_dwconv_minmax_ukernel_up1x9__scalar, DWConvMicrokernelTester::Variant::Scalar); |
| 599 | } |
| 600 | } |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 601 | } |