blob: b2009c26ad459e7421ec441b6a6f5d6e9004b586 [file] [log] [blame]
Giorgio Arena04a8f8c2017-11-23 11:45:24 +00001/*
Giorgio Arena68e29da2021-02-08 16:31:10 +00002 * Copyright (c) 2017-2021 Arm Limited.
Giorgio Arena04a8f8c2017-11-23 11:45:24 +00003 *
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,
Usama Arife73686a2019-04-08 17:30:48 +010021 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
Giorgio Arena04a8f8c2017-11-23 11:45:24 +000022 * 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"
Usama Arife73686a2019-04-08 17:30:48 +010031#include "tests/datasets/DilatedDepthwiseConvolutionLayerDataset.h"
Giorgio Arena04a8f8c2017-11-23 11:45:24 +000032#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
38namespace arm_compute
39{
40namespace test
41{
42namespace validation
43{
44namespace
45{
Georgios Pinitas009fede2018-10-26 12:54:21 +010046RelativeTolerance<half_float::half> tolerance_f16(half_float::half(0.01)); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F16 */
47constexpr RelativeTolerance<float> tolerance_f32(0.01f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F32 */
Georgios Pinitas83e3e752018-11-07 18:33:08 +000048constexpr AbsoluteTolerance<uint8_t> tolerance_qasymm8(0); /**< Tolerance value for comparing reference's output against implementation's output for DataType::QASYMM8 */
Georgios Pinitas009fede2018-10-26 12:54:21 +010049constexpr float tolerance_num = 0.05f; /**< Tolerance number */
Giorgio Arena76572242018-04-04 17:44:26 +010050
Michele Di Giorgio601ba3f2019-08-22 16:20:04 +010051const auto depth_multipliers = framework::dataset::make("DepthMultiplier", { 1, 2, 5 });
Matthew Jackson6c2eac12019-07-23 10:43:10 +010052const auto large_depth_multipliers = framework::dataset::make("DepthMultiplier", { 1, 2, 5, 8 });
Manuel Bottinia788c2f2019-04-08 13:18:00 +010053
54//Activation Functions
55const auto ActivationFunctionsDataset = framework::dataset::make("ActivationInfo",
56{
57 ActivationLayerInfo(),
Michele Di Giorgio17b71022020-11-16 13:10:07 +000058 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU),
59 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 6.f, 0.f)
Manuel Bottinia788c2f2019-04-08 13:18:00 +010060});
Giorgio Arena04a8f8c2017-11-23 11:45:24 +000061} // namespace
62
63TEST_SUITE(CL)
64TEST_SUITE(DepthwiseConvolutionLayer)
65
Giorgio Arenaad0c7382018-04-23 16:16:21 +010066// *INDENT-OFF*
67// clang-format off
Manuel Bottini387259a2020-05-21 17:14:36 +010068DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +010069 framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type input/weights
70 TensorInfo(TensorShape(27U, 13U, 3U), 1, DataType::F32), // Mismatching input feature maps
71 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching depth multiplier
72 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases size
73 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases dimensions
74 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid output size
Usama Arife73686a2019-04-08 17:30:48 +010075 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // patch size bigger than input width
76 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // dilation < 1
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +010077 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32),
78 TensorInfo(TensorShape(32U, 13U, 8U), 1, DataType::QASYMM8),
Giorgio Arenaad0c7382018-04-23 16:16:21 +010079 }),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +010080 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F16),
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, 2U), 1, DataType::F32),
86 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
Usama Arife73686a2019-04-08 17:30:48 +010087 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
88 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +010089 TensorInfo(TensorShape(3U, 3U, 24U), 1, DataType::QASYMM8),
Giorgio Arenaad0c7382018-04-23 16:16:21 +010090 })),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +010091 framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32),
92 TensorInfo(TensorShape(2U), 1, DataType::F32),
93 TensorInfo(TensorShape(2U), 1, DataType::F32),
94 TensorInfo(TensorShape(4U), 1, DataType::F32),
95 TensorInfo(TensorShape(2U, 2U), 1, DataType::F32),
96 TensorInfo(TensorShape(2U), 1, DataType::F32),
97 TensorInfo(TensorShape(16U), 1, DataType::F32),
Usama Arife73686a2019-04-08 17:30:48 +010098 TensorInfo(TensorShape(16U), 1, DataType::F32),
99 TensorInfo(TensorShape(16U), 1, DataType::F32),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100100 TensorInfo(TensorShape(24U), 1, DataType::S32),
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100101 })),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100102 framework::dataset::make("OutputInfo", { 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(25U, 11U, 2U), 1, DataType::F32),
107 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),
108 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
Usama Arife73686a2019-04-08 17:30:48 +0100109 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
110 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100111 TensorInfo(TensorShape(32U, 11U, 24U), 1, DataType::QASYMM8),
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100112 })),
113 framework::dataset::make("ConvInfo", { 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),
Usama Arife73686a2019-04-08 17:30:48 +0100120 PadStrideInfo(1, 1, 0, 0),
121 PadStrideInfo(1, 1, 0, 0),
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100122 PadStrideInfo(1, 1, 1, 0),
123 })),
124 framework::dataset::make("DepthMultiplier", { 1,
125 1,
126 3,
127 1,
128 1,
129 1,
130 2,
Usama Arife73686a2019-04-08 17:30:48 +0100131 2,
132 2,
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100133 3,
134 })),
Usama Arife73686a2019-04-08 17:30:48 +0100135 framework::dataset::make("Dilation", { Size2D(1U, 1U),
136 Size2D(1U, 1U),
137 Size2D(1U, 1U),
138 Size2D(1U, 1U),
139 Size2D(1U, 1U),
140 Size2D(1U, 1U),
141 Size2D(20U, 1U),
142 Size2D(0U, 1U),
143 Size2D(1U, 1U),
144 Size2D(1U, 1U),
145 })),
146 framework::dataset::make("Expected", { false, false, false, false, false, false, false, false, true, true })),
147 input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier, dilation, expected)
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100148{
Michele Di Giorgio601ba3f2019-08-22 16:20:04 +0100149 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));
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100150 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
151}
152// clang-format on
153// *INDENT-ON*
154
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000155template <typename T>
156using CLDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T>;
157
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000158TEST_SUITE(Float)
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100159TEST_SUITE(FP16)
Michele Di Giorgio933fe862018-02-19 15:42:12 +0000160TEST_SUITE(W3x3)
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100161TEST_SUITE(NCHW)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000162FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL,
163 combine(combine(combine(combine(framework::dataset::concat(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
164 datasets::SmallDepthwiseConvolutionLayerDataset3x3NCHW()),
165 depth_multipliers),
166 framework::dataset::make("DataType",
167 DataType::F16)),
168 framework::dataset::make("DataLayout", DataLayout::NCHW)),
169 ActivationFunctionsDataset))
Michele Di Giorgio933fe862018-02-19 15:42:12 +0000170{
171 validate(CLAccessor(_target), _reference, tolerance_f16);
172}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000173FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
174 large_depth_multipliers),
175 framework::dataset::make("DataType",
176 DataType::F16)),
177 framework::dataset::make("DataLayout", DataLayout::NCHW)),
178 ActivationFunctionsDataset))
Michele Di Giorgio933fe862018-02-19 15:42:12 +0000179{
180 validate(CLAccessor(_target), _reference, tolerance_f16);
181}
Usama Arife73686a2019-04-08 17:30:48 +0100182TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000183FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
184 depth_multipliers),
Usama Arife73686a2019-04-08 17:30:48 +0100185 framework::dataset::make("DataType",
186 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100187 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
188 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100189{
190 validate(CLAccessor(_target), _reference, tolerance_f16);
191}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000192FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
193 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
194 large_depth_multipliers),
195 framework::dataset::make("DataType",
196 DataType::F16)),
197 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
198 ActivationFunctionsDataset))
199{
200 validate(CLAccessor(_target), _reference, tolerance_f16);
201}
Usama Arife73686a2019-04-08 17:30:48 +0100202TEST_SUITE_END() // Dilation
203TEST_SUITE_END() // NCHW
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100204
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100205TEST_SUITE(NHWC)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000206FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL,
207 combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
208 depth_multipliers),
209 framework::dataset::make("DataType",
210 DataType::F16)),
211 framework::dataset::make("DataLayout", DataLayout::NHWC)),
212 ActivationFunctionsDataset))
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100213{
214 validate(CLAccessor(_target), _reference, tolerance_f16);
215}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000216FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
217 large_depth_multipliers),
218 framework::dataset::make("DataType",
219 DataType::F16)),
220 framework::dataset::make("DataLayout", DataLayout::NHWC)),
221 ActivationFunctionsDataset))
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100222{
223 validate(CLAccessor(_target), _reference, tolerance_f16);
224}
Usama Arife73686a2019-04-08 17:30:48 +0100225TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000226FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
227 depth_multipliers),
Usama Arife73686a2019-04-08 17:30:48 +0100228 framework::dataset::make("DataType",
229 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100230 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
231 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100232{
233 validate(CLAccessor(_target), _reference, tolerance_f16);
234}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000235FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
236 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
237 large_depth_multipliers),
238 framework::dataset::make("DataType",
239 DataType::F16)),
240 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
241 ActivationFunctionsDataset))
242{
243 validate(CLAccessor(_target), _reference, tolerance_f16);
244}
Usama Arife73686a2019-04-08 17:30:48 +0100245TEST_SUITE_END() // Dilation
246TEST_SUITE_END() // NHWC
247TEST_SUITE_END() // W3x3
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100248
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100249TEST_SUITE(Generic)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000250FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
251 depth_multipliers),
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100252 framework::dataset::make("DataType",
253 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100254 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
255 ActivationFunctionsDataset))
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100256{
257 validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
258}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000259FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
260 large_depth_multipliers),
261 framework::dataset::make("DataType",
262 DataType::F16)),
263 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
264 ActivationFunctionsDataset))
265{
266 validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
267}
Usama Arife73686a2019-04-08 17:30:48 +0100268
269TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000270FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
271 depth_multipliers),
Usama Arife73686a2019-04-08 17:30:48 +0100272 framework::dataset::make("DataType",
273 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100274 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
275 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100276{
277 validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
278}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000279FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
280 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
281 large_depth_multipliers),
282 framework::dataset::make("DataType",
283 DataType::F16)),
284 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
285 ActivationFunctionsDataset))
286{
287 validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
288}
Usama Arife73686a2019-04-08 17:30:48 +0100289TEST_SUITE_END() // Dilation
290TEST_SUITE_END() // Generic
291TEST_SUITE_END() // FP16
Michele Di Giorgio933fe862018-02-19 15:42:12 +0000292
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000293TEST_SUITE(FP32)
294TEST_SUITE(W3x3)
Giorgio Arenad051e972018-06-20 11:46:42 +0100295TEST_SUITE(NCHW)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000296FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL,
297 combine(combine(combine(combine(framework::dataset::concat(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
298 datasets::SmallDepthwiseConvolutionLayerDataset3x3NCHW()),
299 depth_multipliers),
300 framework::dataset::make("DataType",
301 DataType::F32)),
302 framework::dataset::make("DataLayout", DataLayout::NCHW)),
303 ActivationFunctionsDataset))
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000304{
305 validate(CLAccessor(_target), _reference, tolerance_f32);
306}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000307FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
308 large_depth_multipliers),
309 framework::dataset::make("DataType",
310 DataType::F32)),
311 framework::dataset::make("DataLayout", DataLayout::NCHW)),
312 ActivationFunctionsDataset))
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000313{
314 validate(CLAccessor(_target), _reference, tolerance_f32);
315}
Usama Arife73686a2019-04-08 17:30:48 +0100316TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000317FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL,
318 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
319 framework::dataset::make("DataType",
320 DataType::F32)),
321 framework::dataset::make("DataLayout", DataLayout::NCHW)),
322 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100323{
324 validate(CLAccessor(_target), _reference, tolerance_f32);
325}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000326FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
327 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
328 large_depth_multipliers),
329 framework::dataset::make("DataType",
330 DataType::F32)),
331 framework::dataset::make("DataLayout", DataLayout::NCHW)),
332 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100333{
334 validate(CLAccessor(_target), _reference, tolerance_f32);
335}
336
337TEST_SUITE_END() // Dilation
338TEST_SUITE_END() // NCHW
Giorgio Arenad051e972018-06-20 11:46:42 +0100339TEST_SUITE(NHWC)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000340FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL,
341 combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
342 depth_multipliers),
343 framework::dataset::make("DataType",
344 DataType::F32)),
345 framework::dataset::make("DataLayout", DataLayout::NHWC)),
346 ActivationFunctionsDataset))
Giorgio Arenad051e972018-06-20 11:46:42 +0100347{
348 validate(CLAccessor(_target), _reference, tolerance_f32);
349}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000350FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
351 large_depth_multipliers),
352 framework::dataset::make("DataType",
353 DataType::F32)),
354 framework::dataset::make("DataLayout", DataLayout::NHWC)),
355 ActivationFunctionsDataset))
Giorgio Arenad051e972018-06-20 11:46:42 +0100356{
357 validate(CLAccessor(_target), _reference, tolerance_f32);
358}
Usama Arife73686a2019-04-08 17:30:48 +0100359TEST_SUITE(Dilation)
360
Giorgio Arena68e29da2021-02-08 16:31:10 +0000361FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL,
362 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
363 depth_multipliers),
364 framework::dataset::make("DataType",
365 DataType::F32)),
366 framework::dataset::make("DataLayout", DataLayout::NHWC)),
367 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100368{
369 validate(CLAccessor(_target), _reference, tolerance_f32);
370}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000371FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
372 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
373 large_depth_multipliers),
374 framework::dataset::make("DataType",
375 DataType::F32)),
376 framework::dataset::make("DataLayout", DataLayout::NHWC)),
377 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100378{
379 validate(CLAccessor(_target), _reference, tolerance_f32);
380}
381TEST_SUITE_END() // Dilation
382TEST_SUITE_END() // NHWC
383TEST_SUITE_END() // W3x3
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100384
385TEST_SUITE(Generic)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000386FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
387 depth_multipliers),
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100388 framework::dataset::make("DataType",
389 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100390 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
391 ActivationFunctionsDataset))
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100392{
393 validate(CLAccessor(_target), _reference, tolerance_f32);
394}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000395FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
396 large_depth_multipliers),
397 framework::dataset::make("DataType",
398 DataType::F32)),
399 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
400 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100401{
402 validate(CLAccessor(_target), _reference, tolerance_f32);
403}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000404
405TEST_SUITE(Dilation)
406FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
407 depth_multipliers),
408 framework::dataset::make("DataType",
409 DataType::F32)),
410 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
411 ActivationFunctionsDataset))
412{
413 validate(CLAccessor(_target), _reference, tolerance_f32);
414}
415FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
416 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
417 large_depth_multipliers),
418 framework::dataset::make("DataType",
419 DataType::F32)),
420 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
421 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100422{
423 validate(CLAccessor(_target), _reference, tolerance_f32);
424}
425TEST_SUITE_END() // Dilation
426TEST_SUITE_END() // Generic
427TEST_SUITE_END() // FP32
428TEST_SUITE_END() // Float
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000429
430template <typename T>
Georgios Pinitasde5a1cc2018-02-02 12:52:07 +0000431using CLDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T>;
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100432template <typename T>
433using CLDepthwiseConvolutionLayerQuantizedPerChannelFixture = DepthwiseConvolutionLayerValidationQuantizedPerChannelFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T, int8_t>;
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000434
435TEST_SUITE(Quantized)
436TEST_SUITE(QASYMM8)
Georgios Pinitasde5a1cc2018-02-02 12:52:07 +0000437TEST_SUITE(Generic)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000438FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
439 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
440 depth_multipliers),
441 framework::dataset::make("DataType", DataType::QASYMM8)),
442 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10), QuantizationInfo(2.2f, 10) })),
443 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
444 framework::dataset::make("DataLayout", { DataLayout::NHWC })), // NCHW is tested with int8
445 ActivationFunctionsDataset))
Georgios Pinitasde5a1cc2018-02-02 12:52:07 +0000446{
447 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
448}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000449FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
450 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
451 large_depth_multipliers),
452 framework::dataset::make("DataType", DataType::QASYMM8)),
453 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
454 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 2) })),
455 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
456 ActivationFunctionsDataset))
Georgios Pinitasde5a1cc2018-02-02 12:52:07 +0000457{
458 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
459}
Usama Arife73686a2019-04-08 17:30:48 +0100460TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000461FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
462 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
463 depth_multipliers),
464 framework::dataset::make("DataType", DataType::QASYMM8)),
465 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
466 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8, 1) })),
467 framework::dataset::make("DataLayout", { DataLayout::NHWC })), // NCHW is tested with int8
468 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100469{
470 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
471}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000472FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
473 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
474 large_depth_multipliers),
475 framework::dataset::make("DataType", DataType::QASYMM8)),
476 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(1.3f, 10) })),
477 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
478 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
479 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100480{
481 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
482}
483TEST_SUITE_END() // Dilation
484TEST_SUITE_END() // Generic
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000485TEST_SUITE(W3x3)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000486FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
487 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
488 depth_multipliers),
489 framework::dataset::make("DataType", DataType::QASYMM8)),
490 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10), QuantizationInfo(2.2f, 10) })),
491 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
492 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
493 ActivationFunctionsDataset))
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000494{
495 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
496}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000497FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
498 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
499 large_depth_multipliers),
500 framework::dataset::make("DataType", DataType::QASYMM8)),
501 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
502 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
503 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
504 ActivationFunctionsDataset))
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000505{
506 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
507}
Usama Arife73686a2019-04-08 17:30:48 +0100508TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000509FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
510 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
511 depth_multipliers),
512 framework::dataset::make("DataType", DataType::QASYMM8)),
513 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
514 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
515 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
516 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100517{
518 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
519}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000520FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
521 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
522 large_depth_multipliers),
523 framework::dataset::make("DataType", DataType::QASYMM8)),
524 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
525 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
526 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
527 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100528{
529 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
530}
531TEST_SUITE_END() // Dilation
532TEST_SUITE_END() // W3x3
533TEST_SUITE_END() // QASYMM8
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100534
Michele Di Giorgio4cd4cde2020-01-06 14:07:44 +0000535TEST_SUITE(QASYMM8_SIGNED)
536TEST_SUITE(Generic)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000537FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
538 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
539 depth_multipliers),
540 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
541 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10), QuantizationInfo(2.2f, 10) })),
542 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
543 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
544 ActivationFunctionsDataset))
Michele Di Giorgio4cd4cde2020-01-06 14:07:44 +0000545{
546 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
547}
548TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000549FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
550 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
551 depth_multipliers),
552 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
553 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
554 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8, 1) })),
555 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
556 ActivationFunctionsDataset))
Michele Di Giorgio4cd4cde2020-01-06 14:07:44 +0000557{
558 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
559}
560TEST_SUITE_END() // Dilation
561TEST_SUITE_END() // Generic
562TEST_SUITE_END() // QASYMM8_SIGNED
563
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100564TEST_SUITE(QSYMM8_PER_CHANNEL)
565TEST_SUITE(Generic)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000566FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
567 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
568 depth_multipliers),
569 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
570 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
571 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
572 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
573 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
574 ActivationFunctionsDataset))
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100575{
576 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
577}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000578FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
579 combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
580 large_depth_multipliers),
581 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
582 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
583 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
584 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 2) })),
585 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
586 ActivationFunctionsDataset))
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100587{
588 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
589}
590TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000591FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
592 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
593 depth_multipliers),
594 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
595 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
596 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
597 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8, 1) })),
598 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
599 ActivationFunctionsDataset))
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100600{
601 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
602}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000603FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
604 combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
605 large_depth_multipliers),
606 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
607 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
608 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
609 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
610 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
611 ActivationFunctionsDataset))
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100612{
613 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
614}
615TEST_SUITE_END() // Dilation
616TEST_SUITE_END() // Generic
617TEST_SUITE(W3x3)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000618FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
619 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
620 depth_multipliers),
621 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
622 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
623 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
624 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
625 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
626 ActivationFunctionsDataset))
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100627{
628 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
629}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000630FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
631 combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
632 large_depth_multipliers),
633 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
634 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
635 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
636 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
637 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
638 ActivationFunctionsDataset))
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100639{
640 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
641}
642TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000643FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
644 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
645 depth_multipliers),
646 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
647 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
648 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
649 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
650 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
651 ActivationFunctionsDataset))
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100652{
653 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
654}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000655FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
656 combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
657 large_depth_multipliers),
658 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
659 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
660 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
661 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
662 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
663 ActivationFunctionsDataset))
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100664{
665 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
666}
667TEST_SUITE_END() // Dilation
668TEST_SUITE_END() // W3x3
669TEST_SUITE_END() // QSYMM8_PER_CHANNEL
Usama Arife73686a2019-04-08 17:30:48 +0100670TEST_SUITE_END() // Quantized
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000671
Usama Arife73686a2019-04-08 17:30:48 +0100672TEST_SUITE_END() // DepthwiseConvolutionLayer
673TEST_SUITE_END() // CL
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000674} // namespace validation
675} // namespace test
676} // namespace arm_compute