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 | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 26 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub); |
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 | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 34 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub); |
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 | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 43 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub); |
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 | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 52 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub); |
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 | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 62 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub); |
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 | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 72 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub); |
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 | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 83 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub); |
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 | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 93 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub); |
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 | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 103 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub); |
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 | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 114 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub); |
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 | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 122 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub); |
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 | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 131 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub); |
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 | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 140 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub); |
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 | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 150 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub); |
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 | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 160 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub); |
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 | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 171 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub); |
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 | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 181 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub); |
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 | 10f1fe0 | 2021-05-13 12:51:12 -0700 | [diff] [blame] | 191 | .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub); |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 192 | } |
| 193 | } |
| 194 | #endif // XNN_ARCH_ARM64 |