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/f32-vmulc.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
TEST(F32_VMULC__WASMSIMD_X4,batch_eq_4)21 TEST(F32_VMULC__WASMSIMD_X4, batch_eq_4) {
22 VBinOpCMicrokernelTester()
23 .batch_size(4)
24 .Test(xnn_f32_vmulc_ukernel__wasmsimd_x4, VBinOpCMicrokernelTester::OpType::MulC);
25 }
26
TEST(F32_VMULC__WASMSIMD_X4,batch_div_4)27 TEST(F32_VMULC__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_vmulc_ukernel__wasmsimd_x4, VBinOpCMicrokernelTester::OpType::MulC);
32 }
33 }
34
TEST(F32_VMULC__WASMSIMD_X4,batch_lt_4)35 TEST(F32_VMULC__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_vmulc_ukernel__wasmsimd_x4, VBinOpCMicrokernelTester::OpType::MulC);
40 }
41 }
42
TEST(F32_VMULC__WASMSIMD_X4,batch_gt_4)43 TEST(F32_VMULC__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_vmulc_ukernel__wasmsimd_x4, VBinOpCMicrokernelTester::OpType::MulC);
48 }
49 }
50
TEST(F32_VMULC__WASMSIMD_X4,inplace)51 TEST(F32_VMULC__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_vmulc_ukernel__wasmsimd_x4, VBinOpCMicrokernelTester::OpType::MulC);
57 }
58 }
59 #endif // XNN_ARCH_WASMSIMD
60
61
62 #if XNN_ARCH_WASMSIMD
TEST(F32_VMULC__WASMSIMD_X8,batch_eq_8)63 TEST(F32_VMULC__WASMSIMD_X8, batch_eq_8) {
64 VBinOpCMicrokernelTester()
65 .batch_size(8)
66 .Test(xnn_f32_vmulc_ukernel__wasmsimd_x8, VBinOpCMicrokernelTester::OpType::MulC);
67 }
68
TEST(F32_VMULC__WASMSIMD_X8,batch_div_8)69 TEST(F32_VMULC__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_vmulc_ukernel__wasmsimd_x8, VBinOpCMicrokernelTester::OpType::MulC);
74 }
75 }
76
TEST(F32_VMULC__WASMSIMD_X8,batch_lt_8)77 TEST(F32_VMULC__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_vmulc_ukernel__wasmsimd_x8, VBinOpCMicrokernelTester::OpType::MulC);
82 }
83 }
84
TEST(F32_VMULC__WASMSIMD_X8,batch_gt_8)85 TEST(F32_VMULC__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_vmulc_ukernel__wasmsimd_x8, VBinOpCMicrokernelTester::OpType::MulC);
90 }
91 }
92
TEST(F32_VMULC__WASMSIMD_X8,inplace)93 TEST(F32_VMULC__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_vmulc_ukernel__wasmsimd_x8, VBinOpCMicrokernelTester::OpType::MulC);
99 }
100 }
101 #endif // XNN_ARCH_WASMSIMD
102
103
104 #if XNN_ARCH_WASMSIMD
TEST(F32_VMULC__WASMSIMD_X16,batch_eq_16)105 TEST(F32_VMULC__WASMSIMD_X16, batch_eq_16) {
106 VBinOpCMicrokernelTester()
107 .batch_size(16)
108 .Test(xnn_f32_vmulc_ukernel__wasmsimd_x16, VBinOpCMicrokernelTester::OpType::MulC);
109 }
110
TEST(F32_VMULC__WASMSIMD_X16,batch_div_16)111 TEST(F32_VMULC__WASMSIMD_X16, batch_div_16) {
112 for (size_t batch_size = 32; batch_size < 160; batch_size += 16) {
113 VBinOpCMicrokernelTester()
114 .batch_size(batch_size)
115 .Test(xnn_f32_vmulc_ukernel__wasmsimd_x16, VBinOpCMicrokernelTester::OpType::MulC);
116 }
117 }
118
TEST(F32_VMULC__WASMSIMD_X16,batch_lt_16)119 TEST(F32_VMULC__WASMSIMD_X16, batch_lt_16) {
120 for (size_t batch_size = 1; batch_size < 16; batch_size++) {
121 VBinOpCMicrokernelTester()
122 .batch_size(batch_size)
123 .Test(xnn_f32_vmulc_ukernel__wasmsimd_x16, VBinOpCMicrokernelTester::OpType::MulC);
124 }
125 }
126
TEST(F32_VMULC__WASMSIMD_X16,batch_gt_16)127 TEST(F32_VMULC__WASMSIMD_X16, batch_gt_16) {
128 for (size_t batch_size = 17; batch_size < 32; batch_size++) {
129 VBinOpCMicrokernelTester()
130 .batch_size(batch_size)
131 .Test(xnn_f32_vmulc_ukernel__wasmsimd_x16, VBinOpCMicrokernelTester::OpType::MulC);
132 }
133 }
134
TEST(F32_VMULC__WASMSIMD_X16,inplace)135 TEST(F32_VMULC__WASMSIMD_X16, inplace) {
136 for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
137 VBinOpCMicrokernelTester()
138 .batch_size(batch_size)
139 .inplace(true)
140 .Test(xnn_f32_vmulc_ukernel__wasmsimd_x16, VBinOpCMicrokernelTester::OpType::MulC);
141 }
142 }
143 #endif // XNN_ARCH_WASMSIMD
144
145
TEST(F32_VMULC__SCALAR_X1,batch_eq_1)146 TEST(F32_VMULC__SCALAR_X1, batch_eq_1) {
147 VBinOpCMicrokernelTester()
148 .batch_size(1)
149 .Test(xnn_f32_vmulc_ukernel__scalar_x1, VBinOpCMicrokernelTester::OpType::MulC, VBinOpCMicrokernelTester::Variant::Scalar);
150 }
151
TEST(F32_VMULC__SCALAR_X1,batch_gt_1)152 TEST(F32_VMULC__SCALAR_X1, batch_gt_1) {
153 for (size_t batch_size = 2; batch_size < 10; batch_size++) {
154 VBinOpCMicrokernelTester()
155 .batch_size(batch_size)
156 .Test(xnn_f32_vmulc_ukernel__scalar_x1, VBinOpCMicrokernelTester::OpType::MulC, VBinOpCMicrokernelTester::Variant::Scalar);
157 }
158 }
159
TEST(F32_VMULC__SCALAR_X1,inplace)160 TEST(F32_VMULC__SCALAR_X1, inplace) {
161 for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) {
162 VBinOpCMicrokernelTester()
163 .batch_size(batch_size)
164 .inplace(true)
165 .Test(xnn_f32_vmulc_ukernel__scalar_x1, VBinOpCMicrokernelTester::OpType::MulC, VBinOpCMicrokernelTester::Variant::Scalar);
166 }
167 }
168
169
TEST(F32_VMULC__SCALAR_X2,batch_eq_2)170 TEST(F32_VMULC__SCALAR_X2, batch_eq_2) {
171 VBinOpCMicrokernelTester()
172 .batch_size(2)
173 .Test(xnn_f32_vmulc_ukernel__scalar_x2, VBinOpCMicrokernelTester::OpType::MulC, VBinOpCMicrokernelTester::Variant::Scalar);
174 }
175
TEST(F32_VMULC__SCALAR_X2,batch_div_2)176 TEST(F32_VMULC__SCALAR_X2, batch_div_2) {
177 for (size_t batch_size = 4; batch_size < 20; batch_size += 2) {
178 VBinOpCMicrokernelTester()
179 .batch_size(batch_size)
180 .Test(xnn_f32_vmulc_ukernel__scalar_x2, VBinOpCMicrokernelTester::OpType::MulC, VBinOpCMicrokernelTester::Variant::Scalar);
181 }
182 }
183
TEST(F32_VMULC__SCALAR_X2,batch_lt_2)184 TEST(F32_VMULC__SCALAR_X2, batch_lt_2) {
185 for (size_t batch_size = 1; batch_size < 2; batch_size++) {
186 VBinOpCMicrokernelTester()
187 .batch_size(batch_size)
188 .Test(xnn_f32_vmulc_ukernel__scalar_x2, VBinOpCMicrokernelTester::OpType::MulC, VBinOpCMicrokernelTester::Variant::Scalar);
189 }
190 }
191
TEST(F32_VMULC__SCALAR_X2,batch_gt_2)192 TEST(F32_VMULC__SCALAR_X2, batch_gt_2) {
193 for (size_t batch_size = 3; batch_size < 4; batch_size++) {
194 VBinOpCMicrokernelTester()
195 .batch_size(batch_size)
196 .Test(xnn_f32_vmulc_ukernel__scalar_x2, VBinOpCMicrokernelTester::OpType::MulC, VBinOpCMicrokernelTester::Variant::Scalar);
197 }
198 }
199
TEST(F32_VMULC__SCALAR_X2,inplace)200 TEST(F32_VMULC__SCALAR_X2, inplace) {
201 for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) {
202 VBinOpCMicrokernelTester()
203 .batch_size(batch_size)
204 .inplace(true)
205 .Test(xnn_f32_vmulc_ukernel__scalar_x2, VBinOpCMicrokernelTester::OpType::MulC, VBinOpCMicrokernelTester::Variant::Scalar);
206 }
207 }
208
209
TEST(F32_VMULC__SCALAR_X4,batch_eq_4)210 TEST(F32_VMULC__SCALAR_X4, batch_eq_4) {
211 VBinOpCMicrokernelTester()
212 .batch_size(4)
213 .Test(xnn_f32_vmulc_ukernel__scalar_x4, VBinOpCMicrokernelTester::OpType::MulC, VBinOpCMicrokernelTester::Variant::Scalar);
214 }
215
TEST(F32_VMULC__SCALAR_X4,batch_div_4)216 TEST(F32_VMULC__SCALAR_X4, batch_div_4) {
217 for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
218 VBinOpCMicrokernelTester()
219 .batch_size(batch_size)
220 .Test(xnn_f32_vmulc_ukernel__scalar_x4, VBinOpCMicrokernelTester::OpType::MulC, VBinOpCMicrokernelTester::Variant::Scalar);
221 }
222 }
223
TEST(F32_VMULC__SCALAR_X4,batch_lt_4)224 TEST(F32_VMULC__SCALAR_X4, batch_lt_4) {
225 for (size_t batch_size = 1; batch_size < 4; batch_size++) {
226 VBinOpCMicrokernelTester()
227 .batch_size(batch_size)
228 .Test(xnn_f32_vmulc_ukernel__scalar_x4, VBinOpCMicrokernelTester::OpType::MulC, VBinOpCMicrokernelTester::Variant::Scalar);
229 }
230 }
231
TEST(F32_VMULC__SCALAR_X4,batch_gt_4)232 TEST(F32_VMULC__SCALAR_X4, batch_gt_4) {
233 for (size_t batch_size = 5; batch_size < 8; batch_size++) {
234 VBinOpCMicrokernelTester()
235 .batch_size(batch_size)
236 .Test(xnn_f32_vmulc_ukernel__scalar_x4, VBinOpCMicrokernelTester::OpType::MulC, VBinOpCMicrokernelTester::Variant::Scalar);
237 }
238 }
239
TEST(F32_VMULC__SCALAR_X4,inplace)240 TEST(F32_VMULC__SCALAR_X4, inplace) {
241 for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
242 VBinOpCMicrokernelTester()
243 .batch_size(batch_size)
244 .inplace(true)
245 .Test(xnn_f32_vmulc_ukernel__scalar_x4, VBinOpCMicrokernelTester::OpType::MulC, VBinOpCMicrokernelTester::Variant::Scalar);
246 }
247 }
248
249
TEST(F32_VMULC__SCALAR_X8,batch_eq_8)250 TEST(F32_VMULC__SCALAR_X8, batch_eq_8) {
251 VBinOpCMicrokernelTester()
252 .batch_size(8)
253 .Test(xnn_f32_vmulc_ukernel__scalar_x8, VBinOpCMicrokernelTester::OpType::MulC, VBinOpCMicrokernelTester::Variant::Scalar);
254 }
255
TEST(F32_VMULC__SCALAR_X8,batch_div_8)256 TEST(F32_VMULC__SCALAR_X8, batch_div_8) {
257 for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
258 VBinOpCMicrokernelTester()
259 .batch_size(batch_size)
260 .Test(xnn_f32_vmulc_ukernel__scalar_x8, VBinOpCMicrokernelTester::OpType::MulC, VBinOpCMicrokernelTester::Variant::Scalar);
261 }
262 }
263
TEST(F32_VMULC__SCALAR_X8,batch_lt_8)264 TEST(F32_VMULC__SCALAR_X8, batch_lt_8) {
265 for (size_t batch_size = 1; batch_size < 8; batch_size++) {
266 VBinOpCMicrokernelTester()
267 .batch_size(batch_size)
268 .Test(xnn_f32_vmulc_ukernel__scalar_x8, VBinOpCMicrokernelTester::OpType::MulC, VBinOpCMicrokernelTester::Variant::Scalar);
269 }
270 }
271
TEST(F32_VMULC__SCALAR_X8,batch_gt_8)272 TEST(F32_VMULC__SCALAR_X8, batch_gt_8) {
273 for (size_t batch_size = 9; batch_size < 16; batch_size++) {
274 VBinOpCMicrokernelTester()
275 .batch_size(batch_size)
276 .Test(xnn_f32_vmulc_ukernel__scalar_x8, VBinOpCMicrokernelTester::OpType::MulC, VBinOpCMicrokernelTester::Variant::Scalar);
277 }
278 }
279
TEST(F32_VMULC__SCALAR_X8,inplace)280 TEST(F32_VMULC__SCALAR_X8, inplace) {
281 for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
282 VBinOpCMicrokernelTester()
283 .batch_size(batch_size)
284 .inplace(true)
285 .Test(xnn_f32_vmulc_ukernel__scalar_x8, VBinOpCMicrokernelTester::OpType::MulC, VBinOpCMicrokernelTester::Variant::Scalar);
286 }
287 }
288