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-vneg.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_VNEG__NEON_X4,batch_eq_4)21 TEST(F32_VNEG__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_vneg_ukernel__neon_x4), VUnOpMicrokernelTester::OpType::Negate);
26 }
27
TEST(F32_VNEG__NEON_X4,batch_div_4)28 TEST(F32_VNEG__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_vneg_ukernel__neon_x4), VUnOpMicrokernelTester::OpType::Negate);
34 }
35 }
36
TEST(F32_VNEG__NEON_X4,batch_lt_4)37 TEST(F32_VNEG__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_vneg_ukernel__neon_x4), VUnOpMicrokernelTester::OpType::Negate);
43 }
44 }
45
TEST(F32_VNEG__NEON_X4,batch_gt_4)46 TEST(F32_VNEG__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_vneg_ukernel__neon_x4), VUnOpMicrokernelTester::OpType::Negate);
52 }
53 }
54
TEST(F32_VNEG__NEON_X4,inplace)55 TEST(F32_VNEG__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_vneg_ukernel__neon_x4), VUnOpMicrokernelTester::OpType::Negate);
62 }
63 }
64 #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64
65
66
67 #if XNN_ARCH_ARM || XNN_ARCH_ARM64
TEST(F32_VNEG__NEON_X8,batch_eq_8)68 TEST(F32_VNEG__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_vneg_ukernel__neon_x8), VUnOpMicrokernelTester::OpType::Negate);
73 }
74
TEST(F32_VNEG__NEON_X8,batch_div_8)75 TEST(F32_VNEG__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_vneg_ukernel__neon_x8), VUnOpMicrokernelTester::OpType::Negate);
81 }
82 }
83
TEST(F32_VNEG__NEON_X8,batch_lt_8)84 TEST(F32_VNEG__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_vneg_ukernel__neon_x8), VUnOpMicrokernelTester::OpType::Negate);
90 }
91 }
92
TEST(F32_VNEG__NEON_X8,batch_gt_8)93 TEST(F32_VNEG__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_vneg_ukernel__neon_x8), VUnOpMicrokernelTester::OpType::Negate);
99 }
100 }
101
TEST(F32_VNEG__NEON_X8,inplace)102 TEST(F32_VNEG__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_vneg_ukernel__neon_x8), VUnOpMicrokernelTester::OpType::Negate);
109 }
110 }
111 #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64
112
113
114 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(F32_VNEG__SSE_X4,batch_eq_4)115 TEST(F32_VNEG__SSE_X4, batch_eq_4) {
116 TEST_REQUIRES_X86_SSE;
117 VUnOpMicrokernelTester()
118 .batch_size(4)
119 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__sse_x4), VUnOpMicrokernelTester::OpType::Negate);
120 }
121
TEST(F32_VNEG__SSE_X4,batch_div_4)122 TEST(F32_VNEG__SSE_X4, batch_div_4) {
123 TEST_REQUIRES_X86_SSE;
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_vneg_ukernel__sse_x4), VUnOpMicrokernelTester::OpType::Negate);
128 }
129 }
130
TEST(F32_VNEG__SSE_X4,batch_lt_4)131 TEST(F32_VNEG__SSE_X4, batch_lt_4) {
132 TEST_REQUIRES_X86_SSE;
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_vneg_ukernel__sse_x4), VUnOpMicrokernelTester::OpType::Negate);
137 }
138 }
139
TEST(F32_VNEG__SSE_X4,batch_gt_4)140 TEST(F32_VNEG__SSE_X4, batch_gt_4) {
141 TEST_REQUIRES_X86_SSE;
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_vneg_ukernel__sse_x4), VUnOpMicrokernelTester::OpType::Negate);
146 }
147 }
148
TEST(F32_VNEG__SSE_X4,inplace)149 TEST(F32_VNEG__SSE_X4, inplace) {
150 TEST_REQUIRES_X86_SSE;
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_vneg_ukernel__sse_x4), VUnOpMicrokernelTester::OpType::Negate);
156 }
157 }
158 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
159
160
161 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(F32_VNEG__SSE_X8,batch_eq_8)162 TEST(F32_VNEG__SSE_X8, batch_eq_8) {
163 TEST_REQUIRES_X86_SSE;
164 VUnOpMicrokernelTester()
165 .batch_size(8)
166 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__sse_x8), VUnOpMicrokernelTester::OpType::Negate);
167 }
168
TEST(F32_VNEG__SSE_X8,batch_div_8)169 TEST(F32_VNEG__SSE_X8, batch_div_8) {
170 TEST_REQUIRES_X86_SSE;
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_vneg_ukernel__sse_x8), VUnOpMicrokernelTester::OpType::Negate);
175 }
176 }
177
TEST(F32_VNEG__SSE_X8,batch_lt_8)178 TEST(F32_VNEG__SSE_X8, batch_lt_8) {
179 TEST_REQUIRES_X86_SSE;
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_vneg_ukernel__sse_x8), VUnOpMicrokernelTester::OpType::Negate);
184 }
185 }
186
TEST(F32_VNEG__SSE_X8,batch_gt_8)187 TEST(F32_VNEG__SSE_X8, batch_gt_8) {
188 TEST_REQUIRES_X86_SSE;
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_vneg_ukernel__sse_x8), VUnOpMicrokernelTester::OpType::Negate);
193 }
194 }
195
TEST(F32_VNEG__SSE_X8,inplace)196 TEST(F32_VNEG__SSE_X8, inplace) {
197 TEST_REQUIRES_X86_SSE;
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_vneg_ukernel__sse_x8), VUnOpMicrokernelTester::OpType::Negate);
203 }
204 }
205 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
206
207
208 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(F32_VNEG__AVX_X8,batch_eq_8)209 TEST(F32_VNEG__AVX_X8, batch_eq_8) {
210 TEST_REQUIRES_X86_AVX;
211 VUnOpMicrokernelTester()
212 .batch_size(8)
213 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__avx_x8), VUnOpMicrokernelTester::OpType::Negate);
214 }
215
TEST(F32_VNEG__AVX_X8,batch_div_8)216 TEST(F32_VNEG__AVX_X8, batch_div_8) {
217 TEST_REQUIRES_X86_AVX;
218 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
219 VUnOpMicrokernelTester()
220 .batch_size(batch_size)
221 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__avx_x8), VUnOpMicrokernelTester::OpType::Negate);
222 }
223 }
224
TEST(F32_VNEG__AVX_X8,batch_lt_8)225 TEST(F32_VNEG__AVX_X8, batch_lt_8) {
226 TEST_REQUIRES_X86_AVX;
227 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
228 VUnOpMicrokernelTester()
229 .batch_size(batch_size)
230 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__avx_x8), VUnOpMicrokernelTester::OpType::Negate);
231 }
232 }
233
TEST(F32_VNEG__AVX_X8,batch_gt_8)234 TEST(F32_VNEG__AVX_X8, batch_gt_8) {
235 TEST_REQUIRES_X86_AVX;
236 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
237 VUnOpMicrokernelTester()
238 .batch_size(batch_size)
239 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__avx_x8), VUnOpMicrokernelTester::OpType::Negate);
240 }
241 }
242
TEST(F32_VNEG__AVX_X8,inplace)243 TEST(F32_VNEG__AVX_X8, inplace) {
244 TEST_REQUIRES_X86_AVX;
245 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
246 VUnOpMicrokernelTester()
247 .batch_size(batch_size)
248 .inplace(true)
249 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__avx_x8), VUnOpMicrokernelTester::OpType::Negate);
250 }
251 }
252 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
253
254
255 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(F32_VNEG__AVX_X16,batch_eq_16)256 TEST(F32_VNEG__AVX_X16, batch_eq_16) {
257 TEST_REQUIRES_X86_AVX;
258 VUnOpMicrokernelTester()
259 .batch_size(16)
260 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__avx_x16), VUnOpMicrokernelTester::OpType::Negate);
261 }
262
TEST(F32_VNEG__AVX_X16,batch_div_16)263 TEST(F32_VNEG__AVX_X16, batch_div_16) {
264 TEST_REQUIRES_X86_AVX;
265 for (size_t batch_size = 32; batch_size < 160; batch_size += 16) {
266 VUnOpMicrokernelTester()
267 .batch_size(batch_size)
268 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__avx_x16), VUnOpMicrokernelTester::OpType::Negate);
269 }
270 }
271
TEST(F32_VNEG__AVX_X16,batch_lt_16)272 TEST(F32_VNEG__AVX_X16, batch_lt_16) {
273 TEST_REQUIRES_X86_AVX;
274 for (size_t batch_size = 1; batch_size < 16; batch_size++) {
275 VUnOpMicrokernelTester()
276 .batch_size(batch_size)
277 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__avx_x16), VUnOpMicrokernelTester::OpType::Negate);
278 }
279 }
280
TEST(F32_VNEG__AVX_X16,batch_gt_16)281 TEST(F32_VNEG__AVX_X16, batch_gt_16) {
282 TEST_REQUIRES_X86_AVX;
283 for (size_t batch_size = 17; batch_size < 32; batch_size++) {
284 VUnOpMicrokernelTester()
285 .batch_size(batch_size)
286 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__avx_x16), VUnOpMicrokernelTester::OpType::Negate);
287 }
288 }
289
TEST(F32_VNEG__AVX_X16,inplace)290 TEST(F32_VNEG__AVX_X16, inplace) {
291 TEST_REQUIRES_X86_AVX;
292 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
293 VUnOpMicrokernelTester()
294 .batch_size(batch_size)
295 .inplace(true)
296 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__avx_x16), VUnOpMicrokernelTester::OpType::Negate);
297 }
298 }
299 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
300
301
302 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(F32_VNEG__AVX512F_X16,batch_eq_16)303 TEST(F32_VNEG__AVX512F_X16, batch_eq_16) {
304 TEST_REQUIRES_X86_AVX512F;
305 VUnOpMicrokernelTester()
306 .batch_size(16)
307 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__avx512f_x16), VUnOpMicrokernelTester::OpType::Negate);
308 }
309
TEST(F32_VNEG__AVX512F_X16,batch_div_16)310 TEST(F32_VNEG__AVX512F_X16, batch_div_16) {
311 TEST_REQUIRES_X86_AVX512F;
312 for (size_t batch_size = 32; batch_size < 160; batch_size += 16) {
313 VUnOpMicrokernelTester()
314 .batch_size(batch_size)
315 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__avx512f_x16), VUnOpMicrokernelTester::OpType::Negate);
316 }
317 }
318
TEST(F32_VNEG__AVX512F_X16,batch_lt_16)319 TEST(F32_VNEG__AVX512F_X16, batch_lt_16) {
320 TEST_REQUIRES_X86_AVX512F;
321 for (size_t batch_size = 1; batch_size < 16; batch_size++) {
322 VUnOpMicrokernelTester()
323 .batch_size(batch_size)
324 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__avx512f_x16), VUnOpMicrokernelTester::OpType::Negate);
325 }
326 }
327
TEST(F32_VNEG__AVX512F_X16,batch_gt_16)328 TEST(F32_VNEG__AVX512F_X16, batch_gt_16) {
329 TEST_REQUIRES_X86_AVX512F;
330 for (size_t batch_size = 17; batch_size < 32; batch_size++) {
331 VUnOpMicrokernelTester()
332 .batch_size(batch_size)
333 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__avx512f_x16), VUnOpMicrokernelTester::OpType::Negate);
334 }
335 }
336
TEST(F32_VNEG__AVX512F_X16,inplace)337 TEST(F32_VNEG__AVX512F_X16, inplace) {
338 TEST_REQUIRES_X86_AVX512F;
339 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
340 VUnOpMicrokernelTester()
341 .batch_size(batch_size)
342 .inplace(true)
343 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__avx512f_x16), VUnOpMicrokernelTester::OpType::Negate);
344 }
345 }
346 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
347
348
349 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(F32_VNEG__AVX512F_X32,batch_eq_32)350 TEST(F32_VNEG__AVX512F_X32, batch_eq_32) {
351 TEST_REQUIRES_X86_AVX512F;
352 VUnOpMicrokernelTester()
353 .batch_size(32)
354 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__avx512f_x32), VUnOpMicrokernelTester::OpType::Negate);
355 }
356
TEST(F32_VNEG__AVX512F_X32,batch_div_32)357 TEST(F32_VNEG__AVX512F_X32, batch_div_32) {
358 TEST_REQUIRES_X86_AVX512F;
359 for (size_t batch_size = 64; batch_size < 320; batch_size += 32) {
360 VUnOpMicrokernelTester()
361 .batch_size(batch_size)
362 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__avx512f_x32), VUnOpMicrokernelTester::OpType::Negate);
363 }
364 }
365
TEST(F32_VNEG__AVX512F_X32,batch_lt_32)366 TEST(F32_VNEG__AVX512F_X32, batch_lt_32) {
367 TEST_REQUIRES_X86_AVX512F;
368 for (size_t batch_size = 1; batch_size < 32; batch_size++) {
369 VUnOpMicrokernelTester()
370 .batch_size(batch_size)
371 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__avx512f_x32), VUnOpMicrokernelTester::OpType::Negate);
372 }
373 }
374
TEST(F32_VNEG__AVX512F_X32,batch_gt_32)375 TEST(F32_VNEG__AVX512F_X32, batch_gt_32) {
376 TEST_REQUIRES_X86_AVX512F;
377 for (size_t batch_size = 33; batch_size < 64; batch_size++) {
378 VUnOpMicrokernelTester()
379 .batch_size(batch_size)
380 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__avx512f_x32), VUnOpMicrokernelTester::OpType::Negate);
381 }
382 }
383
TEST(F32_VNEG__AVX512F_X32,inplace)384 TEST(F32_VNEG__AVX512F_X32, inplace) {
385 TEST_REQUIRES_X86_AVX512F;
386 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
387 VUnOpMicrokernelTester()
388 .batch_size(batch_size)
389 .inplace(true)
390 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__avx512f_x32), VUnOpMicrokernelTester::OpType::Negate);
391 }
392 }
393 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
394
395
396 #if XNN_ARCH_WASMSIMD
TEST(F32_VNEG__WASMSIMD_X4,batch_eq_4)397 TEST(F32_VNEG__WASMSIMD_X4, batch_eq_4) {
398 VUnOpMicrokernelTester()
399 .batch_size(4)
400 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__wasmsimd_x4), VUnOpMicrokernelTester::OpType::Negate);
401 }
402
TEST(F32_VNEG__WASMSIMD_X4,batch_div_4)403 TEST(F32_VNEG__WASMSIMD_X4, batch_div_4) {
404 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
405 VUnOpMicrokernelTester()
406 .batch_size(batch_size)
407 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__wasmsimd_x4), VUnOpMicrokernelTester::OpType::Negate);
408 }
409 }
410
TEST(F32_VNEG__WASMSIMD_X4,batch_lt_4)411 TEST(F32_VNEG__WASMSIMD_X4, batch_lt_4) {
412 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
413 VUnOpMicrokernelTester()
414 .batch_size(batch_size)
415 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__wasmsimd_x4), VUnOpMicrokernelTester::OpType::Negate);
416 }
417 }
418
TEST(F32_VNEG__WASMSIMD_X4,batch_gt_4)419 TEST(F32_VNEG__WASMSIMD_X4, batch_gt_4) {
420 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
421 VUnOpMicrokernelTester()
422 .batch_size(batch_size)
423 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__wasmsimd_x4), VUnOpMicrokernelTester::OpType::Negate);
424 }
425 }
426
TEST(F32_VNEG__WASMSIMD_X4,inplace)427 TEST(F32_VNEG__WASMSIMD_X4, inplace) {
428 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
429 VUnOpMicrokernelTester()
430 .batch_size(batch_size)
431 .inplace(true)
432 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__wasmsimd_x4), VUnOpMicrokernelTester::OpType::Negate);
433 }
434 }
435 #endif // XNN_ARCH_WASMSIMD
436
437
438 #if XNN_ARCH_WASMSIMD
TEST(F32_VNEG__WASMSIMD_X8,batch_eq_8)439 TEST(F32_VNEG__WASMSIMD_X8, batch_eq_8) {
440 VUnOpMicrokernelTester()
441 .batch_size(8)
442 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__wasmsimd_x8), VUnOpMicrokernelTester::OpType::Negate);
443 }
444
TEST(F32_VNEG__WASMSIMD_X8,batch_div_8)445 TEST(F32_VNEG__WASMSIMD_X8, batch_div_8) {
446 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
447 VUnOpMicrokernelTester()
448 .batch_size(batch_size)
449 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__wasmsimd_x8), VUnOpMicrokernelTester::OpType::Negate);
450 }
451 }
452
TEST(F32_VNEG__WASMSIMD_X8,batch_lt_8)453 TEST(F32_VNEG__WASMSIMD_X8, batch_lt_8) {
454 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
455 VUnOpMicrokernelTester()
456 .batch_size(batch_size)
457 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__wasmsimd_x8), VUnOpMicrokernelTester::OpType::Negate);
458 }
459 }
460
TEST(F32_VNEG__WASMSIMD_X8,batch_gt_8)461 TEST(F32_VNEG__WASMSIMD_X8, batch_gt_8) {
462 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
463 VUnOpMicrokernelTester()
464 .batch_size(batch_size)
465 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__wasmsimd_x8), VUnOpMicrokernelTester::OpType::Negate);
466 }
467 }
468
TEST(F32_VNEG__WASMSIMD_X8,inplace)469 TEST(F32_VNEG__WASMSIMD_X8, inplace) {
470 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
471 VUnOpMicrokernelTester()
472 .batch_size(batch_size)
473 .inplace(true)
474 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__wasmsimd_x8), VUnOpMicrokernelTester::OpType::Negate);
475 }
476 }
477 #endif // XNN_ARCH_WASMSIMD
478
479
TEST(F32_VNEG__SCALAR_X1,batch_eq_1)480 TEST(F32_VNEG__SCALAR_X1, batch_eq_1) {
481 VUnOpMicrokernelTester()
482 .batch_size(1)
483 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__scalar_x1), VUnOpMicrokernelTester::OpType::Negate, VUnOpMicrokernelTester::Variant::Scalar);
484 }
485
TEST(F32_VNEG__SCALAR_X1,batch_gt_1)486 TEST(F32_VNEG__SCALAR_X1, batch_gt_1) {
487 for (size_t batch_size = 2; batch_size < 10; batch_size++) {
488 VUnOpMicrokernelTester()
489 .batch_size(batch_size)
490 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__scalar_x1), VUnOpMicrokernelTester::OpType::Negate, VUnOpMicrokernelTester::Variant::Scalar);
491 }
492 }
493
TEST(F32_VNEG__SCALAR_X1,inplace)494 TEST(F32_VNEG__SCALAR_X1, inplace) {
495 for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) {
496 VUnOpMicrokernelTester()
497 .batch_size(batch_size)
498 .inplace(true)
499 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__scalar_x1), VUnOpMicrokernelTester::OpType::Negate, VUnOpMicrokernelTester::Variant::Scalar);
500 }
501 }
502
503
TEST(F32_VNEG__SCALAR_X2,batch_eq_2)504 TEST(F32_VNEG__SCALAR_X2, batch_eq_2) {
505 VUnOpMicrokernelTester()
506 .batch_size(2)
507 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__scalar_x2), VUnOpMicrokernelTester::OpType::Negate, VUnOpMicrokernelTester::Variant::Scalar);
508 }
509
TEST(F32_VNEG__SCALAR_X2,batch_div_2)510 TEST(F32_VNEG__SCALAR_X2, batch_div_2) {
511 for (size_t batch_size = 4; batch_size < 20; batch_size += 2) {
512 VUnOpMicrokernelTester()
513 .batch_size(batch_size)
514 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__scalar_x2), VUnOpMicrokernelTester::OpType::Negate, VUnOpMicrokernelTester::Variant::Scalar);
515 }
516 }
517
TEST(F32_VNEG__SCALAR_X2,batch_lt_2)518 TEST(F32_VNEG__SCALAR_X2, batch_lt_2) {
519 for (size_t batch_size = 1; batch_size < 2; batch_size++) {
520 VUnOpMicrokernelTester()
521 .batch_size(batch_size)
522 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__scalar_x2), VUnOpMicrokernelTester::OpType::Negate, VUnOpMicrokernelTester::Variant::Scalar);
523 }
524 }
525
TEST(F32_VNEG__SCALAR_X2,batch_gt_2)526 TEST(F32_VNEG__SCALAR_X2, batch_gt_2) {
527 for (size_t batch_size = 3; batch_size < 4; batch_size++) {
528 VUnOpMicrokernelTester()
529 .batch_size(batch_size)
530 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__scalar_x2), VUnOpMicrokernelTester::OpType::Negate, VUnOpMicrokernelTester::Variant::Scalar);
531 }
532 }
533
TEST(F32_VNEG__SCALAR_X2,inplace)534 TEST(F32_VNEG__SCALAR_X2, inplace) {
535 for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) {
536 VUnOpMicrokernelTester()
537 .batch_size(batch_size)
538 .inplace(true)
539 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__scalar_x2), VUnOpMicrokernelTester::OpType::Negate, VUnOpMicrokernelTester::Variant::Scalar);
540 }
541 }
542
543
TEST(F32_VNEG__SCALAR_X4,batch_eq_4)544 TEST(F32_VNEG__SCALAR_X4, batch_eq_4) {
545 VUnOpMicrokernelTester()
546 .batch_size(4)
547 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__scalar_x4), VUnOpMicrokernelTester::OpType::Negate, VUnOpMicrokernelTester::Variant::Scalar);
548 }
549
TEST(F32_VNEG__SCALAR_X4,batch_div_4)550 TEST(F32_VNEG__SCALAR_X4, batch_div_4) {
551 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
552 VUnOpMicrokernelTester()
553 .batch_size(batch_size)
554 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__scalar_x4), VUnOpMicrokernelTester::OpType::Negate, VUnOpMicrokernelTester::Variant::Scalar);
555 }
556 }
557
TEST(F32_VNEG__SCALAR_X4,batch_lt_4)558 TEST(F32_VNEG__SCALAR_X4, batch_lt_4) {
559 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
560 VUnOpMicrokernelTester()
561 .batch_size(batch_size)
562 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__scalar_x4), VUnOpMicrokernelTester::OpType::Negate, VUnOpMicrokernelTester::Variant::Scalar);
563 }
564 }
565
TEST(F32_VNEG__SCALAR_X4,batch_gt_4)566 TEST(F32_VNEG__SCALAR_X4, batch_gt_4) {
567 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
568 VUnOpMicrokernelTester()
569 .batch_size(batch_size)
570 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__scalar_x4), VUnOpMicrokernelTester::OpType::Negate, VUnOpMicrokernelTester::Variant::Scalar);
571 }
572 }
573
TEST(F32_VNEG__SCALAR_X4,inplace)574 TEST(F32_VNEG__SCALAR_X4, inplace) {
575 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
576 VUnOpMicrokernelTester()
577 .batch_size(batch_size)
578 .inplace(true)
579 .Test(xnn_f32_vunary_ukernel_function(xnn_f32_vneg_ukernel__scalar_x4), VUnOpMicrokernelTester::OpType::Negate, VUnOpMicrokernelTester::Variant::Scalar);
580 }
581 }
582