blob: e76adcd712685a08a0061d5bba599f04ab3ee71c [file] [log] [blame]
Frank Barchard674778d2020-08-08 10:17:25 -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-vsubc-relu.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 "vbinaryc-microkernel-tester.h"
18
19
20#if XNN_ARCH_WASMSIMD
21 TEST(F32_VSUBC_RELU__WASMSIMD_X4, batch_eq_4) {
22 VBinOpCMicrokernelTester()
23 .batch_size(4)
24 .Test(xnn_f32_vsubc_relu_ukernel__wasmsimd_x4, VBinOpCMicrokernelTester::OpType::SubC);
25 }
26
27 TEST(F32_VSUBC_RELU__WASMSIMD_X4, batch_div_4) {
28 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
29 VBinOpCMicrokernelTester()
30 .batch_size(batch_size)
31 .Test(xnn_f32_vsubc_relu_ukernel__wasmsimd_x4, VBinOpCMicrokernelTester::OpType::SubC);
32 }
33 }
34
35 TEST(F32_VSUBC_RELU__WASMSIMD_X4, batch_lt_4) {
36 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
37 VBinOpCMicrokernelTester()
38 .batch_size(batch_size)
39 .Test(xnn_f32_vsubc_relu_ukernel__wasmsimd_x4, VBinOpCMicrokernelTester::OpType::SubC);
40 }
41 }
42
43 TEST(F32_VSUBC_RELU__WASMSIMD_X4, batch_gt_4) {
44 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
45 VBinOpCMicrokernelTester()
46 .batch_size(batch_size)
47 .Test(xnn_f32_vsubc_relu_ukernel__wasmsimd_x4, VBinOpCMicrokernelTester::OpType::SubC);
48 }
49 }
50
51 TEST(F32_VSUBC_RELU__WASMSIMD_X4, inplace) {
52 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
53 VBinOpCMicrokernelTester()
54 .batch_size(batch_size)
55 .inplace(true)
56 .Test(xnn_f32_vsubc_relu_ukernel__wasmsimd_x4, VBinOpCMicrokernelTester::OpType::SubC);
57 }
58 }
59#endif // XNN_ARCH_WASMSIMD
60
61
62#if XNN_ARCH_WASMSIMD
63 TEST(F32_VSUBC_RELU__WASMSIMD_X8, batch_eq_8) {
64 VBinOpCMicrokernelTester()
65 .batch_size(8)
66 .Test(xnn_f32_vsubc_relu_ukernel__wasmsimd_x8, VBinOpCMicrokernelTester::OpType::SubC);
67 }
68
69 TEST(F32_VSUBC_RELU__WASMSIMD_X8, batch_div_8) {
70 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
71 VBinOpCMicrokernelTester()
72 .batch_size(batch_size)
73 .Test(xnn_f32_vsubc_relu_ukernel__wasmsimd_x8, VBinOpCMicrokernelTester::OpType::SubC);
74 }
75 }
76
77 TEST(F32_VSUBC_RELU__WASMSIMD_X8, batch_lt_8) {
78 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
79 VBinOpCMicrokernelTester()
80 .batch_size(batch_size)
81 .Test(xnn_f32_vsubc_relu_ukernel__wasmsimd_x8, VBinOpCMicrokernelTester::OpType::SubC);
82 }
83 }
84
85 TEST(F32_VSUBC_RELU__WASMSIMD_X8, batch_gt_8) {
86 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
87 VBinOpCMicrokernelTester()
88 .batch_size(batch_size)
89 .Test(xnn_f32_vsubc_relu_ukernel__wasmsimd_x8, VBinOpCMicrokernelTester::OpType::SubC);
90 }
91 }
92
93 TEST(F32_VSUBC_RELU__WASMSIMD_X8, inplace) {
94 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
95 VBinOpCMicrokernelTester()
96 .batch_size(batch_size)
97 .inplace(true)
98 .Test(xnn_f32_vsubc_relu_ukernel__wasmsimd_x8, VBinOpCMicrokernelTester::OpType::SubC);
99 }
100 }
101#endif // XNN_ARCH_WASMSIMD
102
103
104#if XNN_ARCH_WASM || XNN_ARCH_WASMSIMD
105 TEST(F32_VSUBC_RELU__WASM_X1, batch_eq_1) {
106 VBinOpCMicrokernelTester()
107 .batch_size(1)
108 .Test(xnn_f32_vsubc_relu_ukernel__wasm_x1, VBinOpCMicrokernelTester::OpType::SubC);
109 }
110
111 TEST(F32_VSUBC_RELU__WASM_X1, batch_gt_1) {
112 for (size_t batch_size = 2; batch_size < 10; batch_size++) {
113 VBinOpCMicrokernelTester()
114 .batch_size(batch_size)
115 .Test(xnn_f32_vsubc_relu_ukernel__wasm_x1, VBinOpCMicrokernelTester::OpType::SubC);
116 }
117 }
118
119 TEST(F32_VSUBC_RELU__WASM_X1, inplace) {
120 for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) {
121 VBinOpCMicrokernelTester()
122 .batch_size(batch_size)
123 .inplace(true)
124 .Test(xnn_f32_vsubc_relu_ukernel__wasm_x1, VBinOpCMicrokernelTester::OpType::SubC);
125 }
126 }
127#endif // XNN_ARCH_WASM || XNN_ARCH_WASMSIMD
128
129
130#if XNN_ARCH_WASM || XNN_ARCH_WASMSIMD
131 TEST(F32_VSUBC_RELU__WASM_X2, batch_eq_2) {
132 VBinOpCMicrokernelTester()
133 .batch_size(2)
134 .Test(xnn_f32_vsubc_relu_ukernel__wasm_x2, VBinOpCMicrokernelTester::OpType::SubC);
135 }
136
137 TEST(F32_VSUBC_RELU__WASM_X2, batch_div_2) {
138 for (size_t batch_size = 4; batch_size < 20; batch_size += 2) {
139 VBinOpCMicrokernelTester()
140 .batch_size(batch_size)
141 .Test(xnn_f32_vsubc_relu_ukernel__wasm_x2, VBinOpCMicrokernelTester::OpType::SubC);
142 }
143 }
144
145 TEST(F32_VSUBC_RELU__WASM_X2, batch_lt_2) {
146 for (size_t batch_size = 1; batch_size < 2; batch_size++) {
147 VBinOpCMicrokernelTester()
148 .batch_size(batch_size)
149 .Test(xnn_f32_vsubc_relu_ukernel__wasm_x2, VBinOpCMicrokernelTester::OpType::SubC);
150 }
151 }
152
153 TEST(F32_VSUBC_RELU__WASM_X2, batch_gt_2) {
154 for (size_t batch_size = 3; batch_size < 4; batch_size++) {
155 VBinOpCMicrokernelTester()
156 .batch_size(batch_size)
157 .Test(xnn_f32_vsubc_relu_ukernel__wasm_x2, VBinOpCMicrokernelTester::OpType::SubC);
158 }
159 }
160
161 TEST(F32_VSUBC_RELU__WASM_X2, inplace) {
162 for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) {
163 VBinOpCMicrokernelTester()
164 .batch_size(batch_size)
165 .inplace(true)
166 .Test(xnn_f32_vsubc_relu_ukernel__wasm_x2, VBinOpCMicrokernelTester::OpType::SubC);
167 }
168 }
169#endif // XNN_ARCH_WASM || XNN_ARCH_WASMSIMD
170
171
172#if XNN_ARCH_WASM || XNN_ARCH_WASMSIMD
173 TEST(F32_VSUBC_RELU__WASM_X4, batch_eq_4) {
174 VBinOpCMicrokernelTester()
175 .batch_size(4)
176 .Test(xnn_f32_vsubc_relu_ukernel__wasm_x4, VBinOpCMicrokernelTester::OpType::SubC);
177 }
178
179 TEST(F32_VSUBC_RELU__WASM_X4, batch_div_4) {
180 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
181 VBinOpCMicrokernelTester()
182 .batch_size(batch_size)
183 .Test(xnn_f32_vsubc_relu_ukernel__wasm_x4, VBinOpCMicrokernelTester::OpType::SubC);
184 }
185 }
186
187 TEST(F32_VSUBC_RELU__WASM_X4, batch_lt_4) {
188 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
189 VBinOpCMicrokernelTester()
190 .batch_size(batch_size)
191 .Test(xnn_f32_vsubc_relu_ukernel__wasm_x4, VBinOpCMicrokernelTester::OpType::SubC);
192 }
193 }
194
195 TEST(F32_VSUBC_RELU__WASM_X4, batch_gt_4) {
196 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
197 VBinOpCMicrokernelTester()
198 .batch_size(batch_size)
199 .Test(xnn_f32_vsubc_relu_ukernel__wasm_x4, VBinOpCMicrokernelTester::OpType::SubC);
200 }
201 }
202
203 TEST(F32_VSUBC_RELU__WASM_X4, inplace) {
204 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
205 VBinOpCMicrokernelTester()
206 .batch_size(batch_size)
207 .inplace(true)
208 .Test(xnn_f32_vsubc_relu_ukernel__wasm_x4, VBinOpCMicrokernelTester::OpType::SubC);
209 }
210 }
211#endif // XNN_ARCH_WASM || XNN_ARCH_WASMSIMD
212
213
214TEST(F32_VSUBC_RELU__SCALAR_X1, batch_eq_1) {
215 VBinOpCMicrokernelTester()
216 .batch_size(1)
217 .Test(xnn_f32_vsubc_relu_ukernel__scalar_x1, VBinOpCMicrokernelTester::OpType::SubC, VBinOpCMicrokernelTester::Variant::Scalar);
218}
219
220TEST(F32_VSUBC_RELU__SCALAR_X1, batch_gt_1) {
221 for (size_t batch_size = 2; batch_size < 10; batch_size++) {
222 VBinOpCMicrokernelTester()
223 .batch_size(batch_size)
224 .Test(xnn_f32_vsubc_relu_ukernel__scalar_x1, VBinOpCMicrokernelTester::OpType::SubC, VBinOpCMicrokernelTester::Variant::Scalar);
225 }
226}
227
228TEST(F32_VSUBC_RELU__SCALAR_X1, inplace) {
229 for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) {
230 VBinOpCMicrokernelTester()
231 .batch_size(batch_size)
232 .inplace(true)
233 .Test(xnn_f32_vsubc_relu_ukernel__scalar_x1, VBinOpCMicrokernelTester::OpType::SubC, VBinOpCMicrokernelTester::Variant::Scalar);
234 }
235}
236
237
238TEST(F32_VSUBC_RELU__SCALAR_X2, batch_eq_2) {
239 VBinOpCMicrokernelTester()
240 .batch_size(2)
241 .Test(xnn_f32_vsubc_relu_ukernel__scalar_x2, VBinOpCMicrokernelTester::OpType::SubC, VBinOpCMicrokernelTester::Variant::Scalar);
242}
243
244TEST(F32_VSUBC_RELU__SCALAR_X2, batch_div_2) {
245 for (size_t batch_size = 4; batch_size < 20; batch_size += 2) {
246 VBinOpCMicrokernelTester()
247 .batch_size(batch_size)
248 .Test(xnn_f32_vsubc_relu_ukernel__scalar_x2, VBinOpCMicrokernelTester::OpType::SubC, VBinOpCMicrokernelTester::Variant::Scalar);
249 }
250}
251
252TEST(F32_VSUBC_RELU__SCALAR_X2, batch_lt_2) {
253 for (size_t batch_size = 1; batch_size < 2; batch_size++) {
254 VBinOpCMicrokernelTester()
255 .batch_size(batch_size)
256 .Test(xnn_f32_vsubc_relu_ukernel__scalar_x2, VBinOpCMicrokernelTester::OpType::SubC, VBinOpCMicrokernelTester::Variant::Scalar);
257 }
258}
259
260TEST(F32_VSUBC_RELU__SCALAR_X2, batch_gt_2) {
261 for (size_t batch_size = 3; batch_size < 4; batch_size++) {
262 VBinOpCMicrokernelTester()
263 .batch_size(batch_size)
264 .Test(xnn_f32_vsubc_relu_ukernel__scalar_x2, VBinOpCMicrokernelTester::OpType::SubC, VBinOpCMicrokernelTester::Variant::Scalar);
265 }
266}
267
268TEST(F32_VSUBC_RELU__SCALAR_X2, inplace) {
269 for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) {
270 VBinOpCMicrokernelTester()
271 .batch_size(batch_size)
272 .inplace(true)
273 .Test(xnn_f32_vsubc_relu_ukernel__scalar_x2, VBinOpCMicrokernelTester::OpType::SubC, VBinOpCMicrokernelTester::Variant::Scalar);
274 }
275}
276
277
278TEST(F32_VSUBC_RELU__SCALAR_X4, batch_eq_4) {
279 VBinOpCMicrokernelTester()
280 .batch_size(4)
281 .Test(xnn_f32_vsubc_relu_ukernel__scalar_x4, VBinOpCMicrokernelTester::OpType::SubC, VBinOpCMicrokernelTester::Variant::Scalar);
282}
283
284TEST(F32_VSUBC_RELU__SCALAR_X4, batch_div_4) {
285 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
286 VBinOpCMicrokernelTester()
287 .batch_size(batch_size)
288 .Test(xnn_f32_vsubc_relu_ukernel__scalar_x4, VBinOpCMicrokernelTester::OpType::SubC, VBinOpCMicrokernelTester::Variant::Scalar);
289 }
290}
291
292TEST(F32_VSUBC_RELU__SCALAR_X4, batch_lt_4) {
293 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
294 VBinOpCMicrokernelTester()
295 .batch_size(batch_size)
296 .Test(xnn_f32_vsubc_relu_ukernel__scalar_x4, VBinOpCMicrokernelTester::OpType::SubC, VBinOpCMicrokernelTester::Variant::Scalar);
297 }
298}
299
300TEST(F32_VSUBC_RELU__SCALAR_X4, batch_gt_4) {
301 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
302 VBinOpCMicrokernelTester()
303 .batch_size(batch_size)
304 .Test(xnn_f32_vsubc_relu_ukernel__scalar_x4, VBinOpCMicrokernelTester::OpType::SubC, VBinOpCMicrokernelTester::Variant::Scalar);
305 }
306}
307
308TEST(F32_VSUBC_RELU__SCALAR_X4, inplace) {
309 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
310 VBinOpCMicrokernelTester()
311 .batch_size(batch_size)
312 .inplace(true)
313 .Test(xnn_f32_vsubc_relu_ukernel__scalar_x4, VBinOpCMicrokernelTester::OpType::SubC, VBinOpCMicrokernelTester::Variant::Scalar);
314 }
315}