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-vmax.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/vbinary.h> |
| 17 | #include "vbinary-microkernel-tester.h" |
| 18 | |
| 19 | |
| 20 | #if XNN_ARCH_ARM64 |
| 21 | TEST(F16_VMAX__NEONFP16ARITH_X8, batch_eq_8) { |
| 22 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 23 | VBinOpMicrokernelTester() |
| 24 | .batch_size(8) |
| 25 | .Test(xnn_f16_vmax_ukernel__neonfp16arith_x8, VBinOpMicrokernelTester::OpType::Max); |
| 26 | } |
| 27 | |
| 28 | TEST(F16_VMAX__NEONFP16ARITH_X8, batch_div_8) { |
| 29 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 30 | for (size_t batch_size = 16; batch_size < 80; batch_size += 8) { |
| 31 | VBinOpMicrokernelTester() |
| 32 | .batch_size(batch_size) |
| 33 | .Test(xnn_f16_vmax_ukernel__neonfp16arith_x8, VBinOpMicrokernelTester::OpType::Max); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | TEST(F16_VMAX__NEONFP16ARITH_X8, batch_lt_8) { |
| 38 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 39 | for (size_t batch_size = 1; batch_size < 8; batch_size++) { |
| 40 | VBinOpMicrokernelTester() |
| 41 | .batch_size(batch_size) |
| 42 | .Test(xnn_f16_vmax_ukernel__neonfp16arith_x8, VBinOpMicrokernelTester::OpType::Max); |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | TEST(F16_VMAX__NEONFP16ARITH_X8, batch_gt_8) { |
| 47 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 48 | for (size_t batch_size = 9; batch_size < 16; batch_size++) { |
| 49 | VBinOpMicrokernelTester() |
| 50 | .batch_size(batch_size) |
| 51 | .Test(xnn_f16_vmax_ukernel__neonfp16arith_x8, VBinOpMicrokernelTester::OpType::Max); |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | TEST(F16_VMAX__NEONFP16ARITH_X8, inplace_a) { |
| 56 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 57 | for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { |
| 58 | VBinOpMicrokernelTester() |
| 59 | .batch_size(batch_size) |
| 60 | .inplace_a(true) |
| 61 | .Test(xnn_f16_vmax_ukernel__neonfp16arith_x8, VBinOpMicrokernelTester::OpType::Max); |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | TEST(F16_VMAX__NEONFP16ARITH_X8, inplace_b) { |
| 66 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 67 | for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { |
| 68 | VBinOpMicrokernelTester() |
| 69 | .batch_size(batch_size) |
| 70 | .inplace_b(true) |
| 71 | .Test(xnn_f16_vmax_ukernel__neonfp16arith_x8, VBinOpMicrokernelTester::OpType::Max); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | TEST(F16_VMAX__NEONFP16ARITH_X8, inplace_a_and_b) { |
| 76 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 77 | for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { |
| 78 | VBinOpMicrokernelTester() |
| 79 | .batch_size(batch_size) |
| 80 | .inplace_a(true) |
| 81 | .inplace_b(true) |
| 82 | .Test(xnn_f16_vmax_ukernel__neonfp16arith_x8, VBinOpMicrokernelTester::OpType::Max); |
| 83 | } |
| 84 | } |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 85 | #endif // XNN_ARCH_ARM64 |
| 86 | |
| 87 | |
| 88 | #if XNN_ARCH_ARM64 |
| 89 | TEST(F16_VMAX__NEONFP16ARITH_X16, batch_eq_16) { |
| 90 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 91 | VBinOpMicrokernelTester() |
| 92 | .batch_size(16) |
| 93 | .Test(xnn_f16_vmax_ukernel__neonfp16arith_x16, VBinOpMicrokernelTester::OpType::Max); |
| 94 | } |
| 95 | |
| 96 | TEST(F16_VMAX__NEONFP16ARITH_X16, batch_div_16) { |
| 97 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 98 | for (size_t batch_size = 32; batch_size < 160; batch_size += 16) { |
| 99 | VBinOpMicrokernelTester() |
| 100 | .batch_size(batch_size) |
| 101 | .Test(xnn_f16_vmax_ukernel__neonfp16arith_x16, VBinOpMicrokernelTester::OpType::Max); |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | TEST(F16_VMAX__NEONFP16ARITH_X16, batch_lt_16) { |
| 106 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 107 | for (size_t batch_size = 1; batch_size < 16; batch_size++) { |
| 108 | VBinOpMicrokernelTester() |
| 109 | .batch_size(batch_size) |
| 110 | .Test(xnn_f16_vmax_ukernel__neonfp16arith_x16, VBinOpMicrokernelTester::OpType::Max); |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | TEST(F16_VMAX__NEONFP16ARITH_X16, batch_gt_16) { |
| 115 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 116 | for (size_t batch_size = 17; batch_size < 32; batch_size++) { |
| 117 | VBinOpMicrokernelTester() |
| 118 | .batch_size(batch_size) |
| 119 | .Test(xnn_f16_vmax_ukernel__neonfp16arith_x16, VBinOpMicrokernelTester::OpType::Max); |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | TEST(F16_VMAX__NEONFP16ARITH_X16, inplace_a) { |
| 124 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 125 | for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { |
| 126 | VBinOpMicrokernelTester() |
| 127 | .batch_size(batch_size) |
| 128 | .inplace_a(true) |
| 129 | .Test(xnn_f16_vmax_ukernel__neonfp16arith_x16, VBinOpMicrokernelTester::OpType::Max); |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | TEST(F16_VMAX__NEONFP16ARITH_X16, inplace_b) { |
| 134 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 135 | for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { |
| 136 | VBinOpMicrokernelTester() |
| 137 | .batch_size(batch_size) |
| 138 | .inplace_b(true) |
| 139 | .Test(xnn_f16_vmax_ukernel__neonfp16arith_x16, VBinOpMicrokernelTester::OpType::Max); |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | TEST(F16_VMAX__NEONFP16ARITH_X16, inplace_a_and_b) { |
| 144 | TEST_REQUIRES_ARM_NEON_FP16_ARITH; |
| 145 | for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { |
| 146 | VBinOpMicrokernelTester() |
| 147 | .batch_size(batch_size) |
| 148 | .inplace_a(true) |
| 149 | .inplace_b(true) |
| 150 | .Test(xnn_f16_vmax_ukernel__neonfp16arith_x16, VBinOpMicrokernelTester::OpType::Max); |
| 151 | } |
| 152 | } |
Frank Barchard | d793f6c | 2020-05-08 13:37:43 -0700 | [diff] [blame] | 153 | #endif // XNN_ARCH_ARM64 |