blob: c779092eecea12c9d7357fd968c7383446684161 [file] [log] [blame]
Giorgio Arena04a8f8c2017-11-23 11:45:24 +00001/*
Michele Di Giorgiod9eaf612020-07-08 11:12:57 +01002 * Copyright (c) 2017-2020 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(),
58 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)
59});
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>;
156
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000157TEST_SUITE(Float)
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100158TEST_SUITE(FP16)
Michele Di Giorgio933fe862018-02-19 15:42:12 +0000159TEST_SUITE(W3x3)
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100160TEST_SUITE(NCHW)
Pablo Tello8bf622a2018-12-03 15:54:49 +0000161FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100162 combine(combine(combine(combine(framework::dataset::concat(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
163 datasets::SmallDepthwiseConvolutionLayerDataset3x3NCHW()),
164 depth_multipliers),
165 framework::dataset::make("DataType",
166 DataType::F16)),
167 framework::dataset::make("DataLayout", DataLayout::NCHW)),
168 ActivationFunctionsDataset))
Michele Di Giorgio933fe862018-02-19 15:42:12 +0000169{
170 validate(CLAccessor(_target), _reference, tolerance_f16);
171}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100172FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100173 large_depth_multipliers),
Pablo Tello8bf622a2018-12-03 15:54:49 +0000174 framework::dataset::make("DataType",
175 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100176 framework::dataset::make("DataLayout", DataLayout::NCHW)),
177 ActivationFunctionsDataset))
Michele Di Giorgio933fe862018-02-19 15:42:12 +0000178{
179 validate(CLAccessor(_target), _reference, tolerance_f16);
180}
Usama Arife73686a2019-04-08 17:30:48 +0100181TEST_SUITE(Dilation)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100182FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
Usama Arife73686a2019-04-08 17:30:48 +0100183 depth_multipliers),
184 framework::dataset::make("DataType",
185 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100186 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
187 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100188{
189 validate(CLAccessor(_target), _reference, tolerance_f16);
190}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100191FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100192 large_depth_multipliers),
Usama Arife73686a2019-04-08 17:30:48 +0100193 framework::dataset::make("DataType",
194 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100195 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
196 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100197{
198 validate(CLAccessor(_target), _reference, tolerance_f16);
199}
200TEST_SUITE_END() // Dilation
201TEST_SUITE_END() // NCHW
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100202
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100203TEST_SUITE(NHWC)
Pablo Tello8bf622a2018-12-03 15:54:49 +0000204FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100205 combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
206 depth_multipliers),
207 framework::dataset::make("DataType",
208 DataType::F16)),
209 framework::dataset::make("DataLayout", DataLayout::NHWC)),
210 ActivationFunctionsDataset))
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100211{
212 validate(CLAccessor(_target), _reference, tolerance_f16);
213}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100214FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100215 large_depth_multipliers),
Pablo Tello8bf622a2018-12-03 15:54:49 +0000216 framework::dataset::make("DataType",
217 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100218 framework::dataset::make("DataLayout", DataLayout::NHWC)),
219 ActivationFunctionsDataset))
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100220{
221 validate(CLAccessor(_target), _reference, tolerance_f16);
222}
Usama Arife73686a2019-04-08 17:30:48 +0100223TEST_SUITE(Dilation)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100224FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
Usama Arife73686a2019-04-08 17:30:48 +0100225 depth_multipliers),
226 framework::dataset::make("DataType",
227 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100228 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
229 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100230{
231 validate(CLAccessor(_target), _reference, tolerance_f16);
232}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100233FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100234 large_depth_multipliers),
Usama Arife73686a2019-04-08 17:30:48 +0100235 framework::dataset::make("DataType",
236 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100237 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
238 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100239{
240 validate(CLAccessor(_target), _reference, tolerance_f16);
241}
242TEST_SUITE_END() // Dilation
243TEST_SUITE_END() // NHWC
244TEST_SUITE_END() // W3x3
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100245
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100246TEST_SUITE(Generic)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100247FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
248 depth_multipliers),
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100249 framework::dataset::make("DataType",
250 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100251 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
252 ActivationFunctionsDataset))
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100253{
254 validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
255}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100256FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100257 large_depth_multipliers),
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100258 framework::dataset::make("DataType",
259 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100260 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
261 ActivationFunctionsDataset))
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100262{
263 validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
264}
Usama Arife73686a2019-04-08 17:30:48 +0100265
266TEST_SUITE(Dilation)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100267FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
Usama Arife73686a2019-04-08 17:30:48 +0100268 depth_multipliers),
269 framework::dataset::make("DataType",
270 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100271 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
272 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100273{
274 validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
275}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100276FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100277 large_depth_multipliers),
Usama Arife73686a2019-04-08 17:30:48 +0100278 framework::dataset::make("DataType",
279 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100280 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
281 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100282{
283 validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
284}
285TEST_SUITE_END() // Dilation
286TEST_SUITE_END() // Generic
287TEST_SUITE_END() // FP16
Michele Di Giorgio933fe862018-02-19 15:42:12 +0000288
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000289TEST_SUITE(FP32)
290TEST_SUITE(W3x3)
Giorgio Arenad051e972018-06-20 11:46:42 +0100291TEST_SUITE(NCHW)
Pablo Tello8bf622a2018-12-03 15:54:49 +0000292FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100293 combine(combine(combine(combine(framework::dataset::concat(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
294 datasets::SmallDepthwiseConvolutionLayerDataset3x3NCHW()),
295 depth_multipliers),
296 framework::dataset::make("DataType",
297 DataType::F32)),
298 framework::dataset::make("DataLayout", DataLayout::NCHW)),
299 ActivationFunctionsDataset))
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000300{
301 validate(CLAccessor(_target), _reference, tolerance_f32);
302}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100303FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100304 large_depth_multipliers),
Pablo Tello8bf622a2018-12-03 15:54:49 +0000305 framework::dataset::make("DataType",
306 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100307 framework::dataset::make("DataLayout", DataLayout::NCHW)),
308 ActivationFunctionsDataset))
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000309{
310 validate(CLAccessor(_target), _reference, tolerance_f32);
311}
Usama Arife73686a2019-04-08 17:30:48 +0100312TEST_SUITE(Dilation)
313FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100314 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
315 framework::dataset::make("DataType",
316 DataType::F32)),
317 framework::dataset::make("DataLayout", DataLayout::NCHW)),
318 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100319{
320 validate(CLAccessor(_target), _reference, tolerance_f32);
321}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100322FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
323 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100324 large_depth_multipliers),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100325 framework::dataset::make("DataType",
326 DataType::F32)),
327 framework::dataset::make("DataLayout", DataLayout::NCHW)),
328 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100329{
330 validate(CLAccessor(_target), _reference, tolerance_f32);
331}
332
333TEST_SUITE_END() // Dilation
334TEST_SUITE_END() // NCHW
Giorgio Arenad051e972018-06-20 11:46:42 +0100335TEST_SUITE(NHWC)
Pablo Tello8bf622a2018-12-03 15:54:49 +0000336FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100337 combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
338 depth_multipliers),
339 framework::dataset::make("DataType",
340 DataType::F32)),
341 framework::dataset::make("DataLayout", DataLayout::NHWC)),
342 ActivationFunctionsDataset))
Giorgio Arenad051e972018-06-20 11:46:42 +0100343{
344 validate(CLAccessor(_target), _reference, tolerance_f32);
345}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100346FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100347 large_depth_multipliers),
Pablo Tello8bf622a2018-12-03 15:54:49 +0000348 framework::dataset::make("DataType",
349 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100350 framework::dataset::make("DataLayout", DataLayout::NHWC)),
351 ActivationFunctionsDataset))
Giorgio Arenad051e972018-06-20 11:46:42 +0100352{
353 validate(CLAccessor(_target), _reference, tolerance_f32);
354}
Usama Arife73686a2019-04-08 17:30:48 +0100355TEST_SUITE(Dilation)
356
357FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100358 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
359 depth_multipliers),
360 framework::dataset::make("DataType",
361 DataType::F32)),
362 framework::dataset::make("DataLayout", DataLayout::NHWC)),
363 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100364{
365 validate(CLAccessor(_target), _reference, tolerance_f32);
366}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100367FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
368 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100369 large_depth_multipliers),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100370 framework::dataset::make("DataType",
371 DataType::F32)),
372 framework::dataset::make("DataLayout", DataLayout::NHWC)),
373 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100374{
375 validate(CLAccessor(_target), _reference, tolerance_f32);
376}
377TEST_SUITE_END() // Dilation
378TEST_SUITE_END() // NHWC
379TEST_SUITE_END() // W3x3
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100380
381TEST_SUITE(Generic)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100382FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
383 depth_multipliers),
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100384 framework::dataset::make("DataType",
385 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100386 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
387 ActivationFunctionsDataset))
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100388{
389 validate(CLAccessor(_target), _reference, tolerance_f32);
390}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100391FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100392 large_depth_multipliers),
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100393 framework::dataset::make("DataType",
394 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100395 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
396 ActivationFunctionsDataset))
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100397{
398 validate(CLAccessor(_target), _reference, tolerance_f32);
399}
Usama Arife73686a2019-04-08 17:30:48 +0100400
401TEST_SUITE(Dilation)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100402FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
Usama Arife73686a2019-04-08 17:30:48 +0100403 depth_multipliers),
404 framework::dataset::make("DataType",
405 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100406 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
407 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100408{
409 validate(CLAccessor(_target), _reference, tolerance_f32);
410}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100411FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
412 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100413 large_depth_multipliers),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100414 framework::dataset::make("DataType",
415 DataType::F32)),
416 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
417 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100418{
419 validate(CLAccessor(_target), _reference, tolerance_f32);
420}
421TEST_SUITE_END() // Dilation
422TEST_SUITE_END() // Generic
423TEST_SUITE_END() // FP32
424TEST_SUITE_END() // Float
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000425
426template <typename T>
Georgios Pinitasde5a1cc2018-02-02 12:52:07 +0000427using CLDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T>;
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100428template <typename T>
429using CLDepthwiseConvolutionLayerQuantizedPerChannelFixture = DepthwiseConvolutionLayerValidationQuantizedPerChannelFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T, int8_t>;
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000430
431TEST_SUITE(Quantized)
432TEST_SUITE(QASYMM8)
Georgios Pinitasde5a1cc2018-02-02 12:52:07 +0000433TEST_SUITE(Generic)
Giorgio Arena76572242018-04-04 17:44:26 +0100434FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100435 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
436 depth_multipliers),
437 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgio14cbfb22019-10-23 10:53:10 +0100438 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10), QuantizationInfo(2.2f, 10) })),
Gian Marco Iodicee5ecd012019-08-28 15:56:36 +0100439 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
Michele Di Giorgio4cd4cde2020-01-06 14:07:44 +0000440 framework::dataset::make("DataLayout", { DataLayout::NHWC })), // NCHW is tested with int8
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100441 ActivationFunctionsDataset))
Georgios Pinitasde5a1cc2018-02-02 12:52:07 +0000442{
443 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
444}
Giorgio Arena76572242018-04-04 17:44:26 +0100445FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100446 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100447 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100448 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgio14cbfb22019-10-23 10:53:10 +0100449 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
Gian Marco Iodicee5ecd012019-08-28 15:56:36 +0100450 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 2) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100451 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
452 ActivationFunctionsDataset))
Georgios Pinitasde5a1cc2018-02-02 12:52:07 +0000453{
454 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
455}
Usama Arife73686a2019-04-08 17:30:48 +0100456TEST_SUITE(Dilation)
457FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100458 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
459 depth_multipliers),
460 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgio14cbfb22019-10-23 10:53:10 +0100461 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100462 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8, 1) })),
Michele Di Giorgio4cd4cde2020-01-06 14:07:44 +0000463 framework::dataset::make("DataLayout", { DataLayout::NHWC })), // NCHW is tested with int8
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100464 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100465{
466 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
467}
468FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100469 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100470 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100471 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgio14cbfb22019-10-23 10:53:10 +0100472 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(1.3f, 10) })),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100473 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100474 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
475 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100476{
477 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
478}
479TEST_SUITE_END() // Dilation
480TEST_SUITE_END() // Generic
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000481TEST_SUITE(W3x3)
Pablo Tello8bf622a2018-12-03 15:54:49 +0000482FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100483 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
484 depth_multipliers),
485 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgio14cbfb22019-10-23 10:53:10 +0100486 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10), QuantizationInfo(2.2f, 10) })),
Gian Marco Iodicee5ecd012019-08-28 15:56:36 +0100487 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100488 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
489 ActivationFunctionsDataset))
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000490{
491 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
492}
Pablo Tello8bf622a2018-12-03 15:54:49 +0000493FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100494 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100495 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100496 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgio14cbfb22019-10-23 10:53:10 +0100497 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100498 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100499 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
500 ActivationFunctionsDataset))
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000501{
502 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
503}
Usama Arife73686a2019-04-08 17:30:48 +0100504TEST_SUITE(Dilation)
505FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100506 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
507 depth_multipliers),
508 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgio14cbfb22019-10-23 10:53:10 +0100509 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100510 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100511 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
512 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100513{
514 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
515}
516FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100517 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100518 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100519 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgio14cbfb22019-10-23 10:53:10 +0100520 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100521 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100522 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
523 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100524{
525 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
526}
527TEST_SUITE_END() // Dilation
528TEST_SUITE_END() // W3x3
529TEST_SUITE_END() // QASYMM8
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100530
Michele Di Giorgio4cd4cde2020-01-06 14:07:44 +0000531TEST_SUITE(QASYMM8_SIGNED)
532TEST_SUITE(Generic)
533FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
534 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
535 depth_multipliers),
536 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
537 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10), QuantizationInfo(2.2f, 10) })),
538 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
539 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
540 ActivationFunctionsDataset))
541{
542 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
543}
544TEST_SUITE(Dilation)
545FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
546 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
547 depth_multipliers),
548 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
549 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
550 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8, 1) })),
551 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
552 ActivationFunctionsDataset))
553{
554 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
555}
556TEST_SUITE_END() // Dilation
557TEST_SUITE_END() // Generic
558TEST_SUITE_END() // QASYMM8_SIGNED
559
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100560TEST_SUITE(QSYMM8_PER_CHANNEL)
561TEST_SUITE(Generic)
562FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
563 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
564 depth_multipliers),
565 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
566 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
567 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
568 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
569 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
570 ActivationFunctionsDataset))
571{
572 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
573}
574FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
575 combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
576 large_depth_multipliers),
577 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
578 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
579 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
580 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 2) })),
581 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
582 ActivationFunctionsDataset))
583{
584 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
585}
586TEST_SUITE(Dilation)
587FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
588 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
589 depth_multipliers),
590 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
591 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
592 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
593 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8, 1) })),
594 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
595 ActivationFunctionsDataset))
596{
597 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
598}
599FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
600 combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
601 large_depth_multipliers),
602 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
603 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
604 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
605 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
606 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
607 ActivationFunctionsDataset))
608{
609 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
610}
611TEST_SUITE_END() // Dilation
612TEST_SUITE_END() // Generic
613TEST_SUITE(W3x3)
614FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
615 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
616 depth_multipliers),
617 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
618 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
619 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
620 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
621 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
622 ActivationFunctionsDataset))
623{
624 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
625}
626FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
627 combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
628 large_depth_multipliers),
629 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
630 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
631 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
632 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
633 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
634 ActivationFunctionsDataset))
635{
636 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
637}
638TEST_SUITE(Dilation)
639FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
640 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
641 depth_multipliers),
642 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
643 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
644 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
645 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
646 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
647 ActivationFunctionsDataset))
648{
649 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
650}
651FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
652 combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
653 large_depth_multipliers),
654 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
655 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
656 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
657 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
658 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
659 ActivationFunctionsDataset))
660{
661 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
662}
663TEST_SUITE_END() // Dilation
664TEST_SUITE_END() // W3x3
665TEST_SUITE_END() // QSYMM8_PER_CHANNEL
Usama Arife73686a2019-04-08 17:30:48 +0100666TEST_SUITE_END() // Quantized
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000667
Usama Arife73686a2019-04-08 17:30:48 +0100668TEST_SUITE_END() // DepthwiseConvolutionLayer
669TEST_SUITE_END() // CL
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000670} // namespace validation
671} // namespace test
672} // namespace arm_compute