blob: 2e85c8d0329b4fd18c3401c1116e08b6725e31bb [file] [log] [blame]
Frank Barchardd5b9f1c2020-07-01 15:00:19 -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/f32-vrdivc.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 Barchardd5b9f1c2020-07-01 15:00:19 -070017#include <xnnpack/vbinary.h>
18#include "vbinaryc-microkernel-tester.h"
19
20
21#if XNN_ARCH_WASMSIMD
22 TEST(F32_VRDIVC__WASMSIMD_X4, batch_eq_4) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -070023 VBinaryCMicrokernelTester()
Frank Barchardd5b9f1c2020-07-01 15:00:19 -070024 .batch_size(4)
Marat Dukhan10f1fe02021-05-13 12:51:12 -070025 .Test(xnn_f32_vrdivc_ukernel__wasmsimd_x4, VBinaryCMicrokernelTester::OpType::RDivC);
Frank Barchardd5b9f1c2020-07-01 15:00:19 -070026 }
27
28 TEST(F32_VRDIVC__WASMSIMD_X4, batch_div_4) {
29 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -070030 VBinaryCMicrokernelTester()
Frank Barchardd5b9f1c2020-07-01 15:00:19 -070031 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -070032 .Test(xnn_f32_vrdivc_ukernel__wasmsimd_x4, VBinaryCMicrokernelTester::OpType::RDivC);
Frank Barchardd5b9f1c2020-07-01 15:00:19 -070033 }
34 }
35
36 TEST(F32_VRDIVC__WASMSIMD_X4, batch_lt_4) {
37 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -070038 VBinaryCMicrokernelTester()
Frank Barchardd5b9f1c2020-07-01 15:00:19 -070039 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -070040 .Test(xnn_f32_vrdivc_ukernel__wasmsimd_x4, VBinaryCMicrokernelTester::OpType::RDivC);
Frank Barchardd5b9f1c2020-07-01 15:00:19 -070041 }
42 }
43
44 TEST(F32_VRDIVC__WASMSIMD_X4, batch_gt_4) {
45 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -070046 VBinaryCMicrokernelTester()
Frank Barchardd5b9f1c2020-07-01 15:00:19 -070047 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -070048 .Test(xnn_f32_vrdivc_ukernel__wasmsimd_x4, VBinaryCMicrokernelTester::OpType::RDivC);
Frank Barchardd5b9f1c2020-07-01 15:00:19 -070049 }
50 }
51
52 TEST(F32_VRDIVC__WASMSIMD_X4, inplace) {
53 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -070054 VBinaryCMicrokernelTester()
Frank Barchardd5b9f1c2020-07-01 15:00:19 -070055 .batch_size(batch_size)
56 .inplace(true)
Marat Dukhan10f1fe02021-05-13 12:51:12 -070057 .Test(xnn_f32_vrdivc_ukernel__wasmsimd_x4, VBinaryCMicrokernelTester::OpType::RDivC);
Frank Barchardd5b9f1c2020-07-01 15:00:19 -070058 }
59 }
60#endif // XNN_ARCH_WASMSIMD
61
62
63#if XNN_ARCH_WASMSIMD
64 TEST(F32_VRDIVC__WASMSIMD_X8, batch_eq_8) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -070065 VBinaryCMicrokernelTester()
Frank Barchardd5b9f1c2020-07-01 15:00:19 -070066 .batch_size(8)
Marat Dukhan10f1fe02021-05-13 12:51:12 -070067 .Test(xnn_f32_vrdivc_ukernel__wasmsimd_x8, VBinaryCMicrokernelTester::OpType::RDivC);
Frank Barchardd5b9f1c2020-07-01 15:00:19 -070068 }
69
70 TEST(F32_VRDIVC__WASMSIMD_X8, batch_div_8) {
71 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -070072 VBinaryCMicrokernelTester()
Frank Barchardd5b9f1c2020-07-01 15:00:19 -070073 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -070074 .Test(xnn_f32_vrdivc_ukernel__wasmsimd_x8, VBinaryCMicrokernelTester::OpType::RDivC);
Frank Barchardd5b9f1c2020-07-01 15:00:19 -070075 }
76 }
77
78 TEST(F32_VRDIVC__WASMSIMD_X8, batch_lt_8) {
79 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -070080 VBinaryCMicrokernelTester()
Frank Barchardd5b9f1c2020-07-01 15:00:19 -070081 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -070082 .Test(xnn_f32_vrdivc_ukernel__wasmsimd_x8, VBinaryCMicrokernelTester::OpType::RDivC);
Frank Barchardd5b9f1c2020-07-01 15:00:19 -070083 }
84 }
85
86 TEST(F32_VRDIVC__WASMSIMD_X8, batch_gt_8) {
87 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -070088 VBinaryCMicrokernelTester()
Frank Barchardd5b9f1c2020-07-01 15:00:19 -070089 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -070090 .Test(xnn_f32_vrdivc_ukernel__wasmsimd_x8, VBinaryCMicrokernelTester::OpType::RDivC);
Frank Barchardd5b9f1c2020-07-01 15:00:19 -070091 }
92 }
93
94 TEST(F32_VRDIVC__WASMSIMD_X8, inplace) {
95 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -070096 VBinaryCMicrokernelTester()
Frank Barchardd5b9f1c2020-07-01 15:00:19 -070097 .batch_size(batch_size)
98 .inplace(true)
Marat Dukhan10f1fe02021-05-13 12:51:12 -070099 .Test(xnn_f32_vrdivc_ukernel__wasmsimd_x8, VBinaryCMicrokernelTester::OpType::RDivC);
Frank Barchardd5b9f1c2020-07-01 15:00:19 -0700100 }
101 }
102#endif // XNN_ARCH_WASMSIMD
Frank Barchard8e229db2020-07-06 23:31:35 -0700103
104
Frank Barchard9c7308f2020-08-31 17:03:01 -0700105#if XNN_ARCH_WASMSIMD
106 TEST(F32_VRDIVC__WASMSIMD_X16, batch_eq_16) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700107 VBinaryCMicrokernelTester()
Frank Barchard9c7308f2020-08-31 17:03:01 -0700108 .batch_size(16)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700109 .Test(xnn_f32_vrdivc_ukernel__wasmsimd_x16, VBinaryCMicrokernelTester::OpType::RDivC);
Frank Barchard9c7308f2020-08-31 17:03:01 -0700110 }
111
112 TEST(F32_VRDIVC__WASMSIMD_X16, batch_div_16) {
113 for (size_t batch_size = 32; batch_size < 160; batch_size += 16) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700114 VBinaryCMicrokernelTester()
Frank Barchard9c7308f2020-08-31 17:03:01 -0700115 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700116 .Test(xnn_f32_vrdivc_ukernel__wasmsimd_x16, VBinaryCMicrokernelTester::OpType::RDivC);
Frank Barchard9c7308f2020-08-31 17:03:01 -0700117 }
118 }
119
120 TEST(F32_VRDIVC__WASMSIMD_X16, batch_lt_16) {
121 for (size_t batch_size = 1; batch_size < 16; batch_size++) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700122 VBinaryCMicrokernelTester()
Frank Barchard9c7308f2020-08-31 17:03:01 -0700123 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700124 .Test(xnn_f32_vrdivc_ukernel__wasmsimd_x16, VBinaryCMicrokernelTester::OpType::RDivC);
Frank Barchard9c7308f2020-08-31 17:03:01 -0700125 }
126 }
127
128 TEST(F32_VRDIVC__WASMSIMD_X16, batch_gt_16) {
129 for (size_t batch_size = 17; batch_size < 32; batch_size++) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700130 VBinaryCMicrokernelTester()
Frank Barchard9c7308f2020-08-31 17:03:01 -0700131 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700132 .Test(xnn_f32_vrdivc_ukernel__wasmsimd_x16, VBinaryCMicrokernelTester::OpType::RDivC);
Frank Barchard9c7308f2020-08-31 17:03:01 -0700133 }
134 }
135
136 TEST(F32_VRDIVC__WASMSIMD_X16, inplace) {
137 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700138 VBinaryCMicrokernelTester()
Frank Barchard9c7308f2020-08-31 17:03:01 -0700139 .batch_size(batch_size)
140 .inplace(true)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700141 .Test(xnn_f32_vrdivc_ukernel__wasmsimd_x16, VBinaryCMicrokernelTester::OpType::RDivC);
Frank Barchard9c7308f2020-08-31 17:03:01 -0700142 }
143 }
144#endif // XNN_ARCH_WASMSIMD
145
146
Frank Barchard8e229db2020-07-06 23:31:35 -0700147TEST(F32_VRDIVC__SCALAR_X1, batch_eq_1) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700148 VBinaryCMicrokernelTester()
Frank Barchard8e229db2020-07-06 23:31:35 -0700149 .batch_size(1)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700150 .Test(xnn_f32_vrdivc_ukernel__scalar_x1, VBinaryCMicrokernelTester::OpType::RDivC, VBinaryCMicrokernelTester::Variant::Scalar);
Frank Barchard8e229db2020-07-06 23:31:35 -0700151}
152
153TEST(F32_VRDIVC__SCALAR_X1, batch_gt_1) {
154 for (size_t batch_size = 2; batch_size < 10; batch_size++) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700155 VBinaryCMicrokernelTester()
Frank Barchard8e229db2020-07-06 23:31:35 -0700156 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700157 .Test(xnn_f32_vrdivc_ukernel__scalar_x1, VBinaryCMicrokernelTester::OpType::RDivC, VBinaryCMicrokernelTester::Variant::Scalar);
Frank Barchard8e229db2020-07-06 23:31:35 -0700158 }
159}
160
161TEST(F32_VRDIVC__SCALAR_X1, inplace) {
162 for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700163 VBinaryCMicrokernelTester()
Frank Barchard8e229db2020-07-06 23:31:35 -0700164 .batch_size(batch_size)
165 .inplace(true)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700166 .Test(xnn_f32_vrdivc_ukernel__scalar_x1, VBinaryCMicrokernelTester::OpType::RDivC, VBinaryCMicrokernelTester::Variant::Scalar);
Frank Barchard8e229db2020-07-06 23:31:35 -0700167 }
168}
169
170
171TEST(F32_VRDIVC__SCALAR_X2, batch_eq_2) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700172 VBinaryCMicrokernelTester()
Frank Barchard8e229db2020-07-06 23:31:35 -0700173 .batch_size(2)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700174 .Test(xnn_f32_vrdivc_ukernel__scalar_x2, VBinaryCMicrokernelTester::OpType::RDivC, VBinaryCMicrokernelTester::Variant::Scalar);
Frank Barchard8e229db2020-07-06 23:31:35 -0700175}
176
177TEST(F32_VRDIVC__SCALAR_X2, batch_div_2) {
178 for (size_t batch_size = 4; batch_size < 20; batch_size += 2) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700179 VBinaryCMicrokernelTester()
Frank Barchard8e229db2020-07-06 23:31:35 -0700180 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700181 .Test(xnn_f32_vrdivc_ukernel__scalar_x2, VBinaryCMicrokernelTester::OpType::RDivC, VBinaryCMicrokernelTester::Variant::Scalar);
Frank Barchard8e229db2020-07-06 23:31:35 -0700182 }
183}
184
185TEST(F32_VRDIVC__SCALAR_X2, batch_lt_2) {
186 for (size_t batch_size = 1; batch_size < 2; batch_size++) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700187 VBinaryCMicrokernelTester()
Frank Barchard8e229db2020-07-06 23:31:35 -0700188 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700189 .Test(xnn_f32_vrdivc_ukernel__scalar_x2, VBinaryCMicrokernelTester::OpType::RDivC, VBinaryCMicrokernelTester::Variant::Scalar);
Frank Barchard8e229db2020-07-06 23:31:35 -0700190 }
191}
192
193TEST(F32_VRDIVC__SCALAR_X2, batch_gt_2) {
194 for (size_t batch_size = 3; batch_size < 4; batch_size++) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700195 VBinaryCMicrokernelTester()
Frank Barchard8e229db2020-07-06 23:31:35 -0700196 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700197 .Test(xnn_f32_vrdivc_ukernel__scalar_x2, VBinaryCMicrokernelTester::OpType::RDivC, VBinaryCMicrokernelTester::Variant::Scalar);
Frank Barchard8e229db2020-07-06 23:31:35 -0700198 }
199}
200
201TEST(F32_VRDIVC__SCALAR_X2, inplace) {
202 for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700203 VBinaryCMicrokernelTester()
Frank Barchard8e229db2020-07-06 23:31:35 -0700204 .batch_size(batch_size)
205 .inplace(true)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700206 .Test(xnn_f32_vrdivc_ukernel__scalar_x2, VBinaryCMicrokernelTester::OpType::RDivC, VBinaryCMicrokernelTester::Variant::Scalar);
Frank Barchard8e229db2020-07-06 23:31:35 -0700207 }
208}
209
210
211TEST(F32_VRDIVC__SCALAR_X4, batch_eq_4) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700212 VBinaryCMicrokernelTester()
Frank Barchard8e229db2020-07-06 23:31:35 -0700213 .batch_size(4)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700214 .Test(xnn_f32_vrdivc_ukernel__scalar_x4, VBinaryCMicrokernelTester::OpType::RDivC, VBinaryCMicrokernelTester::Variant::Scalar);
Frank Barchard8e229db2020-07-06 23:31:35 -0700215}
216
217TEST(F32_VRDIVC__SCALAR_X4, batch_div_4) {
218 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700219 VBinaryCMicrokernelTester()
Frank Barchard8e229db2020-07-06 23:31:35 -0700220 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700221 .Test(xnn_f32_vrdivc_ukernel__scalar_x4, VBinaryCMicrokernelTester::OpType::RDivC, VBinaryCMicrokernelTester::Variant::Scalar);
Frank Barchard8e229db2020-07-06 23:31:35 -0700222 }
223}
224
225TEST(F32_VRDIVC__SCALAR_X4, batch_lt_4) {
226 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700227 VBinaryCMicrokernelTester()
Frank Barchard8e229db2020-07-06 23:31:35 -0700228 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700229 .Test(xnn_f32_vrdivc_ukernel__scalar_x4, VBinaryCMicrokernelTester::OpType::RDivC, VBinaryCMicrokernelTester::Variant::Scalar);
Frank Barchard8e229db2020-07-06 23:31:35 -0700230 }
231}
232
233TEST(F32_VRDIVC__SCALAR_X4, batch_gt_4) {
234 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700235 VBinaryCMicrokernelTester()
Frank Barchard8e229db2020-07-06 23:31:35 -0700236 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700237 .Test(xnn_f32_vrdivc_ukernel__scalar_x4, VBinaryCMicrokernelTester::OpType::RDivC, VBinaryCMicrokernelTester::Variant::Scalar);
Frank Barchard8e229db2020-07-06 23:31:35 -0700238 }
239}
240
241TEST(F32_VRDIVC__SCALAR_X4, inplace) {
242 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700243 VBinaryCMicrokernelTester()
Frank Barchard8e229db2020-07-06 23:31:35 -0700244 .batch_size(batch_size)
245 .inplace(true)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700246 .Test(xnn_f32_vrdivc_ukernel__scalar_x4, VBinaryCMicrokernelTester::OpType::RDivC, VBinaryCMicrokernelTester::Variant::Scalar);
Frank Barchard8e229db2020-07-06 23:31:35 -0700247 }
248}
Frank Barchard9c7308f2020-08-31 17:03:01 -0700249
250
251TEST(F32_VRDIVC__SCALAR_X8, batch_eq_8) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700252 VBinaryCMicrokernelTester()
Frank Barchard9c7308f2020-08-31 17:03:01 -0700253 .batch_size(8)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700254 .Test(xnn_f32_vrdivc_ukernel__scalar_x8, VBinaryCMicrokernelTester::OpType::RDivC, VBinaryCMicrokernelTester::Variant::Scalar);
Frank Barchard9c7308f2020-08-31 17:03:01 -0700255}
256
257TEST(F32_VRDIVC__SCALAR_X8, batch_div_8) {
258 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700259 VBinaryCMicrokernelTester()
Frank Barchard9c7308f2020-08-31 17:03:01 -0700260 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700261 .Test(xnn_f32_vrdivc_ukernel__scalar_x8, VBinaryCMicrokernelTester::OpType::RDivC, VBinaryCMicrokernelTester::Variant::Scalar);
Frank Barchard9c7308f2020-08-31 17:03:01 -0700262 }
263}
264
265TEST(F32_VRDIVC__SCALAR_X8, batch_lt_8) {
266 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700267 VBinaryCMicrokernelTester()
Frank Barchard9c7308f2020-08-31 17:03:01 -0700268 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700269 .Test(xnn_f32_vrdivc_ukernel__scalar_x8, VBinaryCMicrokernelTester::OpType::RDivC, VBinaryCMicrokernelTester::Variant::Scalar);
Frank Barchard9c7308f2020-08-31 17:03:01 -0700270 }
271}
272
273TEST(F32_VRDIVC__SCALAR_X8, batch_gt_8) {
274 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700275 VBinaryCMicrokernelTester()
Frank Barchard9c7308f2020-08-31 17:03:01 -0700276 .batch_size(batch_size)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700277 .Test(xnn_f32_vrdivc_ukernel__scalar_x8, VBinaryCMicrokernelTester::OpType::RDivC, VBinaryCMicrokernelTester::Variant::Scalar);
Frank Barchard9c7308f2020-08-31 17:03:01 -0700278 }
279}
280
281TEST(F32_VRDIVC__SCALAR_X8, inplace) {
282 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700283 VBinaryCMicrokernelTester()
Frank Barchard9c7308f2020-08-31 17:03:01 -0700284 .batch_size(batch_size)
285 .inplace(true)
Marat Dukhan10f1fe02021-05-13 12:51:12 -0700286 .Test(xnn_f32_vrdivc_ukernel__scalar_x8, VBinaryCMicrokernelTester::OpType::RDivC, VBinaryCMicrokernelTester::Variant::Scalar);
Frank Barchard9c7308f2020-08-31 17:03:01 -0700287 }
288}