xref: /aosp_15_r20/external/ComputeLibrary/tests/validation/NEON/DepthwiseConvolutionLayer.cpp (revision c217d954acce2dbc11938adb493fc0abd69584f3)
1 /*
2  * Copyright (c) 2017-2022 Arm Limited.
3  *
4  * SPDX-License-Identifier: MIT
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to
8  * deal in the Software without restriction, including without limitation the
9  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10  * sell copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 #include "arm_compute/core/Types.h"
25 #include "arm_compute/core/utils/misc/ShapeCalculator.h"
26 #include "arm_compute/runtime/NEON/functions/NEDepthwiseConvolutionLayer.h"
27 #include "arm_compute/runtime/Tensor.h"
28 #include "arm_compute/runtime/TensorAllocator.h"
29 #include "tests/NEON/Accessor.h"
30 #include "tests/PaddingCalculator.h"
31 #include "tests/datasets/DepthwiseConvolutionLayerDataset.h"
32 #include "tests/datasets/DilatedDepthwiseConvolutionLayerDataset.h"
33 #include "tests/framework/Asserts.h"
34 #include "tests/framework/Macros.h"
35 #include "tests/framework/datasets/Datasets.h"
36 #include "tests/validation/Validation.h"
37 #include "tests/validation/fixtures/DepthwiseConvolutionLayerFixture.h"
38 
39 namespace arm_compute
40 {
41 namespace test
42 {
43 namespace validation
44 {
45 using namespace arm_compute::misc::shape_calculator;
46 
47 namespace
48 {
49 constexpr RelativeTolerance<float>   tolerance_f32(0.01f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F32 */
50 constexpr AbsoluteTolerance<uint8_t> tolerance_qasymm8(1); /**< Tolerance value for comparing reference's output against implementation's output for DataType::QASYMM8 */
51 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
52 RelativeTolerance<half_float::half> tolerance_f16(half_float::half(0.02)); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F16 */
53 constexpr float                     tolerance_num = 0.05f;                 /**< Tolerance number */
54 #endif                                                                     // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
55 
56 const auto depth_multipliers       = framework::dataset::make("DepthMultiplier", { 1, 2, 8 });
57 const auto large_depth_multipliers = framework::dataset::make("DepthMultiplier", { 1, 2, 5, 32 });
58 
59 //Activation Functions
60 const auto ActivationFunctionsDataset = framework::dataset::make("ActivationInfo",
61 {
62     ActivationLayerInfo(),
63     ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)
64 });
65 
66 const auto input_qinfo_dataset = framework::dataset::make("InputQInfo",
67 {
68     QuantizationInfo(0.3f, 10),
69     QuantizationInfo(2.2f, 10),
70 });
71 } // namespace
72 
73 TEST_SUITE(NEON)
TEST_SUITE(DepthwiseConvolutionLayer)74 TEST_SUITE(DepthwiseConvolutionLayer)
75 
76 // *INDENT-OFF*
77 // clang-format off
78 DATA_TEST_CASE(Validate3x3, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
79                framework::dataset::make("InputInfo", { TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32),     // Mismatching data type input/weights
80                                                        TensorInfo(TensorShape(32U, 18U, 3U), 1, DataType::F32),     // Mismatching input feature maps
81                                                        TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32),     // Unsupported weights dimensions
82                                                        TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32),     // Mismatching depth multiplier
83                                                        TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::QASYMM8), // Invalid stride
84                                                        TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32),     // Invalid biases size
85                                                        TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32),     // Invalid biases dimensions
86                                                        TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32),     // Invalid output size
87                                                        TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),     // patch size bigger than input width
88                                                        TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),     // dilation < 1
89                                                        TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),
90                                                      }),
91                framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16),
92                                                          TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
93                                                          TensorInfo(TensorShape(5U, 5U, 2U, 2U), 1, DataType::F32),
94                                                          TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
95                                                          TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::QASYMM8),
96                                                          TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
97                                                          TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
98                                                          TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
99                                                          TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
100                                                          TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
101                                                          TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
102                                                        })),
103                framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32),
104                                                         TensorInfo(TensorShape(2U), 1, DataType::F32),
105                                                         TensorInfo(TensorShape(2U), 1, DataType::F32),
106                                                         TensorInfo(TensorShape(2U), 1, DataType::F32),
107                                                         TensorInfo(TensorShape(2U), 1, DataType::S32),
108                                                         TensorInfo(TensorShape(4U), 1, DataType::F32),
109                                                         TensorInfo(TensorShape(2U, 2U), 1, DataType::F32),
110                                                         TensorInfo(TensorShape(2U), 1, DataType::F32),
111                                                         TensorInfo(TensorShape(2U), 1, DataType::F32),
112                                                         TensorInfo(TensorShape(2U), 1, DataType::F32),
113                                                         TensorInfo(TensorShape(2U), 1, DataType::F32),
114                                                       })),
115                framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
116                                                         TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
117                                                         TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
118                                                         TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
119                                                         TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::QASYMM8),
120                                                         TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
121                                                         TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
122                                                         TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32),
123                                                         TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
124                                                         TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
125                                                         TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
126                                                       })),
127                framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0),
128                                                       PadStrideInfo(1, 1, 0, 0),
129                                                       PadStrideInfo(1, 1, 0, 0),
130                                                       PadStrideInfo(1, 1, 0, 0),
131                                                       PadStrideInfo(4, 1, 0, 0),
132                                                       PadStrideInfo(1, 1, 0, 0),
133                                                       PadStrideInfo(1, 1, 0, 0),
134                                                       PadStrideInfo(1, 1, 0, 0),
135                                                       PadStrideInfo(1, 1, 0, 0),
136                                                       PadStrideInfo(1, 1, 0, 0),
137                                                       PadStrideInfo(1, 1, 0, 0),
138                                                      })),
139                framework::dataset::make("DepthMultiplier", { 1,
140                                                              1,
141                                                              1,
142                                                              3,
143                                                              1,
144                                                              1,
145                                                              1,
146                                                              1,
147                                                              1,
148                                                              1,
149                                                              1,
150                                                             })),
151                framework::dataset::make("Dilation", { Size2D(1U, 1U),
152                                                       Size2D(1U, 1U),
153                                                       Size2D(1U, 1U),
154                                                       Size2D(1U, 1U),
155                                                       Size2D(1U, 1U),
156                                                       Size2D(1U, 1U),
157                                                       Size2D(1U, 1U),
158                                                       Size2D(1U, 1U),
159                                                       Size2D(25U, 1U),
160                                                       Size2D(0U, 1U),
161                                                       Size2D(1U, 1U),
162                                                             })),
163                framework::dataset::make("Expected", { false, false, false, false, false, false, false, false, false, false, true })),
164                input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier,dilation, expected)
165 {
166     bool is_valid = bool(NEDepthwiseConvolutionLayer::validate(&input_info.clone()->set_is_resizable(false),
167      &weights_info.clone()->set_is_resizable(false), &biases_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), conv_info, depth_multiplier, ActivationLayerInfo(), dilation));
168     ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
169 }
170 
171 DATA_TEST_CASE(ValidateGeneric, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
172                 framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),     // Mismatching data type input/weights
173                                                         TensorInfo(TensorShape(27U, 13U, 3U), 1, DataType::F32),     // Mismatching input feature maps
174                                                         TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),     // Mismatching depth multiplier
175                                                         TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),     // Invalid biases size
176                                                         TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),     // Invalid biases dimensions
177                                                         TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),     // Invalid output size
178                                                         TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32),     // Patch size bigger than input width
179                                                         TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32),     // Dilation < 1
180                                                       }),
181                 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F16),
182                                                           TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
183                                                           TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
184                                                           TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
185                                                           TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
186                                                           TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
187                                                           TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
188                                                           TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
189                                                         })),
190                 framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32),
191                                                          TensorInfo(TensorShape(2U), 1, DataType::F32),
192                                                          TensorInfo(TensorShape(2U), 1, DataType::F32),
193                                                          TensorInfo(TensorShape(4U), 1, DataType::F32),
194                                                          TensorInfo(TensorShape(2U, 2U), 1, DataType::F32),
195                                                          TensorInfo(TensorShape(2U), 1, DataType::F32),
196                                                          TensorInfo(TensorShape(16U), 1, DataType::F32),
197                                                          TensorInfo(TensorShape(16U), 1, DataType::F32),
198                                                        })),
199                 framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
200                                                          TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
201                                                          TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
202                                                          TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
203                                                          TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
204                                                          TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),
205                                                          TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
206                                                          TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
207                                                        })),
208                 framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0),
209                                                        PadStrideInfo(1, 1, 0, 0),
210                                                        PadStrideInfo(1, 1, 0, 0),
211                                                        PadStrideInfo(1, 1, 0, 0),
212                                                        PadStrideInfo(1, 1, 0, 0),
213                                                        PadStrideInfo(1, 1, 0, 0),
214                                                        PadStrideInfo(1, 1, 0, 0),
215                                                        PadStrideInfo(1, 1, 0, 0),
216                                                       })),
217                 framework::dataset::make("DepthMultiplier", { 1,
218                                                               1,
219                                                               3,
220                                                               1,
221                                                               1,
222                                                               1,
223                                                               2,
224                                                               2,
225                                                              })),
226                 framework::dataset::make("Dilation", { Size2D(1U, 1U),
227                                                        Size2D(1U, 1U),
228                                                        Size2D(1U, 1U),
229                                                        Size2D(1U, 1U),
230                                                        Size2D(1U, 1U),
231                                                        Size2D(1U, 1U),
232                                                        Size2D(25U, 1U),
233                                                        Size2D(0U, 1U),
234                                                              })),
235                 framework::dataset::make("Expected", { false, false, false, false, false, false, false, false})),
236                 input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier,dilation, expected)
237 {
238     bool is_valid = bool(NEDepthwiseConvolutionLayer::validate(&input_info.clone()->set_is_resizable(false), &weights_info.clone()->set_is_resizable(false), &biases_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), conv_info, depth_multiplier, ActivationLayerInfo(), dilation));
239     ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
240 }
241 // clang-format on
242 // *INDENT-ON*
243 template <typename T>
244 using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
245 template <typename T>
246 using NEDepthwiseConvolutionLayerMixedDataLayoutFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T, true>;
247 template <typename T>
248 using NEDepthwiseConvolutionLayerVariableWeightsFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T, false, false, true>;
249 
250 TEST_SUITE(Float)
TEST_SUITE(F32)251 TEST_SUITE(F32)
252 TEST_SUITE(Generic)
253 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
254                            depth_multipliers),
255                            framework::dataset::make("DataType", DataType::F32)),
256                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
257                            ActivationFunctionsDataset))
258 {
259     validate(Accessor(_target), _reference, tolerance_f32);
260 }
261 FIXTURE_DATA_TEST_CASE_NEW(RunMixedDataLayout, NEDepthwiseConvolutionLayerMixedDataLayoutFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
262                            framework::dataset::make("DepthMultiplier", { 2 })),
263                            framework::dataset::make("DataType", DataType::F32)),
264                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
265                            framework::dataset::make("ActivationInfo", ActivationLayerInfo())))
266 {
267     validate(Accessor(_target), _reference, tolerance_f32);
268 }
269 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
270                            large_depth_multipliers),
271                            framework::dataset::make("DataType",
272                                                     DataType::F32)),
273                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
274                            ActivationFunctionsDataset))
275 {
276     validate(Accessor(_target), _reference, tolerance_f32);
277 }
278 
279 TEST_SUITE(Dilation)
280 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
281                            combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
282                                                            depth_multipliers),
283                                                    framework::dataset::make("DataType",
284                                                                             DataType::F32)),
285                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
286                                    ActivationFunctionsDataset))
287 {
288     validate(Accessor(_target), _reference, tolerance_f32);
289 }
290 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
291                            combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
292                                                            large_depth_multipliers),
293                                                    framework::dataset::make("DataType",
294                                                                             DataType::F32)),
295                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
296                                    ActivationFunctionsDataset))
297 {
298     validate(Accessor(_target), _reference, tolerance_f32);
299 }
300 TEST_SUITE_END() // Dilation
TEST_SUITE_END()301 TEST_SUITE_END() // Generic
302 
303 TEST_SUITE(W3x3)
304 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
305                            depth_multipliers),
306                            framework::dataset::make("DataType",
307                                                     DataType::F32)),
308                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
309                            ActivationFunctionsDataset))
310 {
311     validate(Accessor(_target), _reference, tolerance_f32);
312 }
313 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
314                            combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
315                                                            large_depth_multipliers),
316                                                    framework::dataset::make("DataType",
317                                                                             DataType::F32)),
318                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
319                                    ActivationFunctionsDataset))
320 {
321     validate(Accessor(_target), _reference, tolerance_f32);
322 }
323 TEST_SUITE(Dilation)
324 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
325                            combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
326                                                            depth_multipliers),
327                                                    framework::dataset::make("DataType",
328                                                                             DataType::F32)),
329                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
330                                    ActivationFunctionsDataset))
331 {
332     validate(Accessor(_target), _reference, tolerance_f32);
333 }
334 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
335                            combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
336                                                            large_depth_multipliers),
337                                                    framework::dataset::make("DataType",
338                                                                             DataType::F32)),
339                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
340                                    ActivationFunctionsDataset))
341 {
342     validate(Accessor(_target), _reference, tolerance_f32);
343 }
344 
345 TEST_SUITE_END() // Dilation
TEST_SUITE_END()346 TEST_SUITE_END() // W3x3
347 
348 TEST_SUITE(Optimized)
349 FIXTURE_DATA_TEST_CASE_NEW(RunSmall3x3, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
350                            combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
351                                                            framework::dataset::make("DepthMultiplier", 1)),
352                                                    framework::dataset::make("DataType",
353                                                                             DataType::F32)),
354                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
355                                    ActivationFunctionsDataset))
356 {
357     validate(Accessor(_target), _reference, tolerance_f32);
358 }
359 FIXTURE_DATA_TEST_CASE_NEW(RunVariableWeightsSmall3x3, NEDepthwiseConvolutionLayerVariableWeightsFixture<float>, framework::DatasetMode::PRECOMMIT,
360                            combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
361                                                            framework::dataset::make("DepthMultiplier", 1)),
362                                                    framework::dataset::make("DataType",
363                                                                             DataType::F32)),
364                                            framework::dataset::make("DataLayout", { DataLayout::NHWC })),
365                                    ActivationFunctionsDataset))
366 {
367     validate(Accessor(_target), _reference, tolerance_f32);
368 }
369 FIXTURE_DATA_TEST_CASE_NEW(RunMixedDataLayout3x3, NEDepthwiseConvolutionLayerMixedDataLayoutFixture<float>, framework::DatasetMode::PRECOMMIT,
370                            combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
371                                                            framework::dataset::make("DepthMultiplier", 1)),
372                                                    framework::dataset::make("DataType", DataType::F32)),
373                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
374                                    framework::dataset::make("ActivationInfo", ActivationLayerInfo())))
375 {
376     validate(Accessor(_target), _reference, tolerance_f32);
377 }
378 FIXTURE_DATA_TEST_CASE_NEW(RunSmall5x5, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
379                            combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
380                                                            framework::dataset::make("DepthMultiplier", 1)),
381                                                    framework::dataset::make("DataType",
382                                                                             DataType::F32)),
383                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
384                                    ActivationFunctionsDataset))
385 {
386     validate(Accessor(_target), _reference, tolerance_f32);
387 }
388 FIXTURE_DATA_TEST_CASE_NEW(RunVariableWeightsSmall5x5, NEDepthwiseConvolutionLayerVariableWeightsFixture<float>, framework::DatasetMode::PRECOMMIT,
389                            combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
390                                                            framework::dataset::make("DepthMultiplier", 1)),
391                                                    framework::dataset::make("DataType",
392                                                                             DataType::F32)),
393                                            framework::dataset::make("DataLayout", { DataLayout::NHWC })),
394                                    ActivationFunctionsDataset))
395 {
396     validate(Accessor(_target), _reference, tolerance_f32);
397 }
398 FIXTURE_DATA_TEST_CASE_NEW(RunLarge3x3, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
399                            combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
400                                                            framework::dataset::make("DepthMultiplier", 1)),
401                                                    framework::dataset::make("DataType",
402                                                                             DataType::F32)),
403                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
404                                    ActivationFunctionsDataset))
405 {
406     validate(Accessor(_target), _reference, tolerance_f32);
407 }
408 FIXTURE_DATA_TEST_CASE_NEW(RunVariableWeightsLarge3x3, NEDepthwiseConvolutionLayerVariableWeightsFixture<float>, framework::DatasetMode::NIGHTLY,
409                            combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
410                                                            framework::dataset::make("DepthMultiplier", 1)),
411                                                    framework::dataset::make("DataType",
412                                                                             DataType::F32)),
413                                            framework::dataset::make("DataLayout", { DataLayout::NHWC })),
414                                    ActivationFunctionsDataset))
415 {
416     validate(Accessor(_target), _reference, tolerance_f32);
417 }
418 TEST_SUITE_END() // Optimized
TEST_SUITE_END()419 TEST_SUITE_END() // F32
420 
421 #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
422 TEST_SUITE(F16)
423 TEST_SUITE(Generic)
424 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
425                            depth_multipliers),
426                            framework::dataset::make("DataType",
427                                                     DataType::F16)),
428                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
429                            ActivationFunctionsDataset))
430 {
431     validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
432 }
433 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
434                                                                                                                         large_depth_multipliers),
435                                                                                                                         framework::dataset::make("DataType",
436                                                                                                                                 DataType::F16)),
437                                                                                                                         framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
438                                                                                                                         ActivationFunctionsDataset))
439 {
440     validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
441 }
442 
443 TEST_SUITE(Dilation)
444 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
445                            combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
446                                                            depth_multipliers),
447                                                    framework::dataset::make("DataType",
448                                                                             DataType::F16)),
449                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
450                                    ActivationFunctionsDataset))
451 {
452     validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
453 }
454 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
455                            combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
456                                                            large_depth_multipliers),
457                                                    framework::dataset::make("DataType",
458                                                                             DataType::F16)),
459                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
460                                    ActivationFunctionsDataset))
461 {
462     validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
463 }
464 TEST_SUITE_END() // Dilation
465 
466 TEST_SUITE_END() // Generic
467 template <typename T>
468 using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
469 TEST_SUITE(W3x3)
470 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
471                            depth_multipliers),
472                            framework::dataset::make("DataType",
473                                                     DataType::F16)),
474                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
475                            ActivationFunctionsDataset))
476 {
477     validate(Accessor(_target), _reference, tolerance_f16);
478 }
479 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
480                            combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
481                                                            large_depth_multipliers),
482                                                    framework::dataset::make("DataType",
483                                                                             DataType::F16)),
484                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
485                                    ActivationFunctionsDataset))
486 {
487     validate(Accessor(_target), _reference, tolerance_f16);
488 }
489 
490 TEST_SUITE(Dilation)
491 
492 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
493                            combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
494                                                            depth_multipliers),
495                                                    framework::dataset::make("DataType",
496                                                                             DataType::F16)),
497                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
498                                    ActivationFunctionsDataset))
499 {
500     validate(Accessor(_target), _reference, tolerance_f16);
501 }
502 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
503                            combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
504                                                            large_depth_multipliers),
505                                                    framework::dataset::make("DataType",
506                                                                             DataType::F16)),
507                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
508                                    ActivationFunctionsDataset))
509 {
510     validate(Accessor(_target), _reference, tolerance_f16);
511 }
512 
513 TEST_SUITE_END() // Dilation
TEST_SUITE_END()514 TEST_SUITE_END() // W3x3
515 
516 TEST_SUITE(Optimized)
517 FIXTURE_DATA_TEST_CASE_NEW(RunSmallW3x3, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
518                            combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
519                                                            framework::dataset::make("DepthMultiplier", 1)),
520                                                    framework::dataset::make("DataType",
521                                                                             DataType::F16)),
522                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
523                                    ActivationFunctionsDataset))
524 {
525     validate(Accessor(_target), _reference, tolerance_f16);
526 }
527 FIXTURE_DATA_TEST_CASE_NEW(RunSmallW5x5, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
528                            combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
529                                                            framework::dataset::make("DepthMultiplier", 1)),
530                                                    framework::dataset::make("DataType",
531                                                                             DataType::F16)),
532                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
533                                    ActivationFunctionsDataset))
534 {
535     validate(Accessor(_target), _reference, tolerance_f16);
536 }
537 FIXTURE_DATA_TEST_CASE_NEW(RunLargeW3x3, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
538                            combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
539                                                            framework::dataset::make("DepthMultiplier", 1)),
540                                                    framework::dataset::make("DataType",
541                                                                             DataType::F16)),
542                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
543                                    ActivationFunctionsDataset))
544 {
545     validate(Accessor(_target), _reference, tolerance_f16);
546 }
547 TEST_SUITE_END() // Optimized
548 TEST_SUITE_END() // FP16
549 #endif           // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
550 
551 TEST_SUITE_END() // Float
552 
553 template <typename T>
554 using NEDepthwiseConvolutionLayerQuantizedFixture                    = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
555 template <typename T>
556 using NEDepthwiseConvolutionLayerQuantizedMixedDataLayoutFixture     = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T, true>;
557 using NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture = DepthwiseConvolutionLayerValidationQuantizedPerChannelFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, uint8_t, int8_t>;
558 
559 TEST_SUITE(Quantized)
TEST_SUITE(QASYMM8)560 TEST_SUITE(QASYMM8)
561 TEST_SUITE(Generic)
562 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
563                            combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
564                                                                            depth_multipliers),
565                                                                    framework::dataset::make("DataType", DataType::QASYMM8)),
566                                                            input_qinfo_dataset),
567                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
568                                            framework::dataset::make("DataLayout", { DataLayout::NHWC })),
569                                    ActivationFunctionsDataset))
570 {
571     validate(Accessor(_target), _reference, tolerance_qasymm8);
572 }
573 FIXTURE_DATA_TEST_CASE_NEW(RunMixedDataLayout, NEDepthwiseConvolutionLayerQuantizedMixedDataLayoutFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
574                            combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
575                                                                            framework::dataset::make("DepthMultiplier", { 2 })),
576                                                                    framework::dataset::make("DataType", DataType::QASYMM8)),
577                                                            input_qinfo_dataset),
578                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
579                                            framework::dataset::make("DataLayout", { DataLayout::NHWC })),
580                                    framework::dataset::make("ActivationInfo", ActivationLayerInfo())))
581 {
582     validate(Accessor(_target), _reference, tolerance_qasymm8);
583 }
584 TEST_SUITE(Dilation)
585 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
586                            combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
587                                                                            depth_multipliers),
588                                                                    framework::dataset::make("DataType", DataType::QASYMM8)),
589                                                            input_qinfo_dataset),
590                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8f, 1) })),
591                                            framework::dataset::make("DataLayout", { DataLayout::NHWC })),
592                                    ActivationFunctionsDataset))
593 {
594     validate(Accessor(_target), _reference, tolerance_qasymm8);
595 }
596 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
597                            combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
598                                                                            large_depth_multipliers),
599                                                                    framework::dataset::make("DataType", DataType::QASYMM8)),
600                                                            input_qinfo_dataset),
601                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
602                                            framework::dataset::make("DataLayout", { DataLayout::NHWC })),
603                                    ActivationFunctionsDataset))
604 {
605     validate(Accessor(_target), _reference, tolerance_qasymm8);
606 }
607 TEST_SUITE_END() // Dilation
TEST_SUITE_END()608 TEST_SUITE_END() // Generic
609 TEST_SUITE(W3x3)
610 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
611                            combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers),
612                                                                    framework::dataset::make("DataType", DataType::QASYMM8)),
613                                                            input_qinfo_dataset),
614                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
615                                            framework::dataset::make("DataLayout", { DataLayout::NHWC })),
616                                    ActivationFunctionsDataset))
617 {
618     validate(Accessor(_target), _reference, tolerance_qasymm8);
619 }
620 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
621                            combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
622                                                                            large_depth_multipliers),
623                                                                    framework::dataset::make("DataType", DataType::QASYMM8)),
624                                                            input_qinfo_dataset),
625                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
626                                            framework::dataset::make("DataLayout", { DataLayout::NHWC })),
627                                    ActivationFunctionsDataset))
628 {
629     validate(Accessor(_target), _reference, tolerance_qasymm8);
630 }
631 
632 TEST_SUITE(Dilation)
633 
634 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
635                            combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
636                                                                    framework::dataset::make("DataType", DataType::QASYMM8)),
637                                                            input_qinfo_dataset),
638                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 10) })),
639                                            framework::dataset::make("DataLayout", { DataLayout::NHWC })),
640                                    ActivationFunctionsDataset))
641 {
642     validate(Accessor(_target), _reference, tolerance_qasymm8);
643 }
644 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
645                            combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
646                                                                            large_depth_multipliers),
647                                                                    framework::dataset::make("DataType", DataType::QASYMM8)),
648                                                            input_qinfo_dataset),
649                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
650                                            framework::dataset::make("DataLayout", { DataLayout::NHWC })),
651                                    ActivationFunctionsDataset))
652 {
653     validate(Accessor(_target), _reference, tolerance_qasymm8);
654 }
655 TEST_SUITE_END() // Dilation
TEST_SUITE_END()656 TEST_SUITE_END() // W3x3
657 
658 TEST_SUITE(Optimized)
659 FIXTURE_DATA_TEST_CASE_NEW(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
660                            combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
661                                                                            framework::dataset::make("DepthMultiplier", 1)),
662                                                                    framework::dataset::make("DataType", DataType::QASYMM8)),
663                                                            input_qinfo_dataset),
664                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
665                                            framework::dataset::make("DataLayout", { DataLayout::NHWC })),
666                                    ActivationFunctionsDataset))
667 {
668     validate(Accessor(_target), _reference, tolerance_qasymm8);
669 }
670 FIXTURE_DATA_TEST_CASE_NEW(RunMixedDataLayout3x3, NEDepthwiseConvolutionLayerQuantizedMixedDataLayoutFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
671                            combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
672                                                                            framework::dataset::make("DepthMultiplier", 1)),
673                                                                    framework::dataset::make("DataType", DataType::QASYMM8)),
674                                                            input_qinfo_dataset),
675                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
676                                            framework::dataset::make("DataLayout", { DataLayout::NHWC })),
677                                    framework::dataset::make("ActivationInfo", ActivationLayerInfo())))
678 {
679     validate(Accessor(_target), _reference, tolerance_qasymm8);
680 }
681 FIXTURE_DATA_TEST_CASE_NEW(RunSmall5x5, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
682                            combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
683                                                                            framework::dataset::make("DepthMultiplier", 1)),
684                                                                    framework::dataset::make("DataType",
685                                                                                             DataType::QASYMM8)),
686                                                            input_qinfo_dataset),
687                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
688                                            framework::dataset::make("DataLayout", { DataLayout::NHWC })),
689                                    ActivationFunctionsDataset))
690 {
691     validate(Accessor(_target), _reference, tolerance_qasymm8);
692 }
693 FIXTURE_DATA_TEST_CASE_NEW(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
694                            combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
695                                                                            framework::dataset::make("DepthMultiplier", 1)),
696                                                                    framework::dataset::make("DataType",
697                                                                                             DataType::QASYMM8)),
698                                                            input_qinfo_dataset),
699                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
700                                            framework::dataset::make("DataLayout", { DataLayout::NHWC })),
701                                    ActivationFunctionsDataset))
702 {
703     validate(Accessor(_target), _reference, tolerance_qasymm8);
704 }
705 TEST_SUITE_END() // Optimized
TEST_SUITE_END()706 TEST_SUITE_END() // QASYMM8
707 
708 TEST_SUITE(QASYMM8_SIGNED)
709 TEST_SUITE(Generic)
710 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
711                            combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
712                                                                            depth_multipliers),
713                                                                    framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
714                                                            input_qinfo_dataset),
715                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
716                                            framework::dataset::make("DataLayout", { DataLayout::NCHW })),
717                                    ActivationFunctionsDataset))
718 {
719     validate(Accessor(_target), _reference, tolerance_qasymm8);
720 }
721 
722 TEST_SUITE(Dilation)
723 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
724                            combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
725                                                                            depth_multipliers),
726                                                                    framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
727                                                            input_qinfo_dataset),
728                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8f, 1) })),
729                                            framework::dataset::make("DataLayout", { DataLayout::NCHW })),
730                                    ActivationFunctionsDataset))
731 {
732     validate(Accessor(_target), _reference, tolerance_qasymm8);
733 }
734 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::NIGHTLY,
735                            combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
736                                                                            large_depth_multipliers),
737                                                                    framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
738                                                            input_qinfo_dataset),
739                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
740                                            framework::dataset::make("DataLayout", { DataLayout::NCHW })),
741                                    ActivationFunctionsDataset))
742 {
743     validate(Accessor(_target), _reference, tolerance_qasymm8);
744 }
745 TEST_SUITE_END() // Dilation
TEST_SUITE_END()746 TEST_SUITE_END() // Generic
747 
748 TEST_SUITE(W3x3)
749 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
750                            combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers),
751                                                                    framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
752                                                            input_qinfo_dataset),
753                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
754                                            framework::dataset::make("DataLayout", { DataLayout::NCHW })),
755                                    ActivationFunctionsDataset))
756 {
757     validate(Accessor(_target), _reference, tolerance_qasymm8);
758 }
759 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::NIGHTLY,
760                            combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
761                                                                            large_depth_multipliers),
762                                                                    framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
763                                                            input_qinfo_dataset),
764                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
765                                            framework::dataset::make("DataLayout", { DataLayout::NCHW })),
766                                    ActivationFunctionsDataset))
767 {
768     validate(Accessor(_target), _reference, tolerance_qasymm8);
769 }
770 
771 TEST_SUITE(Dilation)
772 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
773                            combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
774                                                                    framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
775                                                            input_qinfo_dataset),
776                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 10) })),
777                                            framework::dataset::make("DataLayout", { DataLayout::NCHW })),
778                                    ActivationFunctionsDataset))
779 {
780     validate(Accessor(_target), _reference, tolerance_qasymm8);
781 }
782 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::NIGHTLY,
783                            combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
784                                                                            large_depth_multipliers),
785                                                                    framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
786                                                            input_qinfo_dataset),
787                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
788                                            framework::dataset::make("DataLayout", { DataLayout::NCHW })),
789                                    ActivationFunctionsDataset))
790 {
791     validate(Accessor(_target), _reference, tolerance_qasymm8);
792 }
793 TEST_SUITE_END() // Dilation
TEST_SUITE_END()794 TEST_SUITE_END() // W3x3
795 
796 TEST_SUITE(Optimized)
797 FIXTURE_DATA_TEST_CASE_NEW(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
798                            combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
799                                                                            framework::dataset::make("DepthMultiplier", 1)),
800                                                                    framework::dataset::make("DataType",
801                                                                                             DataType::QASYMM8_SIGNED)),
802                                                            input_qinfo_dataset),
803                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
804                                            framework::dataset::make("DataLayout", { DataLayout::NCHW })),
805                                    ActivationFunctionsDataset))
806 {
807     validate(Accessor(_target), _reference, tolerance_qasymm8);
808 }
809 FIXTURE_DATA_TEST_CASE_NEW(RunSmall5x5, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
810                            combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
811                                                                            framework::dataset::make("DepthMultiplier", 1)),
812                                                                    framework::dataset::make("DataType",
813                                                                                             DataType::QASYMM8_SIGNED)),
814                                                            input_qinfo_dataset),
815                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
816                                            framework::dataset::make("DataLayout", { DataLayout::NCHW })),
817                                    ActivationFunctionsDataset))
818 {
819     validate(Accessor(_target), _reference, tolerance_qasymm8);
820 }
821 FIXTURE_DATA_TEST_CASE_NEW(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::NIGHTLY,
822                            combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
823                                                                            framework::dataset::make("DepthMultiplier", 1)),
824                                                                    framework::dataset::make("DataType",
825                                                                                             DataType::QASYMM8_SIGNED)),
826                                                            input_qinfo_dataset),
827                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
828                                            framework::dataset::make("DataLayout", { DataLayout::NCHW })),
829                                    ActivationFunctionsDataset))
830 {
831     validate(Accessor(_target), _reference, tolerance_qasymm8);
832 }
833 TEST_SUITE_END() // Optimized
TEST_SUITE_END()834 TEST_SUITE_END() // QASYMM8_SIGNED
835 
836 TEST_SUITE(QSYMM8_PER_CHANNEL)
837 TEST_SUITE(Generic)
838 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT,
839                            combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
840                                                                                    depth_multipliers),
841                                                                            framework::dataset::make("InputDataType", DataType::QASYMM8)),
842                                                                    framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
843                                                            input_qinfo_dataset),
844                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
845                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
846                                    ActivationFunctionsDataset))
847 {
848     validate(Accessor(_target), _reference, tolerance_qasymm8);
849 }
850 
851 TEST_SUITE(Dilation)
852 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT,
853                            combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
854                                                                                    depth_multipliers),
855                                                                            framework::dataset::make("InputDataType", DataType::QASYMM8)),
856                                                                    framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
857                                                            input_qinfo_dataset),
858                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
859                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
860                                    ActivationFunctionsDataset))
861 {
862     validate(Accessor(_target), _reference, tolerance_qasymm8);
863 }
864 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY,
865                            combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
866                                                                                    depth_multipliers),
867                                                                            framework::dataset::make("InputDataType", DataType::QASYMM8)),
868                                                                    framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
869                                                            input_qinfo_dataset),
870                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
871                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
872                                    ActivationFunctionsDataset))
873 {
874     validate(Accessor(_target), _reference, tolerance_qasymm8);
875 }
876 TEST_SUITE_END() // Dilation
TEST_SUITE_END()877 TEST_SUITE_END() // Generic
878 
879 TEST_SUITE(Optimized)
880 FIXTURE_DATA_TEST_CASE_NEW(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT,
881                            combine(combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
882                                                                                    framework::dataset::make("DepthMultiplier", 1)),
883                                                                            framework::dataset::make("InputDataType", DataType::QASYMM8)),
884                                                                    framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
885                                                            input_qinfo_dataset),
886                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
887                                            framework::dataset::make("DataLayout", { DataLayout::NHWC })),
888                                    ActivationFunctionsDataset))
889 {
890     validate(Accessor(_target), _reference, tolerance_qasymm8);
891 }
892 FIXTURE_DATA_TEST_CASE_NEW(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY,
893                            combine(combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
894                                                                                    framework::dataset::make("DepthMultiplier", 1)),
895                                                                            framework::dataset::make("InputDataType", DataType::QASYMM8)),
896                                                                    framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
897                                                            input_qinfo_dataset),
898                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
899                                            framework::dataset::make("DataLayout", { DataLayout::NHWC })),
900                                    ActivationFunctionsDataset))
901 {
902     validate(Accessor(_target), _reference, tolerance_qasymm8);
903 }
904 TEST_SUITE_END() // Optimized
905 TEST_SUITE_END() // QSYMM8_PER_CHANNEL
906 TEST_SUITE_END() // Quantized
907 
908 TEST_SUITE_END() // DepthwiseConvLayer
909 TEST_SUITE_END() // Neon
910 } // namespace validation
911 } // namespace test
912 } // namespace arm_compute
913