blob: b31f7a919b3a56e141de505887772d39e9a2d3bb [file] [log] [blame]
Frank Barchardd793f6c2020-05-08 13:37:43 -07001// 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 Dukhan87bd5112021-08-02 11:43:53 -070016#include <xnnpack/params-init.h>
Frank Barchardd793f6c2020-05-08 13:37:43 -070017#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 Dukhan10f1fe02021-05-13 12:51:12 -070024 VBinaryMicrokernelTester()
Frank Barchardd793f6c2020-05-08 13:37:43 -070025 .batch_size(8)
Marat Dukhan10f1fe02021-05-13 12:51:12 -070026 .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub);
Frank Barchardd793f6c2020-05-08 13:37:43 -070027 }
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 Dukhan10f1fe02021-05-13 12:51:12 -070032 VBinaryMicrokernelTester()
Frank Barchardd793f6c2020-05-08 13:37:43 -070033 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -070034 .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub);
Frank Barchardd793f6c2020-05-08 13:37:43 -070035 }
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 Dukhan10f1fe02021-05-13 12:51:12 -070041 VBinaryMicrokernelTester()
Frank Barchardd793f6c2020-05-08 13:37:43 -070042 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -070043 .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub);
Frank Barchardd793f6c2020-05-08 13:37:43 -070044 }
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 Dukhan10f1fe02021-05-13 12:51:12 -070050 VBinaryMicrokernelTester()
Frank Barchardd793f6c2020-05-08 13:37:43 -070051 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -070052 .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub);
Frank Barchardd793f6c2020-05-08 13:37:43 -070053 }
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 Dukhan10f1fe02021-05-13 12:51:12 -070059 VBinaryMicrokernelTester()
Frank Barchardd793f6c2020-05-08 13:37:43 -070060 .batch_size(batch_size)
61 .inplace_a(true)
Marat Dukhan10f1fe02021-05-13 12:51:12 -070062 .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub);
Frank Barchardd793f6c2020-05-08 13:37:43 -070063 }
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 Dukhan10f1fe02021-05-13 12:51:12 -070069 VBinaryMicrokernelTester()
Frank Barchardd793f6c2020-05-08 13:37:43 -070070 .batch_size(batch_size)
71 .inplace_b(true)
Marat Dukhan10f1fe02021-05-13 12:51:12 -070072 .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub);
Frank Barchardd793f6c2020-05-08 13:37:43 -070073 }
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 Dukhan10f1fe02021-05-13 12:51:12 -070079 VBinaryMicrokernelTester()
Frank Barchardd793f6c2020-05-08 13:37:43 -070080 .batch_size(batch_size)
81 .inplace_a(true)
82 .inplace_b(true)
Marat Dukhan10f1fe02021-05-13 12:51:12 -070083 .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub);
Frank Barchardd793f6c2020-05-08 13:37:43 -070084 }
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 Dukhan10f1fe02021-05-13 12:51:12 -070090 VBinaryMicrokernelTester()
Frank Barchardd793f6c2020-05-08 13:37:43 -070091 .batch_size(batch_size)
92 .qmin(128)
Marat Dukhan10f1fe02021-05-13 12:51:12 -070093 .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub);
Frank Barchardd793f6c2020-05-08 13:37:43 -070094 }
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 Dukhan10f1fe02021-05-13 12:51:12 -0700100 VBinaryMicrokernelTester()
Frank Barchardd793f6c2020-05-08 13:37:43 -0700101 .batch_size(batch_size)
102 .qmax(128)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700103 .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x8, VBinaryMicrokernelTester::OpType::Sub);
Frank Barchardd793f6c2020-05-08 13:37:43 -0700104 }
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 Dukhan10f1fe02021-05-13 12:51:12 -0700112 VBinaryMicrokernelTester()
Frank Barchardd793f6c2020-05-08 13:37:43 -0700113 .batch_size(16)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700114 .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub);
Frank Barchardd793f6c2020-05-08 13:37:43 -0700115 }
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 Dukhan10f1fe02021-05-13 12:51:12 -0700120 VBinaryMicrokernelTester()
Frank Barchardd793f6c2020-05-08 13:37:43 -0700121 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700122 .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub);
Frank Barchardd793f6c2020-05-08 13:37:43 -0700123 }
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 Dukhan10f1fe02021-05-13 12:51:12 -0700129 VBinaryMicrokernelTester()
Frank Barchardd793f6c2020-05-08 13:37:43 -0700130 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700131 .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub);
Frank Barchardd793f6c2020-05-08 13:37:43 -0700132 }
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 Dukhan10f1fe02021-05-13 12:51:12 -0700138 VBinaryMicrokernelTester()
Frank Barchardd793f6c2020-05-08 13:37:43 -0700139 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700140 .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub);
Frank Barchardd793f6c2020-05-08 13:37:43 -0700141 }
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 Dukhan10f1fe02021-05-13 12:51:12 -0700147 VBinaryMicrokernelTester()
Frank Barchardd793f6c2020-05-08 13:37:43 -0700148 .batch_size(batch_size)
149 .inplace_a(true)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700150 .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub);
Frank Barchardd793f6c2020-05-08 13:37:43 -0700151 }
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 Dukhan10f1fe02021-05-13 12:51:12 -0700157 VBinaryMicrokernelTester()
Frank Barchardd793f6c2020-05-08 13:37:43 -0700158 .batch_size(batch_size)
159 .inplace_b(true)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700160 .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub);
Frank Barchardd793f6c2020-05-08 13:37:43 -0700161 }
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 Dukhan10f1fe02021-05-13 12:51:12 -0700167 VBinaryMicrokernelTester()
Frank Barchardd793f6c2020-05-08 13:37:43 -0700168 .batch_size(batch_size)
169 .inplace_a(true)
170 .inplace_b(true)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700171 .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub);
Frank Barchardd793f6c2020-05-08 13:37:43 -0700172 }
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 Dukhan10f1fe02021-05-13 12:51:12 -0700178 VBinaryMicrokernelTester()
Frank Barchardd793f6c2020-05-08 13:37:43 -0700179 .batch_size(batch_size)
180 .qmin(128)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700181 .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub);
Frank Barchardd793f6c2020-05-08 13:37:43 -0700182 }
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 Dukhan10f1fe02021-05-13 12:51:12 -0700188 VBinaryMicrokernelTester()
Frank Barchardd793f6c2020-05-08 13:37:43 -0700189 .batch_size(batch_size)
190 .qmax(128)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700191 .Test(xnn_f16_vsub_minmax_ukernel__neonfp16arith_x16, VBinaryMicrokernelTester::OpType::Sub);
Frank Barchardd793f6c2020-05-08 13:37:43 -0700192 }
193 }
194#endif // XNN_ARCH_ARM64