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