• 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-prelu.yaml
8 //   Generator: tools/generate-prelu-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/prelu.h>
17 #include "prelu-microkernel-tester.h"
18 
19 
20 #if XNN_ARCH_ARM64
TEST(F16_PRELU__NEONFP16ARITH_2X8,channels_eq_8)21   TEST(F16_PRELU__NEONFP16ARITH_2X8, channels_eq_8) {
22     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
23     PReLUMicrokernelTester()
24       .rows(2)
25       .channels(8)
26       .Test(xnn_f16_prelu_ukernel__neonfp16arith_2x8);
27   }
28 
TEST(F16_PRELU__NEONFP16ARITH_2X8,channels_div_8)29   TEST(F16_PRELU__NEONFP16ARITH_2X8, channels_div_8) {
30     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
31     for (size_t channels = 16; channels < 80; channels += 8) {
32       PReLUMicrokernelTester()
33         .rows(2)
34         .channels(channels)
35         .Test(xnn_f16_prelu_ukernel__neonfp16arith_2x8);
36     }
37   }
38 
TEST(F16_PRELU__NEONFP16ARITH_2X8,channels_lt_8)39   TEST(F16_PRELU__NEONFP16ARITH_2X8, channels_lt_8) {
40     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
41     for (size_t channels = 1; channels < 8; channels++) {
42       PReLUMicrokernelTester()
43         .rows(2)
44         .channels(channels)
45         .Test(xnn_f16_prelu_ukernel__neonfp16arith_2x8);
46     }
47   }
48 
TEST(F16_PRELU__NEONFP16ARITH_2X8,channels_gt_8)49   TEST(F16_PRELU__NEONFP16ARITH_2X8, channels_gt_8) {
50     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
51     for (size_t channels = 9; channels < 16; channels++) {
52       PReLUMicrokernelTester()
53         .rows(2)
54         .channels(channels)
55         .Test(xnn_f16_prelu_ukernel__neonfp16arith_2x8);
56     }
57   }
58 
TEST(F16_PRELU__NEONFP16ARITH_2X8,rows_lt_2)59   TEST(F16_PRELU__NEONFP16ARITH_2X8, rows_lt_2) {
60     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
61     for (size_t rows = 1; rows < 2; rows++) {
62       for (size_t channels = 1; channels <= 40; channels += 7) {
63         PReLUMicrokernelTester()
64           .rows(rows)
65           .channels(channels)
66           .Test(xnn_f16_prelu_ukernel__neonfp16arith_2x8);
67       }
68     }
69   }
70 
TEST(F16_PRELU__NEONFP16ARITH_2X8,rows_div_2)71   TEST(F16_PRELU__NEONFP16ARITH_2X8, rows_div_2) {
72     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
73     for (size_t rows = 4; rows <= 8; rows += 2) {
74       for (size_t channels = 1; channels <= 40; channels += 7) {
75         PReLUMicrokernelTester()
76           .rows(rows)
77           .channels(channels)
78           .Test(xnn_f16_prelu_ukernel__neonfp16arith_2x8);
79       }
80     }
81   }
82 
TEST(F16_PRELU__NEONFP16ARITH_2X8,rows_gt_2)83   TEST(F16_PRELU__NEONFP16ARITH_2X8, rows_gt_2) {
84     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
85     for (size_t rows = 3; rows < 4; rows++) {
86       for (size_t channels = 1; channels <= 40; channels += 7) {
87         PReLUMicrokernelTester()
88           .rows(rows)
89           .channels(channels)
90           .Test(xnn_f16_prelu_ukernel__neonfp16arith_2x8);
91       }
92     }
93   }
94 
TEST(F16_PRELU__NEONFP16ARITH_2X8,input_stride)95   TEST(F16_PRELU__NEONFP16ARITH_2X8, input_stride) {
96     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
97     for (size_t rows = 1; rows <= 6; rows += 1) {
98       for (size_t channels = 1; channels <= 40; channels += 7) {
99         PReLUMicrokernelTester()
100           .rows(rows)
101           .channels(channels)
102           .input_stride(43)
103           .iterations(1)
104           .Test(xnn_f16_prelu_ukernel__neonfp16arith_2x8);
105       }
106     }
107   }
108 
TEST(F16_PRELU__NEONFP16ARITH_2X8,output_stride)109   TEST(F16_PRELU__NEONFP16ARITH_2X8, output_stride) {
110     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
111     for (size_t rows = 1; rows <= 6; rows += 1) {
112       for (size_t channels = 1; channels <= 40; channels += 7) {
113         PReLUMicrokernelTester()
114           .rows(rows)
115           .channels(channels)
116           .output_stride(43)
117           .iterations(1)
118           .Test(xnn_f16_prelu_ukernel__neonfp16arith_2x8);
119       }
120     }
121   }
122 
TEST(F16_PRELU__NEONFP16ARITH_2X8,inplace)123   TEST(F16_PRELU__NEONFP16ARITH_2X8, inplace) {
124     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
125     for (size_t rows = 1; rows <= 6; rows += 1) {
126       for (size_t channels = 1; channels <= 40; channels += 7) {
127         PReLUMicrokernelTester()
128           .rows(rows)
129           .channels(channels)
130           .inplace(true)
131           .iterations(1)
132           .Test(xnn_f16_prelu_ukernel__neonfp16arith_2x8);
133       }
134     }
135   }
136 #endif  // XNN_ARCH_ARM64
137 
138 
139 #if XNN_ARCH_ARM64
TEST(F16_PRELU__NEONFP16ARITH_2X16,channels_eq_16)140   TEST(F16_PRELU__NEONFP16ARITH_2X16, channels_eq_16) {
141     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
142     PReLUMicrokernelTester()
143       .rows(2)
144       .channels(16)
145       .Test(xnn_f16_prelu_ukernel__neonfp16arith_2x16);
146   }
147 
TEST(F16_PRELU__NEONFP16ARITH_2X16,channels_div_16)148   TEST(F16_PRELU__NEONFP16ARITH_2X16, channels_div_16) {
149     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
150     for (size_t channels = 32; channels < 160; channels += 16) {
151       PReLUMicrokernelTester()
152         .rows(2)
153         .channels(channels)
154         .Test(xnn_f16_prelu_ukernel__neonfp16arith_2x16);
155     }
156   }
157 
TEST(F16_PRELU__NEONFP16ARITH_2X16,channels_lt_16)158   TEST(F16_PRELU__NEONFP16ARITH_2X16, channels_lt_16) {
159     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
160     for (size_t channels = 1; channels < 16; channels++) {
161       PReLUMicrokernelTester()
162         .rows(2)
163         .channels(channels)
164         .Test(xnn_f16_prelu_ukernel__neonfp16arith_2x16);
165     }
166   }
167 
TEST(F16_PRELU__NEONFP16ARITH_2X16,channels_gt_16)168   TEST(F16_PRELU__NEONFP16ARITH_2X16, channels_gt_16) {
169     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
170     for (size_t channels = 17; channels < 32; channels++) {
171       PReLUMicrokernelTester()
172         .rows(2)
173         .channels(channels)
174         .Test(xnn_f16_prelu_ukernel__neonfp16arith_2x16);
175     }
176   }
177 
TEST(F16_PRELU__NEONFP16ARITH_2X16,rows_lt_2)178   TEST(F16_PRELU__NEONFP16ARITH_2X16, rows_lt_2) {
179     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
180     for (size_t rows = 1; rows < 2; rows++) {
181       for (size_t channels = 1; channels <= 80; channels += 15) {
182         PReLUMicrokernelTester()
183           .rows(rows)
184           .channels(channels)
185           .Test(xnn_f16_prelu_ukernel__neonfp16arith_2x16);
186       }
187     }
188   }
189 
TEST(F16_PRELU__NEONFP16ARITH_2X16,rows_div_2)190   TEST(F16_PRELU__NEONFP16ARITH_2X16, rows_div_2) {
191     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
192     for (size_t rows = 4; rows <= 8; rows += 2) {
193       for (size_t channels = 1; channels <= 80; channels += 15) {
194         PReLUMicrokernelTester()
195           .rows(rows)
196           .channels(channels)
197           .Test(xnn_f16_prelu_ukernel__neonfp16arith_2x16);
198       }
199     }
200   }
201 
TEST(F16_PRELU__NEONFP16ARITH_2X16,rows_gt_2)202   TEST(F16_PRELU__NEONFP16ARITH_2X16, rows_gt_2) {
203     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
204     for (size_t rows = 3; rows < 4; rows++) {
205       for (size_t channels = 1; channels <= 80; channels += 15) {
206         PReLUMicrokernelTester()
207           .rows(rows)
208           .channels(channels)
209           .Test(xnn_f16_prelu_ukernel__neonfp16arith_2x16);
210       }
211     }
212   }
213 
TEST(F16_PRELU__NEONFP16ARITH_2X16,input_stride)214   TEST(F16_PRELU__NEONFP16ARITH_2X16, input_stride) {
215     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
216     for (size_t rows = 1; rows <= 6; rows += 1) {
217       for (size_t channels = 1; channels <= 80; channels += 15) {
218         PReLUMicrokernelTester()
219           .rows(rows)
220           .channels(channels)
221           .input_stride(83)
222           .iterations(1)
223           .Test(xnn_f16_prelu_ukernel__neonfp16arith_2x16);
224       }
225     }
226   }
227 
TEST(F16_PRELU__NEONFP16ARITH_2X16,output_stride)228   TEST(F16_PRELU__NEONFP16ARITH_2X16, output_stride) {
229     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
230     for (size_t rows = 1; rows <= 6; rows += 1) {
231       for (size_t channels = 1; channels <= 80; channels += 15) {
232         PReLUMicrokernelTester()
233           .rows(rows)
234           .channels(channels)
235           .output_stride(83)
236           .iterations(1)
237           .Test(xnn_f16_prelu_ukernel__neonfp16arith_2x16);
238       }
239     }
240   }
241 
TEST(F16_PRELU__NEONFP16ARITH_2X16,inplace)242   TEST(F16_PRELU__NEONFP16ARITH_2X16, inplace) {
243     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
244     for (size_t rows = 1; rows <= 6; rows += 1) {
245       for (size_t channels = 1; channels <= 80; channels += 15) {
246         PReLUMicrokernelTester()
247           .rows(rows)
248           .channels(channels)
249           .inplace(true)
250           .iterations(1)
251           .Test(xnn_f16_prelu_ukernel__neonfp16arith_2x16);
252       }
253     }
254   }
255 #endif  // XNN_ARCH_ARM64
256