xref: /aosp_15_r20/external/ComputeLibrary/tests/validation/CL/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/runtime/CL/CLTensor.h"
26 #include "arm_compute/runtime/CL/CLTensorAllocator.h"
27 #include "arm_compute/runtime/CL/functions/CLDepthwiseConvolutionLayer.h"
28 #include "tests/CL/CLAccessor.h"
29 #include "tests/PaddingCalculator.h"
30 #include "tests/datasets/DepthwiseConvolutionLayerDataset.h"
31 #include "tests/datasets/DilatedDepthwiseConvolutionLayerDataset.h"
32 #include "tests/framework/Asserts.h"
33 #include "tests/framework/Macros.h"
34 #include "tests/framework/datasets/Datasets.h"
35 #include "tests/validation/Validation.h"
36 #include "tests/validation/fixtures/DepthwiseConvolutionLayerFixture.h"
37 
38 namespace arm_compute
39 {
40 namespace test
41 {
42 namespace validation
43 {
44 namespace
45 {
46 RelativeTolerance<half_float::half>  tolerance_f16(half_float::half(0.01)); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F16 */
47 constexpr RelativeTolerance<float>   tolerance_f32(0.01f);                  /**< Tolerance value for comparing reference's output against implementation's output for DataType::F32 */
48 constexpr AbsoluteTolerance<uint8_t> tolerance_qasymm8(0);                  /**< Tolerance value for comparing reference's output against implementation's output for DataType::QASYMM8 */
49 constexpr float                      tolerance_num = 0.05f;                 /**< Tolerance number */
50 
51 const auto depth_multipliers       = framework::dataset::make("DepthMultiplier", { 1, 4 });
52 const auto large_depth_multipliers = framework::dataset::make("DepthMultiplier", { 1, 2, 5, 8 });
53 
54 //Activation Functions
55 const auto ActivationFunctionsDataset = framework::dataset::make("ActivationInfo",
56 {
57     ActivationLayerInfo(),
58     ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 6.f, 0.f)
59 });
60 } // namespace
61 
62 TEST_SUITE(CL)
TEST_SUITE(DepthwiseConvolutionLayer)63 TEST_SUITE(DepthwiseConvolutionLayer)
64 
65 // *INDENT-OFF*
66 // clang-format off
67 DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
68                 framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),    // Mismatching data type input/weights
69                                                         TensorInfo(TensorShape(27U, 13U, 3U), 1, DataType::F32),    // Mismatching input feature maps
70                                                         TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),    // Mismatching depth multiplier
71                                                         TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),    // Invalid biases size
72                                                         TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),    // Invalid biases dimensions
73                                                         TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),    // Invalid output size
74                                                         TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32),    // patch size bigger than input width
75                                                         TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32),    // dilation < 1
76                                                         TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32),
77                                                         TensorInfo(TensorShape(32U, 13U, 8U), 1, DataType::QASYMM8),
78                                                       }),
79                 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F16),
80                                                           TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
81                                                           TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
82                                                           TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
83                                                           TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
84                                                           TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
85                                                           TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
86                                                           TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
87                                                           TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
88                                                           TensorInfo(TensorShape(3U, 3U, 24U), 1, DataType::QASYMM8),
89                                                         })),
90                 framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32),
91                                                          TensorInfo(TensorShape(2U), 1, DataType::F32),
92                                                          TensorInfo(TensorShape(2U), 1, DataType::F32),
93                                                          TensorInfo(TensorShape(4U), 1, DataType::F32),
94                                                          TensorInfo(TensorShape(2U, 2U), 1, DataType::F32),
95                                                          TensorInfo(TensorShape(2U), 1, DataType::F32),
96                                                          TensorInfo(TensorShape(16U), 1, DataType::F32),
97                                                          TensorInfo(TensorShape(16U), 1, DataType::F32),
98                                                          TensorInfo(TensorShape(16U), 1, DataType::F32),
99                                                          TensorInfo(TensorShape(24U), 1, DataType::S32),
100                                                        })),
101                 framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
102                                                          TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
103                                                          TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
104                                                          TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
105                                                          TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
106                                                          TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),
107                                                          TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
108                                                          TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
109                                                          TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
110                                                          TensorInfo(TensorShape(32U, 11U, 24U), 1, DataType::QASYMM8),
111                                                        })),
112                 framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0),
113                                                        PadStrideInfo(1, 1, 0, 0),
114                                                        PadStrideInfo(1, 1, 0, 0),
115                                                        PadStrideInfo(1, 1, 0, 0),
116                                                        PadStrideInfo(1, 1, 0, 0),
117                                                        PadStrideInfo(1, 1, 0, 0),
118                                                        PadStrideInfo(1, 1, 0, 0),
119                                                        PadStrideInfo(1, 1, 0, 0),
120                                                        PadStrideInfo(1, 1, 0, 0),
121                                                        PadStrideInfo(1, 1, 1, 0),
122                                                       })),
123                 framework::dataset::make("DepthMultiplier", { 1,
124                                                               1,
125                                                               3,
126                                                               1,
127                                                               1,
128                                                               1,
129                                                               2,
130                                                               2,
131                                                               2,
132                                                               3,
133                                                              })),
134                 framework::dataset::make("Dilation", { Size2D(1U, 1U),
135                                                               Size2D(1U, 1U),
136                                                               Size2D(1U, 1U),
137                                                               Size2D(1U, 1U),
138                                                               Size2D(1U, 1U),
139                                                               Size2D(1U, 1U),
140                                                               Size2D(20U, 1U),
141                                                               Size2D(0U, 1U),
142                                                               Size2D(1U, 1U),
143                                                               Size2D(1U, 1U),
144                                                              })),
145                 framework::dataset::make("Expected", { false, false, false, false, false, false, false, false, true, true })),
146                 input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier, dilation, expected)
147 {
148     bool is_valid = bool(CLDepthwiseConvolutionLayer::validate(&input_info.clone()->set_is_resizable(true), &weights_info.clone()->set_is_resizable(true), &biases_info.clone()->set_is_resizable(true), &output_info.clone()->set_is_resizable(true), conv_info, depth_multiplier,ActivationLayerInfo(), dilation));
149     ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
150 }
151 // clang-format on
152 // *INDENT-ON*
153 
154 template <typename T>
155 using CLDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T>;
156 template <typename T>
157 using CLDepthwiseConvolutionLayerMixedDataLayoutFixture = DepthwiseConvolutionLayerValidationFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T, true>;
158 template <typename T>
159 using CLDepthwiseConvolutionLayerInPlaceFixture = DepthwiseConvolutionLayerValidationFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T, false, true>;
160 
161 TEST_SUITE(Float)
TEST_SUITE(FP16)162 TEST_SUITE(FP16)
163 TEST_SUITE(W3x3)
164 TEST_SUITE(NCHW)
165 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL,
166                            combine(combine(combine(combine(framework::dataset::concat(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
167                                                                                       datasets::SmallDepthwiseConvolutionLayerDataset3x3NCHW()),
168                                                            depth_multipliers),
169                                                    framework::dataset::make("DataType",
170                                                                             DataType::F16)),
171                                            framework::dataset::make("DataLayout", DataLayout::NCHW)),
172                                    ActivationFunctionsDataset))
173 {
174     validate(CLAccessor(_target), _reference, tolerance_f16);
175 }
176 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
177                                                                                                                         large_depth_multipliers),
178                                                                                                                         framework::dataset::make("DataType",
179                                                                                                                                 DataType::F16)),
180                                                                                                                         framework::dataset::make("DataLayout", DataLayout::NCHW)),
181                                                                                                                         ActivationFunctionsDataset))
182 {
183     validate(CLAccessor(_target), _reference, tolerance_f16);
184 }
185 TEST_SUITE(Dilation)
186 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
187                                                                                                                     depth_multipliers),
188                                                                                                                     framework::dataset::make("DataType",
189                                                                                                                             DataType::F16)),
190                                                                                                                     framework::dataset::make("DataLayout", { DataLayout::NCHW })),
191                                                                                                                     ActivationFunctionsDataset))
192 {
193     validate(CLAccessor(_target), _reference, tolerance_f16);
194 }
195 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
196                            combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
197                                                            large_depth_multipliers),
198                                                    framework::dataset::make("DataType",
199                                                                             DataType::F16)),
200                                            framework::dataset::make("DataLayout", { DataLayout::NCHW })),
201                                    ActivationFunctionsDataset))
202 {
203     validate(CLAccessor(_target), _reference, tolerance_f16);
204 }
205 TEST_SUITE_END() // Dilation
TEST_SUITE_END()206 TEST_SUITE_END() // NCHW
207 
208 TEST_SUITE(NHWC)
209 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL,
210                            combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
211                                                            depth_multipliers),
212                                                    framework::dataset::make("DataType",
213                                                                             DataType::F16)),
214                                            framework::dataset::make("DataLayout", DataLayout::NHWC)),
215                                    ActivationFunctionsDataset))
216 {
217     validate(CLAccessor(_target), _reference, tolerance_f16);
218 }
219 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
220                                                                                                                         large_depth_multipliers),
221                                                                                                                         framework::dataset::make("DataType",
222                                                                                                                                 DataType::F16)),
223                                                                                                                         framework::dataset::make("DataLayout", DataLayout::NHWC)),
224                                                                                                                         ActivationFunctionsDataset))
225 {
226     validate(CLAccessor(_target), _reference, tolerance_f16);
227 }
228 TEST_SUITE(Dilation)
229 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
230                                                                                                                     depth_multipliers),
231                                                                                                                     framework::dataset::make("DataType",
232                                                                                                                             DataType::F16)),
233                                                                                                                     framework::dataset::make("DataLayout", { DataLayout::NHWC })),
234                                                                                                                     ActivationFunctionsDataset))
235 {
236     validate(CLAccessor(_target), _reference, tolerance_f16);
237 }
238 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
239                            combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
240                                                            large_depth_multipliers),
241                                                    framework::dataset::make("DataType",
242                                                                             DataType::F16)),
243                                            framework::dataset::make("DataLayout", { DataLayout::NHWC })),
244                                    ActivationFunctionsDataset))
245 {
246     validate(CLAccessor(_target), _reference, tolerance_f16);
247 }
248 TEST_SUITE_END() // Dilation
TEST_SUITE_END()249 TEST_SUITE_END() // NHWC
250 TEST_SUITE_END() // W3x3
251 
252 TEST_SUITE(Generic)
253 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
254                                                                                                                     depth_multipliers),
255                                                                                                                     framework::dataset::make("DataType",
256                                                                                                                             DataType::F16)),
257                                                                                                                     framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
258                                                                                                                     ActivationFunctionsDataset))
259 {
260     validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
261 }
262 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
263                                                                                                                         large_depth_multipliers),
264                                                                                                                         framework::dataset::make("DataType",
265                                                                                                                                 DataType::F16)),
266                                                                                                                         framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
267                                                                                                                         ActivationFunctionsDataset))
268 {
269     validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
270 }
271 
272 TEST_SUITE(Dilation)
273 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
274                                                                                                                     depth_multipliers),
275                                                                                                                     framework::dataset::make("DataType",
276                                                                                                                             DataType::F16)),
277                                                                                                                     framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
278                                                                                                                     ActivationFunctionsDataset))
279 {
280     validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
281 }
282 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
283                            combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
284                                                            large_depth_multipliers),
285                                                    framework::dataset::make("DataType",
286                                                                             DataType::F16)),
287                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
288                                    ActivationFunctionsDataset))
289 {
290     validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
291 }
292 TEST_SUITE_END() // Dilation
TEST_SUITE_END()293 TEST_SUITE_END() // Generic
294 
295 TEST_SUITE(InPlace)
296 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerInPlaceFixture<half>, framework::DatasetMode::ALL,
297                            combine(combine(combine(combine(datasets::SmallInPlaceDepthwiseConvolutionLayerDataset(),
298                                                            framework::dataset::make("DepthMultiplier", { 1 })),
299                                                    framework::dataset::make("DataType",
300                                                                             DataType::F16)),
301                                            framework::dataset::make("DataLayout", { DataLayout::NHWC })),
302                                    ActivationFunctionsDataset))
303 {
304     validate(CLAccessor(_src), _reference, tolerance_f16, tolerance_num);
305 }
306 TEST_SUITE_END() // InPlace
TEST_SUITE_END()307 TEST_SUITE_END() // FP16
308 
309 TEST_SUITE(FP32)
310 TEST_SUITE(W3x3)
311 TEST_SUITE(NCHW)
312 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL,
313                            combine(combine(combine(combine(framework::dataset::concat(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
314                                                                                       datasets::SmallDepthwiseConvolutionLayerDataset3x3NCHW()),
315                                                            depth_multipliers),
316                                                    framework::dataset::make("DataType",
317                                                                             DataType::F32)),
318                                            framework::dataset::make("DataLayout", DataLayout::NCHW)),
319                                    ActivationFunctionsDataset))
320 {
321     validate(CLAccessor(_target), _reference, tolerance_f32);
322 }
323 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
324                            large_depth_multipliers),
325                            framework::dataset::make("DataType",
326                                                     DataType::F32)),
327                            framework::dataset::make("DataLayout", DataLayout::NCHW)),
328                            ActivationFunctionsDataset))
329 {
330     validate(CLAccessor(_target), _reference, tolerance_f32);
331 }
332 TEST_SUITE(Dilation)
333 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL,
334                            combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
335                                                    framework::dataset::make("DataType",
336                                                                             DataType::F32)),
337                                            framework::dataset::make("DataLayout", DataLayout::NCHW)),
338                                    ActivationFunctionsDataset))
339 {
340     validate(CLAccessor(_target), _reference, tolerance_f32);
341 }
342 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
343                            combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
344                                                            large_depth_multipliers),
345                                                    framework::dataset::make("DataType",
346                                                                             DataType::F32)),
347                                            framework::dataset::make("DataLayout", DataLayout::NCHW)),
348                                    ActivationFunctionsDataset))
349 {
350     validate(CLAccessor(_target), _reference, tolerance_f32);
351 }
352 
353 TEST_SUITE_END() // Dilation
TEST_SUITE_END()354 TEST_SUITE_END() // NCHW
355 TEST_SUITE(NHWC)
356 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL,
357                            combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
358                                                            depth_multipliers),
359                                                    framework::dataset::make("DataType",
360                                                                             DataType::F32)),
361                                            framework::dataset::make("DataLayout", DataLayout::NHWC)),
362                                    ActivationFunctionsDataset))
363 {
364     validate(CLAccessor(_target), _reference, tolerance_f32);
365 }
366 FIXTURE_DATA_TEST_CASE_NEW(RunMixedDataLayout, CLDepthwiseConvolutionLayerMixedDataLayoutFixture<float>, framework::DatasetMode::PRECOMMIT,
367                            combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
368                                                            framework::dataset::make("DepthMultiplier", { 2 })),
369                                                    framework::dataset::make("DataType",
370                                                                             DataType::F32)),
371                                            framework::dataset::make("DataLayout", DataLayout::NHWC)),
372                                    framework::dataset::make("ActivationInfo", ActivationLayerInfo())))
373 {
374     validate(CLAccessor(_target), _reference, tolerance_f32);
375 }
376 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
377                            large_depth_multipliers),
378                            framework::dataset::make("DataType",
379                                                     DataType::F32)),
380                            framework::dataset::make("DataLayout", DataLayout::NHWC)),
381                            ActivationFunctionsDataset))
382 {
383     validate(CLAccessor(_target), _reference, tolerance_f32);
384 }
385 
386 TEST_SUITE(Dilation)
387 
388 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL,
389                            combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
390                                                            depth_multipliers),
391                                                    framework::dataset::make("DataType",
392                                                                             DataType::F32)),
393                                            framework::dataset::make("DataLayout", DataLayout::NHWC)),
394                                    ActivationFunctionsDataset))
395 {
396     validate(CLAccessor(_target), _reference, tolerance_f32);
397 }
398 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
399                            combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
400                                                            large_depth_multipliers),
401                                                    framework::dataset::make("DataType",
402                                                                             DataType::F32)),
403                                            framework::dataset::make("DataLayout", DataLayout::NHWC)),
404                                    ActivationFunctionsDataset))
405 {
406     validate(CLAccessor(_target), _reference, tolerance_f32);
407 }
408 TEST_SUITE_END() // Dilation
TEST_SUITE_END()409 TEST_SUITE_END() // NHWC
410 TEST_SUITE_END() // W3x3
411 
412 TEST_SUITE(Generic)
413 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
414                                                                                                                      depth_multipliers),
415                                                                                                                      framework::dataset::make("DataType",
416                                                                                                                              DataType::F32)),
417                                                                                                                      framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
418                                                                                                                      ActivationFunctionsDataset))
419 {
420     validate(CLAccessor(_target), _reference, tolerance_f32);
421 }
422 
423 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
424                            large_depth_multipliers),
425                            framework::dataset::make("DataType",
426                                                     DataType::F32)),
427                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
428                            ActivationFunctionsDataset))
429 {
430     validate(CLAccessor(_target), _reference, tolerance_f32);
431 }
432 
433 FIXTURE_DATA_TEST_CASE_NEW(RunLargeKernelSize, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL,
434                            combine(combine(combine(combine(datasets::LargeKernelSizeDepthwiseConvolutionLayerNHWCDataset(),
435                                                            framework::dataset::make("DepthMultiplier", { 1 })),
436                                                    framework::dataset::make("DataType",
437                                                                             DataType::F32)),
438                                            framework::dataset::make("DataLayout", { DataLayout::NHWC })),
439                                    ActivationFunctionsDataset))
440 {
441     validate(CLAccessor(_target), _reference, tolerance_f32);
442 }
443 
444 TEST_SUITE(Dilation)
445 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
446                                                                                                                      depth_multipliers),
447                                                                                                                      framework::dataset::make("DataType",
448                                                                                                                              DataType::F32)),
449                                                                                                                      framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
450                                                                                                                      ActivationFunctionsDataset))
451 {
452     validate(CLAccessor(_target), _reference, tolerance_f32);
453 }
454 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
455                            combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
456                                                            large_depth_multipliers),
457                                                    framework::dataset::make("DataType",
458                                                                             DataType::F32)),
459                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
460                                    ActivationFunctionsDataset))
461 {
462     validate(CLAccessor(_target), _reference, tolerance_f32);
463 }
464 TEST_SUITE_END() // Dilation
TEST_SUITE_END()465 TEST_SUITE_END() // Generic
466 
467 TEST_SUITE(InPlace)
468 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerInPlaceFixture<float>, framework::DatasetMode::ALL,
469                            combine(combine(combine(combine(datasets::SmallInPlaceDepthwiseConvolutionLayerDataset(),
470                                                            framework::dataset::make("DepthMultiplier", { 1 })),
471                                                    framework::dataset::make("DataType",
472                                                                             DataType::F32)),
473                                            framework::dataset::make("DataLayout", { DataLayout::NHWC })),
474                                    ActivationFunctionsDataset))
475 {
476     validate(CLAccessor(_src), _reference, tolerance_f32);
477 }
478 TEST_SUITE_END() // InPlace
479 TEST_SUITE_END() // FP32
480 TEST_SUITE_END() // Float
481 
482 template <typename T>
483 using CLDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T>;
484 template <typename T>
485 using CLDepthwiseConvolutionLayerQuantizedMixedDataLayoutFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T, true>;
486 template <typename T>
487 using CLDepthwiseConvolutionLayerQuantizedPerChannelFixture = DepthwiseConvolutionLayerValidationQuantizedPerChannelFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T, int8_t>;
488 
489 TEST_SUITE(Quantized)
TEST_SUITE(QASYMM8)490 TEST_SUITE(QASYMM8)
491 TEST_SUITE(Generic)
492 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
493                            combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
494                                                                            depth_multipliers),
495                                                                    framework::dataset::make("DataType", DataType::QASYMM8)),
496                                                            framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 128), QuantizationInfo(2.2f, 10) })),
497                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(1.f, 128) })),
498                                            framework::dataset::make("DataLayout", { DataLayout::NHWC })), // NCHW is tested with int8
499                                    ActivationFunctionsDataset))
500 {
501     validate(CLAccessor(_target), _reference, tolerance_qasymm8);
502 }
503 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
504                            combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
505                                                                            large_depth_multipliers),
506                                                                    framework::dataset::make("DataType", DataType::QASYMM8)),
507                                                            framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
508                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 2) })),
509                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
510                                    ActivationFunctionsDataset))
511 {
512     validate(CLAccessor(_target), _reference, tolerance_qasymm8);
513 }
514 TEST_SUITE(Dilation)
515 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
516                            combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
517                                                                            depth_multipliers),
518                                                                    framework::dataset::make("DataType", DataType::QASYMM8)),
519                                                            framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
520                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8, 1) })),
521                                            framework::dataset::make("DataLayout", { DataLayout::NHWC })), // NCHW is tested with int8
522                                    ActivationFunctionsDataset))
523 {
524     validate(CLAccessor(_target), _reference, tolerance_qasymm8);
525 }
526 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
527                            combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
528                                                                            large_depth_multipliers),
529                                                                    framework::dataset::make("DataType", DataType::QASYMM8)),
530                                                            framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(1.3f, 10) })),
531                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
532                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
533                                    ActivationFunctionsDataset))
534 {
535     validate(CLAccessor(_target), _reference, tolerance_qasymm8);
536 }
537 TEST_SUITE_END() // Dilation
TEST_SUITE_END()538 TEST_SUITE_END() // Generic
539 TEST_SUITE(W3x3)
540 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
541                            combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
542                                                                            depth_multipliers),
543                                                                    framework::dataset::make("DataType", DataType::QASYMM8)),
544                                                            framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10), QuantizationInfo(2.2f, 10) })),
545                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
546                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
547                                    ActivationFunctionsDataset))
548 {
549     validate(CLAccessor(_target), _reference, tolerance_qasymm8);
550 }
551 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
552                            combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
553                                                                            large_depth_multipliers),
554                                                                    framework::dataset::make("DataType", DataType::QASYMM8)),
555                                                            framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
556                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
557                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
558                                    ActivationFunctionsDataset))
559 {
560     validate(CLAccessor(_target), _reference, tolerance_qasymm8);
561 }
562 TEST_SUITE(Dilation)
563 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
564                            combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
565                                                                            depth_multipliers),
566                                                                    framework::dataset::make("DataType", DataType::QASYMM8)),
567                                                            framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
568                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
569                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
570                                    ActivationFunctionsDataset))
571 {
572     validate(CLAccessor(_target), _reference, tolerance_qasymm8);
573 }
574 FIXTURE_DATA_TEST_CASE_NEW(RunMixedDataLayout, CLDepthwiseConvolutionLayerQuantizedMixedDataLayoutFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
575                            combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
576                                                                            framework::dataset::make("DepthMultiplier", { 2 })),
577                                                                    framework::dataset::make("DataType", DataType::QASYMM8)),
578                                                            framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
579                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
580                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
581                                    framework::dataset::make("ActivationInfo", ActivationLayerInfo())))
582 {
583     validate(CLAccessor(_target), _reference, tolerance_qasymm8);
584 }
585 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
586                            combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
587                                                                            large_depth_multipliers),
588                                                                    framework::dataset::make("DataType", DataType::QASYMM8)),
589                                                            framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
590                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
591                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
592                                    ActivationFunctionsDataset))
593 {
594     validate(CLAccessor(_target), _reference, tolerance_qasymm8);
595 }
596 TEST_SUITE_END() // Dilation
TEST_SUITE_END()597 TEST_SUITE_END() // W3x3
598 TEST_SUITE_END() // QASYMM8
599 
600 TEST_SUITE(QASYMM8_SIGNED)
601 TEST_SUITE(Generic)
602 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
603                            combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
604                                                                            depth_multipliers),
605                                                                    framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
606                                                            framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10), QuantizationInfo(2.2f, 10) })),
607                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
608                                            framework::dataset::make("DataLayout", { DataLayout::NCHW })),
609                                    ActivationFunctionsDataset))
610 {
611     validate(CLAccessor(_target), _reference, tolerance_qasymm8);
612 }
613 FIXTURE_DATA_TEST_CASE_NEW(RunMixedDataLayout, CLDepthwiseConvolutionLayerQuantizedMixedDataLayoutFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
614                            combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
615                                                                            framework::dataset::make("DepthMultiplier", { 2 })),
616                                                                    framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
617                                                            framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10), QuantizationInfo(2.2f, 10) })),
618                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
619                                            framework::dataset::make("DataLayout", { DataLayout::NCHW })),
620                                    framework::dataset::make("ActivationInfo", ActivationLayerInfo())))
621 {
622     validate(CLAccessor(_target), _reference, tolerance_qasymm8);
623 }
624 TEST_SUITE(Dilation)
625 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
626                            combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
627                                                                            depth_multipliers),
628                                                                    framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
629                                                            framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
630                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8, 1) })),
631                                            framework::dataset::make("DataLayout", { DataLayout::NCHW })),
632                                    ActivationFunctionsDataset))
633 {
634     validate(CLAccessor(_target), _reference, tolerance_qasymm8);
635 }
636 TEST_SUITE_END() // Dilation
TEST_SUITE_END()637 TEST_SUITE_END() // Generic
638 TEST_SUITE_END() // QASYMM8_SIGNED
639 
640 TEST_SUITE(QSYMM8_PER_CHANNEL)
641 TEST_SUITE(Generic)
642 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
643                            combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
644                                                                                    depth_multipliers),
645                                                                            framework::dataset::make("SrcDataType", DataType::QASYMM8)),
646                                                                    framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
647                                                            framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
648                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
649                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
650                                    ActivationFunctionsDataset))
651 {
652     validate(CLAccessor(_target), _reference, tolerance_qasymm8);
653 }
654 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
655                            combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
656                                                                                    large_depth_multipliers),
657                                                                            framework::dataset::make("SrcDataType", DataType::QASYMM8)),
658                                                                    framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
659                                                            framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
660                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 2) })),
661                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
662                                    ActivationFunctionsDataset))
663 {
664     validate(CLAccessor(_target), _reference, tolerance_qasymm8);
665 }
666 TEST_SUITE(Dilation)
667 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
668                            combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
669                                                                                    depth_multipliers),
670                                                                            framework::dataset::make("SrcDataType", DataType::QASYMM8)),
671                                                                    framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
672                                                            framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
673                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8, 1) })),
674                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
675                                    ActivationFunctionsDataset))
676 {
677     validate(CLAccessor(_target), _reference, tolerance_qasymm8);
678 }
679 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
680                            combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
681                                                                                    large_depth_multipliers),
682                                                                            framework::dataset::make("SrcDataType", DataType::QASYMM8)),
683                                                                    framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
684                                                            framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
685                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
686                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
687                                    ActivationFunctionsDataset))
688 {
689     validate(CLAccessor(_target), _reference, tolerance_qasymm8);
690 }
691 TEST_SUITE_END() // Dilation
TEST_SUITE_END()692 TEST_SUITE_END() // Generic
693 TEST_SUITE(W3x3)
694 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
695                            combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
696                                                                                    depth_multipliers),
697                                                                            framework::dataset::make("SrcDataType", DataType::QASYMM8)),
698                                                                    framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
699                                                            framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
700                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
701                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
702                                    ActivationFunctionsDataset))
703 {
704     validate(CLAccessor(_target), _reference, tolerance_qasymm8);
705 }
706 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
707                            combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
708                                                                                    large_depth_multipliers),
709                                                                            framework::dataset::make("SrcDataType", DataType::QASYMM8)),
710                                                                    framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
711                                                            framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
712                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
713                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
714                                    ActivationFunctionsDataset))
715 {
716     validate(CLAccessor(_target), _reference, tolerance_qasymm8);
717 }
718 TEST_SUITE(Dilation)
719 FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
720                            combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
721                                                                                    depth_multipliers),
722                                                                            framework::dataset::make("SrcDataType", DataType::QASYMM8)),
723                                                                    framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
724                                                            framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
725                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
726                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
727                                    ActivationFunctionsDataset))
728 {
729     validate(CLAccessor(_target), _reference, tolerance_qasymm8);
730 }
731 FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
732                            combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
733                                                                                    large_depth_multipliers),
734                                                                            framework::dataset::make("SrcDataType", DataType::QASYMM8)),
735                                                                    framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
736                                                            framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
737                                                    framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
738                                            framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
739                                    ActivationFunctionsDataset))
740 {
741     validate(CLAccessor(_target), _reference, tolerance_qasymm8);
742 }
743 TEST_SUITE_END() // Dilation
744 TEST_SUITE_END() // W3x3
745 TEST_SUITE_END() // QSYMM8_PER_CHANNEL
746 TEST_SUITE_END() // Quantized
747 
748 TEST_SUITE_END() // DepthwiseConvolutionLayer
749 TEST_SUITE_END() // CL
750 } // namespace validation
751 } // namespace test
752 } // namespace arm_compute
753