1 // 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-vrndne.yaml
8 // Generator: tools/generate-vunary-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/vunary.h>
17 #include "vunary-microkernel-tester.h"
18
19
20 #if XNN_ARCH_ARM || XNN_ARCH_ARM64
TEST(F32_VRNDNE__NEON_X4,batch_eq_4)21 TEST(F32_VRNDNE__NEON_X4, batch_eq_4) {
22 TEST_REQUIRES_ARM_NEON;
23 VUnOpMicrokernelTester()
24 .batch_size(4)
25 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__neon_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
26 }
27
TEST(F32_VRNDNE__NEON_X4,batch_div_4)28 TEST(F32_VRNDNE__NEON_X4, batch_div_4) {
29 TEST_REQUIRES_ARM_NEON;
30 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
31 VUnOpMicrokernelTester()
32 .batch_size(batch_size)
33 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__neon_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
34 }
35 }
36
TEST(F32_VRNDNE__NEON_X4,batch_lt_4)37 TEST(F32_VRNDNE__NEON_X4, batch_lt_4) {
38 TEST_REQUIRES_ARM_NEON;
39 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
40 VUnOpMicrokernelTester()
41 .batch_size(batch_size)
42 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__neon_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
43 }
44 }
45
TEST(F32_VRNDNE__NEON_X4,batch_gt_4)46 TEST(F32_VRNDNE__NEON_X4, batch_gt_4) {
47 TEST_REQUIRES_ARM_NEON;
48 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
49 VUnOpMicrokernelTester()
50 .batch_size(batch_size)
51 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__neon_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
52 }
53 }
54
TEST(F32_VRNDNE__NEON_X4,inplace)55 TEST(F32_VRNDNE__NEON_X4, inplace) {
56 TEST_REQUIRES_ARM_NEON;
57 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
58 VUnOpMicrokernelTester()
59 .batch_size(batch_size)
60 .inplace(true)
61 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__neon_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
62 }
63 }
64 #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64
65
66
67 #if XNN_ARCH_ARM || XNN_ARCH_ARM64
TEST(F32_VRNDNE__NEON_X8,batch_eq_8)68 TEST(F32_VRNDNE__NEON_X8, batch_eq_8) {
69 TEST_REQUIRES_ARM_NEON;
70 VUnOpMicrokernelTester()
71 .batch_size(8)
72 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__neon_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
73 }
74
TEST(F32_VRNDNE__NEON_X8,batch_div_8)75 TEST(F32_VRNDNE__NEON_X8, batch_div_8) {
76 TEST_REQUIRES_ARM_NEON;
77 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
78 VUnOpMicrokernelTester()
79 .batch_size(batch_size)
80 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__neon_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
81 }
82 }
83
TEST(F32_VRNDNE__NEON_X8,batch_lt_8)84 TEST(F32_VRNDNE__NEON_X8, batch_lt_8) {
85 TEST_REQUIRES_ARM_NEON;
86 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
87 VUnOpMicrokernelTester()
88 .batch_size(batch_size)
89 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__neon_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
90 }
91 }
92
TEST(F32_VRNDNE__NEON_X8,batch_gt_8)93 TEST(F32_VRNDNE__NEON_X8, batch_gt_8) {
94 TEST_REQUIRES_ARM_NEON;
95 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
96 VUnOpMicrokernelTester()
97 .batch_size(batch_size)
98 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__neon_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
99 }
100 }
101
TEST(F32_VRNDNE__NEON_X8,inplace)102 TEST(F32_VRNDNE__NEON_X8, inplace) {
103 TEST_REQUIRES_ARM_NEON;
104 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
105 VUnOpMicrokernelTester()
106 .batch_size(batch_size)
107 .inplace(true)
108 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__neon_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
109 }
110 }
111 #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64
112
113
114 #if XNN_ARCH_ARM || XNN_ARCH_ARM64
TEST(F32_VRNDNE__NEONV8_X4,batch_eq_4)115 TEST(F32_VRNDNE__NEONV8_X4, batch_eq_4) {
116 TEST_REQUIRES_ARM_NEON_V8;
117 VUnOpMicrokernelTester()
118 .batch_size(4)
119 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__neonv8_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
120 }
121
TEST(F32_VRNDNE__NEONV8_X4,batch_div_4)122 TEST(F32_VRNDNE__NEONV8_X4, batch_div_4) {
123 TEST_REQUIRES_ARM_NEON_V8;
124 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
125 VUnOpMicrokernelTester()
126 .batch_size(batch_size)
127 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__neonv8_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
128 }
129 }
130
TEST(F32_VRNDNE__NEONV8_X4,batch_lt_4)131 TEST(F32_VRNDNE__NEONV8_X4, batch_lt_4) {
132 TEST_REQUIRES_ARM_NEON_V8;
133 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
134 VUnOpMicrokernelTester()
135 .batch_size(batch_size)
136 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__neonv8_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
137 }
138 }
139
TEST(F32_VRNDNE__NEONV8_X4,batch_gt_4)140 TEST(F32_VRNDNE__NEONV8_X4, batch_gt_4) {
141 TEST_REQUIRES_ARM_NEON_V8;
142 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
143 VUnOpMicrokernelTester()
144 .batch_size(batch_size)
145 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__neonv8_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
146 }
147 }
148
TEST(F32_VRNDNE__NEONV8_X4,inplace)149 TEST(F32_VRNDNE__NEONV8_X4, inplace) {
150 TEST_REQUIRES_ARM_NEON_V8;
151 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
152 VUnOpMicrokernelTester()
153 .batch_size(batch_size)
154 .inplace(true)
155 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__neonv8_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
156 }
157 }
158 #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64
159
160
161 #if XNN_ARCH_ARM || XNN_ARCH_ARM64
TEST(F32_VRNDNE__NEONV8_X8,batch_eq_8)162 TEST(F32_VRNDNE__NEONV8_X8, batch_eq_8) {
163 TEST_REQUIRES_ARM_NEON_V8;
164 VUnOpMicrokernelTester()
165 .batch_size(8)
166 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__neonv8_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
167 }
168
TEST(F32_VRNDNE__NEONV8_X8,batch_div_8)169 TEST(F32_VRNDNE__NEONV8_X8, batch_div_8) {
170 TEST_REQUIRES_ARM_NEON_V8;
171 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
172 VUnOpMicrokernelTester()
173 .batch_size(batch_size)
174 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__neonv8_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
175 }
176 }
177
TEST(F32_VRNDNE__NEONV8_X8,batch_lt_8)178 TEST(F32_VRNDNE__NEONV8_X8, batch_lt_8) {
179 TEST_REQUIRES_ARM_NEON_V8;
180 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
181 VUnOpMicrokernelTester()
182 .batch_size(batch_size)
183 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__neonv8_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
184 }
185 }
186
TEST(F32_VRNDNE__NEONV8_X8,batch_gt_8)187 TEST(F32_VRNDNE__NEONV8_X8, batch_gt_8) {
188 TEST_REQUIRES_ARM_NEON_V8;
189 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
190 VUnOpMicrokernelTester()
191 .batch_size(batch_size)
192 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__neonv8_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
193 }
194 }
195
TEST(F32_VRNDNE__NEONV8_X8,inplace)196 TEST(F32_VRNDNE__NEONV8_X8, inplace) {
197 TEST_REQUIRES_ARM_NEON_V8;
198 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
199 VUnOpMicrokernelTester()
200 .batch_size(batch_size)
201 .inplace(true)
202 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__neonv8_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
203 }
204 }
205 #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64
206
207
208 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(F32_VRNDNE__SSE2_X4,batch_eq_4)209 TEST(F32_VRNDNE__SSE2_X4, batch_eq_4) {
210 TEST_REQUIRES_X86_SSE2;
211 VUnOpMicrokernelTester()
212 .batch_size(4)
213 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__sse2_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
214 }
215
TEST(F32_VRNDNE__SSE2_X4,batch_div_4)216 TEST(F32_VRNDNE__SSE2_X4, batch_div_4) {
217 TEST_REQUIRES_X86_SSE2;
218 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
219 VUnOpMicrokernelTester()
220 .batch_size(batch_size)
221 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__sse2_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
222 }
223 }
224
TEST(F32_VRNDNE__SSE2_X4,batch_lt_4)225 TEST(F32_VRNDNE__SSE2_X4, batch_lt_4) {
226 TEST_REQUIRES_X86_SSE2;
227 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
228 VUnOpMicrokernelTester()
229 .batch_size(batch_size)
230 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__sse2_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
231 }
232 }
233
TEST(F32_VRNDNE__SSE2_X4,batch_gt_4)234 TEST(F32_VRNDNE__SSE2_X4, batch_gt_4) {
235 TEST_REQUIRES_X86_SSE2;
236 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
237 VUnOpMicrokernelTester()
238 .batch_size(batch_size)
239 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__sse2_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
240 }
241 }
242
TEST(F32_VRNDNE__SSE2_X4,inplace)243 TEST(F32_VRNDNE__SSE2_X4, inplace) {
244 TEST_REQUIRES_X86_SSE2;
245 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
246 VUnOpMicrokernelTester()
247 .batch_size(batch_size)
248 .inplace(true)
249 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__sse2_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
250 }
251 }
252 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
253
254
255 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(F32_VRNDNE__SSE2_X8,batch_eq_8)256 TEST(F32_VRNDNE__SSE2_X8, batch_eq_8) {
257 TEST_REQUIRES_X86_SSE2;
258 VUnOpMicrokernelTester()
259 .batch_size(8)
260 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__sse2_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
261 }
262
TEST(F32_VRNDNE__SSE2_X8,batch_div_8)263 TEST(F32_VRNDNE__SSE2_X8, batch_div_8) {
264 TEST_REQUIRES_X86_SSE2;
265 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
266 VUnOpMicrokernelTester()
267 .batch_size(batch_size)
268 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__sse2_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
269 }
270 }
271
TEST(F32_VRNDNE__SSE2_X8,batch_lt_8)272 TEST(F32_VRNDNE__SSE2_X8, batch_lt_8) {
273 TEST_REQUIRES_X86_SSE2;
274 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
275 VUnOpMicrokernelTester()
276 .batch_size(batch_size)
277 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__sse2_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
278 }
279 }
280
TEST(F32_VRNDNE__SSE2_X8,batch_gt_8)281 TEST(F32_VRNDNE__SSE2_X8, batch_gt_8) {
282 TEST_REQUIRES_X86_SSE2;
283 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
284 VUnOpMicrokernelTester()
285 .batch_size(batch_size)
286 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__sse2_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
287 }
288 }
289
TEST(F32_VRNDNE__SSE2_X8,inplace)290 TEST(F32_VRNDNE__SSE2_X8, inplace) {
291 TEST_REQUIRES_X86_SSE2;
292 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
293 VUnOpMicrokernelTester()
294 .batch_size(batch_size)
295 .inplace(true)
296 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__sse2_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
297 }
298 }
299 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
300
301
302 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(F32_VRNDNE__SSE41_X4,batch_eq_4)303 TEST(F32_VRNDNE__SSE41_X4, batch_eq_4) {
304 TEST_REQUIRES_X86_SSE41;
305 VUnOpMicrokernelTester()
306 .batch_size(4)
307 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__sse41_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
308 }
309
TEST(F32_VRNDNE__SSE41_X4,batch_div_4)310 TEST(F32_VRNDNE__SSE41_X4, batch_div_4) {
311 TEST_REQUIRES_X86_SSE41;
312 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
313 VUnOpMicrokernelTester()
314 .batch_size(batch_size)
315 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__sse41_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
316 }
317 }
318
TEST(F32_VRNDNE__SSE41_X4,batch_lt_4)319 TEST(F32_VRNDNE__SSE41_X4, batch_lt_4) {
320 TEST_REQUIRES_X86_SSE41;
321 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
322 VUnOpMicrokernelTester()
323 .batch_size(batch_size)
324 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__sse41_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
325 }
326 }
327
TEST(F32_VRNDNE__SSE41_X4,batch_gt_4)328 TEST(F32_VRNDNE__SSE41_X4, batch_gt_4) {
329 TEST_REQUIRES_X86_SSE41;
330 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
331 VUnOpMicrokernelTester()
332 .batch_size(batch_size)
333 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__sse41_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
334 }
335 }
336
TEST(F32_VRNDNE__SSE41_X4,inplace)337 TEST(F32_VRNDNE__SSE41_X4, inplace) {
338 TEST_REQUIRES_X86_SSE41;
339 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
340 VUnOpMicrokernelTester()
341 .batch_size(batch_size)
342 .inplace(true)
343 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__sse41_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
344 }
345 }
346 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
347
348
349 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(F32_VRNDNE__SSE41_X8,batch_eq_8)350 TEST(F32_VRNDNE__SSE41_X8, batch_eq_8) {
351 TEST_REQUIRES_X86_SSE41;
352 VUnOpMicrokernelTester()
353 .batch_size(8)
354 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__sse41_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
355 }
356
TEST(F32_VRNDNE__SSE41_X8,batch_div_8)357 TEST(F32_VRNDNE__SSE41_X8, batch_div_8) {
358 TEST_REQUIRES_X86_SSE41;
359 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
360 VUnOpMicrokernelTester()
361 .batch_size(batch_size)
362 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__sse41_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
363 }
364 }
365
TEST(F32_VRNDNE__SSE41_X8,batch_lt_8)366 TEST(F32_VRNDNE__SSE41_X8, batch_lt_8) {
367 TEST_REQUIRES_X86_SSE41;
368 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
369 VUnOpMicrokernelTester()
370 .batch_size(batch_size)
371 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__sse41_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
372 }
373 }
374
TEST(F32_VRNDNE__SSE41_X8,batch_gt_8)375 TEST(F32_VRNDNE__SSE41_X8, batch_gt_8) {
376 TEST_REQUIRES_X86_SSE41;
377 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
378 VUnOpMicrokernelTester()
379 .batch_size(batch_size)
380 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__sse41_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
381 }
382 }
383
TEST(F32_VRNDNE__SSE41_X8,inplace)384 TEST(F32_VRNDNE__SSE41_X8, inplace) {
385 TEST_REQUIRES_X86_SSE41;
386 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
387 VUnOpMicrokernelTester()
388 .batch_size(batch_size)
389 .inplace(true)
390 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__sse41_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
391 }
392 }
393 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
394
395
396 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(F32_VRNDNE__AVX_X8,batch_eq_8)397 TEST(F32_VRNDNE__AVX_X8, batch_eq_8) {
398 TEST_REQUIRES_X86_AVX;
399 VUnOpMicrokernelTester()
400 .batch_size(8)
401 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__avx_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
402 }
403
TEST(F32_VRNDNE__AVX_X8,batch_div_8)404 TEST(F32_VRNDNE__AVX_X8, batch_div_8) {
405 TEST_REQUIRES_X86_AVX;
406 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
407 VUnOpMicrokernelTester()
408 .batch_size(batch_size)
409 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__avx_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
410 }
411 }
412
TEST(F32_VRNDNE__AVX_X8,batch_lt_8)413 TEST(F32_VRNDNE__AVX_X8, batch_lt_8) {
414 TEST_REQUIRES_X86_AVX;
415 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
416 VUnOpMicrokernelTester()
417 .batch_size(batch_size)
418 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__avx_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
419 }
420 }
421
TEST(F32_VRNDNE__AVX_X8,batch_gt_8)422 TEST(F32_VRNDNE__AVX_X8, batch_gt_8) {
423 TEST_REQUIRES_X86_AVX;
424 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
425 VUnOpMicrokernelTester()
426 .batch_size(batch_size)
427 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__avx_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
428 }
429 }
430
TEST(F32_VRNDNE__AVX_X8,inplace)431 TEST(F32_VRNDNE__AVX_X8, inplace) {
432 TEST_REQUIRES_X86_AVX;
433 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
434 VUnOpMicrokernelTester()
435 .batch_size(batch_size)
436 .inplace(true)
437 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__avx_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
438 }
439 }
440 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
441
442
443 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(F32_VRNDNE__AVX_X16,batch_eq_16)444 TEST(F32_VRNDNE__AVX_X16, batch_eq_16) {
445 TEST_REQUIRES_X86_AVX;
446 VUnOpMicrokernelTester()
447 .batch_size(16)
448 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__avx_x16), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
449 }
450
TEST(F32_VRNDNE__AVX_X16,batch_div_16)451 TEST(F32_VRNDNE__AVX_X16, batch_div_16) {
452 TEST_REQUIRES_X86_AVX;
453 for (size_t batch_size = 32; batch_size < 160; batch_size += 16) {
454 VUnOpMicrokernelTester()
455 .batch_size(batch_size)
456 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__avx_x16), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
457 }
458 }
459
TEST(F32_VRNDNE__AVX_X16,batch_lt_16)460 TEST(F32_VRNDNE__AVX_X16, batch_lt_16) {
461 TEST_REQUIRES_X86_AVX;
462 for (size_t batch_size = 1; batch_size < 16; batch_size++) {
463 VUnOpMicrokernelTester()
464 .batch_size(batch_size)
465 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__avx_x16), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
466 }
467 }
468
TEST(F32_VRNDNE__AVX_X16,batch_gt_16)469 TEST(F32_VRNDNE__AVX_X16, batch_gt_16) {
470 TEST_REQUIRES_X86_AVX;
471 for (size_t batch_size = 17; batch_size < 32; batch_size++) {
472 VUnOpMicrokernelTester()
473 .batch_size(batch_size)
474 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__avx_x16), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
475 }
476 }
477
TEST(F32_VRNDNE__AVX_X16,inplace)478 TEST(F32_VRNDNE__AVX_X16, inplace) {
479 TEST_REQUIRES_X86_AVX;
480 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
481 VUnOpMicrokernelTester()
482 .batch_size(batch_size)
483 .inplace(true)
484 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__avx_x16), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
485 }
486 }
487 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
488
489
490 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(F32_VRNDNE__AVX512F_X16,batch_eq_16)491 TEST(F32_VRNDNE__AVX512F_X16, batch_eq_16) {
492 TEST_REQUIRES_X86_AVX512F;
493 VUnOpMicrokernelTester()
494 .batch_size(16)
495 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__avx512f_x16), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
496 }
497
TEST(F32_VRNDNE__AVX512F_X16,batch_div_16)498 TEST(F32_VRNDNE__AVX512F_X16, batch_div_16) {
499 TEST_REQUIRES_X86_AVX512F;
500 for (size_t batch_size = 32; batch_size < 160; batch_size += 16) {
501 VUnOpMicrokernelTester()
502 .batch_size(batch_size)
503 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__avx512f_x16), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
504 }
505 }
506
TEST(F32_VRNDNE__AVX512F_X16,batch_lt_16)507 TEST(F32_VRNDNE__AVX512F_X16, batch_lt_16) {
508 TEST_REQUIRES_X86_AVX512F;
509 for (size_t batch_size = 1; batch_size < 16; batch_size++) {
510 VUnOpMicrokernelTester()
511 .batch_size(batch_size)
512 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__avx512f_x16), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
513 }
514 }
515
TEST(F32_VRNDNE__AVX512F_X16,batch_gt_16)516 TEST(F32_VRNDNE__AVX512F_X16, batch_gt_16) {
517 TEST_REQUIRES_X86_AVX512F;
518 for (size_t batch_size = 17; batch_size < 32; batch_size++) {
519 VUnOpMicrokernelTester()
520 .batch_size(batch_size)
521 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__avx512f_x16), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
522 }
523 }
524
TEST(F32_VRNDNE__AVX512F_X16,inplace)525 TEST(F32_VRNDNE__AVX512F_X16, inplace) {
526 TEST_REQUIRES_X86_AVX512F;
527 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
528 VUnOpMicrokernelTester()
529 .batch_size(batch_size)
530 .inplace(true)
531 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__avx512f_x16), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
532 }
533 }
534 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
535
536
537 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(F32_VRNDNE__AVX512F_X32,batch_eq_32)538 TEST(F32_VRNDNE__AVX512F_X32, batch_eq_32) {
539 TEST_REQUIRES_X86_AVX512F;
540 VUnOpMicrokernelTester()
541 .batch_size(32)
542 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__avx512f_x32), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
543 }
544
TEST(F32_VRNDNE__AVX512F_X32,batch_div_32)545 TEST(F32_VRNDNE__AVX512F_X32, batch_div_32) {
546 TEST_REQUIRES_X86_AVX512F;
547 for (size_t batch_size = 64; batch_size < 320; batch_size += 32) {
548 VUnOpMicrokernelTester()
549 .batch_size(batch_size)
550 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__avx512f_x32), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
551 }
552 }
553
TEST(F32_VRNDNE__AVX512F_X32,batch_lt_32)554 TEST(F32_VRNDNE__AVX512F_X32, batch_lt_32) {
555 TEST_REQUIRES_X86_AVX512F;
556 for (size_t batch_size = 1; batch_size < 32; batch_size++) {
557 VUnOpMicrokernelTester()
558 .batch_size(batch_size)
559 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__avx512f_x32), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
560 }
561 }
562
TEST(F32_VRNDNE__AVX512F_X32,batch_gt_32)563 TEST(F32_VRNDNE__AVX512F_X32, batch_gt_32) {
564 TEST_REQUIRES_X86_AVX512F;
565 for (size_t batch_size = 33; batch_size < 64; batch_size++) {
566 VUnOpMicrokernelTester()
567 .batch_size(batch_size)
568 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__avx512f_x32), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
569 }
570 }
571
TEST(F32_VRNDNE__AVX512F_X32,inplace)572 TEST(F32_VRNDNE__AVX512F_X32, inplace) {
573 TEST_REQUIRES_X86_AVX512F;
574 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
575 VUnOpMicrokernelTester()
576 .batch_size(batch_size)
577 .inplace(true)
578 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__avx512f_x32), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
579 }
580 }
581 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
582
583
584 #if XNN_ARCH_WASMSIMD
TEST(F32_VRNDNE__WASMSIMD_ADDSUB_X4,batch_eq_4)585 TEST(F32_VRNDNE__WASMSIMD_ADDSUB_X4, batch_eq_4) {
586 VUnOpMicrokernelTester()
587 .batch_size(4)
588 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__wasmsimd_addsub_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
589 }
590
TEST(F32_VRNDNE__WASMSIMD_ADDSUB_X4,batch_div_4)591 TEST(F32_VRNDNE__WASMSIMD_ADDSUB_X4, batch_div_4) {
592 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
593 VUnOpMicrokernelTester()
594 .batch_size(batch_size)
595 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__wasmsimd_addsub_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
596 }
597 }
598
TEST(F32_VRNDNE__WASMSIMD_ADDSUB_X4,batch_lt_4)599 TEST(F32_VRNDNE__WASMSIMD_ADDSUB_X4, batch_lt_4) {
600 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
601 VUnOpMicrokernelTester()
602 .batch_size(batch_size)
603 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__wasmsimd_addsub_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
604 }
605 }
606
TEST(F32_VRNDNE__WASMSIMD_ADDSUB_X4,batch_gt_4)607 TEST(F32_VRNDNE__WASMSIMD_ADDSUB_X4, batch_gt_4) {
608 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
609 VUnOpMicrokernelTester()
610 .batch_size(batch_size)
611 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__wasmsimd_addsub_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
612 }
613 }
614
TEST(F32_VRNDNE__WASMSIMD_ADDSUB_X4,inplace)615 TEST(F32_VRNDNE__WASMSIMD_ADDSUB_X4, inplace) {
616 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
617 VUnOpMicrokernelTester()
618 .batch_size(batch_size)
619 .inplace(true)
620 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__wasmsimd_addsub_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
621 }
622 }
623 #endif // XNN_ARCH_WASMSIMD
624
625
626 #if XNN_ARCH_WASMSIMD
TEST(F32_VRNDNE__WASMSIMD_ADDSUB_X8,batch_eq_8)627 TEST(F32_VRNDNE__WASMSIMD_ADDSUB_X8, batch_eq_8) {
628 VUnOpMicrokernelTester()
629 .batch_size(8)
630 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__wasmsimd_addsub_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
631 }
632
TEST(F32_VRNDNE__WASMSIMD_ADDSUB_X8,batch_div_8)633 TEST(F32_VRNDNE__WASMSIMD_ADDSUB_X8, batch_div_8) {
634 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
635 VUnOpMicrokernelTester()
636 .batch_size(batch_size)
637 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__wasmsimd_addsub_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
638 }
639 }
640
TEST(F32_VRNDNE__WASMSIMD_ADDSUB_X8,batch_lt_8)641 TEST(F32_VRNDNE__WASMSIMD_ADDSUB_X8, batch_lt_8) {
642 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
643 VUnOpMicrokernelTester()
644 .batch_size(batch_size)
645 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__wasmsimd_addsub_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
646 }
647 }
648
TEST(F32_VRNDNE__WASMSIMD_ADDSUB_X8,batch_gt_8)649 TEST(F32_VRNDNE__WASMSIMD_ADDSUB_X8, batch_gt_8) {
650 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
651 VUnOpMicrokernelTester()
652 .batch_size(batch_size)
653 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__wasmsimd_addsub_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
654 }
655 }
656
TEST(F32_VRNDNE__WASMSIMD_ADDSUB_X8,inplace)657 TEST(F32_VRNDNE__WASMSIMD_ADDSUB_X8, inplace) {
658 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
659 VUnOpMicrokernelTester()
660 .batch_size(batch_size)
661 .inplace(true)
662 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__wasmsimd_addsub_x8), VUnOpMicrokernelTester::OpType::RoundToNearestEven);
663 }
664 }
665 #endif // XNN_ARCH_WASMSIMD
666
667
TEST(F32_VRNDNE__SCALAR_LIBM_X1,batch_eq_1)668 TEST(F32_VRNDNE__SCALAR_LIBM_X1, batch_eq_1) {
669 VUnOpMicrokernelTester()
670 .batch_size(1)
671 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__scalar_libm_x1), VUnOpMicrokernelTester::OpType::RoundToNearestEven, VUnOpMicrokernelTester::Variant::Scalar);
672 }
673
TEST(F32_VRNDNE__SCALAR_LIBM_X1,batch_gt_1)674 TEST(F32_VRNDNE__SCALAR_LIBM_X1, batch_gt_1) {
675 for (size_t batch_size = 2; batch_size < 10; batch_size++) {
676 VUnOpMicrokernelTester()
677 .batch_size(batch_size)
678 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__scalar_libm_x1), VUnOpMicrokernelTester::OpType::RoundToNearestEven, VUnOpMicrokernelTester::Variant::Scalar);
679 }
680 }
681
TEST(F32_VRNDNE__SCALAR_LIBM_X1,inplace)682 TEST(F32_VRNDNE__SCALAR_LIBM_X1, inplace) {
683 for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) {
684 VUnOpMicrokernelTester()
685 .batch_size(batch_size)
686 .inplace(true)
687 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__scalar_libm_x1), VUnOpMicrokernelTester::OpType::RoundToNearestEven, VUnOpMicrokernelTester::Variant::Scalar);
688 }
689 }
690
691
TEST(F32_VRNDNE__SCALAR_LIBM_X2,batch_eq_2)692 TEST(F32_VRNDNE__SCALAR_LIBM_X2, batch_eq_2) {
693 VUnOpMicrokernelTester()
694 .batch_size(2)
695 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__scalar_libm_x2), VUnOpMicrokernelTester::OpType::RoundToNearestEven, VUnOpMicrokernelTester::Variant::Scalar);
696 }
697
TEST(F32_VRNDNE__SCALAR_LIBM_X2,batch_div_2)698 TEST(F32_VRNDNE__SCALAR_LIBM_X2, batch_div_2) {
699 for (size_t batch_size = 4; batch_size < 20; batch_size += 2) {
700 VUnOpMicrokernelTester()
701 .batch_size(batch_size)
702 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__scalar_libm_x2), VUnOpMicrokernelTester::OpType::RoundToNearestEven, VUnOpMicrokernelTester::Variant::Scalar);
703 }
704 }
705
TEST(F32_VRNDNE__SCALAR_LIBM_X2,batch_lt_2)706 TEST(F32_VRNDNE__SCALAR_LIBM_X2, batch_lt_2) {
707 for (size_t batch_size = 1; batch_size < 2; batch_size++) {
708 VUnOpMicrokernelTester()
709 .batch_size(batch_size)
710 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__scalar_libm_x2), VUnOpMicrokernelTester::OpType::RoundToNearestEven, VUnOpMicrokernelTester::Variant::Scalar);
711 }
712 }
713
TEST(F32_VRNDNE__SCALAR_LIBM_X2,batch_gt_2)714 TEST(F32_VRNDNE__SCALAR_LIBM_X2, batch_gt_2) {
715 for (size_t batch_size = 3; batch_size < 4; batch_size++) {
716 VUnOpMicrokernelTester()
717 .batch_size(batch_size)
718 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__scalar_libm_x2), VUnOpMicrokernelTester::OpType::RoundToNearestEven, VUnOpMicrokernelTester::Variant::Scalar);
719 }
720 }
721
TEST(F32_VRNDNE__SCALAR_LIBM_X2,inplace)722 TEST(F32_VRNDNE__SCALAR_LIBM_X2, inplace) {
723 for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) {
724 VUnOpMicrokernelTester()
725 .batch_size(batch_size)
726 .inplace(true)
727 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__scalar_libm_x2), VUnOpMicrokernelTester::OpType::RoundToNearestEven, VUnOpMicrokernelTester::Variant::Scalar);
728 }
729 }
730
731
TEST(F32_VRNDNE__SCALAR_LIBM_X4,batch_eq_4)732 TEST(F32_VRNDNE__SCALAR_LIBM_X4, batch_eq_4) {
733 VUnOpMicrokernelTester()
734 .batch_size(4)
735 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__scalar_libm_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven, VUnOpMicrokernelTester::Variant::Scalar);
736 }
737
TEST(F32_VRNDNE__SCALAR_LIBM_X4,batch_div_4)738 TEST(F32_VRNDNE__SCALAR_LIBM_X4, batch_div_4) {
739 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
740 VUnOpMicrokernelTester()
741 .batch_size(batch_size)
742 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__scalar_libm_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven, VUnOpMicrokernelTester::Variant::Scalar);
743 }
744 }
745
TEST(F32_VRNDNE__SCALAR_LIBM_X4,batch_lt_4)746 TEST(F32_VRNDNE__SCALAR_LIBM_X4, batch_lt_4) {
747 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
748 VUnOpMicrokernelTester()
749 .batch_size(batch_size)
750 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__scalar_libm_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven, VUnOpMicrokernelTester::Variant::Scalar);
751 }
752 }
753
TEST(F32_VRNDNE__SCALAR_LIBM_X4,batch_gt_4)754 TEST(F32_VRNDNE__SCALAR_LIBM_X4, batch_gt_4) {
755 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
756 VUnOpMicrokernelTester()
757 .batch_size(batch_size)
758 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__scalar_libm_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven, VUnOpMicrokernelTester::Variant::Scalar);
759 }
760 }
761
TEST(F32_VRNDNE__SCALAR_LIBM_X4,inplace)762 TEST(F32_VRNDNE__SCALAR_LIBM_X4, inplace) {
763 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
764 VUnOpMicrokernelTester()
765 .batch_size(batch_size)
766 .inplace(true)
767 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vrndne_ukernel__scalar_libm_x4), VUnOpMicrokernelTester::OpType::RoundToNearestEven, VUnOpMicrokernelTester::Variant::Scalar);
768 }
769 }
770