Frank Barchard | d793f6c | 2020-05-08 13:37:43 -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/f16-vsub-minmax.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 | |
Marat Dukhan | 87bd511 | 2021-08-02 11:43:53 -0700 | [diff] [blame] | 16 | #include <xnnpack/params-init.h> |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 17 | #include <xnnpack/vbinary.h> |
| 18 | #include "vbinary-microkernel-tester.h" |
| 19 | |
| 20 | |
| 21 | #if XNN_ARCH_ARM64 |
| 22 | TEST(F16_VSUB_MINMAX__NEONFP16ARITH_X8, batch_eq_8) { |
| 23 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
Marat Dukhan | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 24 | VBinaryMicrokernelTester() |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 25 | .batch_size(8) |
Marat Dukhan | 645af97 | 2022-01-09 22:50:27 -0800 | [diff] [blame] | 26 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_neon_params); |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | TEST(F16_VSUB_MINMAX__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) { |
Marat Dukhan | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 32 | VBinaryMicrokernelTester() |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 33 | .batch_size(batch_size) |
Marat Dukhan | 645af97 | 2022-01-09 22:50:27 -0800 | [diff] [blame] | 34 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_neon_params); |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 35 | } |
| 36 | } |
| 37 | |
| 38 | TEST(F16_VSUB_MINMAX__NEONFP16ARITH_X8, batch_lt_8) { |
| 39 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 40 | for (size_t batch_size = 1; batch_size < 8; batch_size++) { |
Marat Dukhan | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 41 | VBinaryMicrokernelTester() |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 42 | .batch_size(batch_size) |
Marat Dukhan | 645af97 | 2022-01-09 22:50:27 -0800 | [diff] [blame] | 43 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_neon_params); |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 44 | } |
| 45 | } |
| 46 | |
| 47 | TEST(F16_VSUB_MINMAX__NEONFP16ARITH_X8, batch_gt_8) { |
| 48 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 49 | for (size_t batch_size = 9; batch_size < 16; batch_size++) { |
Marat Dukhan | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 50 | VBinaryMicrokernelTester() |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 51 | .batch_size(batch_size) |
Marat Dukhan | 645af97 | 2022-01-09 22:50:27 -0800 | [diff] [blame] | 52 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_neon_params); |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 53 | } |
| 54 | } |
| 55 | |
| 56 | TEST(F16_VSUB_MINMAX__NEONFP16ARITH_X8, inplace_a) { |
| 57 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 58 | for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { |
Marat Dukhan | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 59 | VBinaryMicrokernelTester() |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 60 | .batch_size(batch_size) |
| 61 | .inplace_a(true) |
Marat Dukhan | 645af97 | 2022-01-09 22:50:27 -0800 | [diff] [blame] | 62 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_neon_params); |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 63 | } |
| 64 | } |
| 65 | |
| 66 | TEST(F16_VSUB_MINMAX__NEONFP16ARITH_X8, inplace_b) { |
| 67 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 68 | for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { |
Marat Dukhan | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 69 | VBinaryMicrokernelTester() |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 70 | .batch_size(batch_size) |
| 71 | .inplace_b(true) |
Marat Dukhan | 645af97 | 2022-01-09 22:50:27 -0800 | [diff] [blame] | 72 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_neon_params); |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 73 | } |
| 74 | } |
| 75 | |
| 76 | TEST(F16_VSUB_MINMAX__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) { |
Marat Dukhan | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 79 | VBinaryMicrokernelTester() |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 80 | .batch_size(batch_size) |
| 81 | .inplace_a(true) |
| 82 | .inplace_b(true) |
Marat Dukhan | 645af97 | 2022-01-09 22:50:27 -0800 | [diff] [blame] | 83 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_neon_params); |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 84 | } |
| 85 | } |
| 86 | |
| 87 | TEST(F16_VSUB_MINMAX__NEONFP16ARITH_X8, qmin) { |
| 88 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 89 | for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { |
Marat Dukhan | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 90 | VBinaryMicrokernelTester() |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 91 | .batch_size(batch_size) |
| 92 | .qmin(128) |
Marat Dukhan | 645af97 | 2022-01-09 22:50:27 -0800 | [diff] [blame] | 93 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_neon_params); |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 94 | } |
| 95 | } |
| 96 | |
| 97 | TEST(F16_VSUB_MINMAX__NEONFP16ARITH_X8, qmax) { |
| 98 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 99 | for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { |
Marat Dukhan | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 100 | VBinaryMicrokernelTester() |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 101 | .batch_size(batch_size) |
| 102 | .qmax(128) |
Marat Dukhan | 645af97 | 2022-01-09 22:50:27 -0800 | [diff] [blame] | 103 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_neon_params); |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 104 | } |
| 105 | } |
| 106 | #endif // XNN_ARCH_ARM64 |
| 107 | |
| 108 | |
| 109 | #if XNN_ARCH_ARM64 |
| 110 | TEST(F16_VSUB_MINMAX__NEONFP16ARITH_X16, batch_eq_16) { |
| 111 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
Marat Dukhan | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 112 | VBinaryMicrokernelTester() |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 113 | .batch_size(16) |
Marat Dukhan | 645af97 | 2022-01-09 22:50:27 -0800 | [diff] [blame] | 114 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_neon_params); |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 115 | } |
| 116 | |
| 117 | TEST(F16_VSUB_MINMAX__NEONFP16ARITH_X16, batch_div_16) { |
| 118 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 119 | for (size_t batch_size = 32; batch_size < 160; batch_size += 16) { |
Marat Dukhan | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 120 | VBinaryMicrokernelTester() |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 121 | .batch_size(batch_size) |
Marat Dukhan | 645af97 | 2022-01-09 22:50:27 -0800 | [diff] [blame] | 122 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_neon_params); |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 123 | } |
| 124 | } |
| 125 | |
| 126 | TEST(F16_VSUB_MINMAX__NEONFP16ARITH_X16, batch_lt_16) { |
| 127 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 128 | for (size_t batch_size = 1; batch_size < 16; batch_size++) { |
Marat Dukhan | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 129 | VBinaryMicrokernelTester() |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 130 | .batch_size(batch_size) |
Marat Dukhan | 645af97 | 2022-01-09 22:50:27 -0800 | [diff] [blame] | 131 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_neon_params); |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 132 | } |
| 133 | } |
| 134 | |
| 135 | TEST(F16_VSUB_MINMAX__NEONFP16ARITH_X16, batch_gt_16) { |
| 136 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 137 | for (size_t batch_size = 17; batch_size < 32; batch_size++) { |
Marat Dukhan | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 138 | VBinaryMicrokernelTester() |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 139 | .batch_size(batch_size) |
Marat Dukhan | 645af97 | 2022-01-09 22:50:27 -0800 | [diff] [blame] | 140 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_neon_params); |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 141 | } |
| 142 | } |
| 143 | |
| 144 | TEST(F16_VSUB_MINMAX__NEONFP16ARITH_X16, inplace_a) { |
| 145 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 146 | for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { |
Marat Dukhan | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 147 | VBinaryMicrokernelTester() |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 148 | .batch_size(batch_size) |
| 149 | .inplace_a(true) |
Marat Dukhan | 645af97 | 2022-01-09 22:50:27 -0800 | [diff] [blame] | 150 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_neon_params); |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 151 | } |
| 152 | } |
| 153 | |
| 154 | TEST(F16_VSUB_MINMAX__NEONFP16ARITH_X16, inplace_b) { |
| 155 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 156 | for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { |
Marat Dukhan | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 157 | VBinaryMicrokernelTester() |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 158 | .batch_size(batch_size) |
| 159 | .inplace_b(true) |
Marat Dukhan | 645af97 | 2022-01-09 22:50:27 -0800 | [diff] [blame] | 160 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_neon_params); |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 161 | } |
| 162 | } |
| 163 | |
| 164 | TEST(F16_VSUB_MINMAX__NEONFP16ARITH_X16, inplace_a_and_b) { |
| 165 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 166 | for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { |
Marat Dukhan | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 167 | VBinaryMicrokernelTester() |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 168 | .batch_size(batch_size) |
| 169 | .inplace_a(true) |
| 170 | .inplace_b(true) |
Marat Dukhan | 645af97 | 2022-01-09 22:50:27 -0800 | [diff] [blame] | 171 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_neon_params); |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 172 | } |
| 173 | } |
| 174 | |
| 175 | TEST(F16_VSUB_MINMAX__NEONFP16ARITH_X16, qmin) { |
| 176 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 177 | for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { |
Marat Dukhan | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 178 | VBinaryMicrokernelTester() |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 179 | .batch_size(batch_size) |
| 180 | .qmin(128) |
Marat Dukhan | 645af97 | 2022-01-09 22:50:27 -0800 | [diff] [blame] | 181 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_neon_params); |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 182 | } |
| 183 | } |
| 184 | |
| 185 | TEST(F16_VSUB_MINMAX__NEONFP16ARITH_X16, qmax) { |
| 186 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 187 | for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { |
Marat Dukhan | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 188 | VBinaryMicrokernelTester() |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 189 | .batch_size(batch_size) |
| 190 | .qmax(128) |
Marat Dukhan | 645af97 | 2022-01-09 22:50:27 -0800 | [diff] [blame] | 191 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_neon_params); |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 192 | } |
| 193 | } |
| 194 | #endif // XNN_ARCH_ARM64 |
Marat Dukhan | d454545 | 2022-01-10 16:13:11 -0800 | [diff] [blame] | 195 | |
| 196 | |
| 197 | #if XNN_ARCH_X86 || XNN_ARCH_X86_64 |
| 198 | TEST(F16_VSUB_MINMAX__F16C_X8, batch_eq_8) { |
| 199 | TEST_REQUIRES_X86_F16C; |
| 200 | VBinaryMicrokernelTester() |
| 201 | .batch_size(8) |
| 202 | .Test(xnn_f16_vsub_minmax_ukernel__f16c_x8, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_avx_params); |
| 203 | } |
| 204 | |
| 205 | TEST(F16_VSUB_MINMAX__F16C_X8, batch_div_8) { |
| 206 | TEST_REQUIRES_X86_F16C; |
| 207 | for (size_t batch_size = 16; batch_size < 80; batch_size += 8) { |
| 208 | VBinaryMicrokernelTester() |
| 209 | .batch_size(batch_size) |
| 210 | .Test(xnn_f16_vsub_minmax_ukernel__f16c_x8, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_avx_params); |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | TEST(F16_VSUB_MINMAX__F16C_X8, batch_lt_8) { |
| 215 | TEST_REQUIRES_X86_F16C; |
| 216 | for (size_t batch_size = 1; batch_size < 8; batch_size++) { |
| 217 | VBinaryMicrokernelTester() |
| 218 | .batch_size(batch_size) |
| 219 | .Test(xnn_f16_vsub_minmax_ukernel__f16c_x8, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_avx_params); |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | TEST(F16_VSUB_MINMAX__F16C_X8, batch_gt_8) { |
| 224 | TEST_REQUIRES_X86_F16C; |
| 225 | for (size_t batch_size = 9; batch_size < 16; batch_size++) { |
| 226 | VBinaryMicrokernelTester() |
| 227 | .batch_size(batch_size) |
| 228 | .Test(xnn_f16_vsub_minmax_ukernel__f16c_x8, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_avx_params); |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | TEST(F16_VSUB_MINMAX__F16C_X8, inplace_a) { |
| 233 | TEST_REQUIRES_X86_F16C; |
| 234 | for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { |
| 235 | VBinaryMicrokernelTester() |
| 236 | .batch_size(batch_size) |
| 237 | .inplace_a(true) |
| 238 | .Test(xnn_f16_vsub_minmax_ukernel__f16c_x8, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_avx_params); |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | TEST(F16_VSUB_MINMAX__F16C_X8, inplace_b) { |
| 243 | TEST_REQUIRES_X86_F16C; |
| 244 | for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { |
| 245 | VBinaryMicrokernelTester() |
| 246 | .batch_size(batch_size) |
| 247 | .inplace_b(true) |
| 248 | .Test(xnn_f16_vsub_minmax_ukernel__f16c_x8, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_avx_params); |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | TEST(F16_VSUB_MINMAX__F16C_X8, inplace_a_and_b) { |
| 253 | TEST_REQUIRES_X86_F16C; |
| 254 | for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { |
| 255 | VBinaryMicrokernelTester() |
| 256 | .batch_size(batch_size) |
| 257 | .inplace_a(true) |
| 258 | .inplace_b(true) |
| 259 | .Test(xnn_f16_vsub_minmax_ukernel__f16c_x8, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_avx_params); |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | TEST(F16_VSUB_MINMAX__F16C_X8, qmin) { |
| 264 | TEST_REQUIRES_X86_F16C; |
| 265 | for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { |
| 266 | VBinaryMicrokernelTester() |
| 267 | .batch_size(batch_size) |
| 268 | .qmin(128) |
| 269 | .Test(xnn_f16_vsub_minmax_ukernel__f16c_x8, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_avx_params); |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | TEST(F16_VSUB_MINMAX__F16C_X8, qmax) { |
| 274 | TEST_REQUIRES_X86_F16C; |
| 275 | for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { |
| 276 | VBinaryMicrokernelTester() |
| 277 | .batch_size(batch_size) |
| 278 | .qmax(128) |
| 279 | .Test(xnn_f16_vsub_minmax_ukernel__f16c_x8, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_avx_params); |
| 280 | } |
| 281 | } |
| 282 | #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 |
| 283 | |
| 284 | |
| 285 | #if XNN_ARCH_X86 || XNN_ARCH_X86_64 |
| 286 | TEST(F16_VSUB_MINMAX__F16C_X16, batch_eq_16) { |
| 287 | TEST_REQUIRES_X86_F16C; |
| 288 | VBinaryMicrokernelTester() |
| 289 | .batch_size(16) |
| 290 | .Test(xnn_f16_vsub_minmax_ukernel__f16c_x16, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_avx_params); |
| 291 | } |
| 292 | |
| 293 | TEST(F16_VSUB_MINMAX__F16C_X16, batch_div_16) { |
| 294 | TEST_REQUIRES_X86_F16C; |
| 295 | for (size_t batch_size = 32; batch_size < 160; batch_size += 16) { |
| 296 | VBinaryMicrokernelTester() |
| 297 | .batch_size(batch_size) |
| 298 | .Test(xnn_f16_vsub_minmax_ukernel__f16c_x16, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_avx_params); |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | TEST(F16_VSUB_MINMAX__F16C_X16, batch_lt_16) { |
| 303 | TEST_REQUIRES_X86_F16C; |
| 304 | for (size_t batch_size = 1; batch_size < 16; batch_size++) { |
| 305 | VBinaryMicrokernelTester() |
| 306 | .batch_size(batch_size) |
| 307 | .Test(xnn_f16_vsub_minmax_ukernel__f16c_x16, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_avx_params); |
| 308 | } |
| 309 | } |
| 310 | |
| 311 | TEST(F16_VSUB_MINMAX__F16C_X16, batch_gt_16) { |
| 312 | TEST_REQUIRES_X86_F16C; |
| 313 | for (size_t batch_size = 17; batch_size < 32; batch_size++) { |
| 314 | VBinaryMicrokernelTester() |
| 315 | .batch_size(batch_size) |
| 316 | .Test(xnn_f16_vsub_minmax_ukernel__f16c_x16, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_avx_params); |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | TEST(F16_VSUB_MINMAX__F16C_X16, inplace_a) { |
| 321 | TEST_REQUIRES_X86_F16C; |
| 322 | for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { |
| 323 | VBinaryMicrokernelTester() |
| 324 | .batch_size(batch_size) |
| 325 | .inplace_a(true) |
| 326 | .Test(xnn_f16_vsub_minmax_ukernel__f16c_x16, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_avx_params); |
| 327 | } |
| 328 | } |
| 329 | |
| 330 | TEST(F16_VSUB_MINMAX__F16C_X16, inplace_b) { |
| 331 | TEST_REQUIRES_X86_F16C; |
| 332 | for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { |
| 333 | VBinaryMicrokernelTester() |
| 334 | .batch_size(batch_size) |
| 335 | .inplace_b(true) |
| 336 | .Test(xnn_f16_vsub_minmax_ukernel__f16c_x16, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_avx_params); |
| 337 | } |
| 338 | } |
| 339 | |
| 340 | TEST(F16_VSUB_MINMAX__F16C_X16, inplace_a_and_b) { |
| 341 | TEST_REQUIRES_X86_F16C; |
| 342 | for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { |
| 343 | VBinaryMicrokernelTester() |
| 344 | .batch_size(batch_size) |
| 345 | .inplace_a(true) |
| 346 | .inplace_b(true) |
| 347 | .Test(xnn_f16_vsub_minmax_ukernel__f16c_x16, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_avx_params); |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | TEST(F16_VSUB_MINMAX__F16C_X16, qmin) { |
| 352 | TEST_REQUIRES_X86_F16C; |
| 353 | for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { |
| 354 | VBinaryMicrokernelTester() |
| 355 | .batch_size(batch_size) |
| 356 | .qmin(128) |
| 357 | .Test(xnn_f16_vsub_minmax_ukernel__f16c_x16, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_avx_params); |
| 358 | } |
| 359 | } |
| 360 | |
| 361 | TEST(F16_VSUB_MINMAX__F16C_X16, qmax) { |
| 362 | TEST_REQUIRES_X86_F16C; |
| 363 | for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { |
| 364 | VBinaryMicrokernelTester() |
| 365 | .batch_size(batch_size) |
| 366 | .qmax(128) |
| 367 | .Test(xnn_f16_vsub_minmax_ukernel__f16c_x16, VBinaryMicrokernelTester::OpType::Sub, xnn_init_f16_minmax_avx_params); |
| 368 | } |
| 369 | } |
| 370 | #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 |