Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 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-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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 23 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 24 | .batch_size(4) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 25 | .Test(xnn_f32_vsqr_ukernel__neon_x4, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 26 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 31 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 32 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 33 | .Test(xnn_f32_vsqr_ukernel__neon_x4, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 34 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 40 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 41 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 42 | .Test(xnn_f32_vsqr_ukernel__neon_x4, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 43 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 49 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 50 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 51 | .Test(xnn_f32_vsqr_ukernel__neon_x4, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 52 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 58 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 59 | .batch_size(batch_size) |
| 60 | .inplace(true) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 61 | .Test(xnn_f32_vsqr_ukernel__neon_x4, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 62 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 70 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 71 | .batch_size(8) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 72 | .Test(xnn_f32_vsqr_ukernel__neon_x8, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 73 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 78 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 79 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 80 | .Test(xnn_f32_vsqr_ukernel__neon_x8, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 81 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 87 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 88 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 89 | .Test(xnn_f32_vsqr_ukernel__neon_x8, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 90 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 96 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 97 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 98 | .Test(xnn_f32_vsqr_ukernel__neon_x8, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 99 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 105 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 106 | .batch_size(batch_size) |
| 107 | .inplace(true) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 108 | .Test(xnn_f32_vsqr_ukernel__neon_x8, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 109 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 117 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 118 | .batch_size(4) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 119 | .Test(xnn_f32_vsqr_ukernel__sse_x4, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 120 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 125 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 126 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 127 | .Test(xnn_f32_vsqr_ukernel__sse_x4, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 128 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 134 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 135 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 136 | .Test(xnn_f32_vsqr_ukernel__sse_x4, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 137 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 143 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 144 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 145 | .Test(xnn_f32_vsqr_ukernel__sse_x4, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 146 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 152 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 153 | .batch_size(batch_size) |
| 154 | .inplace(true) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 155 | .Test(xnn_f32_vsqr_ukernel__sse_x4, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 156 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 164 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 165 | .batch_size(8) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 166 | .Test(xnn_f32_vsqr_ukernel__sse_x8, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 167 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 172 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 173 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 174 | .Test(xnn_f32_vsqr_ukernel__sse_x8, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 175 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 181 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 182 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 183 | .Test(xnn_f32_vsqr_ukernel__sse_x8, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 184 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 190 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 191 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 192 | .Test(xnn_f32_vsqr_ukernel__sse_x8, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 193 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 199 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 200 | .batch_size(batch_size) |
| 201 | .inplace(true) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 202 | .Test(xnn_f32_vsqr_ukernel__sse_x8, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 203 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 211 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 212 | .batch_size(8) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 213 | .Test(xnn_f32_vsqr_ukernel__avx_x8, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 214 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 219 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 220 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 221 | .Test(xnn_f32_vsqr_ukernel__avx_x8, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 222 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 228 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 229 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 230 | .Test(xnn_f32_vsqr_ukernel__avx_x8, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 231 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 237 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 238 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 239 | .Test(xnn_f32_vsqr_ukernel__avx_x8, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 240 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 246 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 247 | .batch_size(batch_size) |
| 248 | .inplace(true) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 249 | .Test(xnn_f32_vsqr_ukernel__avx_x8, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 250 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 258 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 259 | .batch_size(16) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 260 | .Test(xnn_f32_vsqr_ukernel__avx_x16, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 261 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 266 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 267 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 268 | .Test(xnn_f32_vsqr_ukernel__avx_x16, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 269 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 275 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 276 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 277 | .Test(xnn_f32_vsqr_ukernel__avx_x16, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 278 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 284 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 285 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 286 | .Test(xnn_f32_vsqr_ukernel__avx_x16, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 287 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 293 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 294 | .batch_size(batch_size) |
| 295 | .inplace(true) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 296 | .Test(xnn_f32_vsqr_ukernel__avx_x16, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 297 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 305 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 306 | .batch_size(16) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 307 | .Test(xnn_f32_vsqr_ukernel__avx512f_x16, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 308 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 313 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 314 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 315 | .Test(xnn_f32_vsqr_ukernel__avx512f_x16, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 316 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 322 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 323 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 324 | .Test(xnn_f32_vsqr_ukernel__avx512f_x16, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 325 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 331 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 332 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 333 | .Test(xnn_f32_vsqr_ukernel__avx512f_x16, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 334 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 340 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 341 | .batch_size(batch_size) |
| 342 | .inplace(true) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 343 | .Test(xnn_f32_vsqr_ukernel__avx512f_x16, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 344 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 352 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 353 | .batch_size(32) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 354 | .Test(xnn_f32_vsqr_ukernel__avx512f_x32, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 355 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 360 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 361 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 362 | .Test(xnn_f32_vsqr_ukernel__avx512f_x32, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 363 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 369 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 370 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 371 | .Test(xnn_f32_vsqr_ukernel__avx512f_x32, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 372 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 378 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 379 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 380 | .Test(xnn_f32_vsqr_ukernel__avx512f_x32, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 381 | } |
| 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 Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 387 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 388 | .batch_size(batch_size) |
| 389 | .inplace(true) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 390 | .Test(xnn_f32_vsqr_ukernel__avx512f_x32, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 391 | } |
| 392 | } |
| 393 | #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 |
| 394 | |
| 395 | |
Marat Dukhan | 4c61779 | 2021-12-21 15:47:58 -0800 | [diff] [blame] | 396 | #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 397 | TEST(F32_VSQR__WASMSIMD_X4, batch_eq_4) { |
Marat Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 398 | VUnaryMicrokernelTester() |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 399 | .batch_size(4) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 400 | .Test(xnn_f32_vsqr_ukernel__wasmsimd_x4, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 401 | } |
| 402 | |
| 403 | TEST(F32_VSQR__WASMSIMD_X4, batch_div_4) { |
| 404 | for (size_t batch_size = 8; batch_size < 40; batch_size += 4) { |
Marat Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 405 | VUnaryMicrokernelTester() |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 406 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 407 | .Test(xnn_f32_vsqr_ukernel__wasmsimd_x4, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 408 | } |
| 409 | } |
| 410 | |
| 411 | TEST(F32_VSQR__WASMSIMD_X4, batch_lt_4) { |
| 412 | for (size_t batch_size = 1; batch_size < 4; batch_size++) { |
Marat Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 413 | VUnaryMicrokernelTester() |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 414 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 415 | .Test(xnn_f32_vsqr_ukernel__wasmsimd_x4, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 416 | } |
| 417 | } |
| 418 | |
| 419 | TEST(F32_VSQR__WASMSIMD_X4, batch_gt_4) { |
| 420 | for (size_t batch_size = 5; batch_size < 8; batch_size++) { |
Marat Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 421 | VUnaryMicrokernelTester() |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 422 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 423 | .Test(xnn_f32_vsqr_ukernel__wasmsimd_x4, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 424 | } |
| 425 | } |
| 426 | |
| 427 | TEST(F32_VSQR__WASMSIMD_X4, inplace) { |
| 428 | for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) { |
Marat Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 429 | VUnaryMicrokernelTester() |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 430 | .batch_size(batch_size) |
| 431 | .inplace(true) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 432 | .Test(xnn_f32_vsqr_ukernel__wasmsimd_x4, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 433 | } |
| 434 | } |
Marat Dukhan | 4c61779 | 2021-12-21 15:47:58 -0800 | [diff] [blame] | 435 | #endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 436 | |
| 437 | |
Marat Dukhan | 4c61779 | 2021-12-21 15:47:58 -0800 | [diff] [blame] | 438 | #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 439 | TEST(F32_VSQR__WASMSIMD_X8, batch_eq_8) { |
Marat Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 440 | VUnaryMicrokernelTester() |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 441 | .batch_size(8) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 442 | .Test(xnn_f32_vsqr_ukernel__wasmsimd_x8, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 443 | } |
| 444 | |
| 445 | TEST(F32_VSQR__WASMSIMD_X8, batch_div_8) { |
| 446 | for (size_t batch_size = 16; batch_size < 80; batch_size += 8) { |
Marat Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 447 | VUnaryMicrokernelTester() |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 448 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 449 | .Test(xnn_f32_vsqr_ukernel__wasmsimd_x8, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 450 | } |
| 451 | } |
| 452 | |
| 453 | TEST(F32_VSQR__WASMSIMD_X8, batch_lt_8) { |
| 454 | for (size_t batch_size = 1; batch_size < 8; batch_size++) { |
Marat Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 455 | VUnaryMicrokernelTester() |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 456 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 457 | .Test(xnn_f32_vsqr_ukernel__wasmsimd_x8, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 458 | } |
| 459 | } |
| 460 | |
| 461 | TEST(F32_VSQR__WASMSIMD_X8, batch_gt_8) { |
| 462 | for (size_t batch_size = 9; batch_size < 16; batch_size++) { |
Marat Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 463 | VUnaryMicrokernelTester() |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 464 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 465 | .Test(xnn_f32_vsqr_ukernel__wasmsimd_x8, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 466 | } |
| 467 | } |
| 468 | |
| 469 | TEST(F32_VSQR__WASMSIMD_X8, inplace) { |
| 470 | for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { |
Marat Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 471 | VUnaryMicrokernelTester() |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 472 | .batch_size(batch_size) |
| 473 | .inplace(true) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 474 | .Test(xnn_f32_vsqr_ukernel__wasmsimd_x8, VUnaryMicrokernelTester::OpType::Square); |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 475 | } |
| 476 | } |
Marat Dukhan | 4c61779 | 2021-12-21 15:47:58 -0800 | [diff] [blame] | 477 | #endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD |
Marat Dukhan | 37c8351 | 2020-06-29 13:25:53 -0700 | [diff] [blame] | 478 | |
| 479 | |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 480 | TEST(F32_VSQR__SCALAR_X1, batch_eq_1) { |
Marat Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 481 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 482 | .batch_size(1) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 483 | .Test(xnn_f32_vsqr_ukernel__scalar_x1, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 484 | } |
| 485 | |
| 486 | TEST(F32_VSQR__SCALAR_X1, batch_gt_1) { |
| 487 | for (size_t batch_size = 2; batch_size < 10; batch_size++) { |
Marat Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 488 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 489 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 490 | .Test(xnn_f32_vsqr_ukernel__scalar_x1, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 491 | } |
| 492 | } |
| 493 | |
| 494 | TEST(F32_VSQR__SCALAR_X1, inplace) { |
| 495 | for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) { |
Marat Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 496 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 497 | .batch_size(batch_size) |
| 498 | .inplace(true) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 499 | .Test(xnn_f32_vsqr_ukernel__scalar_x1, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 500 | } |
| 501 | } |
| 502 | |
Frank Barchard | 177fe2d | 2020-06-11 11:09:33 -0700 | [diff] [blame] | 503 | |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 504 | TEST(F32_VSQR__SCALAR_X2, batch_eq_2) { |
Marat Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 505 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 506 | .batch_size(2) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 507 | .Test(xnn_f32_vsqr_ukernel__scalar_x2, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 508 | } |
| 509 | |
| 510 | TEST(F32_VSQR__SCALAR_X2, batch_div_2) { |
| 511 | for (size_t batch_size = 4; batch_size < 20; batch_size += 2) { |
Marat Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 512 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 513 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 514 | .Test(xnn_f32_vsqr_ukernel__scalar_x2, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 515 | } |
| 516 | } |
| 517 | |
| 518 | TEST(F32_VSQR__SCALAR_X2, batch_lt_2) { |
| 519 | for (size_t batch_size = 1; batch_size < 2; batch_size++) { |
Marat Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 520 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 521 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 522 | .Test(xnn_f32_vsqr_ukernel__scalar_x2, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 523 | } |
| 524 | } |
| 525 | |
| 526 | TEST(F32_VSQR__SCALAR_X2, batch_gt_2) { |
| 527 | for (size_t batch_size = 3; batch_size < 4; batch_size++) { |
Marat Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 528 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 529 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 530 | .Test(xnn_f32_vsqr_ukernel__scalar_x2, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 531 | } |
| 532 | } |
| 533 | |
| 534 | TEST(F32_VSQR__SCALAR_X2, inplace) { |
| 535 | for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) { |
Marat Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 536 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 537 | .batch_size(batch_size) |
| 538 | .inplace(true) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 539 | .Test(xnn_f32_vsqr_ukernel__scalar_x2, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 540 | } |
| 541 | } |
| 542 | |
Frank Barchard | 177fe2d | 2020-06-11 11:09:33 -0700 | [diff] [blame] | 543 | |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 544 | TEST(F32_VSQR__SCALAR_X4, batch_eq_4) { |
Marat Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 545 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 546 | .batch_size(4) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 547 | .Test(xnn_f32_vsqr_ukernel__scalar_x4, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 548 | } |
| 549 | |
| 550 | TEST(F32_VSQR__SCALAR_X4, batch_div_4) { |
| 551 | for (size_t batch_size = 8; batch_size < 40; batch_size += 4) { |
Marat Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 552 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 553 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 554 | .Test(xnn_f32_vsqr_ukernel__scalar_x4, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 555 | } |
| 556 | } |
| 557 | |
| 558 | TEST(F32_VSQR__SCALAR_X4, batch_lt_4) { |
| 559 | for (size_t batch_size = 1; batch_size < 4; batch_size++) { |
Marat Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 560 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 561 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 562 | .Test(xnn_f32_vsqr_ukernel__scalar_x4, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 563 | } |
| 564 | } |
| 565 | |
| 566 | TEST(F32_VSQR__SCALAR_X4, batch_gt_4) { |
| 567 | for (size_t batch_size = 5; batch_size < 8; batch_size++) { |
Marat Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 568 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 569 | .batch_size(batch_size) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 570 | .Test(xnn_f32_vsqr_ukernel__scalar_x4, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 571 | } |
| 572 | } |
| 573 | |
| 574 | TEST(F32_VSQR__SCALAR_X4, inplace) { |
| 575 | for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) { |
Marat Dukhan | 87ed45c | 2021-05-13 12:25:22 -0700 | [diff] [blame] | 576 | VUnaryMicrokernelTester() |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 577 | .batch_size(batch_size) |
| 578 | .inplace(true) |
Marat Dukhan | 6eaab71 | 2021-05-13 15:20:58 -0700 | [diff] [blame] | 579 | .Test(xnn_f32_vsqr_ukernel__scalar_x4, VUnaryMicrokernelTester::OpType::Square, VUnaryMicrokernelTester::Variant::Scalar); |
Marat Dukhan | 2b9efd8 | 2020-06-08 01:09:31 -0700 | [diff] [blame] | 580 | } |
Frank Barchard | 177fe2d | 2020-06-11 11:09:33 -0700 | [diff] [blame] | 581 | } |