1 // Copyright 2021 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 // Auto-generated file. Do not edit!
7 // Specification: test/qu8-vcvt.yaml
8 // Generator: tools/generate-vcvt-test.py
9
10
11 #include <gtest/gtest.h>
12
13 #include <xnnpack/common.h>
14 #include <xnnpack/isa-checks.h>
15
16 #include <xnnpack/vcvt.h>
17 #include "vcvt-microkernel-tester.h"
18
19
20 #if XNN_ARCH_ARM || XNN_ARCH_ARM64
TEST(QU8_VCVT__NEON_X8,batch_eq_8)21 TEST(QU8_VCVT__NEON_X8, batch_eq_8) {
22 TEST_REQUIRES_ARM_NEON;
23 VCvtMicrokernelTester()
24 .batch_size(8)
25 .qmin(std::numeric_limits<uint8_t>::min())
26 .qmax(std::numeric_limits<uint8_t>::max())
27 .Test(xnn_qu8_vcvt_ukernel__neon_x8, xnn_init_qu8_cvt_neon_params);
28 }
29
TEST(QU8_VCVT__NEON_X8,batch_div_8)30 TEST(QU8_VCVT__NEON_X8, batch_div_8) {
31 TEST_REQUIRES_ARM_NEON;
32 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
33 VCvtMicrokernelTester()
34 .batch_size(batch_size)
35 .qmin(std::numeric_limits<uint8_t>::min())
36 .qmax(std::numeric_limits<uint8_t>::max())
37 .Test(xnn_qu8_vcvt_ukernel__neon_x8, xnn_init_qu8_cvt_neon_params);
38 }
39 }
40
TEST(QU8_VCVT__NEON_X8,batch_lt_8)41 TEST(QU8_VCVT__NEON_X8, batch_lt_8) {
42 TEST_REQUIRES_ARM_NEON;
43 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
44 VCvtMicrokernelTester()
45 .batch_size(batch_size)
46 .qmin(std::numeric_limits<uint8_t>::min())
47 .qmax(std::numeric_limits<uint8_t>::max())
48 .Test(xnn_qu8_vcvt_ukernel__neon_x8, xnn_init_qu8_cvt_neon_params);
49 }
50 }
51
TEST(QU8_VCVT__NEON_X8,batch_gt_8)52 TEST(QU8_VCVT__NEON_X8, batch_gt_8) {
53 TEST_REQUIRES_ARM_NEON;
54 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
55 VCvtMicrokernelTester()
56 .batch_size(batch_size)
57 .qmin(std::numeric_limits<uint8_t>::min())
58 .qmax(std::numeric_limits<uint8_t>::max())
59 .Test(xnn_qu8_vcvt_ukernel__neon_x8, xnn_init_qu8_cvt_neon_params);
60 }
61 }
62
TEST(QU8_VCVT__NEON_X8,scale)63 TEST(QU8_VCVT__NEON_X8, scale) {
64 TEST_REQUIRES_ARM_NEON;
65 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
66 VCvtMicrokernelTester()
67 .batch_size(batch_size)
68 .scale(50)
69 .output_zero_point(100)
70 .qmin(std::numeric_limits<uint8_t>::min())
71 .qmax(std::numeric_limits<uint8_t>::max())
72 .Test(xnn_qu8_vcvt_ukernel__neon_x8, xnn_init_qu8_cvt_neon_params);
73 }
74 }
75
TEST(QU8_VCVT__NEON_X8,input_zero_point)76 TEST(QU8_VCVT__NEON_X8, input_zero_point) {
77 TEST_REQUIRES_ARM_NEON;
78 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
79 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
80 VCvtMicrokernelTester()
81 .batch_size(batch_size)
82 .input_zero_point(input_zero_point)
83 .qmin(std::numeric_limits<uint8_t>::min())
84 .qmax(std::numeric_limits<uint8_t>::max())
85 .Test(xnn_qu8_vcvt_ukernel__neon_x8, xnn_init_qu8_cvt_neon_params);
86 }
87 }
88 }
89
TEST(QU8_VCVT__NEON_X8,output_zero_point)90 TEST(QU8_VCVT__NEON_X8, output_zero_point) {
91 TEST_REQUIRES_ARM_NEON;
92 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
93 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
94 VCvtMicrokernelTester()
95 .batch_size(batch_size)
96 .output_zero_point(output_zero_point)
97 .qmin(std::numeric_limits<uint8_t>::min())
98 .qmax(std::numeric_limits<uint8_t>::max())
99 .Test(xnn_qu8_vcvt_ukernel__neon_x8, xnn_init_qu8_cvt_neon_params);
100 }
101 }
102 }
103 #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64
104
105
106 #if XNN_ARCH_ARM || XNN_ARCH_ARM64
TEST(QU8_VCVT__NEON_X16,batch_eq_16)107 TEST(QU8_VCVT__NEON_X16, batch_eq_16) {
108 TEST_REQUIRES_ARM_NEON;
109 VCvtMicrokernelTester()
110 .batch_size(16)
111 .qmin(std::numeric_limits<uint8_t>::min())
112 .qmax(std::numeric_limits<uint8_t>::max())
113 .Test(xnn_qu8_vcvt_ukernel__neon_x16, xnn_init_qu8_cvt_neon_params);
114 }
115
TEST(QU8_VCVT__NEON_X16,batch_div_16)116 TEST(QU8_VCVT__NEON_X16, batch_div_16) {
117 TEST_REQUIRES_ARM_NEON;
118 for (size_t batch_size = 32; batch_size < 160; batch_size += 16) {
119 VCvtMicrokernelTester()
120 .batch_size(batch_size)
121 .qmin(std::numeric_limits<uint8_t>::min())
122 .qmax(std::numeric_limits<uint8_t>::max())
123 .Test(xnn_qu8_vcvt_ukernel__neon_x16, xnn_init_qu8_cvt_neon_params);
124 }
125 }
126
TEST(QU8_VCVT__NEON_X16,batch_lt_16)127 TEST(QU8_VCVT__NEON_X16, batch_lt_16) {
128 TEST_REQUIRES_ARM_NEON;
129 for (size_t batch_size = 1; batch_size < 16; batch_size++) {
130 VCvtMicrokernelTester()
131 .batch_size(batch_size)
132 .qmin(std::numeric_limits<uint8_t>::min())
133 .qmax(std::numeric_limits<uint8_t>::max())
134 .Test(xnn_qu8_vcvt_ukernel__neon_x16, xnn_init_qu8_cvt_neon_params);
135 }
136 }
137
TEST(QU8_VCVT__NEON_X16,batch_gt_16)138 TEST(QU8_VCVT__NEON_X16, batch_gt_16) {
139 TEST_REQUIRES_ARM_NEON;
140 for (size_t batch_size = 17; batch_size < 32; batch_size++) {
141 VCvtMicrokernelTester()
142 .batch_size(batch_size)
143 .qmin(std::numeric_limits<uint8_t>::min())
144 .qmax(std::numeric_limits<uint8_t>::max())
145 .Test(xnn_qu8_vcvt_ukernel__neon_x16, xnn_init_qu8_cvt_neon_params);
146 }
147 }
148
TEST(QU8_VCVT__NEON_X16,scale)149 TEST(QU8_VCVT__NEON_X16, scale) {
150 TEST_REQUIRES_ARM_NEON;
151 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
152 VCvtMicrokernelTester()
153 .batch_size(batch_size)
154 .scale(50)
155 .output_zero_point(100)
156 .qmin(std::numeric_limits<uint8_t>::min())
157 .qmax(std::numeric_limits<uint8_t>::max())
158 .Test(xnn_qu8_vcvt_ukernel__neon_x16, xnn_init_qu8_cvt_neon_params);
159 }
160 }
161
TEST(QU8_VCVT__NEON_X16,input_zero_point)162 TEST(QU8_VCVT__NEON_X16, input_zero_point) {
163 TEST_REQUIRES_ARM_NEON;
164 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
165 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
166 VCvtMicrokernelTester()
167 .batch_size(batch_size)
168 .input_zero_point(input_zero_point)
169 .qmin(std::numeric_limits<uint8_t>::min())
170 .qmax(std::numeric_limits<uint8_t>::max())
171 .Test(xnn_qu8_vcvt_ukernel__neon_x16, xnn_init_qu8_cvt_neon_params);
172 }
173 }
174 }
175
TEST(QU8_VCVT__NEON_X16,output_zero_point)176 TEST(QU8_VCVT__NEON_X16, output_zero_point) {
177 TEST_REQUIRES_ARM_NEON;
178 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
179 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
180 VCvtMicrokernelTester()
181 .batch_size(batch_size)
182 .output_zero_point(output_zero_point)
183 .qmin(std::numeric_limits<uint8_t>::min())
184 .qmax(std::numeric_limits<uint8_t>::max())
185 .Test(xnn_qu8_vcvt_ukernel__neon_x16, xnn_init_qu8_cvt_neon_params);
186 }
187 }
188 }
189 #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64
190
191
192 #if XNN_ARCH_ARM || XNN_ARCH_ARM64
TEST(QU8_VCVT__NEON_X32,batch_eq_32)193 TEST(QU8_VCVT__NEON_X32, batch_eq_32) {
194 TEST_REQUIRES_ARM_NEON;
195 VCvtMicrokernelTester()
196 .batch_size(32)
197 .qmin(std::numeric_limits<uint8_t>::min())
198 .qmax(std::numeric_limits<uint8_t>::max())
199 .Test(xnn_qu8_vcvt_ukernel__neon_x32, xnn_init_qu8_cvt_neon_params);
200 }
201
TEST(QU8_VCVT__NEON_X32,batch_div_32)202 TEST(QU8_VCVT__NEON_X32, batch_div_32) {
203 TEST_REQUIRES_ARM_NEON;
204 for (size_t batch_size = 64; batch_size < 320; batch_size += 32) {
205 VCvtMicrokernelTester()
206 .batch_size(batch_size)
207 .qmin(std::numeric_limits<uint8_t>::min())
208 .qmax(std::numeric_limits<uint8_t>::max())
209 .Test(xnn_qu8_vcvt_ukernel__neon_x32, xnn_init_qu8_cvt_neon_params);
210 }
211 }
212
TEST(QU8_VCVT__NEON_X32,batch_lt_32)213 TEST(QU8_VCVT__NEON_X32, batch_lt_32) {
214 TEST_REQUIRES_ARM_NEON;
215 for (size_t batch_size = 1; batch_size < 32; batch_size++) {
216 VCvtMicrokernelTester()
217 .batch_size(batch_size)
218 .qmin(std::numeric_limits<uint8_t>::min())
219 .qmax(std::numeric_limits<uint8_t>::max())
220 .Test(xnn_qu8_vcvt_ukernel__neon_x32, xnn_init_qu8_cvt_neon_params);
221 }
222 }
223
TEST(QU8_VCVT__NEON_X32,batch_gt_32)224 TEST(QU8_VCVT__NEON_X32, batch_gt_32) {
225 TEST_REQUIRES_ARM_NEON;
226 for (size_t batch_size = 33; batch_size < 64; batch_size++) {
227 VCvtMicrokernelTester()
228 .batch_size(batch_size)
229 .qmin(std::numeric_limits<uint8_t>::min())
230 .qmax(std::numeric_limits<uint8_t>::max())
231 .Test(xnn_qu8_vcvt_ukernel__neon_x32, xnn_init_qu8_cvt_neon_params);
232 }
233 }
234
TEST(QU8_VCVT__NEON_X32,scale)235 TEST(QU8_VCVT__NEON_X32, scale) {
236 TEST_REQUIRES_ARM_NEON;
237 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
238 VCvtMicrokernelTester()
239 .batch_size(batch_size)
240 .scale(50)
241 .output_zero_point(100)
242 .qmin(std::numeric_limits<uint8_t>::min())
243 .qmax(std::numeric_limits<uint8_t>::max())
244 .Test(xnn_qu8_vcvt_ukernel__neon_x32, xnn_init_qu8_cvt_neon_params);
245 }
246 }
247
TEST(QU8_VCVT__NEON_X32,input_zero_point)248 TEST(QU8_VCVT__NEON_X32, input_zero_point) {
249 TEST_REQUIRES_ARM_NEON;
250 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
251 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
252 VCvtMicrokernelTester()
253 .batch_size(batch_size)
254 .input_zero_point(input_zero_point)
255 .qmin(std::numeric_limits<uint8_t>::min())
256 .qmax(std::numeric_limits<uint8_t>::max())
257 .Test(xnn_qu8_vcvt_ukernel__neon_x32, xnn_init_qu8_cvt_neon_params);
258 }
259 }
260 }
261
TEST(QU8_VCVT__NEON_X32,output_zero_point)262 TEST(QU8_VCVT__NEON_X32, output_zero_point) {
263 TEST_REQUIRES_ARM_NEON;
264 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
265 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
266 VCvtMicrokernelTester()
267 .batch_size(batch_size)
268 .output_zero_point(output_zero_point)
269 .qmin(std::numeric_limits<uint8_t>::min())
270 .qmax(std::numeric_limits<uint8_t>::max())
271 .Test(xnn_qu8_vcvt_ukernel__neon_x32, xnn_init_qu8_cvt_neon_params);
272 }
273 }
274 }
275 #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64
276
277
278 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(QU8_VCVT__SSE2_X16,batch_eq_16)279 TEST(QU8_VCVT__SSE2_X16, batch_eq_16) {
280 TEST_REQUIRES_X86_SSE2;
281 VCvtMicrokernelTester()
282 .batch_size(16)
283 .qmin(std::numeric_limits<uint8_t>::min())
284 .qmax(std::numeric_limits<uint8_t>::max())
285 .Test(xnn_qu8_vcvt_ukernel__sse2_x16, xnn_init_qu8_cvt_sse2_params);
286 }
287
TEST(QU8_VCVT__SSE2_X16,batch_div_16)288 TEST(QU8_VCVT__SSE2_X16, batch_div_16) {
289 TEST_REQUIRES_X86_SSE2;
290 for (size_t batch_size = 32; batch_size < 160; batch_size += 16) {
291 VCvtMicrokernelTester()
292 .batch_size(batch_size)
293 .qmin(std::numeric_limits<uint8_t>::min())
294 .qmax(std::numeric_limits<uint8_t>::max())
295 .Test(xnn_qu8_vcvt_ukernel__sse2_x16, xnn_init_qu8_cvt_sse2_params);
296 }
297 }
298
TEST(QU8_VCVT__SSE2_X16,batch_lt_16)299 TEST(QU8_VCVT__SSE2_X16, batch_lt_16) {
300 TEST_REQUIRES_X86_SSE2;
301 for (size_t batch_size = 1; batch_size < 16; batch_size++) {
302 VCvtMicrokernelTester()
303 .batch_size(batch_size)
304 .qmin(std::numeric_limits<uint8_t>::min())
305 .qmax(std::numeric_limits<uint8_t>::max())
306 .Test(xnn_qu8_vcvt_ukernel__sse2_x16, xnn_init_qu8_cvt_sse2_params);
307 }
308 }
309
TEST(QU8_VCVT__SSE2_X16,batch_gt_16)310 TEST(QU8_VCVT__SSE2_X16, batch_gt_16) {
311 TEST_REQUIRES_X86_SSE2;
312 for (size_t batch_size = 17; batch_size < 32; batch_size++) {
313 VCvtMicrokernelTester()
314 .batch_size(batch_size)
315 .qmin(std::numeric_limits<uint8_t>::min())
316 .qmax(std::numeric_limits<uint8_t>::max())
317 .Test(xnn_qu8_vcvt_ukernel__sse2_x16, xnn_init_qu8_cvt_sse2_params);
318 }
319 }
320
TEST(QU8_VCVT__SSE2_X16,scale)321 TEST(QU8_VCVT__SSE2_X16, scale) {
322 TEST_REQUIRES_X86_SSE2;
323 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
324 VCvtMicrokernelTester()
325 .batch_size(batch_size)
326 .scale(50)
327 .output_zero_point(100)
328 .qmin(std::numeric_limits<uint8_t>::min())
329 .qmax(std::numeric_limits<uint8_t>::max())
330 .Test(xnn_qu8_vcvt_ukernel__sse2_x16, xnn_init_qu8_cvt_sse2_params);
331 }
332 }
333
TEST(QU8_VCVT__SSE2_X16,input_zero_point)334 TEST(QU8_VCVT__SSE2_X16, input_zero_point) {
335 TEST_REQUIRES_X86_SSE2;
336 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
337 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
338 VCvtMicrokernelTester()
339 .batch_size(batch_size)
340 .input_zero_point(input_zero_point)
341 .qmin(std::numeric_limits<uint8_t>::min())
342 .qmax(std::numeric_limits<uint8_t>::max())
343 .Test(xnn_qu8_vcvt_ukernel__sse2_x16, xnn_init_qu8_cvt_sse2_params);
344 }
345 }
346 }
347
TEST(QU8_VCVT__SSE2_X16,output_zero_point)348 TEST(QU8_VCVT__SSE2_X16, output_zero_point) {
349 TEST_REQUIRES_X86_SSE2;
350 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
351 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
352 VCvtMicrokernelTester()
353 .batch_size(batch_size)
354 .output_zero_point(output_zero_point)
355 .qmin(std::numeric_limits<uint8_t>::min())
356 .qmax(std::numeric_limits<uint8_t>::max())
357 .Test(xnn_qu8_vcvt_ukernel__sse2_x16, xnn_init_qu8_cvt_sse2_params);
358 }
359 }
360 }
361 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
362
363
364 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(QU8_VCVT__SSE2_X32,batch_eq_32)365 TEST(QU8_VCVT__SSE2_X32, batch_eq_32) {
366 TEST_REQUIRES_X86_SSE2;
367 VCvtMicrokernelTester()
368 .batch_size(32)
369 .qmin(std::numeric_limits<uint8_t>::min())
370 .qmax(std::numeric_limits<uint8_t>::max())
371 .Test(xnn_qu8_vcvt_ukernel__sse2_x32, xnn_init_qu8_cvt_sse2_params);
372 }
373
TEST(QU8_VCVT__SSE2_X32,batch_div_32)374 TEST(QU8_VCVT__SSE2_X32, batch_div_32) {
375 TEST_REQUIRES_X86_SSE2;
376 for (size_t batch_size = 64; batch_size < 320; batch_size += 32) {
377 VCvtMicrokernelTester()
378 .batch_size(batch_size)
379 .qmin(std::numeric_limits<uint8_t>::min())
380 .qmax(std::numeric_limits<uint8_t>::max())
381 .Test(xnn_qu8_vcvt_ukernel__sse2_x32, xnn_init_qu8_cvt_sse2_params);
382 }
383 }
384
TEST(QU8_VCVT__SSE2_X32,batch_lt_32)385 TEST(QU8_VCVT__SSE2_X32, batch_lt_32) {
386 TEST_REQUIRES_X86_SSE2;
387 for (size_t batch_size = 1; batch_size < 32; batch_size++) {
388 VCvtMicrokernelTester()
389 .batch_size(batch_size)
390 .qmin(std::numeric_limits<uint8_t>::min())
391 .qmax(std::numeric_limits<uint8_t>::max())
392 .Test(xnn_qu8_vcvt_ukernel__sse2_x32, xnn_init_qu8_cvt_sse2_params);
393 }
394 }
395
TEST(QU8_VCVT__SSE2_X32,batch_gt_32)396 TEST(QU8_VCVT__SSE2_X32, batch_gt_32) {
397 TEST_REQUIRES_X86_SSE2;
398 for (size_t batch_size = 33; batch_size < 64; batch_size++) {
399 VCvtMicrokernelTester()
400 .batch_size(batch_size)
401 .qmin(std::numeric_limits<uint8_t>::min())
402 .qmax(std::numeric_limits<uint8_t>::max())
403 .Test(xnn_qu8_vcvt_ukernel__sse2_x32, xnn_init_qu8_cvt_sse2_params);
404 }
405 }
406
TEST(QU8_VCVT__SSE2_X32,scale)407 TEST(QU8_VCVT__SSE2_X32, scale) {
408 TEST_REQUIRES_X86_SSE2;
409 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
410 VCvtMicrokernelTester()
411 .batch_size(batch_size)
412 .scale(50)
413 .output_zero_point(100)
414 .qmin(std::numeric_limits<uint8_t>::min())
415 .qmax(std::numeric_limits<uint8_t>::max())
416 .Test(xnn_qu8_vcvt_ukernel__sse2_x32, xnn_init_qu8_cvt_sse2_params);
417 }
418 }
419
TEST(QU8_VCVT__SSE2_X32,input_zero_point)420 TEST(QU8_VCVT__SSE2_X32, input_zero_point) {
421 TEST_REQUIRES_X86_SSE2;
422 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
423 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
424 VCvtMicrokernelTester()
425 .batch_size(batch_size)
426 .input_zero_point(input_zero_point)
427 .qmin(std::numeric_limits<uint8_t>::min())
428 .qmax(std::numeric_limits<uint8_t>::max())
429 .Test(xnn_qu8_vcvt_ukernel__sse2_x32, xnn_init_qu8_cvt_sse2_params);
430 }
431 }
432 }
433
TEST(QU8_VCVT__SSE2_X32,output_zero_point)434 TEST(QU8_VCVT__SSE2_X32, output_zero_point) {
435 TEST_REQUIRES_X86_SSE2;
436 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
437 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
438 VCvtMicrokernelTester()
439 .batch_size(batch_size)
440 .output_zero_point(output_zero_point)
441 .qmin(std::numeric_limits<uint8_t>::min())
442 .qmax(std::numeric_limits<uint8_t>::max())
443 .Test(xnn_qu8_vcvt_ukernel__sse2_x32, xnn_init_qu8_cvt_sse2_params);
444 }
445 }
446 }
447 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
448
449
450 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(QU8_VCVT__SSSE3_X16,batch_eq_16)451 TEST(QU8_VCVT__SSSE3_X16, batch_eq_16) {
452 TEST_REQUIRES_X86_SSSE3;
453 VCvtMicrokernelTester()
454 .batch_size(16)
455 .qmin(std::numeric_limits<uint8_t>::min())
456 .qmax(std::numeric_limits<uint8_t>::max())
457 .Test(xnn_qu8_vcvt_ukernel__ssse3_x16, xnn_init_qu8_cvt_ssse3_params);
458 }
459
TEST(QU8_VCVT__SSSE3_X16,batch_div_16)460 TEST(QU8_VCVT__SSSE3_X16, batch_div_16) {
461 TEST_REQUIRES_X86_SSSE3;
462 for (size_t batch_size = 32; batch_size < 160; batch_size += 16) {
463 VCvtMicrokernelTester()
464 .batch_size(batch_size)
465 .qmin(std::numeric_limits<uint8_t>::min())
466 .qmax(std::numeric_limits<uint8_t>::max())
467 .Test(xnn_qu8_vcvt_ukernel__ssse3_x16, xnn_init_qu8_cvt_ssse3_params);
468 }
469 }
470
TEST(QU8_VCVT__SSSE3_X16,batch_lt_16)471 TEST(QU8_VCVT__SSSE3_X16, batch_lt_16) {
472 TEST_REQUIRES_X86_SSSE3;
473 for (size_t batch_size = 1; batch_size < 16; batch_size++) {
474 VCvtMicrokernelTester()
475 .batch_size(batch_size)
476 .qmin(std::numeric_limits<uint8_t>::min())
477 .qmax(std::numeric_limits<uint8_t>::max())
478 .Test(xnn_qu8_vcvt_ukernel__ssse3_x16, xnn_init_qu8_cvt_ssse3_params);
479 }
480 }
481
TEST(QU8_VCVT__SSSE3_X16,batch_gt_16)482 TEST(QU8_VCVT__SSSE3_X16, batch_gt_16) {
483 TEST_REQUIRES_X86_SSSE3;
484 for (size_t batch_size = 17; batch_size < 32; batch_size++) {
485 VCvtMicrokernelTester()
486 .batch_size(batch_size)
487 .qmin(std::numeric_limits<uint8_t>::min())
488 .qmax(std::numeric_limits<uint8_t>::max())
489 .Test(xnn_qu8_vcvt_ukernel__ssse3_x16, xnn_init_qu8_cvt_ssse3_params);
490 }
491 }
492
TEST(QU8_VCVT__SSSE3_X16,scale)493 TEST(QU8_VCVT__SSSE3_X16, scale) {
494 TEST_REQUIRES_X86_SSSE3;
495 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
496 VCvtMicrokernelTester()
497 .batch_size(batch_size)
498 .scale(50)
499 .output_zero_point(100)
500 .qmin(std::numeric_limits<uint8_t>::min())
501 .qmax(std::numeric_limits<uint8_t>::max())
502 .Test(xnn_qu8_vcvt_ukernel__ssse3_x16, xnn_init_qu8_cvt_ssse3_params);
503 }
504 }
505
TEST(QU8_VCVT__SSSE3_X16,input_zero_point)506 TEST(QU8_VCVT__SSSE3_X16, input_zero_point) {
507 TEST_REQUIRES_X86_SSSE3;
508 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
509 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
510 VCvtMicrokernelTester()
511 .batch_size(batch_size)
512 .input_zero_point(input_zero_point)
513 .qmin(std::numeric_limits<uint8_t>::min())
514 .qmax(std::numeric_limits<uint8_t>::max())
515 .Test(xnn_qu8_vcvt_ukernel__ssse3_x16, xnn_init_qu8_cvt_ssse3_params);
516 }
517 }
518 }
519
TEST(QU8_VCVT__SSSE3_X16,output_zero_point)520 TEST(QU8_VCVT__SSSE3_X16, output_zero_point) {
521 TEST_REQUIRES_X86_SSSE3;
522 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
523 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
524 VCvtMicrokernelTester()
525 .batch_size(batch_size)
526 .output_zero_point(output_zero_point)
527 .qmin(std::numeric_limits<uint8_t>::min())
528 .qmax(std::numeric_limits<uint8_t>::max())
529 .Test(xnn_qu8_vcvt_ukernel__ssse3_x16, xnn_init_qu8_cvt_ssse3_params);
530 }
531 }
532 }
533 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
534
535
536 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(QU8_VCVT__SSSE3_X32,batch_eq_32)537 TEST(QU8_VCVT__SSSE3_X32, batch_eq_32) {
538 TEST_REQUIRES_X86_SSSE3;
539 VCvtMicrokernelTester()
540 .batch_size(32)
541 .qmin(std::numeric_limits<uint8_t>::min())
542 .qmax(std::numeric_limits<uint8_t>::max())
543 .Test(xnn_qu8_vcvt_ukernel__ssse3_x32, xnn_init_qu8_cvt_ssse3_params);
544 }
545
TEST(QU8_VCVT__SSSE3_X32,batch_div_32)546 TEST(QU8_VCVT__SSSE3_X32, batch_div_32) {
547 TEST_REQUIRES_X86_SSSE3;
548 for (size_t batch_size = 64; batch_size < 320; batch_size += 32) {
549 VCvtMicrokernelTester()
550 .batch_size(batch_size)
551 .qmin(std::numeric_limits<uint8_t>::min())
552 .qmax(std::numeric_limits<uint8_t>::max())
553 .Test(xnn_qu8_vcvt_ukernel__ssse3_x32, xnn_init_qu8_cvt_ssse3_params);
554 }
555 }
556
TEST(QU8_VCVT__SSSE3_X32,batch_lt_32)557 TEST(QU8_VCVT__SSSE3_X32, batch_lt_32) {
558 TEST_REQUIRES_X86_SSSE3;
559 for (size_t batch_size = 1; batch_size < 32; batch_size++) {
560 VCvtMicrokernelTester()
561 .batch_size(batch_size)
562 .qmin(std::numeric_limits<uint8_t>::min())
563 .qmax(std::numeric_limits<uint8_t>::max())
564 .Test(xnn_qu8_vcvt_ukernel__ssse3_x32, xnn_init_qu8_cvt_ssse3_params);
565 }
566 }
567
TEST(QU8_VCVT__SSSE3_X32,batch_gt_32)568 TEST(QU8_VCVT__SSSE3_X32, batch_gt_32) {
569 TEST_REQUIRES_X86_SSSE3;
570 for (size_t batch_size = 33; batch_size < 64; batch_size++) {
571 VCvtMicrokernelTester()
572 .batch_size(batch_size)
573 .qmin(std::numeric_limits<uint8_t>::min())
574 .qmax(std::numeric_limits<uint8_t>::max())
575 .Test(xnn_qu8_vcvt_ukernel__ssse3_x32, xnn_init_qu8_cvt_ssse3_params);
576 }
577 }
578
TEST(QU8_VCVT__SSSE3_X32,scale)579 TEST(QU8_VCVT__SSSE3_X32, scale) {
580 TEST_REQUIRES_X86_SSSE3;
581 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
582 VCvtMicrokernelTester()
583 .batch_size(batch_size)
584 .scale(50)
585 .output_zero_point(100)
586 .qmin(std::numeric_limits<uint8_t>::min())
587 .qmax(std::numeric_limits<uint8_t>::max())
588 .Test(xnn_qu8_vcvt_ukernel__ssse3_x32, xnn_init_qu8_cvt_ssse3_params);
589 }
590 }
591
TEST(QU8_VCVT__SSSE3_X32,input_zero_point)592 TEST(QU8_VCVT__SSSE3_X32, input_zero_point) {
593 TEST_REQUIRES_X86_SSSE3;
594 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
595 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
596 VCvtMicrokernelTester()
597 .batch_size(batch_size)
598 .input_zero_point(input_zero_point)
599 .qmin(std::numeric_limits<uint8_t>::min())
600 .qmax(std::numeric_limits<uint8_t>::max())
601 .Test(xnn_qu8_vcvt_ukernel__ssse3_x32, xnn_init_qu8_cvt_ssse3_params);
602 }
603 }
604 }
605
TEST(QU8_VCVT__SSSE3_X32,output_zero_point)606 TEST(QU8_VCVT__SSSE3_X32, output_zero_point) {
607 TEST_REQUIRES_X86_SSSE3;
608 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
609 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
610 VCvtMicrokernelTester()
611 .batch_size(batch_size)
612 .output_zero_point(output_zero_point)
613 .qmin(std::numeric_limits<uint8_t>::min())
614 .qmax(std::numeric_limits<uint8_t>::max())
615 .Test(xnn_qu8_vcvt_ukernel__ssse3_x32, xnn_init_qu8_cvt_ssse3_params);
616 }
617 }
618 }
619 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
620
621
622 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(QU8_VCVT__AVX_X8,batch_eq_8)623 TEST(QU8_VCVT__AVX_X8, batch_eq_8) {
624 TEST_REQUIRES_X86_AVX;
625 VCvtMicrokernelTester()
626 .batch_size(8)
627 .qmin(std::numeric_limits<uint8_t>::min())
628 .qmax(std::numeric_limits<uint8_t>::max())
629 .Test(xnn_qu8_vcvt_ukernel__avx_x8, xnn_init_qu8_cvt_ssse3_params);
630 }
631
TEST(QU8_VCVT__AVX_X8,batch_div_8)632 TEST(QU8_VCVT__AVX_X8, batch_div_8) {
633 TEST_REQUIRES_X86_AVX;
634 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
635 VCvtMicrokernelTester()
636 .batch_size(batch_size)
637 .qmin(std::numeric_limits<uint8_t>::min())
638 .qmax(std::numeric_limits<uint8_t>::max())
639 .Test(xnn_qu8_vcvt_ukernel__avx_x8, xnn_init_qu8_cvt_ssse3_params);
640 }
641 }
642
TEST(QU8_VCVT__AVX_X8,batch_lt_8)643 TEST(QU8_VCVT__AVX_X8, batch_lt_8) {
644 TEST_REQUIRES_X86_AVX;
645 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
646 VCvtMicrokernelTester()
647 .batch_size(batch_size)
648 .qmin(std::numeric_limits<uint8_t>::min())
649 .qmax(std::numeric_limits<uint8_t>::max())
650 .Test(xnn_qu8_vcvt_ukernel__avx_x8, xnn_init_qu8_cvt_ssse3_params);
651 }
652 }
653
TEST(QU8_VCVT__AVX_X8,batch_gt_8)654 TEST(QU8_VCVT__AVX_X8, batch_gt_8) {
655 TEST_REQUIRES_X86_AVX;
656 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
657 VCvtMicrokernelTester()
658 .batch_size(batch_size)
659 .qmin(std::numeric_limits<uint8_t>::min())
660 .qmax(std::numeric_limits<uint8_t>::max())
661 .Test(xnn_qu8_vcvt_ukernel__avx_x8, xnn_init_qu8_cvt_ssse3_params);
662 }
663 }
664
TEST(QU8_VCVT__AVX_X8,scale)665 TEST(QU8_VCVT__AVX_X8, scale) {
666 TEST_REQUIRES_X86_AVX;
667 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
668 VCvtMicrokernelTester()
669 .batch_size(batch_size)
670 .scale(50)
671 .output_zero_point(100)
672 .qmin(std::numeric_limits<uint8_t>::min())
673 .qmax(std::numeric_limits<uint8_t>::max())
674 .Test(xnn_qu8_vcvt_ukernel__avx_x8, xnn_init_qu8_cvt_ssse3_params);
675 }
676 }
677
TEST(QU8_VCVT__AVX_X8,input_zero_point)678 TEST(QU8_VCVT__AVX_X8, input_zero_point) {
679 TEST_REQUIRES_X86_AVX;
680 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
681 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
682 VCvtMicrokernelTester()
683 .batch_size(batch_size)
684 .input_zero_point(input_zero_point)
685 .qmin(std::numeric_limits<uint8_t>::min())
686 .qmax(std::numeric_limits<uint8_t>::max())
687 .Test(xnn_qu8_vcvt_ukernel__avx_x8, xnn_init_qu8_cvt_ssse3_params);
688 }
689 }
690 }
691
TEST(QU8_VCVT__AVX_X8,output_zero_point)692 TEST(QU8_VCVT__AVX_X8, output_zero_point) {
693 TEST_REQUIRES_X86_AVX;
694 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
695 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
696 VCvtMicrokernelTester()
697 .batch_size(batch_size)
698 .output_zero_point(output_zero_point)
699 .qmin(std::numeric_limits<uint8_t>::min())
700 .qmax(std::numeric_limits<uint8_t>::max())
701 .Test(xnn_qu8_vcvt_ukernel__avx_x8, xnn_init_qu8_cvt_ssse3_params);
702 }
703 }
704 }
705 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
706
707
708 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(QU8_VCVT__AVX_X16,batch_eq_16)709 TEST(QU8_VCVT__AVX_X16, batch_eq_16) {
710 TEST_REQUIRES_X86_AVX;
711 VCvtMicrokernelTester()
712 .batch_size(16)
713 .qmin(std::numeric_limits<uint8_t>::min())
714 .qmax(std::numeric_limits<uint8_t>::max())
715 .Test(xnn_qu8_vcvt_ukernel__avx_x16, xnn_init_qu8_cvt_ssse3_params);
716 }
717
TEST(QU8_VCVT__AVX_X16,batch_div_16)718 TEST(QU8_VCVT__AVX_X16, batch_div_16) {
719 TEST_REQUIRES_X86_AVX;
720 for (size_t batch_size = 32; batch_size < 160; batch_size += 16) {
721 VCvtMicrokernelTester()
722 .batch_size(batch_size)
723 .qmin(std::numeric_limits<uint8_t>::min())
724 .qmax(std::numeric_limits<uint8_t>::max())
725 .Test(xnn_qu8_vcvt_ukernel__avx_x16, xnn_init_qu8_cvt_ssse3_params);
726 }
727 }
728
TEST(QU8_VCVT__AVX_X16,batch_lt_16)729 TEST(QU8_VCVT__AVX_X16, batch_lt_16) {
730 TEST_REQUIRES_X86_AVX;
731 for (size_t batch_size = 1; batch_size < 16; batch_size++) {
732 VCvtMicrokernelTester()
733 .batch_size(batch_size)
734 .qmin(std::numeric_limits<uint8_t>::min())
735 .qmax(std::numeric_limits<uint8_t>::max())
736 .Test(xnn_qu8_vcvt_ukernel__avx_x16, xnn_init_qu8_cvt_ssse3_params);
737 }
738 }
739
TEST(QU8_VCVT__AVX_X16,batch_gt_16)740 TEST(QU8_VCVT__AVX_X16, batch_gt_16) {
741 TEST_REQUIRES_X86_AVX;
742 for (size_t batch_size = 17; batch_size < 32; batch_size++) {
743 VCvtMicrokernelTester()
744 .batch_size(batch_size)
745 .qmin(std::numeric_limits<uint8_t>::min())
746 .qmax(std::numeric_limits<uint8_t>::max())
747 .Test(xnn_qu8_vcvt_ukernel__avx_x16, xnn_init_qu8_cvt_ssse3_params);
748 }
749 }
750
TEST(QU8_VCVT__AVX_X16,scale)751 TEST(QU8_VCVT__AVX_X16, scale) {
752 TEST_REQUIRES_X86_AVX;
753 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
754 VCvtMicrokernelTester()
755 .batch_size(batch_size)
756 .scale(50)
757 .output_zero_point(100)
758 .qmin(std::numeric_limits<uint8_t>::min())
759 .qmax(std::numeric_limits<uint8_t>::max())
760 .Test(xnn_qu8_vcvt_ukernel__avx_x16, xnn_init_qu8_cvt_ssse3_params);
761 }
762 }
763
TEST(QU8_VCVT__AVX_X16,input_zero_point)764 TEST(QU8_VCVT__AVX_X16, input_zero_point) {
765 TEST_REQUIRES_X86_AVX;
766 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
767 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
768 VCvtMicrokernelTester()
769 .batch_size(batch_size)
770 .input_zero_point(input_zero_point)
771 .qmin(std::numeric_limits<uint8_t>::min())
772 .qmax(std::numeric_limits<uint8_t>::max())
773 .Test(xnn_qu8_vcvt_ukernel__avx_x16, xnn_init_qu8_cvt_ssse3_params);
774 }
775 }
776 }
777
TEST(QU8_VCVT__AVX_X16,output_zero_point)778 TEST(QU8_VCVT__AVX_X16, output_zero_point) {
779 TEST_REQUIRES_X86_AVX;
780 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
781 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
782 VCvtMicrokernelTester()
783 .batch_size(batch_size)
784 .output_zero_point(output_zero_point)
785 .qmin(std::numeric_limits<uint8_t>::min())
786 .qmax(std::numeric_limits<uint8_t>::max())
787 .Test(xnn_qu8_vcvt_ukernel__avx_x16, xnn_init_qu8_cvt_ssse3_params);
788 }
789 }
790 }
791 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
792
793
794 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(QU8_VCVT__AVX_X32,batch_eq_32)795 TEST(QU8_VCVT__AVX_X32, batch_eq_32) {
796 TEST_REQUIRES_X86_AVX;
797 VCvtMicrokernelTester()
798 .batch_size(32)
799 .qmin(std::numeric_limits<uint8_t>::min())
800 .qmax(std::numeric_limits<uint8_t>::max())
801 .Test(xnn_qu8_vcvt_ukernel__avx_x32, xnn_init_qu8_cvt_ssse3_params);
802 }
803
TEST(QU8_VCVT__AVX_X32,batch_div_32)804 TEST(QU8_VCVT__AVX_X32, batch_div_32) {
805 TEST_REQUIRES_X86_AVX;
806 for (size_t batch_size = 64; batch_size < 320; batch_size += 32) {
807 VCvtMicrokernelTester()
808 .batch_size(batch_size)
809 .qmin(std::numeric_limits<uint8_t>::min())
810 .qmax(std::numeric_limits<uint8_t>::max())
811 .Test(xnn_qu8_vcvt_ukernel__avx_x32, xnn_init_qu8_cvt_ssse3_params);
812 }
813 }
814
TEST(QU8_VCVT__AVX_X32,batch_lt_32)815 TEST(QU8_VCVT__AVX_X32, batch_lt_32) {
816 TEST_REQUIRES_X86_AVX;
817 for (size_t batch_size = 1; batch_size < 32; batch_size++) {
818 VCvtMicrokernelTester()
819 .batch_size(batch_size)
820 .qmin(std::numeric_limits<uint8_t>::min())
821 .qmax(std::numeric_limits<uint8_t>::max())
822 .Test(xnn_qu8_vcvt_ukernel__avx_x32, xnn_init_qu8_cvt_ssse3_params);
823 }
824 }
825
TEST(QU8_VCVT__AVX_X32,batch_gt_32)826 TEST(QU8_VCVT__AVX_X32, batch_gt_32) {
827 TEST_REQUIRES_X86_AVX;
828 for (size_t batch_size = 33; batch_size < 64; batch_size++) {
829 VCvtMicrokernelTester()
830 .batch_size(batch_size)
831 .qmin(std::numeric_limits<uint8_t>::min())
832 .qmax(std::numeric_limits<uint8_t>::max())
833 .Test(xnn_qu8_vcvt_ukernel__avx_x32, xnn_init_qu8_cvt_ssse3_params);
834 }
835 }
836
TEST(QU8_VCVT__AVX_X32,scale)837 TEST(QU8_VCVT__AVX_X32, scale) {
838 TEST_REQUIRES_X86_AVX;
839 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
840 VCvtMicrokernelTester()
841 .batch_size(batch_size)
842 .scale(50)
843 .output_zero_point(100)
844 .qmin(std::numeric_limits<uint8_t>::min())
845 .qmax(std::numeric_limits<uint8_t>::max())
846 .Test(xnn_qu8_vcvt_ukernel__avx_x32, xnn_init_qu8_cvt_ssse3_params);
847 }
848 }
849
TEST(QU8_VCVT__AVX_X32,input_zero_point)850 TEST(QU8_VCVT__AVX_X32, input_zero_point) {
851 TEST_REQUIRES_X86_AVX;
852 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
853 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
854 VCvtMicrokernelTester()
855 .batch_size(batch_size)
856 .input_zero_point(input_zero_point)
857 .qmin(std::numeric_limits<uint8_t>::min())
858 .qmax(std::numeric_limits<uint8_t>::max())
859 .Test(xnn_qu8_vcvt_ukernel__avx_x32, xnn_init_qu8_cvt_ssse3_params);
860 }
861 }
862 }
863
TEST(QU8_VCVT__AVX_X32,output_zero_point)864 TEST(QU8_VCVT__AVX_X32, output_zero_point) {
865 TEST_REQUIRES_X86_AVX;
866 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
867 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
868 VCvtMicrokernelTester()
869 .batch_size(batch_size)
870 .output_zero_point(output_zero_point)
871 .qmin(std::numeric_limits<uint8_t>::min())
872 .qmax(std::numeric_limits<uint8_t>::max())
873 .Test(xnn_qu8_vcvt_ukernel__avx_x32, xnn_init_qu8_cvt_ssse3_params);
874 }
875 }
876 }
877 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
878
879
880 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(QU8_VCVT__SSE41_X8,batch_eq_8)881 TEST(QU8_VCVT__SSE41_X8, batch_eq_8) {
882 TEST_REQUIRES_X86_SSE41;
883 VCvtMicrokernelTester()
884 .batch_size(8)
885 .qmin(std::numeric_limits<uint8_t>::min())
886 .qmax(std::numeric_limits<uint8_t>::max())
887 .Test(xnn_qu8_vcvt_ukernel__sse41_x8, xnn_init_qu8_cvt_ssse3_params);
888 }
889
TEST(QU8_VCVT__SSE41_X8,batch_div_8)890 TEST(QU8_VCVT__SSE41_X8, batch_div_8) {
891 TEST_REQUIRES_X86_SSE41;
892 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
893 VCvtMicrokernelTester()
894 .batch_size(batch_size)
895 .qmin(std::numeric_limits<uint8_t>::min())
896 .qmax(std::numeric_limits<uint8_t>::max())
897 .Test(xnn_qu8_vcvt_ukernel__sse41_x8, xnn_init_qu8_cvt_ssse3_params);
898 }
899 }
900
TEST(QU8_VCVT__SSE41_X8,batch_lt_8)901 TEST(QU8_VCVT__SSE41_X8, batch_lt_8) {
902 TEST_REQUIRES_X86_SSE41;
903 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
904 VCvtMicrokernelTester()
905 .batch_size(batch_size)
906 .qmin(std::numeric_limits<uint8_t>::min())
907 .qmax(std::numeric_limits<uint8_t>::max())
908 .Test(xnn_qu8_vcvt_ukernel__sse41_x8, xnn_init_qu8_cvt_ssse3_params);
909 }
910 }
911
TEST(QU8_VCVT__SSE41_X8,batch_gt_8)912 TEST(QU8_VCVT__SSE41_X8, batch_gt_8) {
913 TEST_REQUIRES_X86_SSE41;
914 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
915 VCvtMicrokernelTester()
916 .batch_size(batch_size)
917 .qmin(std::numeric_limits<uint8_t>::min())
918 .qmax(std::numeric_limits<uint8_t>::max())
919 .Test(xnn_qu8_vcvt_ukernel__sse41_x8, xnn_init_qu8_cvt_ssse3_params);
920 }
921 }
922
TEST(QU8_VCVT__SSE41_X8,scale)923 TEST(QU8_VCVT__SSE41_X8, scale) {
924 TEST_REQUIRES_X86_SSE41;
925 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
926 VCvtMicrokernelTester()
927 .batch_size(batch_size)
928 .scale(50)
929 .output_zero_point(100)
930 .qmin(std::numeric_limits<uint8_t>::min())
931 .qmax(std::numeric_limits<uint8_t>::max())
932 .Test(xnn_qu8_vcvt_ukernel__sse41_x8, xnn_init_qu8_cvt_ssse3_params);
933 }
934 }
935
TEST(QU8_VCVT__SSE41_X8,input_zero_point)936 TEST(QU8_VCVT__SSE41_X8, input_zero_point) {
937 TEST_REQUIRES_X86_SSE41;
938 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
939 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
940 VCvtMicrokernelTester()
941 .batch_size(batch_size)
942 .input_zero_point(input_zero_point)
943 .qmin(std::numeric_limits<uint8_t>::min())
944 .qmax(std::numeric_limits<uint8_t>::max())
945 .Test(xnn_qu8_vcvt_ukernel__sse41_x8, xnn_init_qu8_cvt_ssse3_params);
946 }
947 }
948 }
949
TEST(QU8_VCVT__SSE41_X8,output_zero_point)950 TEST(QU8_VCVT__SSE41_X8, output_zero_point) {
951 TEST_REQUIRES_X86_SSE41;
952 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
953 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
954 VCvtMicrokernelTester()
955 .batch_size(batch_size)
956 .output_zero_point(output_zero_point)
957 .qmin(std::numeric_limits<uint8_t>::min())
958 .qmax(std::numeric_limits<uint8_t>::max())
959 .Test(xnn_qu8_vcvt_ukernel__sse41_x8, xnn_init_qu8_cvt_ssse3_params);
960 }
961 }
962 }
963 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
964
965
966 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(QU8_VCVT__SSE41_X16,batch_eq_16)967 TEST(QU8_VCVT__SSE41_X16, batch_eq_16) {
968 TEST_REQUIRES_X86_SSE41;
969 VCvtMicrokernelTester()
970 .batch_size(16)
971 .qmin(std::numeric_limits<uint8_t>::min())
972 .qmax(std::numeric_limits<uint8_t>::max())
973 .Test(xnn_qu8_vcvt_ukernel__sse41_x16, xnn_init_qu8_cvt_ssse3_params);
974 }
975
TEST(QU8_VCVT__SSE41_X16,batch_div_16)976 TEST(QU8_VCVT__SSE41_X16, batch_div_16) {
977 TEST_REQUIRES_X86_SSE41;
978 for (size_t batch_size = 32; batch_size < 160; batch_size += 16) {
979 VCvtMicrokernelTester()
980 .batch_size(batch_size)
981 .qmin(std::numeric_limits<uint8_t>::min())
982 .qmax(std::numeric_limits<uint8_t>::max())
983 .Test(xnn_qu8_vcvt_ukernel__sse41_x16, xnn_init_qu8_cvt_ssse3_params);
984 }
985 }
986
TEST(QU8_VCVT__SSE41_X16,batch_lt_16)987 TEST(QU8_VCVT__SSE41_X16, batch_lt_16) {
988 TEST_REQUIRES_X86_SSE41;
989 for (size_t batch_size = 1; batch_size < 16; batch_size++) {
990 VCvtMicrokernelTester()
991 .batch_size(batch_size)
992 .qmin(std::numeric_limits<uint8_t>::min())
993 .qmax(std::numeric_limits<uint8_t>::max())
994 .Test(xnn_qu8_vcvt_ukernel__sse41_x16, xnn_init_qu8_cvt_ssse3_params);
995 }
996 }
997
TEST(QU8_VCVT__SSE41_X16,batch_gt_16)998 TEST(QU8_VCVT__SSE41_X16, batch_gt_16) {
999 TEST_REQUIRES_X86_SSE41;
1000 for (size_t batch_size = 17; batch_size < 32; batch_size++) {
1001 VCvtMicrokernelTester()
1002 .batch_size(batch_size)
1003 .qmin(std::numeric_limits<uint8_t>::min())
1004 .qmax(std::numeric_limits<uint8_t>::max())
1005 .Test(xnn_qu8_vcvt_ukernel__sse41_x16, xnn_init_qu8_cvt_ssse3_params);
1006 }
1007 }
1008
TEST(QU8_VCVT__SSE41_X16,scale)1009 TEST(QU8_VCVT__SSE41_X16, scale) {
1010 TEST_REQUIRES_X86_SSE41;
1011 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
1012 VCvtMicrokernelTester()
1013 .batch_size(batch_size)
1014 .scale(50)
1015 .output_zero_point(100)
1016 .qmin(std::numeric_limits<uint8_t>::min())
1017 .qmax(std::numeric_limits<uint8_t>::max())
1018 .Test(xnn_qu8_vcvt_ukernel__sse41_x16, xnn_init_qu8_cvt_ssse3_params);
1019 }
1020 }
1021
TEST(QU8_VCVT__SSE41_X16,input_zero_point)1022 TEST(QU8_VCVT__SSE41_X16, input_zero_point) {
1023 TEST_REQUIRES_X86_SSE41;
1024 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
1025 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
1026 VCvtMicrokernelTester()
1027 .batch_size(batch_size)
1028 .input_zero_point(input_zero_point)
1029 .qmin(std::numeric_limits<uint8_t>::min())
1030 .qmax(std::numeric_limits<uint8_t>::max())
1031 .Test(xnn_qu8_vcvt_ukernel__sse41_x16, xnn_init_qu8_cvt_ssse3_params);
1032 }
1033 }
1034 }
1035
TEST(QU8_VCVT__SSE41_X16,output_zero_point)1036 TEST(QU8_VCVT__SSE41_X16, output_zero_point) {
1037 TEST_REQUIRES_X86_SSE41;
1038 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
1039 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
1040 VCvtMicrokernelTester()
1041 .batch_size(batch_size)
1042 .output_zero_point(output_zero_point)
1043 .qmin(std::numeric_limits<uint8_t>::min())
1044 .qmax(std::numeric_limits<uint8_t>::max())
1045 .Test(xnn_qu8_vcvt_ukernel__sse41_x16, xnn_init_qu8_cvt_ssse3_params);
1046 }
1047 }
1048 }
1049 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
1050
1051
1052 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(QU8_VCVT__SSE41_X32,batch_eq_32)1053 TEST(QU8_VCVT__SSE41_X32, batch_eq_32) {
1054 TEST_REQUIRES_X86_SSE41;
1055 VCvtMicrokernelTester()
1056 .batch_size(32)
1057 .qmin(std::numeric_limits<uint8_t>::min())
1058 .qmax(std::numeric_limits<uint8_t>::max())
1059 .Test(xnn_qu8_vcvt_ukernel__sse41_x32, xnn_init_qu8_cvt_ssse3_params);
1060 }
1061
TEST(QU8_VCVT__SSE41_X32,batch_div_32)1062 TEST(QU8_VCVT__SSE41_X32, batch_div_32) {
1063 TEST_REQUIRES_X86_SSE41;
1064 for (size_t batch_size = 64; batch_size < 320; batch_size += 32) {
1065 VCvtMicrokernelTester()
1066 .batch_size(batch_size)
1067 .qmin(std::numeric_limits<uint8_t>::min())
1068 .qmax(std::numeric_limits<uint8_t>::max())
1069 .Test(xnn_qu8_vcvt_ukernel__sse41_x32, xnn_init_qu8_cvt_ssse3_params);
1070 }
1071 }
1072
TEST(QU8_VCVT__SSE41_X32,batch_lt_32)1073 TEST(QU8_VCVT__SSE41_X32, batch_lt_32) {
1074 TEST_REQUIRES_X86_SSE41;
1075 for (size_t batch_size = 1; batch_size < 32; batch_size++) {
1076 VCvtMicrokernelTester()
1077 .batch_size(batch_size)
1078 .qmin(std::numeric_limits<uint8_t>::min())
1079 .qmax(std::numeric_limits<uint8_t>::max())
1080 .Test(xnn_qu8_vcvt_ukernel__sse41_x32, xnn_init_qu8_cvt_ssse3_params);
1081 }
1082 }
1083
TEST(QU8_VCVT__SSE41_X32,batch_gt_32)1084 TEST(QU8_VCVT__SSE41_X32, batch_gt_32) {
1085 TEST_REQUIRES_X86_SSE41;
1086 for (size_t batch_size = 33; batch_size < 64; batch_size++) {
1087 VCvtMicrokernelTester()
1088 .batch_size(batch_size)
1089 .qmin(std::numeric_limits<uint8_t>::min())
1090 .qmax(std::numeric_limits<uint8_t>::max())
1091 .Test(xnn_qu8_vcvt_ukernel__sse41_x32, xnn_init_qu8_cvt_ssse3_params);
1092 }
1093 }
1094
TEST(QU8_VCVT__SSE41_X32,scale)1095 TEST(QU8_VCVT__SSE41_X32, scale) {
1096 TEST_REQUIRES_X86_SSE41;
1097 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
1098 VCvtMicrokernelTester()
1099 .batch_size(batch_size)
1100 .scale(50)
1101 .output_zero_point(100)
1102 .qmin(std::numeric_limits<uint8_t>::min())
1103 .qmax(std::numeric_limits<uint8_t>::max())
1104 .Test(xnn_qu8_vcvt_ukernel__sse41_x32, xnn_init_qu8_cvt_ssse3_params);
1105 }
1106 }
1107
TEST(QU8_VCVT__SSE41_X32,input_zero_point)1108 TEST(QU8_VCVT__SSE41_X32, input_zero_point) {
1109 TEST_REQUIRES_X86_SSE41;
1110 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
1111 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
1112 VCvtMicrokernelTester()
1113 .batch_size(batch_size)
1114 .input_zero_point(input_zero_point)
1115 .qmin(std::numeric_limits<uint8_t>::min())
1116 .qmax(std::numeric_limits<uint8_t>::max())
1117 .Test(xnn_qu8_vcvt_ukernel__sse41_x32, xnn_init_qu8_cvt_ssse3_params);
1118 }
1119 }
1120 }
1121
TEST(QU8_VCVT__SSE41_X32,output_zero_point)1122 TEST(QU8_VCVT__SSE41_X32, output_zero_point) {
1123 TEST_REQUIRES_X86_SSE41;
1124 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
1125 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
1126 VCvtMicrokernelTester()
1127 .batch_size(batch_size)
1128 .output_zero_point(output_zero_point)
1129 .qmin(std::numeric_limits<uint8_t>::min())
1130 .qmax(std::numeric_limits<uint8_t>::max())
1131 .Test(xnn_qu8_vcvt_ukernel__sse41_x32, xnn_init_qu8_cvt_ssse3_params);
1132 }
1133 }
1134 }
1135 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
1136
1137
1138 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(QU8_VCVT__AVX2_X16,batch_eq_16)1139 TEST(QU8_VCVT__AVX2_X16, batch_eq_16) {
1140 TEST_REQUIRES_X86_AVX2;
1141 VCvtMicrokernelTester()
1142 .batch_size(16)
1143 .qmin(std::numeric_limits<uint8_t>::min())
1144 .qmax(std::numeric_limits<uint8_t>::max())
1145 .Test(xnn_qu8_vcvt_ukernel__avx2_x16, xnn_init_qu8_cvt_avx2_params);
1146 }
1147
TEST(QU8_VCVT__AVX2_X16,batch_div_16)1148 TEST(QU8_VCVT__AVX2_X16, batch_div_16) {
1149 TEST_REQUIRES_X86_AVX2;
1150 for (size_t batch_size = 32; batch_size < 160; batch_size += 16) {
1151 VCvtMicrokernelTester()
1152 .batch_size(batch_size)
1153 .qmin(std::numeric_limits<uint8_t>::min())
1154 .qmax(std::numeric_limits<uint8_t>::max())
1155 .Test(xnn_qu8_vcvt_ukernel__avx2_x16, xnn_init_qu8_cvt_avx2_params);
1156 }
1157 }
1158
TEST(QU8_VCVT__AVX2_X16,batch_lt_16)1159 TEST(QU8_VCVT__AVX2_X16, batch_lt_16) {
1160 TEST_REQUIRES_X86_AVX2;
1161 for (size_t batch_size = 1; batch_size < 16; batch_size++) {
1162 VCvtMicrokernelTester()
1163 .batch_size(batch_size)
1164 .qmin(std::numeric_limits<uint8_t>::min())
1165 .qmax(std::numeric_limits<uint8_t>::max())
1166 .Test(xnn_qu8_vcvt_ukernel__avx2_x16, xnn_init_qu8_cvt_avx2_params);
1167 }
1168 }
1169
TEST(QU8_VCVT__AVX2_X16,batch_gt_16)1170 TEST(QU8_VCVT__AVX2_X16, batch_gt_16) {
1171 TEST_REQUIRES_X86_AVX2;
1172 for (size_t batch_size = 17; batch_size < 32; batch_size++) {
1173 VCvtMicrokernelTester()
1174 .batch_size(batch_size)
1175 .qmin(std::numeric_limits<uint8_t>::min())
1176 .qmax(std::numeric_limits<uint8_t>::max())
1177 .Test(xnn_qu8_vcvt_ukernel__avx2_x16, xnn_init_qu8_cvt_avx2_params);
1178 }
1179 }
1180
TEST(QU8_VCVT__AVX2_X16,scale)1181 TEST(QU8_VCVT__AVX2_X16, scale) {
1182 TEST_REQUIRES_X86_AVX2;
1183 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
1184 VCvtMicrokernelTester()
1185 .batch_size(batch_size)
1186 .scale(50)
1187 .output_zero_point(100)
1188 .qmin(std::numeric_limits<uint8_t>::min())
1189 .qmax(std::numeric_limits<uint8_t>::max())
1190 .Test(xnn_qu8_vcvt_ukernel__avx2_x16, xnn_init_qu8_cvt_avx2_params);
1191 }
1192 }
1193
TEST(QU8_VCVT__AVX2_X16,input_zero_point)1194 TEST(QU8_VCVT__AVX2_X16, input_zero_point) {
1195 TEST_REQUIRES_X86_AVX2;
1196 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
1197 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
1198 VCvtMicrokernelTester()
1199 .batch_size(batch_size)
1200 .input_zero_point(input_zero_point)
1201 .qmin(std::numeric_limits<uint8_t>::min())
1202 .qmax(std::numeric_limits<uint8_t>::max())
1203 .Test(xnn_qu8_vcvt_ukernel__avx2_x16, xnn_init_qu8_cvt_avx2_params);
1204 }
1205 }
1206 }
1207
TEST(QU8_VCVT__AVX2_X16,output_zero_point)1208 TEST(QU8_VCVT__AVX2_X16, output_zero_point) {
1209 TEST_REQUIRES_X86_AVX2;
1210 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
1211 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
1212 VCvtMicrokernelTester()
1213 .batch_size(batch_size)
1214 .output_zero_point(output_zero_point)
1215 .qmin(std::numeric_limits<uint8_t>::min())
1216 .qmax(std::numeric_limits<uint8_t>::max())
1217 .Test(xnn_qu8_vcvt_ukernel__avx2_x16, xnn_init_qu8_cvt_avx2_params);
1218 }
1219 }
1220 }
1221 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
1222
1223
1224 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(QU8_VCVT__AVX2_X32,batch_eq_32)1225 TEST(QU8_VCVT__AVX2_X32, batch_eq_32) {
1226 TEST_REQUIRES_X86_AVX2;
1227 VCvtMicrokernelTester()
1228 .batch_size(32)
1229 .qmin(std::numeric_limits<uint8_t>::min())
1230 .qmax(std::numeric_limits<uint8_t>::max())
1231 .Test(xnn_qu8_vcvt_ukernel__avx2_x32, xnn_init_qu8_cvt_avx2_params);
1232 }
1233
TEST(QU8_VCVT__AVX2_X32,batch_div_32)1234 TEST(QU8_VCVT__AVX2_X32, batch_div_32) {
1235 TEST_REQUIRES_X86_AVX2;
1236 for (size_t batch_size = 64; batch_size < 320; batch_size += 32) {
1237 VCvtMicrokernelTester()
1238 .batch_size(batch_size)
1239 .qmin(std::numeric_limits<uint8_t>::min())
1240 .qmax(std::numeric_limits<uint8_t>::max())
1241 .Test(xnn_qu8_vcvt_ukernel__avx2_x32, xnn_init_qu8_cvt_avx2_params);
1242 }
1243 }
1244
TEST(QU8_VCVT__AVX2_X32,batch_lt_32)1245 TEST(QU8_VCVT__AVX2_X32, batch_lt_32) {
1246 TEST_REQUIRES_X86_AVX2;
1247 for (size_t batch_size = 1; batch_size < 32; batch_size++) {
1248 VCvtMicrokernelTester()
1249 .batch_size(batch_size)
1250 .qmin(std::numeric_limits<uint8_t>::min())
1251 .qmax(std::numeric_limits<uint8_t>::max())
1252 .Test(xnn_qu8_vcvt_ukernel__avx2_x32, xnn_init_qu8_cvt_avx2_params);
1253 }
1254 }
1255
TEST(QU8_VCVT__AVX2_X32,batch_gt_32)1256 TEST(QU8_VCVT__AVX2_X32, batch_gt_32) {
1257 TEST_REQUIRES_X86_AVX2;
1258 for (size_t batch_size = 33; batch_size < 64; batch_size++) {
1259 VCvtMicrokernelTester()
1260 .batch_size(batch_size)
1261 .qmin(std::numeric_limits<uint8_t>::min())
1262 .qmax(std::numeric_limits<uint8_t>::max())
1263 .Test(xnn_qu8_vcvt_ukernel__avx2_x32, xnn_init_qu8_cvt_avx2_params);
1264 }
1265 }
1266
TEST(QU8_VCVT__AVX2_X32,scale)1267 TEST(QU8_VCVT__AVX2_X32, scale) {
1268 TEST_REQUIRES_X86_AVX2;
1269 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
1270 VCvtMicrokernelTester()
1271 .batch_size(batch_size)
1272 .scale(50)
1273 .output_zero_point(100)
1274 .qmin(std::numeric_limits<uint8_t>::min())
1275 .qmax(std::numeric_limits<uint8_t>::max())
1276 .Test(xnn_qu8_vcvt_ukernel__avx2_x32, xnn_init_qu8_cvt_avx2_params);
1277 }
1278 }
1279
TEST(QU8_VCVT__AVX2_X32,input_zero_point)1280 TEST(QU8_VCVT__AVX2_X32, input_zero_point) {
1281 TEST_REQUIRES_X86_AVX2;
1282 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
1283 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
1284 VCvtMicrokernelTester()
1285 .batch_size(batch_size)
1286 .input_zero_point(input_zero_point)
1287 .qmin(std::numeric_limits<uint8_t>::min())
1288 .qmax(std::numeric_limits<uint8_t>::max())
1289 .Test(xnn_qu8_vcvt_ukernel__avx2_x32, xnn_init_qu8_cvt_avx2_params);
1290 }
1291 }
1292 }
1293
TEST(QU8_VCVT__AVX2_X32,output_zero_point)1294 TEST(QU8_VCVT__AVX2_X32, output_zero_point) {
1295 TEST_REQUIRES_X86_AVX2;
1296 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
1297 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
1298 VCvtMicrokernelTester()
1299 .batch_size(batch_size)
1300 .output_zero_point(output_zero_point)
1301 .qmin(std::numeric_limits<uint8_t>::min())
1302 .qmax(std::numeric_limits<uint8_t>::max())
1303 .Test(xnn_qu8_vcvt_ukernel__avx2_x32, xnn_init_qu8_cvt_avx2_params);
1304 }
1305 }
1306 }
1307 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
1308
1309
1310 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(QU8_VCVT__AVX2_X64,batch_eq_64)1311 TEST(QU8_VCVT__AVX2_X64, batch_eq_64) {
1312 TEST_REQUIRES_X86_AVX2;
1313 VCvtMicrokernelTester()
1314 .batch_size(64)
1315 .qmin(std::numeric_limits<uint8_t>::min())
1316 .qmax(std::numeric_limits<uint8_t>::max())
1317 .Test(xnn_qu8_vcvt_ukernel__avx2_x64, xnn_init_qu8_cvt_avx2_params);
1318 }
1319
TEST(QU8_VCVT__AVX2_X64,batch_div_64)1320 TEST(QU8_VCVT__AVX2_X64, batch_div_64) {
1321 TEST_REQUIRES_X86_AVX2;
1322 for (size_t batch_size = 128; batch_size < 640; batch_size += 64) {
1323 VCvtMicrokernelTester()
1324 .batch_size(batch_size)
1325 .qmin(std::numeric_limits<uint8_t>::min())
1326 .qmax(std::numeric_limits<uint8_t>::max())
1327 .Test(xnn_qu8_vcvt_ukernel__avx2_x64, xnn_init_qu8_cvt_avx2_params);
1328 }
1329 }
1330
TEST(QU8_VCVT__AVX2_X64,batch_lt_64)1331 TEST(QU8_VCVT__AVX2_X64, batch_lt_64) {
1332 TEST_REQUIRES_X86_AVX2;
1333 for (size_t batch_size = 1; batch_size < 64; batch_size++) {
1334 VCvtMicrokernelTester()
1335 .batch_size(batch_size)
1336 .qmin(std::numeric_limits<uint8_t>::min())
1337 .qmax(std::numeric_limits<uint8_t>::max())
1338 .Test(xnn_qu8_vcvt_ukernel__avx2_x64, xnn_init_qu8_cvt_avx2_params);
1339 }
1340 }
1341
TEST(QU8_VCVT__AVX2_X64,batch_gt_64)1342 TEST(QU8_VCVT__AVX2_X64, batch_gt_64) {
1343 TEST_REQUIRES_X86_AVX2;
1344 for (size_t batch_size = 65; batch_size < 128; batch_size++) {
1345 VCvtMicrokernelTester()
1346 .batch_size(batch_size)
1347 .qmin(std::numeric_limits<uint8_t>::min())
1348 .qmax(std::numeric_limits<uint8_t>::max())
1349 .Test(xnn_qu8_vcvt_ukernel__avx2_x64, xnn_init_qu8_cvt_avx2_params);
1350 }
1351 }
1352
TEST(QU8_VCVT__AVX2_X64,scale)1353 TEST(QU8_VCVT__AVX2_X64, scale) {
1354 TEST_REQUIRES_X86_AVX2;
1355 for (size_t batch_size = 1; batch_size <= 320; batch_size += 63) {
1356 VCvtMicrokernelTester()
1357 .batch_size(batch_size)
1358 .scale(50)
1359 .output_zero_point(100)
1360 .qmin(std::numeric_limits<uint8_t>::min())
1361 .qmax(std::numeric_limits<uint8_t>::max())
1362 .Test(xnn_qu8_vcvt_ukernel__avx2_x64, xnn_init_qu8_cvt_avx2_params);
1363 }
1364 }
1365
TEST(QU8_VCVT__AVX2_X64,input_zero_point)1366 TEST(QU8_VCVT__AVX2_X64, input_zero_point) {
1367 TEST_REQUIRES_X86_AVX2;
1368 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
1369 for (size_t batch_size = 1; batch_size <= 320; batch_size += 63) {
1370 VCvtMicrokernelTester()
1371 .batch_size(batch_size)
1372 .input_zero_point(input_zero_point)
1373 .qmin(std::numeric_limits<uint8_t>::min())
1374 .qmax(std::numeric_limits<uint8_t>::max())
1375 .Test(xnn_qu8_vcvt_ukernel__avx2_x64, xnn_init_qu8_cvt_avx2_params);
1376 }
1377 }
1378 }
1379
TEST(QU8_VCVT__AVX2_X64,output_zero_point)1380 TEST(QU8_VCVT__AVX2_X64, output_zero_point) {
1381 TEST_REQUIRES_X86_AVX2;
1382 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
1383 for (size_t batch_size = 1; batch_size <= 320; batch_size += 63) {
1384 VCvtMicrokernelTester()
1385 .batch_size(batch_size)
1386 .output_zero_point(output_zero_point)
1387 .qmin(std::numeric_limits<uint8_t>::min())
1388 .qmax(std::numeric_limits<uint8_t>::max())
1389 .Test(xnn_qu8_vcvt_ukernel__avx2_x64, xnn_init_qu8_cvt_avx2_params);
1390 }
1391 }
1392 }
1393 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
1394
1395
1396 #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD
TEST(QU8_VCVT__WASMSIMD_X8,batch_eq_8)1397 TEST(QU8_VCVT__WASMSIMD_X8, batch_eq_8) {
1398 VCvtMicrokernelTester()
1399 .batch_size(8)
1400 .qmin(std::numeric_limits<uint8_t>::min())
1401 .qmax(std::numeric_limits<uint8_t>::max())
1402 .Test(xnn_qu8_vcvt_ukernel__wasmsimd_x8, xnn_init_qu8_cvt_wasmsimd_params);
1403 }
1404
TEST(QU8_VCVT__WASMSIMD_X8,batch_div_8)1405 TEST(QU8_VCVT__WASMSIMD_X8, batch_div_8) {
1406 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
1407 VCvtMicrokernelTester()
1408 .batch_size(batch_size)
1409 .qmin(std::numeric_limits<uint8_t>::min())
1410 .qmax(std::numeric_limits<uint8_t>::max())
1411 .Test(xnn_qu8_vcvt_ukernel__wasmsimd_x8, xnn_init_qu8_cvt_wasmsimd_params);
1412 }
1413 }
1414
TEST(QU8_VCVT__WASMSIMD_X8,batch_lt_8)1415 TEST(QU8_VCVT__WASMSIMD_X8, batch_lt_8) {
1416 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
1417 VCvtMicrokernelTester()
1418 .batch_size(batch_size)
1419 .qmin(std::numeric_limits<uint8_t>::min())
1420 .qmax(std::numeric_limits<uint8_t>::max())
1421 .Test(xnn_qu8_vcvt_ukernel__wasmsimd_x8, xnn_init_qu8_cvt_wasmsimd_params);
1422 }
1423 }
1424
TEST(QU8_VCVT__WASMSIMD_X8,batch_gt_8)1425 TEST(QU8_VCVT__WASMSIMD_X8, batch_gt_8) {
1426 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
1427 VCvtMicrokernelTester()
1428 .batch_size(batch_size)
1429 .qmin(std::numeric_limits<uint8_t>::min())
1430 .qmax(std::numeric_limits<uint8_t>::max())
1431 .Test(xnn_qu8_vcvt_ukernel__wasmsimd_x8, xnn_init_qu8_cvt_wasmsimd_params);
1432 }
1433 }
1434
TEST(QU8_VCVT__WASMSIMD_X8,scale)1435 TEST(QU8_VCVT__WASMSIMD_X8, scale) {
1436 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
1437 VCvtMicrokernelTester()
1438 .batch_size(batch_size)
1439 .scale(50)
1440 .output_zero_point(100)
1441 .qmin(std::numeric_limits<uint8_t>::min())
1442 .qmax(std::numeric_limits<uint8_t>::max())
1443 .Test(xnn_qu8_vcvt_ukernel__wasmsimd_x8, xnn_init_qu8_cvt_wasmsimd_params);
1444 }
1445 }
1446
TEST(QU8_VCVT__WASMSIMD_X8,input_zero_point)1447 TEST(QU8_VCVT__WASMSIMD_X8, input_zero_point) {
1448 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
1449 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
1450 VCvtMicrokernelTester()
1451 .batch_size(batch_size)
1452 .input_zero_point(input_zero_point)
1453 .qmin(std::numeric_limits<uint8_t>::min())
1454 .qmax(std::numeric_limits<uint8_t>::max())
1455 .Test(xnn_qu8_vcvt_ukernel__wasmsimd_x8, xnn_init_qu8_cvt_wasmsimd_params);
1456 }
1457 }
1458 }
1459
TEST(QU8_VCVT__WASMSIMD_X8,output_zero_point)1460 TEST(QU8_VCVT__WASMSIMD_X8, output_zero_point) {
1461 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
1462 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
1463 VCvtMicrokernelTester()
1464 .batch_size(batch_size)
1465 .output_zero_point(output_zero_point)
1466 .qmin(std::numeric_limits<uint8_t>::min())
1467 .qmax(std::numeric_limits<uint8_t>::max())
1468 .Test(xnn_qu8_vcvt_ukernel__wasmsimd_x8, xnn_init_qu8_cvt_wasmsimd_params);
1469 }
1470 }
1471 }
1472 #endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD
1473
1474
1475 #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD
TEST(QU8_VCVT__WASMSIMD_X16,batch_eq_16)1476 TEST(QU8_VCVT__WASMSIMD_X16, batch_eq_16) {
1477 VCvtMicrokernelTester()
1478 .batch_size(16)
1479 .qmin(std::numeric_limits<uint8_t>::min())
1480 .qmax(std::numeric_limits<uint8_t>::max())
1481 .Test(xnn_qu8_vcvt_ukernel__wasmsimd_x16, xnn_init_qu8_cvt_wasmsimd_params);
1482 }
1483
TEST(QU8_VCVT__WASMSIMD_X16,batch_div_16)1484 TEST(QU8_VCVT__WASMSIMD_X16, batch_div_16) {
1485 for (size_t batch_size = 32; batch_size < 160; batch_size += 16) {
1486 VCvtMicrokernelTester()
1487 .batch_size(batch_size)
1488 .qmin(std::numeric_limits<uint8_t>::min())
1489 .qmax(std::numeric_limits<uint8_t>::max())
1490 .Test(xnn_qu8_vcvt_ukernel__wasmsimd_x16, xnn_init_qu8_cvt_wasmsimd_params);
1491 }
1492 }
1493
TEST(QU8_VCVT__WASMSIMD_X16,batch_lt_16)1494 TEST(QU8_VCVT__WASMSIMD_X16, batch_lt_16) {
1495 for (size_t batch_size = 1; batch_size < 16; batch_size++) {
1496 VCvtMicrokernelTester()
1497 .batch_size(batch_size)
1498 .qmin(std::numeric_limits<uint8_t>::min())
1499 .qmax(std::numeric_limits<uint8_t>::max())
1500 .Test(xnn_qu8_vcvt_ukernel__wasmsimd_x16, xnn_init_qu8_cvt_wasmsimd_params);
1501 }
1502 }
1503
TEST(QU8_VCVT__WASMSIMD_X16,batch_gt_16)1504 TEST(QU8_VCVT__WASMSIMD_X16, batch_gt_16) {
1505 for (size_t batch_size = 17; batch_size < 32; batch_size++) {
1506 VCvtMicrokernelTester()
1507 .batch_size(batch_size)
1508 .qmin(std::numeric_limits<uint8_t>::min())
1509 .qmax(std::numeric_limits<uint8_t>::max())
1510 .Test(xnn_qu8_vcvt_ukernel__wasmsimd_x16, xnn_init_qu8_cvt_wasmsimd_params);
1511 }
1512 }
1513
TEST(QU8_VCVT__WASMSIMD_X16,scale)1514 TEST(QU8_VCVT__WASMSIMD_X16, scale) {
1515 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
1516 VCvtMicrokernelTester()
1517 .batch_size(batch_size)
1518 .scale(50)
1519 .output_zero_point(100)
1520 .qmin(std::numeric_limits<uint8_t>::min())
1521 .qmax(std::numeric_limits<uint8_t>::max())
1522 .Test(xnn_qu8_vcvt_ukernel__wasmsimd_x16, xnn_init_qu8_cvt_wasmsimd_params);
1523 }
1524 }
1525
TEST(QU8_VCVT__WASMSIMD_X16,input_zero_point)1526 TEST(QU8_VCVT__WASMSIMD_X16, input_zero_point) {
1527 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
1528 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
1529 VCvtMicrokernelTester()
1530 .batch_size(batch_size)
1531 .input_zero_point(input_zero_point)
1532 .qmin(std::numeric_limits<uint8_t>::min())
1533 .qmax(std::numeric_limits<uint8_t>::max())
1534 .Test(xnn_qu8_vcvt_ukernel__wasmsimd_x16, xnn_init_qu8_cvt_wasmsimd_params);
1535 }
1536 }
1537 }
1538
TEST(QU8_VCVT__WASMSIMD_X16,output_zero_point)1539 TEST(QU8_VCVT__WASMSIMD_X16, output_zero_point) {
1540 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
1541 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
1542 VCvtMicrokernelTester()
1543 .batch_size(batch_size)
1544 .output_zero_point(output_zero_point)
1545 .qmin(std::numeric_limits<uint8_t>::min())
1546 .qmax(std::numeric_limits<uint8_t>::max())
1547 .Test(xnn_qu8_vcvt_ukernel__wasmsimd_x16, xnn_init_qu8_cvt_wasmsimd_params);
1548 }
1549 }
1550 }
1551 #endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD
1552
1553
1554 #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD
TEST(QU8_VCVT__WASMSIMD_X32,batch_eq_32)1555 TEST(QU8_VCVT__WASMSIMD_X32, batch_eq_32) {
1556 VCvtMicrokernelTester()
1557 .batch_size(32)
1558 .qmin(std::numeric_limits<uint8_t>::min())
1559 .qmax(std::numeric_limits<uint8_t>::max())
1560 .Test(xnn_qu8_vcvt_ukernel__wasmsimd_x32, xnn_init_qu8_cvt_wasmsimd_params);
1561 }
1562
TEST(QU8_VCVT__WASMSIMD_X32,batch_div_32)1563 TEST(QU8_VCVT__WASMSIMD_X32, batch_div_32) {
1564 for (size_t batch_size = 64; batch_size < 320; batch_size += 32) {
1565 VCvtMicrokernelTester()
1566 .batch_size(batch_size)
1567 .qmin(std::numeric_limits<uint8_t>::min())
1568 .qmax(std::numeric_limits<uint8_t>::max())
1569 .Test(xnn_qu8_vcvt_ukernel__wasmsimd_x32, xnn_init_qu8_cvt_wasmsimd_params);
1570 }
1571 }
1572
TEST(QU8_VCVT__WASMSIMD_X32,batch_lt_32)1573 TEST(QU8_VCVT__WASMSIMD_X32, batch_lt_32) {
1574 for (size_t batch_size = 1; batch_size < 32; batch_size++) {
1575 VCvtMicrokernelTester()
1576 .batch_size(batch_size)
1577 .qmin(std::numeric_limits<uint8_t>::min())
1578 .qmax(std::numeric_limits<uint8_t>::max())
1579 .Test(xnn_qu8_vcvt_ukernel__wasmsimd_x32, xnn_init_qu8_cvt_wasmsimd_params);
1580 }
1581 }
1582
TEST(QU8_VCVT__WASMSIMD_X32,batch_gt_32)1583 TEST(QU8_VCVT__WASMSIMD_X32, batch_gt_32) {
1584 for (size_t batch_size = 33; batch_size < 64; batch_size++) {
1585 VCvtMicrokernelTester()
1586 .batch_size(batch_size)
1587 .qmin(std::numeric_limits<uint8_t>::min())
1588 .qmax(std::numeric_limits<uint8_t>::max())
1589 .Test(xnn_qu8_vcvt_ukernel__wasmsimd_x32, xnn_init_qu8_cvt_wasmsimd_params);
1590 }
1591 }
1592
TEST(QU8_VCVT__WASMSIMD_X32,scale)1593 TEST(QU8_VCVT__WASMSIMD_X32, scale) {
1594 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
1595 VCvtMicrokernelTester()
1596 .batch_size(batch_size)
1597 .scale(50)
1598 .output_zero_point(100)
1599 .qmin(std::numeric_limits<uint8_t>::min())
1600 .qmax(std::numeric_limits<uint8_t>::max())
1601 .Test(xnn_qu8_vcvt_ukernel__wasmsimd_x32, xnn_init_qu8_cvt_wasmsimd_params);
1602 }
1603 }
1604
TEST(QU8_VCVT__WASMSIMD_X32,input_zero_point)1605 TEST(QU8_VCVT__WASMSIMD_X32, input_zero_point) {
1606 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
1607 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
1608 VCvtMicrokernelTester()
1609 .batch_size(batch_size)
1610 .input_zero_point(input_zero_point)
1611 .qmin(std::numeric_limits<uint8_t>::min())
1612 .qmax(std::numeric_limits<uint8_t>::max())
1613 .Test(xnn_qu8_vcvt_ukernel__wasmsimd_x32, xnn_init_qu8_cvt_wasmsimd_params);
1614 }
1615 }
1616 }
1617
TEST(QU8_VCVT__WASMSIMD_X32,output_zero_point)1618 TEST(QU8_VCVT__WASMSIMD_X32, output_zero_point) {
1619 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
1620 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
1621 VCvtMicrokernelTester()
1622 .batch_size(batch_size)
1623 .output_zero_point(output_zero_point)
1624 .qmin(std::numeric_limits<uint8_t>::min())
1625 .qmax(std::numeric_limits<uint8_t>::max())
1626 .Test(xnn_qu8_vcvt_ukernel__wasmsimd_x32, xnn_init_qu8_cvt_wasmsimd_params);
1627 }
1628 }
1629 }
1630 #endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD
1631
1632
1633 #if XNN_ARCH_WASMRELAXEDSIMD
TEST(QU8_VCVT__WASMRELAXEDSIMD_X8,batch_eq_8)1634 TEST(QU8_VCVT__WASMRELAXEDSIMD_X8, batch_eq_8) {
1635 VCvtMicrokernelTester()
1636 .batch_size(8)
1637 .qmin(std::numeric_limits<uint8_t>::min())
1638 .qmax(std::numeric_limits<uint8_t>::max())
1639 .Test(xnn_qu8_vcvt_ukernel__wasmrelaxedsimd_x8, xnn_init_qu8_cvt_wasmsimd_params);
1640 }
1641
TEST(QU8_VCVT__WASMRELAXEDSIMD_X8,batch_div_8)1642 TEST(QU8_VCVT__WASMRELAXEDSIMD_X8, batch_div_8) {
1643 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
1644 VCvtMicrokernelTester()
1645 .batch_size(batch_size)
1646 .qmin(std::numeric_limits<uint8_t>::min())
1647 .qmax(std::numeric_limits<uint8_t>::max())
1648 .Test(xnn_qu8_vcvt_ukernel__wasmrelaxedsimd_x8, xnn_init_qu8_cvt_wasmsimd_params);
1649 }
1650 }
1651
TEST(QU8_VCVT__WASMRELAXEDSIMD_X8,batch_lt_8)1652 TEST(QU8_VCVT__WASMRELAXEDSIMD_X8, batch_lt_8) {
1653 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
1654 VCvtMicrokernelTester()
1655 .batch_size(batch_size)
1656 .qmin(std::numeric_limits<uint8_t>::min())
1657 .qmax(std::numeric_limits<uint8_t>::max())
1658 .Test(xnn_qu8_vcvt_ukernel__wasmrelaxedsimd_x8, xnn_init_qu8_cvt_wasmsimd_params);
1659 }
1660 }
1661
TEST(QU8_VCVT__WASMRELAXEDSIMD_X8,batch_gt_8)1662 TEST(QU8_VCVT__WASMRELAXEDSIMD_X8, batch_gt_8) {
1663 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
1664 VCvtMicrokernelTester()
1665 .batch_size(batch_size)
1666 .qmin(std::numeric_limits<uint8_t>::min())
1667 .qmax(std::numeric_limits<uint8_t>::max())
1668 .Test(xnn_qu8_vcvt_ukernel__wasmrelaxedsimd_x8, xnn_init_qu8_cvt_wasmsimd_params);
1669 }
1670 }
1671
TEST(QU8_VCVT__WASMRELAXEDSIMD_X8,scale)1672 TEST(QU8_VCVT__WASMRELAXEDSIMD_X8, scale) {
1673 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
1674 VCvtMicrokernelTester()
1675 .batch_size(batch_size)
1676 .scale(50)
1677 .output_zero_point(100)
1678 .qmin(std::numeric_limits<uint8_t>::min())
1679 .qmax(std::numeric_limits<uint8_t>::max())
1680 .Test(xnn_qu8_vcvt_ukernel__wasmrelaxedsimd_x8, xnn_init_qu8_cvt_wasmsimd_params);
1681 }
1682 }
1683
TEST(QU8_VCVT__WASMRELAXEDSIMD_X8,input_zero_point)1684 TEST(QU8_VCVT__WASMRELAXEDSIMD_X8, input_zero_point) {
1685 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
1686 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
1687 VCvtMicrokernelTester()
1688 .batch_size(batch_size)
1689 .input_zero_point(input_zero_point)
1690 .qmin(std::numeric_limits<uint8_t>::min())
1691 .qmax(std::numeric_limits<uint8_t>::max())
1692 .Test(xnn_qu8_vcvt_ukernel__wasmrelaxedsimd_x8, xnn_init_qu8_cvt_wasmsimd_params);
1693 }
1694 }
1695 }
1696
TEST(QU8_VCVT__WASMRELAXEDSIMD_X8,output_zero_point)1697 TEST(QU8_VCVT__WASMRELAXEDSIMD_X8, output_zero_point) {
1698 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
1699 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
1700 VCvtMicrokernelTester()
1701 .batch_size(batch_size)
1702 .output_zero_point(output_zero_point)
1703 .qmin(std::numeric_limits<uint8_t>::min())
1704 .qmax(std::numeric_limits<uint8_t>::max())
1705 .Test(xnn_qu8_vcvt_ukernel__wasmrelaxedsimd_x8, xnn_init_qu8_cvt_wasmsimd_params);
1706 }
1707 }
1708 }
1709 #endif // XNN_ARCH_WASMRELAXEDSIMD
1710
1711
1712 #if XNN_ARCH_WASMRELAXEDSIMD
TEST(QU8_VCVT__WASMRELAXEDSIMD_X16,batch_eq_16)1713 TEST(QU8_VCVT__WASMRELAXEDSIMD_X16, batch_eq_16) {
1714 VCvtMicrokernelTester()
1715 .batch_size(16)
1716 .qmin(std::numeric_limits<uint8_t>::min())
1717 .qmax(std::numeric_limits<uint8_t>::max())
1718 .Test(xnn_qu8_vcvt_ukernel__wasmrelaxedsimd_x16, xnn_init_qu8_cvt_wasmsimd_params);
1719 }
1720
TEST(QU8_VCVT__WASMRELAXEDSIMD_X16,batch_div_16)1721 TEST(QU8_VCVT__WASMRELAXEDSIMD_X16, batch_div_16) {
1722 for (size_t batch_size = 32; batch_size < 160; batch_size += 16) {
1723 VCvtMicrokernelTester()
1724 .batch_size(batch_size)
1725 .qmin(std::numeric_limits<uint8_t>::min())
1726 .qmax(std::numeric_limits<uint8_t>::max())
1727 .Test(xnn_qu8_vcvt_ukernel__wasmrelaxedsimd_x16, xnn_init_qu8_cvt_wasmsimd_params);
1728 }
1729 }
1730
TEST(QU8_VCVT__WASMRELAXEDSIMD_X16,batch_lt_16)1731 TEST(QU8_VCVT__WASMRELAXEDSIMD_X16, batch_lt_16) {
1732 for (size_t batch_size = 1; batch_size < 16; batch_size++) {
1733 VCvtMicrokernelTester()
1734 .batch_size(batch_size)
1735 .qmin(std::numeric_limits<uint8_t>::min())
1736 .qmax(std::numeric_limits<uint8_t>::max())
1737 .Test(xnn_qu8_vcvt_ukernel__wasmrelaxedsimd_x16, xnn_init_qu8_cvt_wasmsimd_params);
1738 }
1739 }
1740
TEST(QU8_VCVT__WASMRELAXEDSIMD_X16,batch_gt_16)1741 TEST(QU8_VCVT__WASMRELAXEDSIMD_X16, batch_gt_16) {
1742 for (size_t batch_size = 17; batch_size < 32; batch_size++) {
1743 VCvtMicrokernelTester()
1744 .batch_size(batch_size)
1745 .qmin(std::numeric_limits<uint8_t>::min())
1746 .qmax(std::numeric_limits<uint8_t>::max())
1747 .Test(xnn_qu8_vcvt_ukernel__wasmrelaxedsimd_x16, xnn_init_qu8_cvt_wasmsimd_params);
1748 }
1749 }
1750
TEST(QU8_VCVT__WASMRELAXEDSIMD_X16,scale)1751 TEST(QU8_VCVT__WASMRELAXEDSIMD_X16, scale) {
1752 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
1753 VCvtMicrokernelTester()
1754 .batch_size(batch_size)
1755 .scale(50)
1756 .output_zero_point(100)
1757 .qmin(std::numeric_limits<uint8_t>::min())
1758 .qmax(std::numeric_limits<uint8_t>::max())
1759 .Test(xnn_qu8_vcvt_ukernel__wasmrelaxedsimd_x16, xnn_init_qu8_cvt_wasmsimd_params);
1760 }
1761 }
1762
TEST(QU8_VCVT__WASMRELAXEDSIMD_X16,input_zero_point)1763 TEST(QU8_VCVT__WASMRELAXEDSIMD_X16, input_zero_point) {
1764 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
1765 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
1766 VCvtMicrokernelTester()
1767 .batch_size(batch_size)
1768 .input_zero_point(input_zero_point)
1769 .qmin(std::numeric_limits<uint8_t>::min())
1770 .qmax(std::numeric_limits<uint8_t>::max())
1771 .Test(xnn_qu8_vcvt_ukernel__wasmrelaxedsimd_x16, xnn_init_qu8_cvt_wasmsimd_params);
1772 }
1773 }
1774 }
1775
TEST(QU8_VCVT__WASMRELAXEDSIMD_X16,output_zero_point)1776 TEST(QU8_VCVT__WASMRELAXEDSIMD_X16, output_zero_point) {
1777 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
1778 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
1779 VCvtMicrokernelTester()
1780 .batch_size(batch_size)
1781 .output_zero_point(output_zero_point)
1782 .qmin(std::numeric_limits<uint8_t>::min())
1783 .qmax(std::numeric_limits<uint8_t>::max())
1784 .Test(xnn_qu8_vcvt_ukernel__wasmrelaxedsimd_x16, xnn_init_qu8_cvt_wasmsimd_params);
1785 }
1786 }
1787 }
1788 #endif // XNN_ARCH_WASMRELAXEDSIMD
1789
1790
1791 #if XNN_ARCH_WASMRELAXEDSIMD
TEST(QU8_VCVT__WASMRELAXEDSIMD_X32,batch_eq_32)1792 TEST(QU8_VCVT__WASMRELAXEDSIMD_X32, batch_eq_32) {
1793 VCvtMicrokernelTester()
1794 .batch_size(32)
1795 .qmin(std::numeric_limits<uint8_t>::min())
1796 .qmax(std::numeric_limits<uint8_t>::max())
1797 .Test(xnn_qu8_vcvt_ukernel__wasmrelaxedsimd_x32, xnn_init_qu8_cvt_wasmsimd_params);
1798 }
1799
TEST(QU8_VCVT__WASMRELAXEDSIMD_X32,batch_div_32)1800 TEST(QU8_VCVT__WASMRELAXEDSIMD_X32, batch_div_32) {
1801 for (size_t batch_size = 64; batch_size < 320; batch_size += 32) {
1802 VCvtMicrokernelTester()
1803 .batch_size(batch_size)
1804 .qmin(std::numeric_limits<uint8_t>::min())
1805 .qmax(std::numeric_limits<uint8_t>::max())
1806 .Test(xnn_qu8_vcvt_ukernel__wasmrelaxedsimd_x32, xnn_init_qu8_cvt_wasmsimd_params);
1807 }
1808 }
1809
TEST(QU8_VCVT__WASMRELAXEDSIMD_X32,batch_lt_32)1810 TEST(QU8_VCVT__WASMRELAXEDSIMD_X32, batch_lt_32) {
1811 for (size_t batch_size = 1; batch_size < 32; batch_size++) {
1812 VCvtMicrokernelTester()
1813 .batch_size(batch_size)
1814 .qmin(std::numeric_limits<uint8_t>::min())
1815 .qmax(std::numeric_limits<uint8_t>::max())
1816 .Test(xnn_qu8_vcvt_ukernel__wasmrelaxedsimd_x32, xnn_init_qu8_cvt_wasmsimd_params);
1817 }
1818 }
1819
TEST(QU8_VCVT__WASMRELAXEDSIMD_X32,batch_gt_32)1820 TEST(QU8_VCVT__WASMRELAXEDSIMD_X32, batch_gt_32) {
1821 for (size_t batch_size = 33; batch_size < 64; batch_size++) {
1822 VCvtMicrokernelTester()
1823 .batch_size(batch_size)
1824 .qmin(std::numeric_limits<uint8_t>::min())
1825 .qmax(std::numeric_limits<uint8_t>::max())
1826 .Test(xnn_qu8_vcvt_ukernel__wasmrelaxedsimd_x32, xnn_init_qu8_cvt_wasmsimd_params);
1827 }
1828 }
1829
TEST(QU8_VCVT__WASMRELAXEDSIMD_X32,scale)1830 TEST(QU8_VCVT__WASMRELAXEDSIMD_X32, scale) {
1831 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
1832 VCvtMicrokernelTester()
1833 .batch_size(batch_size)
1834 .scale(50)
1835 .output_zero_point(100)
1836 .qmin(std::numeric_limits<uint8_t>::min())
1837 .qmax(std::numeric_limits<uint8_t>::max())
1838 .Test(xnn_qu8_vcvt_ukernel__wasmrelaxedsimd_x32, xnn_init_qu8_cvt_wasmsimd_params);
1839 }
1840 }
1841
TEST(QU8_VCVT__WASMRELAXEDSIMD_X32,input_zero_point)1842 TEST(QU8_VCVT__WASMRELAXEDSIMD_X32, input_zero_point) {
1843 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
1844 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
1845 VCvtMicrokernelTester()
1846 .batch_size(batch_size)
1847 .input_zero_point(input_zero_point)
1848 .qmin(std::numeric_limits<uint8_t>::min())
1849 .qmax(std::numeric_limits<uint8_t>::max())
1850 .Test(xnn_qu8_vcvt_ukernel__wasmrelaxedsimd_x32, xnn_init_qu8_cvt_wasmsimd_params);
1851 }
1852 }
1853 }
1854
TEST(QU8_VCVT__WASMRELAXEDSIMD_X32,output_zero_point)1855 TEST(QU8_VCVT__WASMRELAXEDSIMD_X32, output_zero_point) {
1856 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
1857 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
1858 VCvtMicrokernelTester()
1859 .batch_size(batch_size)
1860 .output_zero_point(output_zero_point)
1861 .qmin(std::numeric_limits<uint8_t>::min())
1862 .qmax(std::numeric_limits<uint8_t>::max())
1863 .Test(xnn_qu8_vcvt_ukernel__wasmrelaxedsimd_x32, xnn_init_qu8_cvt_wasmsimd_params);
1864 }
1865 }
1866 }
1867 #endif // XNN_ARCH_WASMRELAXEDSIMD
1868
1869
1870 #if XNN_ARCH_ARM
TEST(QU8_VCVT__ARMSIMD32_X4,batch_eq_4)1871 TEST(QU8_VCVT__ARMSIMD32_X4, batch_eq_4) {
1872 TEST_REQUIRES_ARM_SIMD32;
1873 VCvtMicrokernelTester()
1874 .batch_size(4)
1875 .qmin(std::numeric_limits<uint8_t>::min())
1876 .qmax(std::numeric_limits<uint8_t>::max())
1877 .Test(xnn_qu8_vcvt_ukernel__armsimd32_x4, xnn_init_qu8_cvt_armsimd32_params);
1878 }
1879
TEST(QU8_VCVT__ARMSIMD32_X4,batch_div_4)1880 TEST(QU8_VCVT__ARMSIMD32_X4, batch_div_4) {
1881 TEST_REQUIRES_ARM_SIMD32;
1882 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
1883 VCvtMicrokernelTester()
1884 .batch_size(batch_size)
1885 .qmin(std::numeric_limits<uint8_t>::min())
1886 .qmax(std::numeric_limits<uint8_t>::max())
1887 .Test(xnn_qu8_vcvt_ukernel__armsimd32_x4, xnn_init_qu8_cvt_armsimd32_params);
1888 }
1889 }
1890
TEST(QU8_VCVT__ARMSIMD32_X4,batch_lt_4)1891 TEST(QU8_VCVT__ARMSIMD32_X4, batch_lt_4) {
1892 TEST_REQUIRES_ARM_SIMD32;
1893 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
1894 VCvtMicrokernelTester()
1895 .batch_size(batch_size)
1896 .qmin(std::numeric_limits<uint8_t>::min())
1897 .qmax(std::numeric_limits<uint8_t>::max())
1898 .Test(xnn_qu8_vcvt_ukernel__armsimd32_x4, xnn_init_qu8_cvt_armsimd32_params);
1899 }
1900 }
1901
TEST(QU8_VCVT__ARMSIMD32_X4,batch_gt_4)1902 TEST(QU8_VCVT__ARMSIMD32_X4, batch_gt_4) {
1903 TEST_REQUIRES_ARM_SIMD32;
1904 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
1905 VCvtMicrokernelTester()
1906 .batch_size(batch_size)
1907 .qmin(std::numeric_limits<uint8_t>::min())
1908 .qmax(std::numeric_limits<uint8_t>::max())
1909 .Test(xnn_qu8_vcvt_ukernel__armsimd32_x4, xnn_init_qu8_cvt_armsimd32_params);
1910 }
1911 }
1912
TEST(QU8_VCVT__ARMSIMD32_X4,scale)1913 TEST(QU8_VCVT__ARMSIMD32_X4, scale) {
1914 TEST_REQUIRES_ARM_SIMD32;
1915 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
1916 VCvtMicrokernelTester()
1917 .batch_size(batch_size)
1918 .scale(50)
1919 .output_zero_point(100)
1920 .qmin(std::numeric_limits<uint8_t>::min())
1921 .qmax(std::numeric_limits<uint8_t>::max())
1922 .Test(xnn_qu8_vcvt_ukernel__armsimd32_x4, xnn_init_qu8_cvt_armsimd32_params);
1923 }
1924 }
1925
TEST(QU8_VCVT__ARMSIMD32_X4,input_zero_point)1926 TEST(QU8_VCVT__ARMSIMD32_X4, input_zero_point) {
1927 TEST_REQUIRES_ARM_SIMD32;
1928 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
1929 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
1930 VCvtMicrokernelTester()
1931 .batch_size(batch_size)
1932 .input_zero_point(input_zero_point)
1933 .qmin(std::numeric_limits<uint8_t>::min())
1934 .qmax(std::numeric_limits<uint8_t>::max())
1935 .Test(xnn_qu8_vcvt_ukernel__armsimd32_x4, xnn_init_qu8_cvt_armsimd32_params);
1936 }
1937 }
1938 }
1939
TEST(QU8_VCVT__ARMSIMD32_X4,output_zero_point)1940 TEST(QU8_VCVT__ARMSIMD32_X4, output_zero_point) {
1941 TEST_REQUIRES_ARM_SIMD32;
1942 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
1943 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
1944 VCvtMicrokernelTester()
1945 .batch_size(batch_size)
1946 .output_zero_point(output_zero_point)
1947 .qmin(std::numeric_limits<uint8_t>::min())
1948 .qmax(std::numeric_limits<uint8_t>::max())
1949 .Test(xnn_qu8_vcvt_ukernel__armsimd32_x4, xnn_init_qu8_cvt_armsimd32_params);
1950 }
1951 }
1952 }
1953 #endif // XNN_ARCH_ARM
1954
1955
1956 #if XNN_ARCH_ARM
TEST(QU8_VCVT__ARMSIMD32_X8,batch_eq_8)1957 TEST(QU8_VCVT__ARMSIMD32_X8, batch_eq_8) {
1958 TEST_REQUIRES_ARM_SIMD32;
1959 VCvtMicrokernelTester()
1960 .batch_size(8)
1961 .qmin(std::numeric_limits<uint8_t>::min())
1962 .qmax(std::numeric_limits<uint8_t>::max())
1963 .Test(xnn_qu8_vcvt_ukernel__armsimd32_x8, xnn_init_qu8_cvt_armsimd32_params);
1964 }
1965
TEST(QU8_VCVT__ARMSIMD32_X8,batch_div_8)1966 TEST(QU8_VCVT__ARMSIMD32_X8, batch_div_8) {
1967 TEST_REQUIRES_ARM_SIMD32;
1968 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
1969 VCvtMicrokernelTester()
1970 .batch_size(batch_size)
1971 .qmin(std::numeric_limits<uint8_t>::min())
1972 .qmax(std::numeric_limits<uint8_t>::max())
1973 .Test(xnn_qu8_vcvt_ukernel__armsimd32_x8, xnn_init_qu8_cvt_armsimd32_params);
1974 }
1975 }
1976
TEST(QU8_VCVT__ARMSIMD32_X8,batch_lt_8)1977 TEST(QU8_VCVT__ARMSIMD32_X8, batch_lt_8) {
1978 TEST_REQUIRES_ARM_SIMD32;
1979 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
1980 VCvtMicrokernelTester()
1981 .batch_size(batch_size)
1982 .qmin(std::numeric_limits<uint8_t>::min())
1983 .qmax(std::numeric_limits<uint8_t>::max())
1984 .Test(xnn_qu8_vcvt_ukernel__armsimd32_x8, xnn_init_qu8_cvt_armsimd32_params);
1985 }
1986 }
1987
TEST(QU8_VCVT__ARMSIMD32_X8,batch_gt_8)1988 TEST(QU8_VCVT__ARMSIMD32_X8, batch_gt_8) {
1989 TEST_REQUIRES_ARM_SIMD32;
1990 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
1991 VCvtMicrokernelTester()
1992 .batch_size(batch_size)
1993 .qmin(std::numeric_limits<uint8_t>::min())
1994 .qmax(std::numeric_limits<uint8_t>::max())
1995 .Test(xnn_qu8_vcvt_ukernel__armsimd32_x8, xnn_init_qu8_cvt_armsimd32_params);
1996 }
1997 }
1998
TEST(QU8_VCVT__ARMSIMD32_X8,scale)1999 TEST(QU8_VCVT__ARMSIMD32_X8, scale) {
2000 TEST_REQUIRES_ARM_SIMD32;
2001 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
2002 VCvtMicrokernelTester()
2003 .batch_size(batch_size)
2004 .scale(50)
2005 .output_zero_point(100)
2006 .qmin(std::numeric_limits<uint8_t>::min())
2007 .qmax(std::numeric_limits<uint8_t>::max())
2008 .Test(xnn_qu8_vcvt_ukernel__armsimd32_x8, xnn_init_qu8_cvt_armsimd32_params);
2009 }
2010 }
2011
TEST(QU8_VCVT__ARMSIMD32_X8,input_zero_point)2012 TEST(QU8_VCVT__ARMSIMD32_X8, input_zero_point) {
2013 TEST_REQUIRES_ARM_SIMD32;
2014 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
2015 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
2016 VCvtMicrokernelTester()
2017 .batch_size(batch_size)
2018 .input_zero_point(input_zero_point)
2019 .qmin(std::numeric_limits<uint8_t>::min())
2020 .qmax(std::numeric_limits<uint8_t>::max())
2021 .Test(xnn_qu8_vcvt_ukernel__armsimd32_x8, xnn_init_qu8_cvt_armsimd32_params);
2022 }
2023 }
2024 }
2025
TEST(QU8_VCVT__ARMSIMD32_X8,output_zero_point)2026 TEST(QU8_VCVT__ARMSIMD32_X8, output_zero_point) {
2027 TEST_REQUIRES_ARM_SIMD32;
2028 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
2029 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
2030 VCvtMicrokernelTester()
2031 .batch_size(batch_size)
2032 .output_zero_point(output_zero_point)
2033 .qmin(std::numeric_limits<uint8_t>::min())
2034 .qmax(std::numeric_limits<uint8_t>::max())
2035 .Test(xnn_qu8_vcvt_ukernel__armsimd32_x8, xnn_init_qu8_cvt_armsimd32_params);
2036 }
2037 }
2038 }
2039 #endif // XNN_ARCH_ARM
2040
2041
TEST(QU8_VCVT__SCALAR_X1,batch_eq_1)2042 TEST(QU8_VCVT__SCALAR_X1, batch_eq_1) {
2043 VCvtMicrokernelTester()
2044 .batch_size(1)
2045 .qmin(std::numeric_limits<uint8_t>::min())
2046 .qmax(std::numeric_limits<uint8_t>::max())
2047 .Test(xnn_qu8_vcvt_ukernel__scalar_x1, xnn_init_qu8_cvt_scalar_params);
2048 }
2049
TEST(QU8_VCVT__SCALAR_X1,batch_gt_1)2050 TEST(QU8_VCVT__SCALAR_X1, batch_gt_1) {
2051 for (size_t batch_size = 2; batch_size < 10; batch_size++) {
2052 VCvtMicrokernelTester()
2053 .batch_size(batch_size)
2054 .qmin(std::numeric_limits<uint8_t>::min())
2055 .qmax(std::numeric_limits<uint8_t>::max())
2056 .Test(xnn_qu8_vcvt_ukernel__scalar_x1, xnn_init_qu8_cvt_scalar_params);
2057 }
2058 }
2059
TEST(QU8_VCVT__SCALAR_X1,scale)2060 TEST(QU8_VCVT__SCALAR_X1, scale) {
2061 for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) {
2062 VCvtMicrokernelTester()
2063 .batch_size(batch_size)
2064 .scale(50)
2065 .output_zero_point(100)
2066 .qmin(std::numeric_limits<uint8_t>::min())
2067 .qmax(std::numeric_limits<uint8_t>::max())
2068 .Test(xnn_qu8_vcvt_ukernel__scalar_x1, xnn_init_qu8_cvt_scalar_params);
2069 }
2070 }
2071
TEST(QU8_VCVT__SCALAR_X1,input_zero_point)2072 TEST(QU8_VCVT__SCALAR_X1, input_zero_point) {
2073 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
2074 for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) {
2075 VCvtMicrokernelTester()
2076 .batch_size(batch_size)
2077 .input_zero_point(input_zero_point)
2078 .qmin(std::numeric_limits<uint8_t>::min())
2079 .qmax(std::numeric_limits<uint8_t>::max())
2080 .Test(xnn_qu8_vcvt_ukernel__scalar_x1, xnn_init_qu8_cvt_scalar_params);
2081 }
2082 }
2083 }
2084
TEST(QU8_VCVT__SCALAR_X1,output_zero_point)2085 TEST(QU8_VCVT__SCALAR_X1, output_zero_point) {
2086 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
2087 for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) {
2088 VCvtMicrokernelTester()
2089 .batch_size(batch_size)
2090 .output_zero_point(output_zero_point)
2091 .qmin(std::numeric_limits<uint8_t>::min())
2092 .qmax(std::numeric_limits<uint8_t>::max())
2093 .Test(xnn_qu8_vcvt_ukernel__scalar_x1, xnn_init_qu8_cvt_scalar_params);
2094 }
2095 }
2096 }
2097
2098
TEST(QU8_VCVT__SCALAR_X2,batch_eq_2)2099 TEST(QU8_VCVT__SCALAR_X2, batch_eq_2) {
2100 VCvtMicrokernelTester()
2101 .batch_size(2)
2102 .qmin(std::numeric_limits<uint8_t>::min())
2103 .qmax(std::numeric_limits<uint8_t>::max())
2104 .Test(xnn_qu8_vcvt_ukernel__scalar_x2, xnn_init_qu8_cvt_scalar_params);
2105 }
2106
TEST(QU8_VCVT__SCALAR_X2,batch_div_2)2107 TEST(QU8_VCVT__SCALAR_X2, batch_div_2) {
2108 for (size_t batch_size = 4; batch_size < 20; batch_size += 2) {
2109 VCvtMicrokernelTester()
2110 .batch_size(batch_size)
2111 .qmin(std::numeric_limits<uint8_t>::min())
2112 .qmax(std::numeric_limits<uint8_t>::max())
2113 .Test(xnn_qu8_vcvt_ukernel__scalar_x2, xnn_init_qu8_cvt_scalar_params);
2114 }
2115 }
2116
TEST(QU8_VCVT__SCALAR_X2,batch_lt_2)2117 TEST(QU8_VCVT__SCALAR_X2, batch_lt_2) {
2118 for (size_t batch_size = 1; batch_size < 2; batch_size++) {
2119 VCvtMicrokernelTester()
2120 .batch_size(batch_size)
2121 .qmin(std::numeric_limits<uint8_t>::min())
2122 .qmax(std::numeric_limits<uint8_t>::max())
2123 .Test(xnn_qu8_vcvt_ukernel__scalar_x2, xnn_init_qu8_cvt_scalar_params);
2124 }
2125 }
2126
TEST(QU8_VCVT__SCALAR_X2,batch_gt_2)2127 TEST(QU8_VCVT__SCALAR_X2, batch_gt_2) {
2128 for (size_t batch_size = 3; batch_size < 4; batch_size++) {
2129 VCvtMicrokernelTester()
2130 .batch_size(batch_size)
2131 .qmin(std::numeric_limits<uint8_t>::min())
2132 .qmax(std::numeric_limits<uint8_t>::max())
2133 .Test(xnn_qu8_vcvt_ukernel__scalar_x2, xnn_init_qu8_cvt_scalar_params);
2134 }
2135 }
2136
TEST(QU8_VCVT__SCALAR_X2,scale)2137 TEST(QU8_VCVT__SCALAR_X2, scale) {
2138 for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) {
2139 VCvtMicrokernelTester()
2140 .batch_size(batch_size)
2141 .scale(50)
2142 .output_zero_point(100)
2143 .qmin(std::numeric_limits<uint8_t>::min())
2144 .qmax(std::numeric_limits<uint8_t>::max())
2145 .Test(xnn_qu8_vcvt_ukernel__scalar_x2, xnn_init_qu8_cvt_scalar_params);
2146 }
2147 }
2148
TEST(QU8_VCVT__SCALAR_X2,input_zero_point)2149 TEST(QU8_VCVT__SCALAR_X2, input_zero_point) {
2150 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
2151 for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) {
2152 VCvtMicrokernelTester()
2153 .batch_size(batch_size)
2154 .input_zero_point(input_zero_point)
2155 .qmin(std::numeric_limits<uint8_t>::min())
2156 .qmax(std::numeric_limits<uint8_t>::max())
2157 .Test(xnn_qu8_vcvt_ukernel__scalar_x2, xnn_init_qu8_cvt_scalar_params);
2158 }
2159 }
2160 }
2161
TEST(QU8_VCVT__SCALAR_X2,output_zero_point)2162 TEST(QU8_VCVT__SCALAR_X2, output_zero_point) {
2163 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
2164 for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) {
2165 VCvtMicrokernelTester()
2166 .batch_size(batch_size)
2167 .output_zero_point(output_zero_point)
2168 .qmin(std::numeric_limits<uint8_t>::min())
2169 .qmax(std::numeric_limits<uint8_t>::max())
2170 .Test(xnn_qu8_vcvt_ukernel__scalar_x2, xnn_init_qu8_cvt_scalar_params);
2171 }
2172 }
2173 }
2174
2175
TEST(QU8_VCVT__SCALAR_X4,batch_eq_4)2176 TEST(QU8_VCVT__SCALAR_X4, batch_eq_4) {
2177 VCvtMicrokernelTester()
2178 .batch_size(4)
2179 .qmin(std::numeric_limits<uint8_t>::min())
2180 .qmax(std::numeric_limits<uint8_t>::max())
2181 .Test(xnn_qu8_vcvt_ukernel__scalar_x4, xnn_init_qu8_cvt_scalar_params);
2182 }
2183
TEST(QU8_VCVT__SCALAR_X4,batch_div_4)2184 TEST(QU8_VCVT__SCALAR_X4, batch_div_4) {
2185 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
2186 VCvtMicrokernelTester()
2187 .batch_size(batch_size)
2188 .qmin(std::numeric_limits<uint8_t>::min())
2189 .qmax(std::numeric_limits<uint8_t>::max())
2190 .Test(xnn_qu8_vcvt_ukernel__scalar_x4, xnn_init_qu8_cvt_scalar_params);
2191 }
2192 }
2193
TEST(QU8_VCVT__SCALAR_X4,batch_lt_4)2194 TEST(QU8_VCVT__SCALAR_X4, batch_lt_4) {
2195 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
2196 VCvtMicrokernelTester()
2197 .batch_size(batch_size)
2198 .qmin(std::numeric_limits<uint8_t>::min())
2199 .qmax(std::numeric_limits<uint8_t>::max())
2200 .Test(xnn_qu8_vcvt_ukernel__scalar_x4, xnn_init_qu8_cvt_scalar_params);
2201 }
2202 }
2203
TEST(QU8_VCVT__SCALAR_X4,batch_gt_4)2204 TEST(QU8_VCVT__SCALAR_X4, batch_gt_4) {
2205 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
2206 VCvtMicrokernelTester()
2207 .batch_size(batch_size)
2208 .qmin(std::numeric_limits<uint8_t>::min())
2209 .qmax(std::numeric_limits<uint8_t>::max())
2210 .Test(xnn_qu8_vcvt_ukernel__scalar_x4, xnn_init_qu8_cvt_scalar_params);
2211 }
2212 }
2213
TEST(QU8_VCVT__SCALAR_X4,scale)2214 TEST(QU8_VCVT__SCALAR_X4, scale) {
2215 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
2216 VCvtMicrokernelTester()
2217 .batch_size(batch_size)
2218 .scale(50)
2219 .output_zero_point(100)
2220 .qmin(std::numeric_limits<uint8_t>::min())
2221 .qmax(std::numeric_limits<uint8_t>::max())
2222 .Test(xnn_qu8_vcvt_ukernel__scalar_x4, xnn_init_qu8_cvt_scalar_params);
2223 }
2224 }
2225
TEST(QU8_VCVT__SCALAR_X4,input_zero_point)2226 TEST(QU8_VCVT__SCALAR_X4, input_zero_point) {
2227 for (int16_t input_zero_point = 0; input_zero_point < 5; input_zero_point += 2) {
2228 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
2229 VCvtMicrokernelTester()
2230 .batch_size(batch_size)
2231 .input_zero_point(input_zero_point)
2232 .qmin(std::numeric_limits<uint8_t>::min())
2233 .qmax(std::numeric_limits<uint8_t>::max())
2234 .Test(xnn_qu8_vcvt_ukernel__scalar_x4, xnn_init_qu8_cvt_scalar_params);
2235 }
2236 }
2237 }
2238
TEST(QU8_VCVT__SCALAR_X4,output_zero_point)2239 TEST(QU8_VCVT__SCALAR_X4, output_zero_point) {
2240 for (int16_t output_zero_point = 0; output_zero_point < 5; output_zero_point += 2) {
2241 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
2242 VCvtMicrokernelTester()
2243 .batch_size(batch_size)
2244 .output_zero_point(output_zero_point)
2245 .qmin(std::numeric_limits<uint8_t>::min())
2246 .qmax(std::numeric_limits<uint8_t>::max())
2247 .Test(xnn_qu8_vcvt_ukernel__scalar_x4, xnn_init_qu8_cvt_scalar_params);
2248 }
2249 }
2250 }
2251