• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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-vdivc.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/microparams-init.h>
17 #include <xnnpack/vbinary.h>
18 #include "vbinaryc-microkernel-tester.h"
19 
20 
21 #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD
TEST(F32_VDIVC__WASMSIMD_X4,batch_eq_4)22   TEST(F32_VDIVC__WASMSIMD_X4, batch_eq_4) {
23     VBinaryCMicrokernelTester()
24       .batch_size(4)
25       .Test(xnn_f32_vdivc_ukernel__wasmsimd_x4, VBinaryCMicrokernelTester::OpType::DivC);
26   }
27 
TEST(F32_VDIVC__WASMSIMD_X4,batch_div_4)28   TEST(F32_VDIVC__WASMSIMD_X4, batch_div_4) {
29     for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
30       VBinaryCMicrokernelTester()
31         .batch_size(batch_size)
32         .Test(xnn_f32_vdivc_ukernel__wasmsimd_x4, VBinaryCMicrokernelTester::OpType::DivC);
33     }
34   }
35 
TEST(F32_VDIVC__WASMSIMD_X4,batch_lt_4)36   TEST(F32_VDIVC__WASMSIMD_X4, batch_lt_4) {
37     for (size_t batch_size = 1; batch_size < 4; batch_size++) {
38       VBinaryCMicrokernelTester()
39         .batch_size(batch_size)
40         .Test(xnn_f32_vdivc_ukernel__wasmsimd_x4, VBinaryCMicrokernelTester::OpType::DivC);
41     }
42   }
43 
TEST(F32_VDIVC__WASMSIMD_X4,batch_gt_4)44   TEST(F32_VDIVC__WASMSIMD_X4, batch_gt_4) {
45     for (size_t batch_size = 5; batch_size < 8; batch_size++) {
46       VBinaryCMicrokernelTester()
47         .batch_size(batch_size)
48         .Test(xnn_f32_vdivc_ukernel__wasmsimd_x4, VBinaryCMicrokernelTester::OpType::DivC);
49     }
50   }
51 
TEST(F32_VDIVC__WASMSIMD_X4,inplace)52   TEST(F32_VDIVC__WASMSIMD_X4, inplace) {
53     for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
54       VBinaryCMicrokernelTester()
55         .batch_size(batch_size)
56         .inplace(true)
57         .Test(xnn_f32_vdivc_ukernel__wasmsimd_x4, VBinaryCMicrokernelTester::OpType::DivC);
58     }
59   }
60 #endif  // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD
61 
62 
63 #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD
TEST(F32_VDIVC__WASMSIMD_X8,batch_eq_8)64   TEST(F32_VDIVC__WASMSIMD_X8, batch_eq_8) {
65     VBinaryCMicrokernelTester()
66       .batch_size(8)
67       .Test(xnn_f32_vdivc_ukernel__wasmsimd_x8, VBinaryCMicrokernelTester::OpType::DivC);
68   }
69 
TEST(F32_VDIVC__WASMSIMD_X8,batch_div_8)70   TEST(F32_VDIVC__WASMSIMD_X8, batch_div_8) {
71     for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
72       VBinaryCMicrokernelTester()
73         .batch_size(batch_size)
74         .Test(xnn_f32_vdivc_ukernel__wasmsimd_x8, VBinaryCMicrokernelTester::OpType::DivC);
75     }
76   }
77 
TEST(F32_VDIVC__WASMSIMD_X8,batch_lt_8)78   TEST(F32_VDIVC__WASMSIMD_X8, batch_lt_8) {
79     for (size_t batch_size = 1; batch_size < 8; batch_size++) {
80       VBinaryCMicrokernelTester()
81         .batch_size(batch_size)
82         .Test(xnn_f32_vdivc_ukernel__wasmsimd_x8, VBinaryCMicrokernelTester::OpType::DivC);
83     }
84   }
85 
TEST(F32_VDIVC__WASMSIMD_X8,batch_gt_8)86   TEST(F32_VDIVC__WASMSIMD_X8, batch_gt_8) {
87     for (size_t batch_size = 9; batch_size < 16; batch_size++) {
88       VBinaryCMicrokernelTester()
89         .batch_size(batch_size)
90         .Test(xnn_f32_vdivc_ukernel__wasmsimd_x8, VBinaryCMicrokernelTester::OpType::DivC);
91     }
92   }
93 
TEST(F32_VDIVC__WASMSIMD_X8,inplace)94   TEST(F32_VDIVC__WASMSIMD_X8, inplace) {
95     for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
96       VBinaryCMicrokernelTester()
97         .batch_size(batch_size)
98         .inplace(true)
99         .Test(xnn_f32_vdivc_ukernel__wasmsimd_x8, VBinaryCMicrokernelTester::OpType::DivC);
100     }
101   }
102 #endif  // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD
103 
104 
105 #if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD
TEST(F32_VDIVC__WASMSIMD_X16,batch_eq_16)106   TEST(F32_VDIVC__WASMSIMD_X16, batch_eq_16) {
107     VBinaryCMicrokernelTester()
108       .batch_size(16)
109       .Test(xnn_f32_vdivc_ukernel__wasmsimd_x16, VBinaryCMicrokernelTester::OpType::DivC);
110   }
111 
TEST(F32_VDIVC__WASMSIMD_X16,batch_div_16)112   TEST(F32_VDIVC__WASMSIMD_X16, batch_div_16) {
113     for (size_t batch_size = 32; batch_size < 160; batch_size += 16) {
114       VBinaryCMicrokernelTester()
115         .batch_size(batch_size)
116         .Test(xnn_f32_vdivc_ukernel__wasmsimd_x16, VBinaryCMicrokernelTester::OpType::DivC);
117     }
118   }
119 
TEST(F32_VDIVC__WASMSIMD_X16,batch_lt_16)120   TEST(F32_VDIVC__WASMSIMD_X16, batch_lt_16) {
121     for (size_t batch_size = 1; batch_size < 16; batch_size++) {
122       VBinaryCMicrokernelTester()
123         .batch_size(batch_size)
124         .Test(xnn_f32_vdivc_ukernel__wasmsimd_x16, VBinaryCMicrokernelTester::OpType::DivC);
125     }
126   }
127 
TEST(F32_VDIVC__WASMSIMD_X16,batch_gt_16)128   TEST(F32_VDIVC__WASMSIMD_X16, batch_gt_16) {
129     for (size_t batch_size = 17; batch_size < 32; batch_size++) {
130       VBinaryCMicrokernelTester()
131         .batch_size(batch_size)
132         .Test(xnn_f32_vdivc_ukernel__wasmsimd_x16, VBinaryCMicrokernelTester::OpType::DivC);
133     }
134   }
135 
TEST(F32_VDIVC__WASMSIMD_X16,inplace)136   TEST(F32_VDIVC__WASMSIMD_X16, inplace) {
137     for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
138       VBinaryCMicrokernelTester()
139         .batch_size(batch_size)
140         .inplace(true)
141         .Test(xnn_f32_vdivc_ukernel__wasmsimd_x16, VBinaryCMicrokernelTester::OpType::DivC);
142     }
143   }
144 #endif  // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD
145 
146 
TEST(F32_VDIVC__SCALAR_X1,batch_eq_1)147 TEST(F32_VDIVC__SCALAR_X1, batch_eq_1) {
148   VBinaryCMicrokernelTester()
149     .batch_size(1)
150     .Test(xnn_f32_vdivc_ukernel__scalar_x1, VBinaryCMicrokernelTester::OpType::DivC);
151 }
152 
TEST(F32_VDIVC__SCALAR_X1,batch_gt_1)153 TEST(F32_VDIVC__SCALAR_X1, batch_gt_1) {
154   for (size_t batch_size = 2; batch_size < 10; batch_size++) {
155     VBinaryCMicrokernelTester()
156       .batch_size(batch_size)
157       .Test(xnn_f32_vdivc_ukernel__scalar_x1, VBinaryCMicrokernelTester::OpType::DivC);
158   }
159 }
160 
TEST(F32_VDIVC__SCALAR_X1,inplace)161 TEST(F32_VDIVC__SCALAR_X1, inplace) {
162   for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) {
163     VBinaryCMicrokernelTester()
164       .batch_size(batch_size)
165       .inplace(true)
166       .Test(xnn_f32_vdivc_ukernel__scalar_x1, VBinaryCMicrokernelTester::OpType::DivC);
167   }
168 }
169 
170 
TEST(F32_VDIVC__SCALAR_X2,batch_eq_2)171 TEST(F32_VDIVC__SCALAR_X2, batch_eq_2) {
172   VBinaryCMicrokernelTester()
173     .batch_size(2)
174     .Test(xnn_f32_vdivc_ukernel__scalar_x2, VBinaryCMicrokernelTester::OpType::DivC);
175 }
176 
TEST(F32_VDIVC__SCALAR_X2,batch_div_2)177 TEST(F32_VDIVC__SCALAR_X2, batch_div_2) {
178   for (size_t batch_size = 4; batch_size < 20; batch_size += 2) {
179     VBinaryCMicrokernelTester()
180       .batch_size(batch_size)
181       .Test(xnn_f32_vdivc_ukernel__scalar_x2, VBinaryCMicrokernelTester::OpType::DivC);
182   }
183 }
184 
TEST(F32_VDIVC__SCALAR_X2,batch_lt_2)185 TEST(F32_VDIVC__SCALAR_X2, batch_lt_2) {
186   for (size_t batch_size = 1; batch_size < 2; batch_size++) {
187     VBinaryCMicrokernelTester()
188       .batch_size(batch_size)
189       .Test(xnn_f32_vdivc_ukernel__scalar_x2, VBinaryCMicrokernelTester::OpType::DivC);
190   }
191 }
192 
TEST(F32_VDIVC__SCALAR_X2,batch_gt_2)193 TEST(F32_VDIVC__SCALAR_X2, batch_gt_2) {
194   for (size_t batch_size = 3; batch_size < 4; batch_size++) {
195     VBinaryCMicrokernelTester()
196       .batch_size(batch_size)
197       .Test(xnn_f32_vdivc_ukernel__scalar_x2, VBinaryCMicrokernelTester::OpType::DivC);
198   }
199 }
200 
TEST(F32_VDIVC__SCALAR_X2,inplace)201 TEST(F32_VDIVC__SCALAR_X2, inplace) {
202   for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) {
203     VBinaryCMicrokernelTester()
204       .batch_size(batch_size)
205       .inplace(true)
206       .Test(xnn_f32_vdivc_ukernel__scalar_x2, VBinaryCMicrokernelTester::OpType::DivC);
207   }
208 }
209 
210 
TEST(F32_VDIVC__SCALAR_X4,batch_eq_4)211 TEST(F32_VDIVC__SCALAR_X4, batch_eq_4) {
212   VBinaryCMicrokernelTester()
213     .batch_size(4)
214     .Test(xnn_f32_vdivc_ukernel__scalar_x4, VBinaryCMicrokernelTester::OpType::DivC);
215 }
216 
TEST(F32_VDIVC__SCALAR_X4,batch_div_4)217 TEST(F32_VDIVC__SCALAR_X4, batch_div_4) {
218   for (size_t batch_size = 8; batch_size < 40; batch_size += 4) {
219     VBinaryCMicrokernelTester()
220       .batch_size(batch_size)
221       .Test(xnn_f32_vdivc_ukernel__scalar_x4, VBinaryCMicrokernelTester::OpType::DivC);
222   }
223 }
224 
TEST(F32_VDIVC__SCALAR_X4,batch_lt_4)225 TEST(F32_VDIVC__SCALAR_X4, batch_lt_4) {
226   for (size_t batch_size = 1; batch_size < 4; batch_size++) {
227     VBinaryCMicrokernelTester()
228       .batch_size(batch_size)
229       .Test(xnn_f32_vdivc_ukernel__scalar_x4, VBinaryCMicrokernelTester::OpType::DivC);
230   }
231 }
232 
TEST(F32_VDIVC__SCALAR_X4,batch_gt_4)233 TEST(F32_VDIVC__SCALAR_X4, batch_gt_4) {
234   for (size_t batch_size = 5; batch_size < 8; batch_size++) {
235     VBinaryCMicrokernelTester()
236       .batch_size(batch_size)
237       .Test(xnn_f32_vdivc_ukernel__scalar_x4, VBinaryCMicrokernelTester::OpType::DivC);
238   }
239 }
240 
TEST(F32_VDIVC__SCALAR_X4,inplace)241 TEST(F32_VDIVC__SCALAR_X4, inplace) {
242   for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) {
243     VBinaryCMicrokernelTester()
244       .batch_size(batch_size)
245       .inplace(true)
246       .Test(xnn_f32_vdivc_ukernel__scalar_x4, VBinaryCMicrokernelTester::OpType::DivC);
247   }
248 }
249 
250 
TEST(F32_VDIVC__SCALAR_X8,batch_eq_8)251 TEST(F32_VDIVC__SCALAR_X8, batch_eq_8) {
252   VBinaryCMicrokernelTester()
253     .batch_size(8)
254     .Test(xnn_f32_vdivc_ukernel__scalar_x8, VBinaryCMicrokernelTester::OpType::DivC);
255 }
256 
TEST(F32_VDIVC__SCALAR_X8,batch_div_8)257 TEST(F32_VDIVC__SCALAR_X8, batch_div_8) {
258   for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
259     VBinaryCMicrokernelTester()
260       .batch_size(batch_size)
261       .Test(xnn_f32_vdivc_ukernel__scalar_x8, VBinaryCMicrokernelTester::OpType::DivC);
262   }
263 }
264 
TEST(F32_VDIVC__SCALAR_X8,batch_lt_8)265 TEST(F32_VDIVC__SCALAR_X8, batch_lt_8) {
266   for (size_t batch_size = 1; batch_size < 8; batch_size++) {
267     VBinaryCMicrokernelTester()
268       .batch_size(batch_size)
269       .Test(xnn_f32_vdivc_ukernel__scalar_x8, VBinaryCMicrokernelTester::OpType::DivC);
270   }
271 }
272 
TEST(F32_VDIVC__SCALAR_X8,batch_gt_8)273 TEST(F32_VDIVC__SCALAR_X8, batch_gt_8) {
274   for (size_t batch_size = 9; batch_size < 16; batch_size++) {
275     VBinaryCMicrokernelTester()
276       .batch_size(batch_size)
277       .Test(xnn_f32_vdivc_ukernel__scalar_x8, VBinaryCMicrokernelTester::OpType::DivC);
278   }
279 }
280 
TEST(F32_VDIVC__SCALAR_X8,inplace)281 TEST(F32_VDIVC__SCALAR_X8, inplace) {
282   for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
283     VBinaryCMicrokernelTester()
284       .batch_size(batch_size)
285       .inplace(true)
286       .Test(xnn_f32_vdivc_ukernel__scalar_x8, VBinaryCMicrokernelTester::OpType::DivC);
287   }
288 }
289