blob: b2cff2b792c80fe6ceef441cc673eb23caae6477 [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
Gian Marco Iodice8155c022021-04-16 15:08:59 +010051const auto depth_multipliers = framework::dataset::make("DepthMultiplier", { 1, 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{
Gian Marco Iodicec63b7222021-06-30 08:39:44 +000057 ActivationLayerInfo(),
Michele Di Giorgio17b71022020-11-16 13:10:07 +000058 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 6.f, 0.f)
Manuel Bottinia788c2f2019-04-08 13:18:00 +010059});
Giorgio Arena04a8f8c2017-11-23 11:45:24 +000060} // namespace
61
62TEST_SUITE(CL)
63TEST_SUITE(DepthwiseConvolutionLayer)
64
Giorgio Arenaad0c7382018-04-23 16:16:21 +010065// *INDENT-OFF*
66// clang-format off
Manuel Bottini387259a2020-05-21 17:14:36 +010067DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +010068 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
Usama Arife73686a2019-04-08 17:30:48 +010074 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
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +010076 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32),
77 TensorInfo(TensorShape(32U, 13U, 8U), 1, DataType::QASYMM8),
Giorgio Arenaad0c7382018-04-23 16:16:21 +010078 }),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +010079 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),
Usama Arife73686a2019-04-08 17:30:48 +010086 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
87 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +010088 TensorInfo(TensorShape(3U, 3U, 24U), 1, DataType::QASYMM8),
Giorgio Arenaad0c7382018-04-23 16:16:21 +010089 })),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +010090 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),
Usama Arife73686a2019-04-08 17:30:48 +010097 TensorInfo(TensorShape(16U), 1, DataType::F32),
98 TensorInfo(TensorShape(16U), 1, DataType::F32),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +010099 TensorInfo(TensorShape(24U), 1, DataType::S32),
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100100 })),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100101 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),
Usama Arife73686a2019-04-08 17:30:48 +0100108 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
109 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100110 TensorInfo(TensorShape(32U, 11U, 24U), 1, DataType::QASYMM8),
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100111 })),
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),
Usama Arife73686a2019-04-08 17:30:48 +0100119 PadStrideInfo(1, 1, 0, 0),
120 PadStrideInfo(1, 1, 0, 0),
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100121 PadStrideInfo(1, 1, 1, 0),
122 })),
123 framework::dataset::make("DepthMultiplier", { 1,
124 1,
125 3,
126 1,
127 1,
128 1,
129 2,
Usama Arife73686a2019-04-08 17:30:48 +0100130 2,
131 2,
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100132 3,
133 })),
Usama Arife73686a2019-04-08 17:30:48 +0100134 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)
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100147{
Michele Di Giorgio601ba3f2019-08-22 16:20:04 +0100148 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 +0100149 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
150}
151// clang-format on
152// *INDENT-ON*
153
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000154template <typename T>
155using CLDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T>;
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000156template <typename T>
157using CLDepthwiseConvolutionLayerMixedDataLayoutFixture = DepthwiseConvolutionLayerValidationFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T, true>;
SiCongLibc4e3112021-06-29 13:18:30 +0100158template <typename T>
159using CLDepthwiseConvolutionLayerInPlaceFixture = DepthwiseConvolutionLayerValidationFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T, false, true>;
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000160
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000161TEST_SUITE(Float)
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100162TEST_SUITE(FP16)
Michele Di Giorgio933fe862018-02-19 15:42:12 +0000163TEST_SUITE(W3x3)
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100164TEST_SUITE(NCHW)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000165FIXTURE_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))
Michele Di Giorgio933fe862018-02-19 15:42:12 +0000173{
174 validate(CLAccessor(_target), _reference, tolerance_f16);
175}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000176FIXTURE_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))
Michele Di Giorgio933fe862018-02-19 15:42:12 +0000182{
183 validate(CLAccessor(_target), _reference, tolerance_f16);
184}
Usama Arife73686a2019-04-08 17:30:48 +0100185TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000186FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
187 depth_multipliers),
Usama Arife73686a2019-04-08 17:30:48 +0100188 framework::dataset::make("DataType",
189 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100190 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
191 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100192{
193 validate(CLAccessor(_target), _reference, tolerance_f16);
194}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000195FIXTURE_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}
Usama Arife73686a2019-04-08 17:30:48 +0100205TEST_SUITE_END() // Dilation
206TEST_SUITE_END() // NCHW
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100207
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100208TEST_SUITE(NHWC)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000209FIXTURE_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))
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100216{
217 validate(CLAccessor(_target), _reference, tolerance_f16);
218}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000219FIXTURE_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))
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100225{
226 validate(CLAccessor(_target), _reference, tolerance_f16);
227}
Usama Arife73686a2019-04-08 17:30:48 +0100228TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000229FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
230 depth_multipliers),
Usama Arife73686a2019-04-08 17:30:48 +0100231 framework::dataset::make("DataType",
232 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100233 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
234 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100235{
236 validate(CLAccessor(_target), _reference, tolerance_f16);
237}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000238FIXTURE_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}
Usama Arife73686a2019-04-08 17:30:48 +0100248TEST_SUITE_END() // Dilation
249TEST_SUITE_END() // NHWC
250TEST_SUITE_END() // W3x3
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100251
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100252TEST_SUITE(Generic)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000253FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
254 depth_multipliers),
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100255 framework::dataset::make("DataType",
256 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100257 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
258 ActivationFunctionsDataset))
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100259{
260 validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
261}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000262FIXTURE_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}
Usama Arife73686a2019-04-08 17:30:48 +0100271
272TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000273FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
274 depth_multipliers),
Usama Arife73686a2019-04-08 17:30:48 +0100275 framework::dataset::make("DataType",
276 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100277 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
278 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100279{
280 validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
281}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000282FIXTURE_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}
Usama Arife73686a2019-04-08 17:30:48 +0100292TEST_SUITE_END() // Dilation
293TEST_SUITE_END() // Generic
SiCongLibc4e3112021-06-29 13:18:30 +0100294
295TEST_SUITE(InPlace)
296FIXTURE_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}
306TEST_SUITE_END() // InPlace
Usama Arife73686a2019-04-08 17:30:48 +0100307TEST_SUITE_END() // FP16
Michele Di Giorgio933fe862018-02-19 15:42:12 +0000308
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000309TEST_SUITE(FP32)
310TEST_SUITE(W3x3)
Giorgio Arenad051e972018-06-20 11:46:42 +0100311TEST_SUITE(NCHW)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000312FIXTURE_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))
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000320{
321 validate(CLAccessor(_target), _reference, tolerance_f32);
322}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000323FIXTURE_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))
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000329{
330 validate(CLAccessor(_target), _reference, tolerance_f32);
331}
Usama Arife73686a2019-04-08 17:30:48 +0100332TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000333FIXTURE_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))
Usama Arife73686a2019-04-08 17:30:48 +0100339{
340 validate(CLAccessor(_target), _reference, tolerance_f32);
341}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000342FIXTURE_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))
Usama Arife73686a2019-04-08 17:30:48 +0100349{
350 validate(CLAccessor(_target), _reference, tolerance_f32);
351}
352
353TEST_SUITE_END() // Dilation
354TEST_SUITE_END() // NCHW
Giorgio Arenad051e972018-06-20 11:46:42 +0100355TEST_SUITE(NHWC)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000356FIXTURE_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))
Giorgio Arenad051e972018-06-20 11:46:42 +0100363{
364 validate(CLAccessor(_target), _reference, tolerance_f32);
365}
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000366FIXTURE_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)),
SiCongLibc4e3112021-06-29 13:18:30 +0100372 framework::dataset::make("ActivationInfo", ActivationLayerInfo())))
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000373{
374 validate(CLAccessor(_target), _reference, tolerance_f32);
375}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000376FIXTURE_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))
Giorgio Arenad051e972018-06-20 11:46:42 +0100382{
383 validate(CLAccessor(_target), _reference, tolerance_f32);
384}
Gian Marco Iodice5e281812021-07-06 13:19:41 +0100385
Usama Arife73686a2019-04-08 17:30:48 +0100386TEST_SUITE(Dilation)
387
Giorgio Arena68e29da2021-02-08 16:31:10 +0000388FIXTURE_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))
Usama Arife73686a2019-04-08 17:30:48 +0100395{
396 validate(CLAccessor(_target), _reference, tolerance_f32);
397}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000398FIXTURE_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))
Usama Arife73686a2019-04-08 17:30:48 +0100405{
406 validate(CLAccessor(_target), _reference, tolerance_f32);
407}
408TEST_SUITE_END() // Dilation
409TEST_SUITE_END() // NHWC
410TEST_SUITE_END() // W3x3
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100411
412TEST_SUITE(Generic)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000413FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
414 depth_multipliers),
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100415 framework::dataset::make("DataType",
416 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100417 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
418 ActivationFunctionsDataset))
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100419{
420 validate(CLAccessor(_target), _reference, tolerance_f32);
421}
Gian Marco Iodice5e281812021-07-06 13:19:41 +0100422
Giorgio Arena68e29da2021-02-08 16:31:10 +0000423FIXTURE_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))
Usama Arife73686a2019-04-08 17:30:48 +0100429{
430 validate(CLAccessor(_target), _reference, tolerance_f32);
431}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000432
Gian Marco Iodice5e281812021-07-06 13:19:41 +0100433FIXTURE_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
Giorgio Arena68e29da2021-02-08 16:31:10 +0000444TEST_SUITE(Dilation)
445FIXTURE_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}
454FIXTURE_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))
Usama Arife73686a2019-04-08 17:30:48 +0100461{
462 validate(CLAccessor(_target), _reference, tolerance_f32);
463}
464TEST_SUITE_END() // Dilation
465TEST_SUITE_END() // Generic
SiCongLibc4e3112021-06-29 13:18:30 +0100466
467TEST_SUITE(InPlace)
468FIXTURE_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}
478TEST_SUITE_END() // InPlace
Usama Arife73686a2019-04-08 17:30:48 +0100479TEST_SUITE_END() // FP32
480TEST_SUITE_END() // Float
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000481
482template <typename T>
Georgios Pinitasde5a1cc2018-02-02 12:52:07 +0000483using CLDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T>;
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100484template <typename T>
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000485using CLDepthwiseConvolutionLayerQuantizedMixedDataLayoutFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T, true>;
486template <typename T>
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100487using CLDepthwiseConvolutionLayerQuantizedPerChannelFixture = DepthwiseConvolutionLayerValidationQuantizedPerChannelFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T, int8_t>;
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000488
489TEST_SUITE(Quantized)
490TEST_SUITE(QASYMM8)
Georgios Pinitasde5a1cc2018-02-02 12:52:07 +0000491TEST_SUITE(Generic)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000492FIXTURE_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)),
Gian Marco Iodice8155c022021-04-16 15:08:59 +0100496 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 128), QuantizationInfo(2.2f, 10) })),
497 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(1.f, 128) })),
Giorgio Arena68e29da2021-02-08 16:31:10 +0000498 framework::dataset::make("DataLayout", { DataLayout::NHWC })), // NCHW is tested with int8
499 ActivationFunctionsDataset))
Georgios Pinitasde5a1cc2018-02-02 12:52:07 +0000500{
501 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
502}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000503FIXTURE_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))
Georgios Pinitasde5a1cc2018-02-02 12:52:07 +0000511{
512 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
513}
Usama Arife73686a2019-04-08 17:30:48 +0100514TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000515FIXTURE_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))
Usama Arife73686a2019-04-08 17:30:48 +0100523{
524 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
525}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000526FIXTURE_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))
Usama Arife73686a2019-04-08 17:30:48 +0100534{
535 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
536}
537TEST_SUITE_END() // Dilation
538TEST_SUITE_END() // Generic
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000539TEST_SUITE(W3x3)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000540FIXTURE_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))
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000548{
549 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
550}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000551FIXTURE_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))
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000559{
560 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
561}
Usama Arife73686a2019-04-08 17:30:48 +0100562TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000563FIXTURE_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))
Usama Arife73686a2019-04-08 17:30:48 +0100571{
572 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
573}
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000574FIXTURE_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}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000585FIXTURE_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))
Usama Arife73686a2019-04-08 17:30:48 +0100593{
594 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
595}
596TEST_SUITE_END() // Dilation
597TEST_SUITE_END() // W3x3
598TEST_SUITE_END() // QASYMM8
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100599
Michele Di Giorgio4cd4cde2020-01-06 14:07:44 +0000600TEST_SUITE(QASYMM8_SIGNED)
601TEST_SUITE(Generic)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000602FIXTURE_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))
Michele Di Giorgio4cd4cde2020-01-06 14:07:44 +0000610{
611 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
612}
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000613FIXTURE_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}
Michele Di Giorgio4cd4cde2020-01-06 14:07:44 +0000624TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000625FIXTURE_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))
Michele Di Giorgio4cd4cde2020-01-06 14:07:44 +0000633{
634 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
635}
636TEST_SUITE_END() // Dilation
637TEST_SUITE_END() // Generic
638TEST_SUITE_END() // QASYMM8_SIGNED
639
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100640TEST_SUITE(QSYMM8_PER_CHANNEL)
641TEST_SUITE(Generic)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000642FIXTURE_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))
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100651{
652 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
653}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000654FIXTURE_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))
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100663{
664 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
665}
666TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000667FIXTURE_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))
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100676{
677 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
678}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000679FIXTURE_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))
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100688{
689 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
690}
691TEST_SUITE_END() // Dilation
692TEST_SUITE_END() // Generic
693TEST_SUITE(W3x3)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000694FIXTURE_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))
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100703{
704 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
705}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000706FIXTURE_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))
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100715{
716 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
717}
718TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000719FIXTURE_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))
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100728{
729 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
730}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000731FIXTURE_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))
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100740{
741 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
742}
743TEST_SUITE_END() // Dilation
744TEST_SUITE_END() // W3x3
745TEST_SUITE_END() // QSYMM8_PER_CHANNEL
Usama Arife73686a2019-04-08 17:30:48 +0100746TEST_SUITE_END() // Quantized
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000747
Usama Arife73686a2019-04-08 17:30:48 +0100748TEST_SUITE_END() // DepthwiseConvolutionLayer
749TEST_SUITE_END() // CL
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000750} // namespace validation
751} // namespace test
752} // namespace arm_compute