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/f16-vsqrdiff.yaml 8 // Generator: tools/generate-vbinary-test.py 9 10 11 #include <gtest/gtest.h> 12 13 #include <xnnpack/common.h> 14 #include <xnnpack/isa-checks.h> 15 16 #include <xnnpack/microparams-init.h> 17 #include <xnnpack/vbinary.h> 18 #include "vbinary-microkernel-tester.h" 19 20 21 #if XNN_ENABLE_ARM_FP16 && XNN_ARCH_ARM64 TEST(F16_VSQRDIFF__NEONFP16ARITH_X8,batch_eq_8)22 TEST(F16_VSQRDIFF__NEONFP16ARITH_X8, batch_eq_8) { 23 TEST_REQUIRES_ARM_NEON_FP16_ARITH; 24 VBinaryMicrokernelTester() 25 .batch_size(8) 26 .Test(xnn_f16_vsqrdiff_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::SqrDiff); 27 } 28 TEST(F16_VSQRDIFF__NEONFP16ARITH_X8,batch_div_8)29 TEST(F16_VSQRDIFF__NEONFP16ARITH_X8, batch_div_8) { 30 TEST_REQUIRES_ARM_NEON_FP16_ARITH; 31 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) { 32 VBinaryMicrokernelTester() 33 .batch_size(batch_size) 34 .Test(xnn_f16_vsqrdiff_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::SqrDiff); 35 } 36 } 37 TEST(F16_VSQRDIFF__NEONFP16ARITH_X8,batch_lt_8)38 TEST(F16_VSQRDIFF__NEONFP16ARITH_X8, batch_lt_8) { 39 TEST_REQUIRES_ARM_NEON_FP16_ARITH; 40 for (size_t batch_size = 1; batch_size < 8; batch_size++) { 41 VBinaryMicrokernelTester() 42 .batch_size(batch_size) 43 .Test(xnn_f16_vsqrdiff_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::SqrDiff); 44 } 45 } 46 TEST(F16_VSQRDIFF__NEONFP16ARITH_X8,batch_gt_8)47 TEST(F16_VSQRDIFF__NEONFP16ARITH_X8, batch_gt_8) { 48 TEST_REQUIRES_ARM_NEON_FP16_ARITH; 49 for (size_t batch_size = 9; batch_size < 16; batch_size++) { 50 VBinaryMicrokernelTester() 51 .batch_size(batch_size) 52 .Test(xnn_f16_vsqrdiff_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::SqrDiff); 53 } 54 } 55 TEST(F16_VSQRDIFF__NEONFP16ARITH_X8,inplace_a)56 TEST(F16_VSQRDIFF__NEONFP16ARITH_X8, inplace_a) { 57 TEST_REQUIRES_ARM_NEON_FP16_ARITH; 58 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { 59 VBinaryMicrokernelTester() 60 .batch_size(batch_size) 61 .inplace_a(true) 62 .Test(xnn_f16_vsqrdiff_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::SqrDiff); 63 } 64 } 65 TEST(F16_VSQRDIFF__NEONFP16ARITH_X8,inplace_b)66 TEST(F16_VSQRDIFF__NEONFP16ARITH_X8, inplace_b) { 67 TEST_REQUIRES_ARM_NEON_FP16_ARITH; 68 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { 69 VBinaryMicrokernelTester() 70 .batch_size(batch_size) 71 .inplace_b(true) 72 .Test(xnn_f16_vsqrdiff_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::SqrDiff); 73 } 74 } 75 TEST(F16_VSQRDIFF__NEONFP16ARITH_X8,inplace_a_and_b)76 TEST(F16_VSQRDIFF__NEONFP16ARITH_X8, inplace_a_and_b) { 77 TEST_REQUIRES_ARM_NEON_FP16_ARITH; 78 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { 79 VBinaryMicrokernelTester() 80 .batch_size(batch_size) 81 .inplace_a(true) 82 .inplace_b(true) 83 .Test(xnn_f16_vsqrdiff_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::SqrDiff); 84 } 85 } 86 #endif // XNN_ENABLE_ARM_FP16 && XNN_ARCH_ARM64 87 88 89 #if XNN_ENABLE_ARM_FP16 && XNN_ARCH_ARM64 TEST(F16_VSQRDIFF__NEONFP16ARITH_X16,batch_eq_16)90 TEST(F16_VSQRDIFF__NEONFP16ARITH_X16, batch_eq_16) { 91 TEST_REQUIRES_ARM_NEON_FP16_ARITH; 92 VBinaryMicrokernelTester() 93 .batch_size(16) 94 .Test(xnn_f16_vsqrdiff_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::SqrDiff); 95 } 96 TEST(F16_VSQRDIFF__NEONFP16ARITH_X16,batch_div_16)97 TEST(F16_VSQRDIFF__NEONFP16ARITH_X16, batch_div_16) { 98 TEST_REQUIRES_ARM_NEON_FP16_ARITH; 99 for (size_t batch_size = 32; batch_size < 160; batch_size += 16) { 100 VBinaryMicrokernelTester() 101 .batch_size(batch_size) 102 .Test(xnn_f16_vsqrdiff_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::SqrDiff); 103 } 104 } 105 TEST(F16_VSQRDIFF__NEONFP16ARITH_X16,batch_lt_16)106 TEST(F16_VSQRDIFF__NEONFP16ARITH_X16, batch_lt_16) { 107 TEST_REQUIRES_ARM_NEON_FP16_ARITH; 108 for (size_t batch_size = 1; batch_size < 16; batch_size++) { 109 VBinaryMicrokernelTester() 110 .batch_size(batch_size) 111 .Test(xnn_f16_vsqrdiff_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::SqrDiff); 112 } 113 } 114 TEST(F16_VSQRDIFF__NEONFP16ARITH_X16,batch_gt_16)115 TEST(F16_VSQRDIFF__NEONFP16ARITH_X16, batch_gt_16) { 116 TEST_REQUIRES_ARM_NEON_FP16_ARITH; 117 for (size_t batch_size = 17; batch_size < 32; batch_size++) { 118 VBinaryMicrokernelTester() 119 .batch_size(batch_size) 120 .Test(xnn_f16_vsqrdiff_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::SqrDiff); 121 } 122 } 123 TEST(F16_VSQRDIFF__NEONFP16ARITH_X16,inplace_a)124 TEST(F16_VSQRDIFF__NEONFP16ARITH_X16, inplace_a) { 125 TEST_REQUIRES_ARM_NEON_FP16_ARITH; 126 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { 127 VBinaryMicrokernelTester() 128 .batch_size(batch_size) 129 .inplace_a(true) 130 .Test(xnn_f16_vsqrdiff_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::SqrDiff); 131 } 132 } 133 TEST(F16_VSQRDIFF__NEONFP16ARITH_X16,inplace_b)134 TEST(F16_VSQRDIFF__NEONFP16ARITH_X16, inplace_b) { 135 TEST_REQUIRES_ARM_NEON_FP16_ARITH; 136 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { 137 VBinaryMicrokernelTester() 138 .batch_size(batch_size) 139 .inplace_b(true) 140 .Test(xnn_f16_vsqrdiff_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::SqrDiff); 141 } 142 } 143 TEST(F16_VSQRDIFF__NEONFP16ARITH_X16,inplace_a_and_b)144 TEST(F16_VSQRDIFF__NEONFP16ARITH_X16, inplace_a_and_b) { 145 TEST_REQUIRES_ARM_NEON_FP16_ARITH; 146 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { 147 VBinaryMicrokernelTester() 148 .batch_size(batch_size) 149 .inplace_a(true) 150 .inplace_b(true) 151 .Test(xnn_f16_vsqrdiff_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::SqrDiff); 152 } 153 } 154 #endif // XNN_ENABLE_ARM_FP16 && XNN_ARCH_ARM64 155 156 157 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F16_VSQRDIFF__F16C_X8,batch_eq_8)158 TEST(F16_VSQRDIFF__F16C_X8, batch_eq_8) { 159 TEST_REQUIRES_X86_F16C; 160 VBinaryMicrokernelTester() 161 .batch_size(8) 162 .Test(xnn_f16_vsqrdiff_ukernel__f16c_x8, VBinaryMicrokernelTester::OpType::SqrDiff); 163 } 164 TEST(F16_VSQRDIFF__F16C_X8,batch_div_8)165 TEST(F16_VSQRDIFF__F16C_X8, batch_div_8) { 166 TEST_REQUIRES_X86_F16C; 167 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) { 168 VBinaryMicrokernelTester() 169 .batch_size(batch_size) 170 .Test(xnn_f16_vsqrdiff_ukernel__f16c_x8, VBinaryMicrokernelTester::OpType::SqrDiff); 171 } 172 } 173 TEST(F16_VSQRDIFF__F16C_X8,batch_lt_8)174 TEST(F16_VSQRDIFF__F16C_X8, batch_lt_8) { 175 TEST_REQUIRES_X86_F16C; 176 for (size_t batch_size = 1; batch_size < 8; batch_size++) { 177 VBinaryMicrokernelTester() 178 .batch_size(batch_size) 179 .Test(xnn_f16_vsqrdiff_ukernel__f16c_x8, VBinaryMicrokernelTester::OpType::SqrDiff); 180 } 181 } 182 TEST(F16_VSQRDIFF__F16C_X8,batch_gt_8)183 TEST(F16_VSQRDIFF__F16C_X8, batch_gt_8) { 184 TEST_REQUIRES_X86_F16C; 185 for (size_t batch_size = 9; batch_size < 16; batch_size++) { 186 VBinaryMicrokernelTester() 187 .batch_size(batch_size) 188 .Test(xnn_f16_vsqrdiff_ukernel__f16c_x8, VBinaryMicrokernelTester::OpType::SqrDiff); 189 } 190 } 191 TEST(F16_VSQRDIFF__F16C_X8,inplace_a)192 TEST(F16_VSQRDIFF__F16C_X8, inplace_a) { 193 TEST_REQUIRES_X86_F16C; 194 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { 195 VBinaryMicrokernelTester() 196 .batch_size(batch_size) 197 .inplace_a(true) 198 .Test(xnn_f16_vsqrdiff_ukernel__f16c_x8, VBinaryMicrokernelTester::OpType::SqrDiff); 199 } 200 } 201 TEST(F16_VSQRDIFF__F16C_X8,inplace_b)202 TEST(F16_VSQRDIFF__F16C_X8, inplace_b) { 203 TEST_REQUIRES_X86_F16C; 204 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { 205 VBinaryMicrokernelTester() 206 .batch_size(batch_size) 207 .inplace_b(true) 208 .Test(xnn_f16_vsqrdiff_ukernel__f16c_x8, VBinaryMicrokernelTester::OpType::SqrDiff); 209 } 210 } 211 TEST(F16_VSQRDIFF__F16C_X8,inplace_a_and_b)212 TEST(F16_VSQRDIFF__F16C_X8, inplace_a_and_b) { 213 TEST_REQUIRES_X86_F16C; 214 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { 215 VBinaryMicrokernelTester() 216 .batch_size(batch_size) 217 .inplace_a(true) 218 .inplace_b(true) 219 .Test(xnn_f16_vsqrdiff_ukernel__f16c_x8, VBinaryMicrokernelTester::OpType::SqrDiff); 220 } 221 } 222 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 223 224 225 #if XNN_ARCH_X86 || XNN_ARCH_X86_64 TEST(F16_VSQRDIFF__F16C_X16,batch_eq_16)226 TEST(F16_VSQRDIFF__F16C_X16, batch_eq_16) { 227 TEST_REQUIRES_X86_F16C; 228 VBinaryMicrokernelTester() 229 .batch_size(16) 230 .Test(xnn_f16_vsqrdiff_ukernel__f16c_x16, VBinaryMicrokernelTester::OpType::SqrDiff); 231 } 232 TEST(F16_VSQRDIFF__F16C_X16,batch_div_16)233 TEST(F16_VSQRDIFF__F16C_X16, batch_div_16) { 234 TEST_REQUIRES_X86_F16C; 235 for (size_t batch_size = 32; batch_size < 160; batch_size += 16) { 236 VBinaryMicrokernelTester() 237 .batch_size(batch_size) 238 .Test(xnn_f16_vsqrdiff_ukernel__f16c_x16, VBinaryMicrokernelTester::OpType::SqrDiff); 239 } 240 } 241 TEST(F16_VSQRDIFF__F16C_X16,batch_lt_16)242 TEST(F16_VSQRDIFF__F16C_X16, batch_lt_16) { 243 TEST_REQUIRES_X86_F16C; 244 for (size_t batch_size = 1; batch_size < 16; batch_size++) { 245 VBinaryMicrokernelTester() 246 .batch_size(batch_size) 247 .Test(xnn_f16_vsqrdiff_ukernel__f16c_x16, VBinaryMicrokernelTester::OpType::SqrDiff); 248 } 249 } 250 TEST(F16_VSQRDIFF__F16C_X16,batch_gt_16)251 TEST(F16_VSQRDIFF__F16C_X16, batch_gt_16) { 252 TEST_REQUIRES_X86_F16C; 253 for (size_t batch_size = 17; batch_size < 32; batch_size++) { 254 VBinaryMicrokernelTester() 255 .batch_size(batch_size) 256 .Test(xnn_f16_vsqrdiff_ukernel__f16c_x16, VBinaryMicrokernelTester::OpType::SqrDiff); 257 } 258 } 259 TEST(F16_VSQRDIFF__F16C_X16,inplace_a)260 TEST(F16_VSQRDIFF__F16C_X16, inplace_a) { 261 TEST_REQUIRES_X86_F16C; 262 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { 263 VBinaryMicrokernelTester() 264 .batch_size(batch_size) 265 .inplace_a(true) 266 .Test(xnn_f16_vsqrdiff_ukernel__f16c_x16, VBinaryMicrokernelTester::OpType::SqrDiff); 267 } 268 } 269 TEST(F16_VSQRDIFF__F16C_X16,inplace_b)270 TEST(F16_VSQRDIFF__F16C_X16, inplace_b) { 271 TEST_REQUIRES_X86_F16C; 272 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { 273 VBinaryMicrokernelTester() 274 .batch_size(batch_size) 275 .inplace_b(true) 276 .Test(xnn_f16_vsqrdiff_ukernel__f16c_x16, VBinaryMicrokernelTester::OpType::SqrDiff); 277 } 278 } 279 TEST(F16_VSQRDIFF__F16C_X16,inplace_a_and_b)280 TEST(F16_VSQRDIFF__F16C_X16, inplace_a_and_b) { 281 TEST_REQUIRES_X86_F16C; 282 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { 283 VBinaryMicrokernelTester() 284 .batch_size(batch_size) 285 .inplace_a(true) 286 .inplace_b(true) 287 .Test(xnn_f16_vsqrdiff_ukernel__f16c_x16, VBinaryMicrokernelTester::OpType::SqrDiff); 288 } 289 } 290 #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 291