blob: 3dbe60ab8741eb27f7b97e8aae9497c45337d9ca [file] [log] [blame]
Marat Dukhan403b7d42019-12-05 12:49:11 -08001// Copyright 2019 Google LLC
2//
3// This source code is licensed under the BSD-style license found in the
4// LICENSE file in the root directory of this source tree.
5//
6// Auto-generated file. Do not edit!
7// Specification: test/f32-vmax.yaml
8// Generator: tools/generate-vbinary-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/vbinary.h>
17#include "vbinary-microkernel-tester.h"
18
19
20#if XNN_ARCH_ARM || XNN_ARCH_ARM64
21 TEST(F32_VMAX__NEON_X4, batch_eq_4) {
22 TEST_REQUIRES_ARM_NEON;
23 VBinOpMicrokernelTester()
24 .batch_size(4)
25 .Test(xnn_f32_vmax_ukernel__neon_x4, VBinOpMicrokernelTester::OpType::Max);
26 }
27
28 TEST(F32_VMAX__NEON_X4, batch_div_4) {
29 TEST_REQUIRES_ARM_NEON;
30 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
31 VBinOpMicrokernelTester()
32 .batch_size(batch_size)
33 .Test(xnn_f32_vmax_ukernel__neon_x4, VBinOpMicrokernelTester::OpType::Max);
34 }
35 }
36
37 TEST(F32_VMAX__NEON_X4, batch_lt_4) {
38 TEST_REQUIRES_ARM_NEON;
39 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
40 VBinOpMicrokernelTester()
41 .batch_size(batch_size)
42 .Test(xnn_f32_vmax_ukernel__neon_x4, VBinOpMicrokernelTester::OpType::Max);
43 }
44 }
45
46 TEST(F32_VMAX__NEON_X4, batch_gt_4) {
47 TEST_REQUIRES_ARM_NEON;
48 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
49 VBinOpMicrokernelTester()
50 .batch_size(batch_size)
51 .Test(xnn_f32_vmax_ukernel__neon_x4, VBinOpMicrokernelTester::OpType::Max);
52 }
53 }
54
55 TEST(F32_VMAX__NEON_X4, inplace_a) {
56 TEST_REQUIRES_ARM_NEON;
57 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
58 VBinOpMicrokernelTester()
59 .batch_size(batch_size)
60 .inplace_a(true)
61 .Test(xnn_f32_vmax_ukernel__neon_x4, VBinOpMicrokernelTester::OpType::Max);
62 }
63 }
64
65 TEST(F32_VMAX__NEON_X4, inplace_b) {
66 TEST_REQUIRES_ARM_NEON;
67 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
68 VBinOpMicrokernelTester()
69 .batch_size(batch_size)
70 .inplace_b(true)
71 .Test(xnn_f32_vmax_ukernel__neon_x4, VBinOpMicrokernelTester::OpType::Max);
72 }
73 }
74
75 TEST(F32_VMAX__NEON_X4, inplace_a_and_b) {
76 TEST_REQUIRES_ARM_NEON;
77 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
78 VBinOpMicrokernelTester()
79 .batch_size(batch_size)
80 .inplace_a(true)
81 .inplace_b(true)
82 .Test(xnn_f32_vmax_ukernel__neon_x4, VBinOpMicrokernelTester::OpType::Max);
83 }
84 }
Marat Dukhan403b7d42019-12-05 12:49:11 -080085#endif // XNN_ARCH_ARM || XNN_ARCH_ARM64
86
87
88#if XNN_ARCH_ARM || XNN_ARCH_ARM64
89 TEST(F32_VMAX__NEON_X8, batch_eq_8) {
90 TEST_REQUIRES_ARM_NEON;
91 VBinOpMicrokernelTester()
92 .batch_size(8)
93 .Test(xnn_f32_vmax_ukernel__neon_x8, VBinOpMicrokernelTester::OpType::Max);
94 }
95
96 TEST(F32_VMAX__NEON_X8, batch_div_8) {
97 TEST_REQUIRES_ARM_NEON;
98 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
99 VBinOpMicrokernelTester()
100 .batch_size(batch_size)
101 .Test(xnn_f32_vmax_ukernel__neon_x8, VBinOpMicrokernelTester::OpType::Max);
102 }
103 }
104
105 TEST(F32_VMAX__NEON_X8, batch_lt_8) {
106 TEST_REQUIRES_ARM_NEON;
107 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
108 VBinOpMicrokernelTester()
109 .batch_size(batch_size)
110 .Test(xnn_f32_vmax_ukernel__neon_x8, VBinOpMicrokernelTester::OpType::Max);
111 }
112 }
113
114 TEST(F32_VMAX__NEON_X8, batch_gt_8) {
115 TEST_REQUIRES_ARM_NEON;
116 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
117 VBinOpMicrokernelTester()
118 .batch_size(batch_size)
119 .Test(xnn_f32_vmax_ukernel__neon_x8, VBinOpMicrokernelTester::OpType::Max);
120 }
121 }
122
123 TEST(F32_VMAX__NEON_X8, inplace_a) {
124 TEST_REQUIRES_ARM_NEON;
125 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
126 VBinOpMicrokernelTester()
127 .batch_size(batch_size)
128 .inplace_a(true)
129 .Test(xnn_f32_vmax_ukernel__neon_x8, VBinOpMicrokernelTester::OpType::Max);
130 }
131 }
132
133 TEST(F32_VMAX__NEON_X8, inplace_b) {
134 TEST_REQUIRES_ARM_NEON;
135 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
136 VBinOpMicrokernelTester()
137 .batch_size(batch_size)
138 .inplace_b(true)
139 .Test(xnn_f32_vmax_ukernel__neon_x8, VBinOpMicrokernelTester::OpType::Max);
140 }
141 }
142
143 TEST(F32_VMAX__NEON_X8, inplace_a_and_b) {
144 TEST_REQUIRES_ARM_NEON;
145 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
146 VBinOpMicrokernelTester()
147 .batch_size(batch_size)
148 .inplace_a(true)
149 .inplace_b(true)
150 .Test(xnn_f32_vmax_ukernel__neon_x8, VBinOpMicrokernelTester::OpType::Max);
151 }
152 }
Marat Dukhan403b7d42019-12-05 12:49:11 -0800153#endif // XNN_ARCH_ARM || XNN_ARCH_ARM64
154
155
156#if XNN_ARCH_X86 || XNN_ARCH_X86_64
157 TEST(F32_VMAX__SSE_X4, batch_eq_4) {
158 TEST_REQUIRES_X86_SSE;
159 VBinOpMicrokernelTester()
160 .batch_size(4)
161 .Test(xnn_f32_vmax_ukernel__sse_x4, VBinOpMicrokernelTester::OpType::Max);
162 }
163
164 TEST(F32_VMAX__SSE_X4, batch_div_4) {
165 TEST_REQUIRES_X86_SSE;
166 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
167 VBinOpMicrokernelTester()
168 .batch_size(batch_size)
169 .Test(xnn_f32_vmax_ukernel__sse_x4, VBinOpMicrokernelTester::OpType::Max);
170 }
171 }
172
173 TEST(F32_VMAX__SSE_X4, batch_lt_4) {
174 TEST_REQUIRES_X86_SSE;
175 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
176 VBinOpMicrokernelTester()
177 .batch_size(batch_size)
178 .Test(xnn_f32_vmax_ukernel__sse_x4, VBinOpMicrokernelTester::OpType::Max);
179 }
180 }
181
182 TEST(F32_VMAX__SSE_X4, batch_gt_4) {
183 TEST_REQUIRES_X86_SSE;
184 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
185 VBinOpMicrokernelTester()
186 .batch_size(batch_size)
187 .Test(xnn_f32_vmax_ukernel__sse_x4, VBinOpMicrokernelTester::OpType::Max);
188 }
189 }
190
191 TEST(F32_VMAX__SSE_X4, inplace_a) {
192 TEST_REQUIRES_X86_SSE;
193 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
194 VBinOpMicrokernelTester()
195 .batch_size(batch_size)
196 .inplace_a(true)
197 .Test(xnn_f32_vmax_ukernel__sse_x4, VBinOpMicrokernelTester::OpType::Max);
198 }
199 }
200
201 TEST(F32_VMAX__SSE_X4, inplace_b) {
202 TEST_REQUIRES_X86_SSE;
203 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
204 VBinOpMicrokernelTester()
205 .batch_size(batch_size)
206 .inplace_b(true)
207 .Test(xnn_f32_vmax_ukernel__sse_x4, VBinOpMicrokernelTester::OpType::Max);
208 }
209 }
210
211 TEST(F32_VMAX__SSE_X4, inplace_a_and_b) {
212 TEST_REQUIRES_X86_SSE;
213 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
214 VBinOpMicrokernelTester()
215 .batch_size(batch_size)
216 .inplace_a(true)
217 .inplace_b(true)
218 .Test(xnn_f32_vmax_ukernel__sse_x4, VBinOpMicrokernelTester::OpType::Max);
219 }
220 }
Marat Dukhan403b7d42019-12-05 12:49:11 -0800221#endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
222
223
224#if XNN_ARCH_X86 || XNN_ARCH_X86_64
225 TEST(F32_VMAX__SSE_X8, batch_eq_8) {
226 TEST_REQUIRES_X86_SSE;
227 VBinOpMicrokernelTester()
228 .batch_size(8)
229 .Test(xnn_f32_vmax_ukernel__sse_x8, VBinOpMicrokernelTester::OpType::Max);
230 }
231
232 TEST(F32_VMAX__SSE_X8, batch_div_8) {
233 TEST_REQUIRES_X86_SSE;
234 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
235 VBinOpMicrokernelTester()
236 .batch_size(batch_size)
237 .Test(xnn_f32_vmax_ukernel__sse_x8, VBinOpMicrokernelTester::OpType::Max);
238 }
239 }
240
241 TEST(F32_VMAX__SSE_X8, batch_lt_8) {
242 TEST_REQUIRES_X86_SSE;
243 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
244 VBinOpMicrokernelTester()
245 .batch_size(batch_size)
246 .Test(xnn_f32_vmax_ukernel__sse_x8, VBinOpMicrokernelTester::OpType::Max);
247 }
248 }
249
250 TEST(F32_VMAX__SSE_X8, batch_gt_8) {
251 TEST_REQUIRES_X86_SSE;
252 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
253 VBinOpMicrokernelTester()
254 .batch_size(batch_size)
255 .Test(xnn_f32_vmax_ukernel__sse_x8, VBinOpMicrokernelTester::OpType::Max);
256 }
257 }
258
259 TEST(F32_VMAX__SSE_X8, inplace_a) {
260 TEST_REQUIRES_X86_SSE;
261 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
262 VBinOpMicrokernelTester()
263 .batch_size(batch_size)
264 .inplace_a(true)
265 .Test(xnn_f32_vmax_ukernel__sse_x8, VBinOpMicrokernelTester::OpType::Max);
266 }
267 }
268
269 TEST(F32_VMAX__SSE_X8, inplace_b) {
270 TEST_REQUIRES_X86_SSE;
271 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
272 VBinOpMicrokernelTester()
273 .batch_size(batch_size)
274 .inplace_b(true)
275 .Test(xnn_f32_vmax_ukernel__sse_x8, VBinOpMicrokernelTester::OpType::Max);
276 }
277 }
278
279 TEST(F32_VMAX__SSE_X8, inplace_a_and_b) {
280 TEST_REQUIRES_X86_SSE;
281 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
282 VBinOpMicrokernelTester()
283 .batch_size(batch_size)
284 .inplace_a(true)
285 .inplace_b(true)
286 .Test(xnn_f32_vmax_ukernel__sse_x8, VBinOpMicrokernelTester::OpType::Max);
287 }
288 }
Marat Dukhan403b7d42019-12-05 12:49:11 -0800289#endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
290
291
Marat Dukhan9a88efe2019-12-10 15:54:24 -0800292#if XNN_ARCH_X86 || XNN_ARCH_X86_64
293 TEST(F32_VMAX__AVX_X8, batch_eq_8) {
294 TEST_REQUIRES_X86_AVX;
295 VBinOpMicrokernelTester()
296 .batch_size(8)
297 .Test(xnn_f32_vmax_ukernel__avx_x8, VBinOpMicrokernelTester::OpType::Max);
298 }
299
300 TEST(F32_VMAX__AVX_X8, batch_div_8) {
301 TEST_REQUIRES_X86_AVX;
302 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
303 VBinOpMicrokernelTester()
304 .batch_size(batch_size)
305 .Test(xnn_f32_vmax_ukernel__avx_x8, VBinOpMicrokernelTester::OpType::Max);
306 }
307 }
308
309 TEST(F32_VMAX__AVX_X8, batch_lt_8) {
310 TEST_REQUIRES_X86_AVX;
311 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
312 VBinOpMicrokernelTester()
313 .batch_size(batch_size)
314 .Test(xnn_f32_vmax_ukernel__avx_x8, VBinOpMicrokernelTester::OpType::Max);
315 }
316 }
317
318 TEST(F32_VMAX__AVX_X8, batch_gt_8) {
319 TEST_REQUIRES_X86_AVX;
320 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
321 VBinOpMicrokernelTester()
322 .batch_size(batch_size)
323 .Test(xnn_f32_vmax_ukernel__avx_x8, VBinOpMicrokernelTester::OpType::Max);
324 }
325 }
326
327 TEST(F32_VMAX__AVX_X8, inplace_a) {
328 TEST_REQUIRES_X86_AVX;
329 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
330 VBinOpMicrokernelTester()
331 .batch_size(batch_size)
332 .inplace_a(true)
333 .Test(xnn_f32_vmax_ukernel__avx_x8, VBinOpMicrokernelTester::OpType::Max);
334 }
335 }
336
337 TEST(F32_VMAX__AVX_X8, inplace_b) {
338 TEST_REQUIRES_X86_AVX;
339 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
340 VBinOpMicrokernelTester()
341 .batch_size(batch_size)
342 .inplace_b(true)
343 .Test(xnn_f32_vmax_ukernel__avx_x8, VBinOpMicrokernelTester::OpType::Max);
344 }
345 }
346
347 TEST(F32_VMAX__AVX_X8, inplace_a_and_b) {
348 TEST_REQUIRES_X86_AVX;
349 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
350 VBinOpMicrokernelTester()
351 .batch_size(batch_size)
352 .inplace_a(true)
353 .inplace_b(true)
354 .Test(xnn_f32_vmax_ukernel__avx_x8, VBinOpMicrokernelTester::OpType::Max);
355 }
356 }
Marat Dukhan9a88efe2019-12-10 15:54:24 -0800357#endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
358
359
360#if XNN_ARCH_X86 || XNN_ARCH_X86_64
361 TEST(F32_VMAX__AVX_X16, batch_eq_16) {
362 TEST_REQUIRES_X86_AVX;
363 VBinOpMicrokernelTester()
364 .batch_size(16)
365 .Test(xnn_f32_vmax_ukernel__avx_x16, VBinOpMicrokernelTester::OpType::Max);
366 }
367
368 TEST(F32_VMAX__AVX_X16, batch_div_16) {
369 TEST_REQUIRES_X86_AVX;
370 for (size_t batch_size = 32; batch_size < 160; batch_size += 16) {
371 VBinOpMicrokernelTester()
372 .batch_size(batch_size)
373 .Test(xnn_f32_vmax_ukernel__avx_x16, VBinOpMicrokernelTester::OpType::Max);
374 }
375 }
376
377 TEST(F32_VMAX__AVX_X16, batch_lt_16) {
378 TEST_REQUIRES_X86_AVX;
379 for (size_t batch_size = 1; batch_size < 16; batch_size++) {
380 VBinOpMicrokernelTester()
381 .batch_size(batch_size)
382 .Test(xnn_f32_vmax_ukernel__avx_x16, VBinOpMicrokernelTester::OpType::Max);
383 }
384 }
385
386 TEST(F32_VMAX__AVX_X16, batch_gt_16) {
387 TEST_REQUIRES_X86_AVX;
388 for (size_t batch_size = 17; batch_size < 32; batch_size++) {
389 VBinOpMicrokernelTester()
390 .batch_size(batch_size)
391 .Test(xnn_f32_vmax_ukernel__avx_x16, VBinOpMicrokernelTester::OpType::Max);
392 }
393 }
394
395 TEST(F32_VMAX__AVX_X16, inplace_a) {
396 TEST_REQUIRES_X86_AVX;
397 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
398 VBinOpMicrokernelTester()
399 .batch_size(batch_size)
400 .inplace_a(true)
401 .Test(xnn_f32_vmax_ukernel__avx_x16, VBinOpMicrokernelTester::OpType::Max);
402 }
403 }
404
405 TEST(F32_VMAX__AVX_X16, inplace_b) {
406 TEST_REQUIRES_X86_AVX;
407 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
408 VBinOpMicrokernelTester()
409 .batch_size(batch_size)
410 .inplace_b(true)
411 .Test(xnn_f32_vmax_ukernel__avx_x16, VBinOpMicrokernelTester::OpType::Max);
412 }
413 }
414
415 TEST(F32_VMAX__AVX_X16, inplace_a_and_b) {
416 TEST_REQUIRES_X86_AVX;
417 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
418 VBinOpMicrokernelTester()
419 .batch_size(batch_size)
420 .inplace_a(true)
421 .inplace_b(true)
422 .Test(xnn_f32_vmax_ukernel__avx_x16, VBinOpMicrokernelTester::OpType::Max);
423 }
424 }
Marat Dukhan9a88efe2019-12-10 15:54:24 -0800425#endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
426
427
428#if XNN_ARCH_X86 || XNN_ARCH_X86_64
429 TEST(F32_VMAX__AVX512F_X16, batch_eq_16) {
430 TEST_REQUIRES_X86_AVX512F;
431 VBinOpMicrokernelTester()
432 .batch_size(16)
433 .Test(xnn_f32_vmax_ukernel__avx512f_x16, VBinOpMicrokernelTester::OpType::Max);
434 }
435
436 TEST(F32_VMAX__AVX512F_X16, batch_div_16) {
437 TEST_REQUIRES_X86_AVX512F;
438 for (size_t batch_size = 32; batch_size < 160; batch_size += 16) {
439 VBinOpMicrokernelTester()
440 .batch_size(batch_size)
441 .Test(xnn_f32_vmax_ukernel__avx512f_x16, VBinOpMicrokernelTester::OpType::Max);
442 }
443 }
444
445 TEST(F32_VMAX__AVX512F_X16, batch_lt_16) {
446 TEST_REQUIRES_X86_AVX512F;
447 for (size_t batch_size = 1; batch_size < 16; batch_size++) {
448 VBinOpMicrokernelTester()
449 .batch_size(batch_size)
450 .Test(xnn_f32_vmax_ukernel__avx512f_x16, VBinOpMicrokernelTester::OpType::Max);
451 }
452 }
453
454 TEST(F32_VMAX__AVX512F_X16, batch_gt_16) {
455 TEST_REQUIRES_X86_AVX512F;
456 for (size_t batch_size = 17; batch_size < 32; batch_size++) {
457 VBinOpMicrokernelTester()
458 .batch_size(batch_size)
459 .Test(xnn_f32_vmax_ukernel__avx512f_x16, VBinOpMicrokernelTester::OpType::Max);
460 }
461 }
462
463 TEST(F32_VMAX__AVX512F_X16, inplace_a) {
464 TEST_REQUIRES_X86_AVX512F;
465 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
466 VBinOpMicrokernelTester()
467 .batch_size(batch_size)
468 .inplace_a(true)
469 .Test(xnn_f32_vmax_ukernel__avx512f_x16, VBinOpMicrokernelTester::OpType::Max);
470 }
471 }
472
473 TEST(F32_VMAX__AVX512F_X16, inplace_b) {
474 TEST_REQUIRES_X86_AVX512F;
475 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
476 VBinOpMicrokernelTester()
477 .batch_size(batch_size)
478 .inplace_b(true)
479 .Test(xnn_f32_vmax_ukernel__avx512f_x16, VBinOpMicrokernelTester::OpType::Max);
480 }
481 }
482
483 TEST(F32_VMAX__AVX512F_X16, inplace_a_and_b) {
484 TEST_REQUIRES_X86_AVX512F;
485 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
486 VBinOpMicrokernelTester()
487 .batch_size(batch_size)
488 .inplace_a(true)
489 .inplace_b(true)
490 .Test(xnn_f32_vmax_ukernel__avx512f_x16, VBinOpMicrokernelTester::OpType::Max);
491 }
492 }
Marat Dukhan9a88efe2019-12-10 15:54:24 -0800493#endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
494
495
496#if XNN_ARCH_X86 || XNN_ARCH_X86_64
497 TEST(F32_VMAX__AVX512F_X32, batch_eq_32) {
498 TEST_REQUIRES_X86_AVX512F;
499 VBinOpMicrokernelTester()
500 .batch_size(32)
501 .Test(xnn_f32_vmax_ukernel__avx512f_x32, VBinOpMicrokernelTester::OpType::Max);
502 }
503
504 TEST(F32_VMAX__AVX512F_X32, batch_div_32) {
505 TEST_REQUIRES_X86_AVX512F;
506 for (size_t batch_size = 64; batch_size < 320; batch_size += 32) {
507 VBinOpMicrokernelTester()
508 .batch_size(batch_size)
509 .Test(xnn_f32_vmax_ukernel__avx512f_x32, VBinOpMicrokernelTester::OpType::Max);
510 }
511 }
512
513 TEST(F32_VMAX__AVX512F_X32, batch_lt_32) {
514 TEST_REQUIRES_X86_AVX512F;
515 for (size_t batch_size = 1; batch_size < 32; batch_size++) {
516 VBinOpMicrokernelTester()
517 .batch_size(batch_size)
518 .Test(xnn_f32_vmax_ukernel__avx512f_x32, VBinOpMicrokernelTester::OpType::Max);
519 }
520 }
521
522 TEST(F32_VMAX__AVX512F_X32, batch_gt_32) {
523 TEST_REQUIRES_X86_AVX512F;
524 for (size_t batch_size = 33; batch_size < 64; batch_size++) {
525 VBinOpMicrokernelTester()
526 .batch_size(batch_size)
527 .Test(xnn_f32_vmax_ukernel__avx512f_x32, VBinOpMicrokernelTester::OpType::Max);
528 }
529 }
530
531 TEST(F32_VMAX__AVX512F_X32, inplace_a) {
532 TEST_REQUIRES_X86_AVX512F;
533 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
534 VBinOpMicrokernelTester()
535 .batch_size(batch_size)
536 .inplace_a(true)
537 .Test(xnn_f32_vmax_ukernel__avx512f_x32, VBinOpMicrokernelTester::OpType::Max);
538 }
539 }
540
541 TEST(F32_VMAX__AVX512F_X32, inplace_b) {
542 TEST_REQUIRES_X86_AVX512F;
543 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
544 VBinOpMicrokernelTester()
545 .batch_size(batch_size)
546 .inplace_b(true)
547 .Test(xnn_f32_vmax_ukernel__avx512f_x32, VBinOpMicrokernelTester::OpType::Max);
548 }
549 }
550
551 TEST(F32_VMAX__AVX512F_X32, inplace_a_and_b) {
552 TEST_REQUIRES_X86_AVX512F;
553 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
554 VBinOpMicrokernelTester()
555 .batch_size(batch_size)
556 .inplace_a(true)
557 .inplace_b(true)
558 .Test(xnn_f32_vmax_ukernel__avx512f_x32, VBinOpMicrokernelTester::OpType::Max);
559 }
560 }
Marat Dukhan9a88efe2019-12-10 15:54:24 -0800561#endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
562
563
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700564#if XNN_ARCH_WASMSIMD
565 TEST(F32_VMAX__WASMSIMD_ARM_X4, batch_eq_4) {
566 VBinOpMicrokernelTester()
567 .batch_size(4)
Marat Dukhan47387d62020-06-29 12:53:20 -0700568 .Test(xnn_f32_vmax_ukernel__wasmsimd_arm_x4, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700569 }
570
571 TEST(F32_VMAX__WASMSIMD_ARM_X4, batch_div_4) {
572 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
573 VBinOpMicrokernelTester()
574 .batch_size(batch_size)
Marat Dukhan47387d62020-06-29 12:53:20 -0700575 .Test(xnn_f32_vmax_ukernel__wasmsimd_arm_x4, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700576 }
577 }
578
579 TEST(F32_VMAX__WASMSIMD_ARM_X4, batch_lt_4) {
580 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
581 VBinOpMicrokernelTester()
582 .batch_size(batch_size)
Marat Dukhan47387d62020-06-29 12:53:20 -0700583 .Test(xnn_f32_vmax_ukernel__wasmsimd_arm_x4, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700584 }
585 }
586
587 TEST(F32_VMAX__WASMSIMD_ARM_X4, batch_gt_4) {
588 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
589 VBinOpMicrokernelTester()
590 .batch_size(batch_size)
Marat Dukhan47387d62020-06-29 12:53:20 -0700591 .Test(xnn_f32_vmax_ukernel__wasmsimd_arm_x4, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700592 }
593 }
594
595 TEST(F32_VMAX__WASMSIMD_ARM_X4, inplace_a) {
596 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
597 VBinOpMicrokernelTester()
598 .batch_size(batch_size)
599 .inplace_a(true)
Marat Dukhan47387d62020-06-29 12:53:20 -0700600 .Test(xnn_f32_vmax_ukernel__wasmsimd_arm_x4, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700601 }
602 }
603
604 TEST(F32_VMAX__WASMSIMD_ARM_X4, inplace_b) {
605 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
606 VBinOpMicrokernelTester()
607 .batch_size(batch_size)
608 .inplace_b(true)
Marat Dukhan47387d62020-06-29 12:53:20 -0700609 .Test(xnn_f32_vmax_ukernel__wasmsimd_arm_x4, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700610 }
611 }
612
613 TEST(F32_VMAX__WASMSIMD_ARM_X4, inplace_a_and_b) {
614 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
615 VBinOpMicrokernelTester()
616 .batch_size(batch_size)
617 .inplace_a(true)
618 .inplace_b(true)
Marat Dukhan47387d62020-06-29 12:53:20 -0700619 .Test(xnn_f32_vmax_ukernel__wasmsimd_arm_x4, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700620 }
621 }
622#endif // XNN_ARCH_WASMSIMD
623
624
625#if XNN_ARCH_WASMSIMD
626 TEST(F32_VMAX__WASMSIMD_ARM_X8, batch_eq_8) {
627 VBinOpMicrokernelTester()
628 .batch_size(8)
Marat Dukhan47387d62020-06-29 12:53:20 -0700629 .Test(xnn_f32_vmax_ukernel__wasmsimd_arm_x8, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700630 }
631
632 TEST(F32_VMAX__WASMSIMD_ARM_X8, batch_div_8) {
633 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
634 VBinOpMicrokernelTester()
635 .batch_size(batch_size)
Marat Dukhan47387d62020-06-29 12:53:20 -0700636 .Test(xnn_f32_vmax_ukernel__wasmsimd_arm_x8, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700637 }
638 }
639
640 TEST(F32_VMAX__WASMSIMD_ARM_X8, batch_lt_8) {
641 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
642 VBinOpMicrokernelTester()
643 .batch_size(batch_size)
Marat Dukhan47387d62020-06-29 12:53:20 -0700644 .Test(xnn_f32_vmax_ukernel__wasmsimd_arm_x8, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700645 }
646 }
647
648 TEST(F32_VMAX__WASMSIMD_ARM_X8, batch_gt_8) {
649 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
650 VBinOpMicrokernelTester()
651 .batch_size(batch_size)
Marat Dukhan47387d62020-06-29 12:53:20 -0700652 .Test(xnn_f32_vmax_ukernel__wasmsimd_arm_x8, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700653 }
654 }
655
656 TEST(F32_VMAX__WASMSIMD_ARM_X8, inplace_a) {
657 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
658 VBinOpMicrokernelTester()
659 .batch_size(batch_size)
660 .inplace_a(true)
Marat Dukhan47387d62020-06-29 12:53:20 -0700661 .Test(xnn_f32_vmax_ukernel__wasmsimd_arm_x8, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700662 }
663 }
664
665 TEST(F32_VMAX__WASMSIMD_ARM_X8, inplace_b) {
666 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
667 VBinOpMicrokernelTester()
668 .batch_size(batch_size)
669 .inplace_b(true)
Marat Dukhan47387d62020-06-29 12:53:20 -0700670 .Test(xnn_f32_vmax_ukernel__wasmsimd_arm_x8, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700671 }
672 }
673
674 TEST(F32_VMAX__WASMSIMD_ARM_X8, inplace_a_and_b) {
675 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
676 VBinOpMicrokernelTester()
677 .batch_size(batch_size)
678 .inplace_a(true)
679 .inplace_b(true)
Marat Dukhan47387d62020-06-29 12:53:20 -0700680 .Test(xnn_f32_vmax_ukernel__wasmsimd_arm_x8, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700681 }
682 }
683#endif // XNN_ARCH_WASMSIMD
684
685
686#if XNN_ARCH_WASMSIMD
687 TEST(F32_VMAX__WASMSIMD_X86_X4, batch_eq_4) {
688 VBinOpMicrokernelTester()
689 .batch_size(4)
Marat Dukhan47387d62020-06-29 12:53:20 -0700690 .Test(xnn_f32_vmax_ukernel__wasmsimd_x86_x4, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700691 }
692
693 TEST(F32_VMAX__WASMSIMD_X86_X4, batch_div_4) {
694 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
695 VBinOpMicrokernelTester()
696 .batch_size(batch_size)
Marat Dukhan47387d62020-06-29 12:53:20 -0700697 .Test(xnn_f32_vmax_ukernel__wasmsimd_x86_x4, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700698 }
699 }
700
701 TEST(F32_VMAX__WASMSIMD_X86_X4, batch_lt_4) {
702 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
703 VBinOpMicrokernelTester()
704 .batch_size(batch_size)
Marat Dukhan47387d62020-06-29 12:53:20 -0700705 .Test(xnn_f32_vmax_ukernel__wasmsimd_x86_x4, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700706 }
707 }
708
709 TEST(F32_VMAX__WASMSIMD_X86_X4, batch_gt_4) {
710 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
711 VBinOpMicrokernelTester()
712 .batch_size(batch_size)
Marat Dukhan47387d62020-06-29 12:53:20 -0700713 .Test(xnn_f32_vmax_ukernel__wasmsimd_x86_x4, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700714 }
715 }
716
717 TEST(F32_VMAX__WASMSIMD_X86_X4, inplace_a) {
718 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
719 VBinOpMicrokernelTester()
720 .batch_size(batch_size)
721 .inplace_a(true)
Marat Dukhan47387d62020-06-29 12:53:20 -0700722 .Test(xnn_f32_vmax_ukernel__wasmsimd_x86_x4, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700723 }
724 }
725
726 TEST(F32_VMAX__WASMSIMD_X86_X4, inplace_b) {
727 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
728 VBinOpMicrokernelTester()
729 .batch_size(batch_size)
730 .inplace_b(true)
Marat Dukhan47387d62020-06-29 12:53:20 -0700731 .Test(xnn_f32_vmax_ukernel__wasmsimd_x86_x4, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700732 }
733 }
734
735 TEST(F32_VMAX__WASMSIMD_X86_X4, inplace_a_and_b) {
736 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
737 VBinOpMicrokernelTester()
738 .batch_size(batch_size)
739 .inplace_a(true)
740 .inplace_b(true)
Marat Dukhan47387d62020-06-29 12:53:20 -0700741 .Test(xnn_f32_vmax_ukernel__wasmsimd_x86_x4, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700742 }
743 }
744#endif // XNN_ARCH_WASMSIMD
745
746
747#if XNN_ARCH_WASMSIMD
748 TEST(F32_VMAX__WASMSIMD_X86_X8, batch_eq_8) {
749 VBinOpMicrokernelTester()
750 .batch_size(8)
Marat Dukhan47387d62020-06-29 12:53:20 -0700751 .Test(xnn_f32_vmax_ukernel__wasmsimd_x86_x8, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700752 }
753
754 TEST(F32_VMAX__WASMSIMD_X86_X8, batch_div_8) {
755 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
756 VBinOpMicrokernelTester()
757 .batch_size(batch_size)
Marat Dukhan47387d62020-06-29 12:53:20 -0700758 .Test(xnn_f32_vmax_ukernel__wasmsimd_x86_x8, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700759 }
760 }
761
762 TEST(F32_VMAX__WASMSIMD_X86_X8, batch_lt_8) {
763 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
764 VBinOpMicrokernelTester()
765 .batch_size(batch_size)
Marat Dukhan47387d62020-06-29 12:53:20 -0700766 .Test(xnn_f32_vmax_ukernel__wasmsimd_x86_x8, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700767 }
768 }
769
770 TEST(F32_VMAX__WASMSIMD_X86_X8, batch_gt_8) {
771 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
772 VBinOpMicrokernelTester()
773 .batch_size(batch_size)
Marat Dukhan47387d62020-06-29 12:53:20 -0700774 .Test(xnn_f32_vmax_ukernel__wasmsimd_x86_x8, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700775 }
776 }
777
778 TEST(F32_VMAX__WASMSIMD_X86_X8, inplace_a) {
779 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
780 VBinOpMicrokernelTester()
781 .batch_size(batch_size)
782 .inplace_a(true)
Marat Dukhan47387d62020-06-29 12:53:20 -0700783 .Test(xnn_f32_vmax_ukernel__wasmsimd_x86_x8, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700784 }
785 }
786
787 TEST(F32_VMAX__WASMSIMD_X86_X8, inplace_b) {
788 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
789 VBinOpMicrokernelTester()
790 .batch_size(batch_size)
791 .inplace_b(true)
Marat Dukhan47387d62020-06-29 12:53:20 -0700792 .Test(xnn_f32_vmax_ukernel__wasmsimd_x86_x8, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700793 }
794 }
795
796 TEST(F32_VMAX__WASMSIMD_X86_X8, inplace_a_and_b) {
797 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
798 VBinOpMicrokernelTester()
799 .batch_size(batch_size)
800 .inplace_a(true)
801 .inplace_b(true)
Marat Dukhan47387d62020-06-29 12:53:20 -0700802 .Test(xnn_f32_vmax_ukernel__wasmsimd_x86_x8, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan93d1ba12020-06-26 12:33:35 -0700803 }
804 }
805#endif // XNN_ARCH_WASMSIMD
806
807
Marat Dukhanfb5b20a2020-06-26 13:14:50 -0700808#if XNN_ARCH_WASM || XNN_ARCH_WASMSIMD
Marat Dukhan403b7d42019-12-05 12:49:11 -0800809 TEST(F32_VMAX__WASM_X1, batch_eq_1) {
810 VBinOpMicrokernelTester()
811 .batch_size(1)
Marat Dukhan47387d62020-06-29 12:53:20 -0700812 .Test(xnn_f32_vmax_ukernel__wasm_x1, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan403b7d42019-12-05 12:49:11 -0800813 }
814
815 TEST(F32_VMAX__WASM_X1, batch_gt_1) {
816 for (size_t batch_size = 2; batch_size < 10; batch_size++) {
817 VBinOpMicrokernelTester()
818 .batch_size(batch_size)
Marat Dukhan47387d62020-06-29 12:53:20 -0700819 .Test(xnn_f32_vmax_ukernel__wasm_x1, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan403b7d42019-12-05 12:49:11 -0800820 }
821 }
822
823 TEST(F32_VMAX__WASM_X1, inplace_a) {
824 for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) {
825 VBinOpMicrokernelTester()
826 .batch_size(batch_size)
827 .inplace_a(true)
Marat Dukhan47387d62020-06-29 12:53:20 -0700828 .Test(xnn_f32_vmax_ukernel__wasm_x1, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan403b7d42019-12-05 12:49:11 -0800829 }
830 }
831
832 TEST(F32_VMAX__WASM_X1, inplace_b) {
833 for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) {
834 VBinOpMicrokernelTester()
835 .batch_size(batch_size)
836 .inplace_b(true)
Marat Dukhan47387d62020-06-29 12:53:20 -0700837 .Test(xnn_f32_vmax_ukernel__wasm_x1, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan403b7d42019-12-05 12:49:11 -0800838 }
839 }
840
841 TEST(F32_VMAX__WASM_X1, inplace_a_and_b) {
842 for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) {
843 VBinOpMicrokernelTester()
844 .batch_size(batch_size)
845 .inplace_a(true)
846 .inplace_b(true)
Marat Dukhan47387d62020-06-29 12:53:20 -0700847 .Test(xnn_f32_vmax_ukernel__wasm_x1, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan403b7d42019-12-05 12:49:11 -0800848 }
849 }
Marat Dukhanfb5b20a2020-06-26 13:14:50 -0700850#endif // XNN_ARCH_WASM || XNN_ARCH_WASMSIMD
Marat Dukhan403b7d42019-12-05 12:49:11 -0800851
852
Marat Dukhanfb5b20a2020-06-26 13:14:50 -0700853#if XNN_ARCH_WASM || XNN_ARCH_WASMSIMD
Marat Dukhan403b7d42019-12-05 12:49:11 -0800854 TEST(F32_VMAX__WASM_X2, batch_eq_2) {
855 VBinOpMicrokernelTester()
856 .batch_size(2)
Marat Dukhan47387d62020-06-29 12:53:20 -0700857 .Test(xnn_f32_vmax_ukernel__wasm_x2, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan403b7d42019-12-05 12:49:11 -0800858 }
859
860 TEST(F32_VMAX__WASM_X2, batch_div_2) {
861 for (size_t batch_size = 4; batch_size < 20; batch_size += 2) {
862 VBinOpMicrokernelTester()
863 .batch_size(batch_size)
Marat Dukhan47387d62020-06-29 12:53:20 -0700864 .Test(xnn_f32_vmax_ukernel__wasm_x2, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan403b7d42019-12-05 12:49:11 -0800865 }
866 }
867
868 TEST(F32_VMAX__WASM_X2, batch_lt_2) {
869 for (size_t batch_size = 1; batch_size < 2; batch_size++) {
870 VBinOpMicrokernelTester()
871 .batch_size(batch_size)
Marat Dukhan47387d62020-06-29 12:53:20 -0700872 .Test(xnn_f32_vmax_ukernel__wasm_x2, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan403b7d42019-12-05 12:49:11 -0800873 }
874 }
875
876 TEST(F32_VMAX__WASM_X2, batch_gt_2) {
877 for (size_t batch_size = 3; batch_size < 4; batch_size++) {
878 VBinOpMicrokernelTester()
879 .batch_size(batch_size)
Marat Dukhan47387d62020-06-29 12:53:20 -0700880 .Test(xnn_f32_vmax_ukernel__wasm_x2, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan403b7d42019-12-05 12:49:11 -0800881 }
882 }
883
884 TEST(F32_VMAX__WASM_X2, inplace_a) {
885 for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) {
886 VBinOpMicrokernelTester()
887 .batch_size(batch_size)
888 .inplace_a(true)
Marat Dukhan47387d62020-06-29 12:53:20 -0700889 .Test(xnn_f32_vmax_ukernel__wasm_x2, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan403b7d42019-12-05 12:49:11 -0800890 }
891 }
892
893 TEST(F32_VMAX__WASM_X2, inplace_b) {
894 for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) {
895 VBinOpMicrokernelTester()
896 .batch_size(batch_size)
897 .inplace_b(true)
Marat Dukhan47387d62020-06-29 12:53:20 -0700898 .Test(xnn_f32_vmax_ukernel__wasm_x2, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan403b7d42019-12-05 12:49:11 -0800899 }
900 }
901
902 TEST(F32_VMAX__WASM_X2, inplace_a_and_b) {
903 for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) {
904 VBinOpMicrokernelTester()
905 .batch_size(batch_size)
906 .inplace_a(true)
907 .inplace_b(true)
Marat Dukhan47387d62020-06-29 12:53:20 -0700908 .Test(xnn_f32_vmax_ukernel__wasm_x2, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan403b7d42019-12-05 12:49:11 -0800909 }
910 }
Marat Dukhanfb5b20a2020-06-26 13:14:50 -0700911#endif // XNN_ARCH_WASM || XNN_ARCH_WASMSIMD
Marat Dukhan403b7d42019-12-05 12:49:11 -0800912
913
Marat Dukhanfb5b20a2020-06-26 13:14:50 -0700914#if XNN_ARCH_WASM || XNN_ARCH_WASMSIMD
Marat Dukhan403b7d42019-12-05 12:49:11 -0800915 TEST(F32_VMAX__WASM_X4, batch_eq_4) {
916 VBinOpMicrokernelTester()
917 .batch_size(4)
Marat Dukhan47387d62020-06-29 12:53:20 -0700918 .Test(xnn_f32_vmax_ukernel__wasm_x4, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan403b7d42019-12-05 12:49:11 -0800919 }
920
921 TEST(F32_VMAX__WASM_X4, batch_div_4) {
922 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
923 VBinOpMicrokernelTester()
924 .batch_size(batch_size)
Marat Dukhan47387d62020-06-29 12:53:20 -0700925 .Test(xnn_f32_vmax_ukernel__wasm_x4, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan403b7d42019-12-05 12:49:11 -0800926 }
927 }
928
929 TEST(F32_VMAX__WASM_X4, batch_lt_4) {
930 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
931 VBinOpMicrokernelTester()
932 .batch_size(batch_size)
Marat Dukhan47387d62020-06-29 12:53:20 -0700933 .Test(xnn_f32_vmax_ukernel__wasm_x4, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan403b7d42019-12-05 12:49:11 -0800934 }
935 }
936
937 TEST(F32_VMAX__WASM_X4, batch_gt_4) {
938 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
939 VBinOpMicrokernelTester()
940 .batch_size(batch_size)
Marat Dukhan47387d62020-06-29 12:53:20 -0700941 .Test(xnn_f32_vmax_ukernel__wasm_x4, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan403b7d42019-12-05 12:49:11 -0800942 }
943 }
944
945 TEST(F32_VMAX__WASM_X4, inplace_a) {
946 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
947 VBinOpMicrokernelTester()
948 .batch_size(batch_size)
949 .inplace_a(true)
Marat Dukhan47387d62020-06-29 12:53:20 -0700950 .Test(xnn_f32_vmax_ukernel__wasm_x4, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan403b7d42019-12-05 12:49:11 -0800951 }
952 }
953
954 TEST(F32_VMAX__WASM_X4, inplace_b) {
955 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
956 VBinOpMicrokernelTester()
957 .batch_size(batch_size)
958 .inplace_b(true)
Marat Dukhan47387d62020-06-29 12:53:20 -0700959 .Test(xnn_f32_vmax_ukernel__wasm_x4, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan403b7d42019-12-05 12:49:11 -0800960 }
961 }
962
963 TEST(F32_VMAX__WASM_X4, inplace_a_and_b) {
964 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
965 VBinOpMicrokernelTester()
966 .batch_size(batch_size)
967 .inplace_a(true)
968 .inplace_b(true)
Marat Dukhan47387d62020-06-29 12:53:20 -0700969 .Test(xnn_f32_vmax_ukernel__wasm_x4, VBinOpMicrokernelTester::OpType::Max);
Marat Dukhan403b7d42019-12-05 12:49:11 -0800970 }
971 }
Marat Dukhanfb5b20a2020-06-26 13:14:50 -0700972#endif // XNN_ARCH_WASM || XNN_ARCH_WASMSIMD
Marat Dukhan403b7d42019-12-05 12:49:11 -0800973
974
975TEST(F32_VMAX__SCALAR_X1, batch_eq_1) {
976 VBinOpMicrokernelTester()
977 .batch_size(1)
978 .Test(xnn_f32_vmax_ukernel__scalar_x1, VBinOpMicrokernelTester::OpType::Max, VBinOpMicrokernelTester::Variant::Scalar);
979}
980
981TEST(F32_VMAX__SCALAR_X1, batch_gt_1) {
982 for (size_t batch_size = 2; batch_size < 10; batch_size++) {
983 VBinOpMicrokernelTester()
984 .batch_size(batch_size)
985 .Test(xnn_f32_vmax_ukernel__scalar_x1, VBinOpMicrokernelTester::OpType::Max, VBinOpMicrokernelTester::Variant::Scalar);
986 }
987}
988
989TEST(F32_VMAX__SCALAR_X1, inplace_a) {
990 for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) {
991 VBinOpMicrokernelTester()
992 .batch_size(batch_size)
993 .inplace_a(true)
994 .Test(xnn_f32_vmax_ukernel__scalar_x1, VBinOpMicrokernelTester::OpType::Max, VBinOpMicrokernelTester::Variant::Scalar);
995 }
996}
997
998TEST(F32_VMAX__SCALAR_X1, inplace_b) {
999 for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) {
1000 VBinOpMicrokernelTester()
1001 .batch_size(batch_size)
1002 .inplace_b(true)
1003 .Test(xnn_f32_vmax_ukernel__scalar_x1, VBinOpMicrokernelTester::OpType::Max, VBinOpMicrokernelTester::Variant::Scalar);
1004 }
1005}
1006
1007TEST(F32_VMAX__SCALAR_X1, inplace_a_and_b) {
1008 for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) {
1009 VBinOpMicrokernelTester()
1010 .batch_size(batch_size)
1011 .inplace_a(true)
1012 .inplace_b(true)
1013 .Test(xnn_f32_vmax_ukernel__scalar_x1, VBinOpMicrokernelTester::OpType::Max, VBinOpMicrokernelTester::Variant::Scalar);
1014 }
1015}
1016
Marat Dukhan403b7d42019-12-05 12:49:11 -08001017
1018TEST(F32_VMAX__SCALAR_X2, batch_eq_2) {
1019 VBinOpMicrokernelTester()
1020 .batch_size(2)
1021 .Test(xnn_f32_vmax_ukernel__scalar_x2, VBinOpMicrokernelTester::OpType::Max, VBinOpMicrokernelTester::Variant::Scalar);
1022}
1023
1024TEST(F32_VMAX__SCALAR_X2, batch_div_2) {
1025 for (size_t batch_size = 4; batch_size < 20; batch_size += 2) {
1026 VBinOpMicrokernelTester()
1027 .batch_size(batch_size)
1028 .Test(xnn_f32_vmax_ukernel__scalar_x2, VBinOpMicrokernelTester::OpType::Max, VBinOpMicrokernelTester::Variant::Scalar);
1029 }
1030}
1031
1032TEST(F32_VMAX__SCALAR_X2, batch_lt_2) {
1033 for (size_t batch_size = 1; batch_size < 2; batch_size++) {
1034 VBinOpMicrokernelTester()
1035 .batch_size(batch_size)
1036 .Test(xnn_f32_vmax_ukernel__scalar_x2, VBinOpMicrokernelTester::OpType::Max, VBinOpMicrokernelTester::Variant::Scalar);
1037 }
1038}
1039
1040TEST(F32_VMAX__SCALAR_X2, batch_gt_2) {
1041 for (size_t batch_size = 3; batch_size < 4; batch_size++) {
1042 VBinOpMicrokernelTester()
1043 .batch_size(batch_size)
1044 .Test(xnn_f32_vmax_ukernel__scalar_x2, VBinOpMicrokernelTester::OpType::Max, VBinOpMicrokernelTester::Variant::Scalar);
1045 }
1046}
1047
1048TEST(F32_VMAX__SCALAR_X2, inplace_a) {
1049 for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) {
1050 VBinOpMicrokernelTester()
1051 .batch_size(batch_size)
1052 .inplace_a(true)
1053 .Test(xnn_f32_vmax_ukernel__scalar_x2, VBinOpMicrokernelTester::OpType::Max, VBinOpMicrokernelTester::Variant::Scalar);
1054 }
1055}
1056
1057TEST(F32_VMAX__SCALAR_X2, inplace_b) {
1058 for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) {
1059 VBinOpMicrokernelTester()
1060 .batch_size(batch_size)
1061 .inplace_b(true)
1062 .Test(xnn_f32_vmax_ukernel__scalar_x2, VBinOpMicrokernelTester::OpType::Max, VBinOpMicrokernelTester::Variant::Scalar);
1063 }
1064}
1065
1066TEST(F32_VMAX__SCALAR_X2, inplace_a_and_b) {
1067 for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) {
1068 VBinOpMicrokernelTester()
1069 .batch_size(batch_size)
1070 .inplace_a(true)
1071 .inplace_b(true)
1072 .Test(xnn_f32_vmax_ukernel__scalar_x2, VBinOpMicrokernelTester::OpType::Max, VBinOpMicrokernelTester::Variant::Scalar);
1073 }
1074}
1075
Marat Dukhan403b7d42019-12-05 12:49:11 -08001076
1077TEST(F32_VMAX__SCALAR_X4, batch_eq_4) {
1078 VBinOpMicrokernelTester()
1079 .batch_size(4)
1080 .Test(xnn_f32_vmax_ukernel__scalar_x4, VBinOpMicrokernelTester::OpType::Max, VBinOpMicrokernelTester::Variant::Scalar);
1081}
1082
1083TEST(F32_VMAX__SCALAR_X4, batch_div_4) {
1084 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
1085 VBinOpMicrokernelTester()
1086 .batch_size(batch_size)
1087 .Test(xnn_f32_vmax_ukernel__scalar_x4, VBinOpMicrokernelTester::OpType::Max, VBinOpMicrokernelTester::Variant::Scalar);
1088 }
1089}
1090
1091TEST(F32_VMAX__SCALAR_X4, batch_lt_4) {
1092 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
1093 VBinOpMicrokernelTester()
1094 .batch_size(batch_size)
1095 .Test(xnn_f32_vmax_ukernel__scalar_x4, VBinOpMicrokernelTester::OpType::Max, VBinOpMicrokernelTester::Variant::Scalar);
1096 }
1097}
1098
1099TEST(F32_VMAX__SCALAR_X4, batch_gt_4) {
1100 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
1101 VBinOpMicrokernelTester()
1102 .batch_size(batch_size)
1103 .Test(xnn_f32_vmax_ukernel__scalar_x4, VBinOpMicrokernelTester::OpType::Max, VBinOpMicrokernelTester::Variant::Scalar);
1104 }
1105}
1106
1107TEST(F32_VMAX__SCALAR_X4, inplace_a) {
1108 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
1109 VBinOpMicrokernelTester()
1110 .batch_size(batch_size)
1111 .inplace_a(true)
1112 .Test(xnn_f32_vmax_ukernel__scalar_x4, VBinOpMicrokernelTester::OpType::Max, VBinOpMicrokernelTester::Variant::Scalar);
1113 }
1114}
1115
1116TEST(F32_VMAX__SCALAR_X4, inplace_b) {
1117 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
1118 VBinOpMicrokernelTester()
1119 .batch_size(batch_size)
1120 .inplace_b(true)
1121 .Test(xnn_f32_vmax_ukernel__scalar_x4, VBinOpMicrokernelTester::OpType::Max, VBinOpMicrokernelTester::Variant::Scalar);
1122 }
1123}
1124
1125TEST(F32_VMAX__SCALAR_X4, inplace_a_and_b) {
1126 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
1127 VBinOpMicrokernelTester()
1128 .batch_size(batch_size)
1129 .inplace_a(true)
1130 .inplace_b(true)
1131 .Test(xnn_f32_vmax_ukernel__scalar_x4, VBinOpMicrokernelTester::OpType::Max, VBinOpMicrokernelTester::Variant::Scalar);
1132 }
1133}