• 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/f16-vrndu.yaml
8 //   Generator: tools/generate-vunary-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/vunary.h>
17 #include "vunary-microkernel-tester.h"
18 
19 
20 #if XNN_ENABLE_ARM_FP16 && (XNN_ARCH_ARM || XNN_ARCH_ARM64)
TEST(F16_VRNDU__NEONFP16ARITH_X8,batch_eq_8)21   TEST(F16_VRNDU__NEONFP16ARITH_X8, batch_eq_8) {
22     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
23     VUnaryMicrokernelTester()
24       .batch_size(8)
25       .Test(xnn_f16_vrndu_ukernel__neonfp16arith_x8, VUnaryMicrokernelTester::OpType::RoundUp);
26   }
27 
TEST(F16_VRNDU__NEONFP16ARITH_X8,batch_div_8)28   TEST(F16_VRNDU__NEONFP16ARITH_X8, batch_div_8) {
29     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
30     for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
31       VUnaryMicrokernelTester()
32         .batch_size(batch_size)
33         .Test(xnn_f16_vrndu_ukernel__neonfp16arith_x8, VUnaryMicrokernelTester::OpType::RoundUp);
34     }
35   }
36 
TEST(F16_VRNDU__NEONFP16ARITH_X8,batch_lt_8)37   TEST(F16_VRNDU__NEONFP16ARITH_X8, batch_lt_8) {
38     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
39     for (size_t batch_size = 1; batch_size < 8; batch_size++) {
40       VUnaryMicrokernelTester()
41         .batch_size(batch_size)
42         .Test(xnn_f16_vrndu_ukernel__neonfp16arith_x8, VUnaryMicrokernelTester::OpType::RoundUp);
43     }
44   }
45 
TEST(F16_VRNDU__NEONFP16ARITH_X8,batch_gt_8)46   TEST(F16_VRNDU__NEONFP16ARITH_X8, batch_gt_8) {
47     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
48     for (size_t batch_size = 9; batch_size < 16; batch_size++) {
49       VUnaryMicrokernelTester()
50         .batch_size(batch_size)
51         .Test(xnn_f16_vrndu_ukernel__neonfp16arith_x8, VUnaryMicrokernelTester::OpType::RoundUp);
52     }
53   }
54 
TEST(F16_VRNDU__NEONFP16ARITH_X8,inplace)55   TEST(F16_VRNDU__NEONFP16ARITH_X8, inplace) {
56     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
57     for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
58       VUnaryMicrokernelTester()
59         .batch_size(batch_size)
60         .inplace(true)
61         .Test(xnn_f16_vrndu_ukernel__neonfp16arith_x8, VUnaryMicrokernelTester::OpType::RoundUp);
62     }
63   }
64 #endif  // XNN_ENABLE_ARM_FP16 && (XNN_ARCH_ARM || XNN_ARCH_ARM64)
65 
66 
67 #if XNN_ENABLE_ARM_FP16 && (XNN_ARCH_ARM || XNN_ARCH_ARM64)
TEST(F16_VRNDU__NEONFP16ARITH_X16,batch_eq_16)68   TEST(F16_VRNDU__NEONFP16ARITH_X16, batch_eq_16) {
69     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
70     VUnaryMicrokernelTester()
71       .batch_size(16)
72       .Test(xnn_f16_vrndu_ukernel__neonfp16arith_x16, VUnaryMicrokernelTester::OpType::RoundUp);
73   }
74 
TEST(F16_VRNDU__NEONFP16ARITH_X16,batch_div_16)75   TEST(F16_VRNDU__NEONFP16ARITH_X16, batch_div_16) {
76     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
77     for (size_t batch_size = 32; batch_size < 160; batch_size += 16) {
78       VUnaryMicrokernelTester()
79         .batch_size(batch_size)
80         .Test(xnn_f16_vrndu_ukernel__neonfp16arith_x16, VUnaryMicrokernelTester::OpType::RoundUp);
81     }
82   }
83 
TEST(F16_VRNDU__NEONFP16ARITH_X16,batch_lt_16)84   TEST(F16_VRNDU__NEONFP16ARITH_X16, batch_lt_16) {
85     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
86     for (size_t batch_size = 1; batch_size < 16; batch_size++) {
87       VUnaryMicrokernelTester()
88         .batch_size(batch_size)
89         .Test(xnn_f16_vrndu_ukernel__neonfp16arith_x16, VUnaryMicrokernelTester::OpType::RoundUp);
90     }
91   }
92 
TEST(F16_VRNDU__NEONFP16ARITH_X16,batch_gt_16)93   TEST(F16_VRNDU__NEONFP16ARITH_X16, batch_gt_16) {
94     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
95     for (size_t batch_size = 17; batch_size < 32; batch_size++) {
96       VUnaryMicrokernelTester()
97         .batch_size(batch_size)
98         .Test(xnn_f16_vrndu_ukernel__neonfp16arith_x16, VUnaryMicrokernelTester::OpType::RoundUp);
99     }
100   }
101 
TEST(F16_VRNDU__NEONFP16ARITH_X16,inplace)102   TEST(F16_VRNDU__NEONFP16ARITH_X16, inplace) {
103     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
104     for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
105       VUnaryMicrokernelTester()
106         .batch_size(batch_size)
107         .inplace(true)
108         .Test(xnn_f16_vrndu_ukernel__neonfp16arith_x16, VUnaryMicrokernelTester::OpType::RoundUp);
109     }
110   }
111 #endif  // XNN_ENABLE_ARM_FP16 && (XNN_ARCH_ARM || XNN_ARCH_ARM64)
112 
113 
114 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(F16_VRNDU__F16C_X8,batch_eq_8)115   TEST(F16_VRNDU__F16C_X8, batch_eq_8) {
116     TEST_REQUIRES_X86_F16C;
117     VUnaryMicrokernelTester()
118       .batch_size(8)
119       .Test(xnn_f16_vrndu_ukernel__f16c_x8, VUnaryMicrokernelTester::OpType::RoundUp);
120   }
121 
TEST(F16_VRNDU__F16C_X8,batch_div_8)122   TEST(F16_VRNDU__F16C_X8, batch_div_8) {
123     TEST_REQUIRES_X86_F16C;
124     for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
125       VUnaryMicrokernelTester()
126         .batch_size(batch_size)
127         .Test(xnn_f16_vrndu_ukernel__f16c_x8, VUnaryMicrokernelTester::OpType::RoundUp);
128     }
129   }
130 
TEST(F16_VRNDU__F16C_X8,batch_lt_8)131   TEST(F16_VRNDU__F16C_X8, batch_lt_8) {
132     TEST_REQUIRES_X86_F16C;
133     for (size_t batch_size = 1; batch_size < 8; batch_size++) {
134       VUnaryMicrokernelTester()
135         .batch_size(batch_size)
136         .Test(xnn_f16_vrndu_ukernel__f16c_x8, VUnaryMicrokernelTester::OpType::RoundUp);
137     }
138   }
139 
TEST(F16_VRNDU__F16C_X8,batch_gt_8)140   TEST(F16_VRNDU__F16C_X8, batch_gt_8) {
141     TEST_REQUIRES_X86_F16C;
142     for (size_t batch_size = 9; batch_size < 16; batch_size++) {
143       VUnaryMicrokernelTester()
144         .batch_size(batch_size)
145         .Test(xnn_f16_vrndu_ukernel__f16c_x8, VUnaryMicrokernelTester::OpType::RoundUp);
146     }
147   }
148 
TEST(F16_VRNDU__F16C_X8,inplace)149   TEST(F16_VRNDU__F16C_X8, inplace) {
150     TEST_REQUIRES_X86_F16C;
151     for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
152       VUnaryMicrokernelTester()
153         .batch_size(batch_size)
154         .inplace(true)
155         .Test(xnn_f16_vrndu_ukernel__f16c_x8, VUnaryMicrokernelTester::OpType::RoundUp);
156     }
157   }
158 #endif  // XNN_ARCH_X86 || XNN_ARCH_X86_64
159 
160 
161 #if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(F16_VRNDU__F16C_X16,batch_eq_16)162   TEST(F16_VRNDU__F16C_X16, batch_eq_16) {
163     TEST_REQUIRES_X86_F16C;
164     VUnaryMicrokernelTester()
165       .batch_size(16)
166       .Test(xnn_f16_vrndu_ukernel__f16c_x16, VUnaryMicrokernelTester::OpType::RoundUp);
167   }
168 
TEST(F16_VRNDU__F16C_X16,batch_div_16)169   TEST(F16_VRNDU__F16C_X16, batch_div_16) {
170     TEST_REQUIRES_X86_F16C;
171     for (size_t batch_size = 32; batch_size < 160; batch_size += 16) {
172       VUnaryMicrokernelTester()
173         .batch_size(batch_size)
174         .Test(xnn_f16_vrndu_ukernel__f16c_x16, VUnaryMicrokernelTester::OpType::RoundUp);
175     }
176   }
177 
TEST(F16_VRNDU__F16C_X16,batch_lt_16)178   TEST(F16_VRNDU__F16C_X16, batch_lt_16) {
179     TEST_REQUIRES_X86_F16C;
180     for (size_t batch_size = 1; batch_size < 16; batch_size++) {
181       VUnaryMicrokernelTester()
182         .batch_size(batch_size)
183         .Test(xnn_f16_vrndu_ukernel__f16c_x16, VUnaryMicrokernelTester::OpType::RoundUp);
184     }
185   }
186 
TEST(F16_VRNDU__F16C_X16,batch_gt_16)187   TEST(F16_VRNDU__F16C_X16, batch_gt_16) {
188     TEST_REQUIRES_X86_F16C;
189     for (size_t batch_size = 17; batch_size < 32; batch_size++) {
190       VUnaryMicrokernelTester()
191         .batch_size(batch_size)
192         .Test(xnn_f16_vrndu_ukernel__f16c_x16, VUnaryMicrokernelTester::OpType::RoundUp);
193     }
194   }
195 
TEST(F16_VRNDU__F16C_X16,inplace)196   TEST(F16_VRNDU__F16C_X16, inplace) {
197     TEST_REQUIRES_X86_F16C;
198     for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
199       VUnaryMicrokernelTester()
200         .batch_size(batch_size)
201         .inplace(true)
202         .Test(xnn_f16_vrndu_ukernel__f16c_x16, VUnaryMicrokernelTester::OpType::RoundUp);
203     }
204   }
205 #endif  // XNN_ARCH_X86 || XNN_ARCH_X86_64
206