blob: 168a2e78d7f353ca777a290804cffee0ef6442f9 [file] [log] [blame]
Marat Dukhan2b9efd82020-06-08 01:09:31 -07001// 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-vsqr.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
21 TEST(F32_VSQR__NEON_X4, batch_eq_4) {
22 TEST_REQUIRES_ARM_NEON;
Marat Dukhan87ed45c2021-05-13 12:25:22 -070023 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -070024 .batch_size(4)
Marat Dukhan6eaab712021-05-13 15:20:58 -070025 .Test(xnn_f32_vsqr_ukernel__neon_x4, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -070026 }
27
28 TEST(F32_VSQR__NEON_X4, batch_div_4) {
29 TEST_REQUIRES_ARM_NEON;
30 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -070031 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -070032 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -070033 .Test(xnn_f32_vsqr_ukernel__neon_x4, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -070034 }
35 }
36
37 TEST(F32_VSQR__NEON_X4, batch_lt_4) {
38 TEST_REQUIRES_ARM_NEON;
39 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -070040 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -070041 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -070042 .Test(xnn_f32_vsqr_ukernel__neon_x4, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -070043 }
44 }
45
46 TEST(F32_VSQR__NEON_X4, batch_gt_4) {
47 TEST_REQUIRES_ARM_NEON;
48 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -070049 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -070050 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -070051 .Test(xnn_f32_vsqr_ukernel__neon_x4, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -070052 }
53 }
54
55 TEST(F32_VSQR__NEON_X4, inplace) {
56 TEST_REQUIRES_ARM_NEON;
57 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -070058 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -070059 .batch_size(batch_size)
60 .inplace(true)
Marat Dukhan6eaab712021-05-13 15:20:58 -070061 .Test(xnn_f32_vsqr_ukernel__neon_x4, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -070062 }
63 }
64#endif // XNN_ARCH_ARM || XNN_ARCH_ARM64
65
66
67#if XNN_ARCH_ARM || XNN_ARCH_ARM64
68 TEST(F32_VSQR__NEON_X8, batch_eq_8) {
69 TEST_REQUIRES_ARM_NEON;
Marat Dukhan87ed45c2021-05-13 12:25:22 -070070 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -070071 .batch_size(8)
Marat Dukhan6eaab712021-05-13 15:20:58 -070072 .Test(xnn_f32_vsqr_ukernel__neon_x8, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -070073 }
74
75 TEST(F32_VSQR__NEON_X8, batch_div_8) {
76 TEST_REQUIRES_ARM_NEON;
77 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -070078 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -070079 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -070080 .Test(xnn_f32_vsqr_ukernel__neon_x8, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -070081 }
82 }
83
84 TEST(F32_VSQR__NEON_X8, batch_lt_8) {
85 TEST_REQUIRES_ARM_NEON;
86 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -070087 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -070088 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -070089 .Test(xnn_f32_vsqr_ukernel__neon_x8, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -070090 }
91 }
92
93 TEST(F32_VSQR__NEON_X8, batch_gt_8) {
94 TEST_REQUIRES_ARM_NEON;
95 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -070096 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -070097 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -070098 .Test(xnn_f32_vsqr_ukernel__neon_x8, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -070099 }
100 }
101
102 TEST(F32_VSQR__NEON_X8, inplace) {
103 TEST_REQUIRES_ARM_NEON;
104 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700105 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700106 .batch_size(batch_size)
107 .inplace(true)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700108 .Test(xnn_f32_vsqr_ukernel__neon_x8, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700109 }
110 }
111#endif // XNN_ARCH_ARM || XNN_ARCH_ARM64
112
113
114#if XNN_ARCH_X86 || XNN_ARCH_X86_64
115 TEST(F32_VSQR__SSE_X4, batch_eq_4) {
116 TEST_REQUIRES_X86_SSE;
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700117 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700118 .batch_size(4)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700119 .Test(xnn_f32_vsqr_ukernel__sse_x4, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700120 }
121
122 TEST(F32_VSQR__SSE_X4, batch_div_4) {
123 TEST_REQUIRES_X86_SSE;
124 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700125 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700126 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700127 .Test(xnn_f32_vsqr_ukernel__sse_x4, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700128 }
129 }
130
131 TEST(F32_VSQR__SSE_X4, batch_lt_4) {
132 TEST_REQUIRES_X86_SSE;
133 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700134 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700135 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700136 .Test(xnn_f32_vsqr_ukernel__sse_x4, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700137 }
138 }
139
140 TEST(F32_VSQR__SSE_X4, batch_gt_4) {
141 TEST_REQUIRES_X86_SSE;
142 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700143 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700144 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700145 .Test(xnn_f32_vsqr_ukernel__sse_x4, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700146 }
147 }
148
149 TEST(F32_VSQR__SSE_X4, inplace) {
150 TEST_REQUIRES_X86_SSE;
151 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700152 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700153 .batch_size(batch_size)
154 .inplace(true)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700155 .Test(xnn_f32_vsqr_ukernel__sse_x4, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700156 }
157 }
158#endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
159
160
161#if XNN_ARCH_X86 || XNN_ARCH_X86_64
162 TEST(F32_VSQR__SSE_X8, batch_eq_8) {
163 TEST_REQUIRES_X86_SSE;
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700164 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700165 .batch_size(8)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700166 .Test(xnn_f32_vsqr_ukernel__sse_x8, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700167 }
168
169 TEST(F32_VSQR__SSE_X8, batch_div_8) {
170 TEST_REQUIRES_X86_SSE;
171 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700172 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700173 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700174 .Test(xnn_f32_vsqr_ukernel__sse_x8, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700175 }
176 }
177
178 TEST(F32_VSQR__SSE_X8, batch_lt_8) {
179 TEST_REQUIRES_X86_SSE;
180 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700181 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700182 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700183 .Test(xnn_f32_vsqr_ukernel__sse_x8, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700184 }
185 }
186
187 TEST(F32_VSQR__SSE_X8, batch_gt_8) {
188 TEST_REQUIRES_X86_SSE;
189 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700190 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700191 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700192 .Test(xnn_f32_vsqr_ukernel__sse_x8, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700193 }
194 }
195
196 TEST(F32_VSQR__SSE_X8, inplace) {
197 TEST_REQUIRES_X86_SSE;
198 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700199 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700200 .batch_size(batch_size)
201 .inplace(true)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700202 .Test(xnn_f32_vsqr_ukernel__sse_x8, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700203 }
204 }
205#endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
206
207
208#if XNN_ARCH_X86 || XNN_ARCH_X86_64
209 TEST(F32_VSQR__AVX_X8, batch_eq_8) {
210 TEST_REQUIRES_X86_AVX;
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700211 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700212 .batch_size(8)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700213 .Test(xnn_f32_vsqr_ukernel__avx_x8, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700214 }
215
216 TEST(F32_VSQR__AVX_X8, batch_div_8) {
217 TEST_REQUIRES_X86_AVX;
218 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700219 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700220 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700221 .Test(xnn_f32_vsqr_ukernel__avx_x8, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700222 }
223 }
224
225 TEST(F32_VSQR__AVX_X8, batch_lt_8) {
226 TEST_REQUIRES_X86_AVX;
227 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700228 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700229 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700230 .Test(xnn_f32_vsqr_ukernel__avx_x8, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700231 }
232 }
233
234 TEST(F32_VSQR__AVX_X8, batch_gt_8) {
235 TEST_REQUIRES_X86_AVX;
236 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700237 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700238 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700239 .Test(xnn_f32_vsqr_ukernel__avx_x8, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700240 }
241 }
242
243 TEST(F32_VSQR__AVX_X8, inplace) {
244 TEST_REQUIRES_X86_AVX;
245 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700246 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700247 .batch_size(batch_size)
248 .inplace(true)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700249 .Test(xnn_f32_vsqr_ukernel__avx_x8, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700250 }
251 }
252#endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
253
254
255#if XNN_ARCH_X86 || XNN_ARCH_X86_64
256 TEST(F32_VSQR__AVX_X16, batch_eq_16) {
257 TEST_REQUIRES_X86_AVX;
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700258 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700259 .batch_size(16)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700260 .Test(xnn_f32_vsqr_ukernel__avx_x16, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700261 }
262
263 TEST(F32_VSQR__AVX_X16, batch_div_16) {
264 TEST_REQUIRES_X86_AVX;
265 for (size_t batch_size = 32; batch_size < 160; batch_size += 16) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700266 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700267 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700268 .Test(xnn_f32_vsqr_ukernel__avx_x16, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700269 }
270 }
271
272 TEST(F32_VSQR__AVX_X16, batch_lt_16) {
273 TEST_REQUIRES_X86_AVX;
274 for (size_t batch_size = 1; batch_size < 16; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700275 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700276 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700277 .Test(xnn_f32_vsqr_ukernel__avx_x16, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700278 }
279 }
280
281 TEST(F32_VSQR__AVX_X16, batch_gt_16) {
282 TEST_REQUIRES_X86_AVX;
283 for (size_t batch_size = 17; batch_size < 32; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700284 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700285 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700286 .Test(xnn_f32_vsqr_ukernel__avx_x16, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700287 }
288 }
289
290 TEST(F32_VSQR__AVX_X16, inplace) {
291 TEST_REQUIRES_X86_AVX;
292 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700293 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700294 .batch_size(batch_size)
295 .inplace(true)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700296 .Test(xnn_f32_vsqr_ukernel__avx_x16, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700297 }
298 }
299#endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
300
301
302#if XNN_ARCH_X86 || XNN_ARCH_X86_64
303 TEST(F32_VSQR__AVX512F_X16, batch_eq_16) {
304 TEST_REQUIRES_X86_AVX512F;
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700305 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700306 .batch_size(16)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700307 .Test(xnn_f32_vsqr_ukernel__avx512f_x16, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700308 }
309
310 TEST(F32_VSQR__AVX512F_X16, batch_div_16) {
311 TEST_REQUIRES_X86_AVX512F;
312 for (size_t batch_size = 32; batch_size < 160; batch_size += 16) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700313 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700314 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700315 .Test(xnn_f32_vsqr_ukernel__avx512f_x16, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700316 }
317 }
318
319 TEST(F32_VSQR__AVX512F_X16, batch_lt_16) {
320 TEST_REQUIRES_X86_AVX512F;
321 for (size_t batch_size = 1; batch_size < 16; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700322 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700323 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700324 .Test(xnn_f32_vsqr_ukernel__avx512f_x16, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700325 }
326 }
327
328 TEST(F32_VSQR__AVX512F_X16, batch_gt_16) {
329 TEST_REQUIRES_X86_AVX512F;
330 for (size_t batch_size = 17; batch_size < 32; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700331 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700332 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700333 .Test(xnn_f32_vsqr_ukernel__avx512f_x16, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700334 }
335 }
336
337 TEST(F32_VSQR__AVX512F_X16, inplace) {
338 TEST_REQUIRES_X86_AVX512F;
339 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700340 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700341 .batch_size(batch_size)
342 .inplace(true)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700343 .Test(xnn_f32_vsqr_ukernel__avx512f_x16, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700344 }
345 }
346#endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
347
348
349#if XNN_ARCH_X86 || XNN_ARCH_X86_64
350 TEST(F32_VSQR__AVX512F_X32, batch_eq_32) {
351 TEST_REQUIRES_X86_AVX512F;
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700352 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700353 .batch_size(32)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700354 .Test(xnn_f32_vsqr_ukernel__avx512f_x32, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700355 }
356
357 TEST(F32_VSQR__AVX512F_X32, batch_div_32) {
358 TEST_REQUIRES_X86_AVX512F;
359 for (size_t batch_size = 64; batch_size < 320; batch_size += 32) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700360 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700361 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700362 .Test(xnn_f32_vsqr_ukernel__avx512f_x32, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700363 }
364 }
365
366 TEST(F32_VSQR__AVX512F_X32, batch_lt_32) {
367 TEST_REQUIRES_X86_AVX512F;
368 for (size_t batch_size = 1; batch_size < 32; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700369 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700370 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700371 .Test(xnn_f32_vsqr_ukernel__avx512f_x32, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700372 }
373 }
374
375 TEST(F32_VSQR__AVX512F_X32, batch_gt_32) {
376 TEST_REQUIRES_X86_AVX512F;
377 for (size_t batch_size = 33; batch_size < 64; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700378 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700379 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700380 .Test(xnn_f32_vsqr_ukernel__avx512f_x32, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700381 }
382 }
383
384 TEST(F32_VSQR__AVX512F_X32, inplace) {
385 TEST_REQUIRES_X86_AVX512F;
386 for (size_t batch_size = 1; batch_size <= 160; batch_size += 31) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700387 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700388 .batch_size(batch_size)
389 .inplace(true)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700390 .Test(xnn_f32_vsqr_ukernel__avx512f_x32, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700391 }
392 }
393#endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
394
395
Marat Dukhan4c617792021-12-21 15:47:58 -0800396#if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD
Marat Dukhan37c83512020-06-29 13:25:53 -0700397 TEST(F32_VSQR__WASMSIMD_X4, batch_eq_4) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700398 VUnaryMicrokernelTester()
Marat Dukhan37c83512020-06-29 13:25:53 -0700399 .batch_size(4)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700400 .Test(xnn_f32_vsqr_ukernel__wasmsimd_x4, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan37c83512020-06-29 13:25:53 -0700401 }
402
403 TEST(F32_VSQR__WASMSIMD_X4, batch_div_4) {
404 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700405 VUnaryMicrokernelTester()
Marat Dukhan37c83512020-06-29 13:25:53 -0700406 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700407 .Test(xnn_f32_vsqr_ukernel__wasmsimd_x4, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan37c83512020-06-29 13:25:53 -0700408 }
409 }
410
411 TEST(F32_VSQR__WASMSIMD_X4, batch_lt_4) {
412 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700413 VUnaryMicrokernelTester()
Marat Dukhan37c83512020-06-29 13:25:53 -0700414 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700415 .Test(xnn_f32_vsqr_ukernel__wasmsimd_x4, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan37c83512020-06-29 13:25:53 -0700416 }
417 }
418
419 TEST(F32_VSQR__WASMSIMD_X4, batch_gt_4) {
420 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700421 VUnaryMicrokernelTester()
Marat Dukhan37c83512020-06-29 13:25:53 -0700422 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700423 .Test(xnn_f32_vsqr_ukernel__wasmsimd_x4, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan37c83512020-06-29 13:25:53 -0700424 }
425 }
426
427 TEST(F32_VSQR__WASMSIMD_X4, inplace) {
428 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700429 VUnaryMicrokernelTester()
Marat Dukhan37c83512020-06-29 13:25:53 -0700430 .batch_size(batch_size)
431 .inplace(true)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700432 .Test(xnn_f32_vsqr_ukernel__wasmsimd_x4, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan37c83512020-06-29 13:25:53 -0700433 }
434 }
Marat Dukhan4c617792021-12-21 15:47:58 -0800435#endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD
Marat Dukhan37c83512020-06-29 13:25:53 -0700436
437
Marat Dukhan4c617792021-12-21 15:47:58 -0800438#if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD
Marat Dukhan37c83512020-06-29 13:25:53 -0700439 TEST(F32_VSQR__WASMSIMD_X8, batch_eq_8) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700440 VUnaryMicrokernelTester()
Marat Dukhan37c83512020-06-29 13:25:53 -0700441 .batch_size(8)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700442 .Test(xnn_f32_vsqr_ukernel__wasmsimd_x8, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan37c83512020-06-29 13:25:53 -0700443 }
444
445 TEST(F32_VSQR__WASMSIMD_X8, batch_div_8) {
446 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700447 VUnaryMicrokernelTester()
Marat Dukhan37c83512020-06-29 13:25:53 -0700448 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700449 .Test(xnn_f32_vsqr_ukernel__wasmsimd_x8, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan37c83512020-06-29 13:25:53 -0700450 }
451 }
452
453 TEST(F32_VSQR__WASMSIMD_X8, batch_lt_8) {
454 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700455 VUnaryMicrokernelTester()
Marat Dukhan37c83512020-06-29 13:25:53 -0700456 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700457 .Test(xnn_f32_vsqr_ukernel__wasmsimd_x8, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan37c83512020-06-29 13:25:53 -0700458 }
459 }
460
461 TEST(F32_VSQR__WASMSIMD_X8, batch_gt_8) {
462 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700463 VUnaryMicrokernelTester()
Marat Dukhan37c83512020-06-29 13:25:53 -0700464 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700465 .Test(xnn_f32_vsqr_ukernel__wasmsimd_x8, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan37c83512020-06-29 13:25:53 -0700466 }
467 }
468
469 TEST(F32_VSQR__WASMSIMD_X8, inplace) {
470 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700471 VUnaryMicrokernelTester()
Marat Dukhan37c83512020-06-29 13:25:53 -0700472 .batch_size(batch_size)
473 .inplace(true)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700474 .Test(xnn_f32_vsqr_ukernel__wasmsimd_x8, VUnaryMicrokernelTester::OpType::Square);
Marat Dukhan37c83512020-06-29 13:25:53 -0700475 }
476 }
Marat Dukhan4c617792021-12-21 15:47:58 -0800477#endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD
Marat Dukhan37c83512020-06-29 13:25:53 -0700478
479
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700480TEST(F32_VSQR__SCALAR_X1, batch_eq_1) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700481 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700482 .batch_size(1)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700483 .Test(xnn_f32_vsqr_ukernel__scalar_x1, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700484}
485
486TEST(F32_VSQR__SCALAR_X1, batch_gt_1) {
487 for (size_t batch_size = 2; batch_size < 10; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700488 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700489 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700490 .Test(xnn_f32_vsqr_ukernel__scalar_x1, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700491 }
492}
493
494TEST(F32_VSQR__SCALAR_X1, inplace) {
495 for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700496 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700497 .batch_size(batch_size)
498 .inplace(true)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700499 .Test(xnn_f32_vsqr_ukernel__scalar_x1, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700500 }
501}
502
Frank Barchard177fe2d2020-06-11 11:09:33 -0700503
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700504TEST(F32_VSQR__SCALAR_X2, batch_eq_2) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700505 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700506 .batch_size(2)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700507 .Test(xnn_f32_vsqr_ukernel__scalar_x2, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700508}
509
510TEST(F32_VSQR__SCALAR_X2, batch_div_2) {
511 for (size_t batch_size = 4; batch_size < 20; batch_size += 2) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700512 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700513 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700514 .Test(xnn_f32_vsqr_ukernel__scalar_x2, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700515 }
516}
517
518TEST(F32_VSQR__SCALAR_X2, batch_lt_2) {
519 for (size_t batch_size = 1; batch_size < 2; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700520 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700521 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700522 .Test(xnn_f32_vsqr_ukernel__scalar_x2, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700523 }
524}
525
526TEST(F32_VSQR__SCALAR_X2, batch_gt_2) {
527 for (size_t batch_size = 3; batch_size < 4; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700528 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700529 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700530 .Test(xnn_f32_vsqr_ukernel__scalar_x2, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700531 }
532}
533
534TEST(F32_VSQR__SCALAR_X2, inplace) {
535 for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700536 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700537 .batch_size(batch_size)
538 .inplace(true)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700539 .Test(xnn_f32_vsqr_ukernel__scalar_x2, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700540 }
541}
542
Frank Barchard177fe2d2020-06-11 11:09:33 -0700543
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700544TEST(F32_VSQR__SCALAR_X4, batch_eq_4) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700545 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700546 .batch_size(4)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700547 .Test(xnn_f32_vsqr_ukernel__scalar_x4, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700548}
549
550TEST(F32_VSQR__SCALAR_X4, batch_div_4) {
551 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700552 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700553 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700554 .Test(xnn_f32_vsqr_ukernel__scalar_x4, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700555 }
556}
557
558TEST(F32_VSQR__SCALAR_X4, batch_lt_4) {
559 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700560 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700561 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700562 .Test(xnn_f32_vsqr_ukernel__scalar_x4, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700563 }
564}
565
566TEST(F32_VSQR__SCALAR_X4, batch_gt_4) {
567 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700568 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700569 .batch_size(batch_size)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700570 .Test(xnn_f32_vsqr_ukernel__scalar_x4, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700571 }
572}
573
574TEST(F32_VSQR__SCALAR_X4, inplace) {
575 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
Marat Dukhan87ed45c2021-05-13 12:25:22 -0700576 VUnaryMicrokernelTester()
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700577 .batch_size(batch_size)
578 .inplace(true)
Marat Dukhan6eaab712021-05-13 15:20:58 -0700579 .Test(xnn_f32_vsqr_ukernel__scalar_x4, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar);
Marat Dukhan2b9efd82020-06-08 01:09:31 -0700580 }
Frank Barchard177fe2d2020-06-11 11:09:33 -0700581}