blob: 351819ae557fbe7e53bd9bd2b9659497e6c10573 [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(),
Michele Di Giorgio17b71022020-11-16 13:10:07 +000058 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU),
59 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 6.f, 0.f)
Manuel Bottinia788c2f2019-04-08 13:18:00 +010060});
Giorgio Arena04a8f8c2017-11-23 11:45:24 +000061} // namespace
62
63TEST_SUITE(CL)
64TEST_SUITE(DepthwiseConvolutionLayer)
65
Giorgio Arenaad0c7382018-04-23 16:16:21 +010066// *INDENT-OFF*
67// clang-format off
Manuel Bottini387259a2020-05-21 17:14:36 +010068DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +010069 framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type input/weights
70 TensorInfo(TensorShape(27U, 13U, 3U), 1, DataType::F32), // Mismatching input feature maps
71 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching depth multiplier
72 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases size
73 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases dimensions
74 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid output size
Usama Arife73686a2019-04-08 17:30:48 +010075 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // patch size bigger than input width
76 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // dilation < 1
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +010077 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32),
78 TensorInfo(TensorShape(32U, 13U, 8U), 1, DataType::QASYMM8),
Giorgio Arenaad0c7382018-04-23 16:16:21 +010079 }),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +010080 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F16),
81 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
82 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
83 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
84 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
85 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
86 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
Usama Arife73686a2019-04-08 17:30:48 +010087 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
88 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +010089 TensorInfo(TensorShape(3U, 3U, 24U), 1, DataType::QASYMM8),
Giorgio Arenaad0c7382018-04-23 16:16:21 +010090 })),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +010091 framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32),
92 TensorInfo(TensorShape(2U), 1, DataType::F32),
93 TensorInfo(TensorShape(2U), 1, DataType::F32),
94 TensorInfo(TensorShape(4U), 1, DataType::F32),
95 TensorInfo(TensorShape(2U, 2U), 1, DataType::F32),
96 TensorInfo(TensorShape(2U), 1, DataType::F32),
97 TensorInfo(TensorShape(16U), 1, DataType::F32),
Usama Arife73686a2019-04-08 17:30:48 +010098 TensorInfo(TensorShape(16U), 1, DataType::F32),
99 TensorInfo(TensorShape(16U), 1, DataType::F32),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100100 TensorInfo(TensorShape(24U), 1, DataType::S32),
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100101 })),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100102 framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
103 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
104 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
105 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
106 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
107 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),
108 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
Usama Arife73686a2019-04-08 17:30:48 +0100109 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
110 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100111 TensorInfo(TensorShape(32U, 11U, 24U), 1, DataType::QASYMM8),
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100112 })),
113 framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0),
114 PadStrideInfo(1, 1, 0, 0),
115 PadStrideInfo(1, 1, 0, 0),
116 PadStrideInfo(1, 1, 0, 0),
117 PadStrideInfo(1, 1, 0, 0),
118 PadStrideInfo(1, 1, 0, 0),
119 PadStrideInfo(1, 1, 0, 0),
Usama Arife73686a2019-04-08 17:30:48 +0100120 PadStrideInfo(1, 1, 0, 0),
121 PadStrideInfo(1, 1, 0, 0),
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100122 PadStrideInfo(1, 1, 1, 0),
123 })),
124 framework::dataset::make("DepthMultiplier", { 1,
125 1,
126 3,
127 1,
128 1,
129 1,
130 2,
Usama Arife73686a2019-04-08 17:30:48 +0100131 2,
132 2,
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100133 3,
134 })),
Usama Arife73686a2019-04-08 17:30:48 +0100135 framework::dataset::make("Dilation", { Size2D(1U, 1U),
136 Size2D(1U, 1U),
137 Size2D(1U, 1U),
138 Size2D(1U, 1U),
139 Size2D(1U, 1U),
140 Size2D(1U, 1U),
141 Size2D(20U, 1U),
142 Size2D(0U, 1U),
143 Size2D(1U, 1U),
144 Size2D(1U, 1U),
145 })),
146 framework::dataset::make("Expected", { false, false, false, false, false, false, false, false, true, true })),
147 input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier, dilation, expected)
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100148{
Michele Di Giorgio601ba3f2019-08-22 16:20:04 +0100149 bool is_valid = bool(CLDepthwiseConvolutionLayer::validate(&input_info.clone()->set_is_resizable(true), &weights_info.clone()->set_is_resizable(true), &biases_info.clone()->set_is_resizable(true), &output_info.clone()->set_is_resizable(true), conv_info, depth_multiplier,ActivationLayerInfo(), dilation));
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100150 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
151}
152// clang-format on
153// *INDENT-ON*
154
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000155template <typename T>
156using CLDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T>;
157
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000158TEST_SUITE(Float)
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100159TEST_SUITE(FP16)
Michele Di Giorgio933fe862018-02-19 15:42:12 +0000160TEST_SUITE(W3x3)
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100161TEST_SUITE(NCHW)
Pablo Tello8bf622a2018-12-03 15:54:49 +0000162FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100163 combine(combine(combine(combine(framework::dataset::concat(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
164 datasets::SmallDepthwiseConvolutionLayerDataset3x3NCHW()),
165 depth_multipliers),
166 framework::dataset::make("DataType",
167 DataType::F16)),
168 framework::dataset::make("DataLayout", DataLayout::NCHW)),
169 ActivationFunctionsDataset))
Michele Di Giorgio933fe862018-02-19 15:42:12 +0000170{
171 validate(CLAccessor(_target), _reference, tolerance_f16);
172}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100173FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100174 large_depth_multipliers),
Pablo Tello8bf622a2018-12-03 15:54:49 +0000175 framework::dataset::make("DataType",
176 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100177 framework::dataset::make("DataLayout", DataLayout::NCHW)),
178 ActivationFunctionsDataset))
Michele Di Giorgio933fe862018-02-19 15:42:12 +0000179{
180 validate(CLAccessor(_target), _reference, tolerance_f16);
181}
Usama Arife73686a2019-04-08 17:30:48 +0100182TEST_SUITE(Dilation)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100183FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
Usama Arife73686a2019-04-08 17:30:48 +0100184 depth_multipliers),
185 framework::dataset::make("DataType",
186 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100187 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
188 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100189{
190 validate(CLAccessor(_target), _reference, tolerance_f16);
191}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100192FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100193 large_depth_multipliers),
Usama Arife73686a2019-04-08 17:30:48 +0100194 framework::dataset::make("DataType",
195 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100196 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
197 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100198{
199 validate(CLAccessor(_target), _reference, tolerance_f16);
200}
201TEST_SUITE_END() // Dilation
202TEST_SUITE_END() // NCHW
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100203
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100204TEST_SUITE(NHWC)
Pablo Tello8bf622a2018-12-03 15:54:49 +0000205FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100206 combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
207 depth_multipliers),
208 framework::dataset::make("DataType",
209 DataType::F16)),
210 framework::dataset::make("DataLayout", DataLayout::NHWC)),
211 ActivationFunctionsDataset))
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100212{
213 validate(CLAccessor(_target), _reference, tolerance_f16);
214}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100215FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100216 large_depth_multipliers),
Pablo Tello8bf622a2018-12-03 15:54:49 +0000217 framework::dataset::make("DataType",
218 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100219 framework::dataset::make("DataLayout", DataLayout::NHWC)),
220 ActivationFunctionsDataset))
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100221{
222 validate(CLAccessor(_target), _reference, tolerance_f16);
223}
Usama Arife73686a2019-04-08 17:30:48 +0100224TEST_SUITE(Dilation)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100225FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
Usama Arife73686a2019-04-08 17:30:48 +0100226 depth_multipliers),
227 framework::dataset::make("DataType",
228 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100229 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
230 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100231{
232 validate(CLAccessor(_target), _reference, tolerance_f16);
233}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100234FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100235 large_depth_multipliers),
Usama Arife73686a2019-04-08 17:30:48 +0100236 framework::dataset::make("DataType",
237 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100238 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
239 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100240{
241 validate(CLAccessor(_target), _reference, tolerance_f16);
242}
243TEST_SUITE_END() // Dilation
244TEST_SUITE_END() // NHWC
245TEST_SUITE_END() // W3x3
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100246
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100247TEST_SUITE(Generic)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100248FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
249 depth_multipliers),
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100250 framework::dataset::make("DataType",
251 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100252 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
253 ActivationFunctionsDataset))
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100254{
255 validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
256}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100257FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100258 large_depth_multipliers),
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100259 framework::dataset::make("DataType",
260 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100261 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
262 ActivationFunctionsDataset))
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100263{
264 validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
265}
Usama Arife73686a2019-04-08 17:30:48 +0100266
267TEST_SUITE(Dilation)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100268FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
Usama Arife73686a2019-04-08 17:30:48 +0100269 depth_multipliers),
270 framework::dataset::make("DataType",
271 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100272 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
273 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100274{
275 validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
276}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100277FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100278 large_depth_multipliers),
Usama Arife73686a2019-04-08 17:30:48 +0100279 framework::dataset::make("DataType",
280 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100281 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
282 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100283{
284 validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
285}
286TEST_SUITE_END() // Dilation
287TEST_SUITE_END() // Generic
288TEST_SUITE_END() // FP16
Michele Di Giorgio933fe862018-02-19 15:42:12 +0000289
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000290TEST_SUITE(FP32)
291TEST_SUITE(W3x3)
Giorgio Arenad051e972018-06-20 11:46:42 +0100292TEST_SUITE(NCHW)
Pablo Tello8bf622a2018-12-03 15:54:49 +0000293FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100294 combine(combine(combine(combine(framework::dataset::concat(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
295 datasets::SmallDepthwiseConvolutionLayerDataset3x3NCHW()),
296 depth_multipliers),
297 framework::dataset::make("DataType",
298 DataType::F32)),
299 framework::dataset::make("DataLayout", DataLayout::NCHW)),
300 ActivationFunctionsDataset))
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000301{
302 validate(CLAccessor(_target), _reference, tolerance_f32);
303}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100304FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100305 large_depth_multipliers),
Pablo Tello8bf622a2018-12-03 15:54:49 +0000306 framework::dataset::make("DataType",
307 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100308 framework::dataset::make("DataLayout", DataLayout::NCHW)),
309 ActivationFunctionsDataset))
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000310{
311 validate(CLAccessor(_target), _reference, tolerance_f32);
312}
Usama Arife73686a2019-04-08 17:30:48 +0100313TEST_SUITE(Dilation)
314FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100315 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
316 framework::dataset::make("DataType",
317 DataType::F32)),
318 framework::dataset::make("DataLayout", DataLayout::NCHW)),
319 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100320{
321 validate(CLAccessor(_target), _reference, tolerance_f32);
322}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100323FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
324 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100325 large_depth_multipliers),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100326 framework::dataset::make("DataType",
327 DataType::F32)),
328 framework::dataset::make("DataLayout", DataLayout::NCHW)),
329 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100330{
331 validate(CLAccessor(_target), _reference, tolerance_f32);
332}
333
334TEST_SUITE_END() // Dilation
335TEST_SUITE_END() // NCHW
Giorgio Arenad051e972018-06-20 11:46:42 +0100336TEST_SUITE(NHWC)
Pablo Tello8bf622a2018-12-03 15:54:49 +0000337FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100338 combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
339 depth_multipliers),
340 framework::dataset::make("DataType",
341 DataType::F32)),
342 framework::dataset::make("DataLayout", DataLayout::NHWC)),
343 ActivationFunctionsDataset))
Giorgio Arenad051e972018-06-20 11:46:42 +0100344{
345 validate(CLAccessor(_target), _reference, tolerance_f32);
346}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100347FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100348 large_depth_multipliers),
Pablo Tello8bf622a2018-12-03 15:54:49 +0000349 framework::dataset::make("DataType",
350 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100351 framework::dataset::make("DataLayout", DataLayout::NHWC)),
352 ActivationFunctionsDataset))
Giorgio Arenad051e972018-06-20 11:46:42 +0100353{
354 validate(CLAccessor(_target), _reference, tolerance_f32);
355}
Usama Arife73686a2019-04-08 17:30:48 +0100356TEST_SUITE(Dilation)
357
358FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100359 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
360 depth_multipliers),
361 framework::dataset::make("DataType",
362 DataType::F32)),
363 framework::dataset::make("DataLayout", DataLayout::NHWC)),
364 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100365{
366 validate(CLAccessor(_target), _reference, tolerance_f32);
367}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100368FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
369 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100370 large_depth_multipliers),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100371 framework::dataset::make("DataType",
372 DataType::F32)),
373 framework::dataset::make("DataLayout", DataLayout::NHWC)),
374 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100375{
376 validate(CLAccessor(_target), _reference, tolerance_f32);
377}
378TEST_SUITE_END() // Dilation
379TEST_SUITE_END() // NHWC
380TEST_SUITE_END() // W3x3
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100381
382TEST_SUITE(Generic)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100383FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
384 depth_multipliers),
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100385 framework::dataset::make("DataType",
386 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100387 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
388 ActivationFunctionsDataset))
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100389{
390 validate(CLAccessor(_target), _reference, tolerance_f32);
391}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100392FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100393 large_depth_multipliers),
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100394 framework::dataset::make("DataType",
395 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100396 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
397 ActivationFunctionsDataset))
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100398{
399 validate(CLAccessor(_target), _reference, tolerance_f32);
400}
Usama Arife73686a2019-04-08 17:30:48 +0100401
402TEST_SUITE(Dilation)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100403FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
Usama Arife73686a2019-04-08 17:30:48 +0100404 depth_multipliers),
405 framework::dataset::make("DataType",
406 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100407 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
408 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100409{
410 validate(CLAccessor(_target), _reference, tolerance_f32);
411}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100412FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
413 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100414 large_depth_multipliers),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100415 framework::dataset::make("DataType",
416 DataType::F32)),
417 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
418 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100419{
420 validate(CLAccessor(_target), _reference, tolerance_f32);
421}
422TEST_SUITE_END() // Dilation
423TEST_SUITE_END() // Generic
424TEST_SUITE_END() // FP32
425TEST_SUITE_END() // Float
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000426
427template <typename T>
Georgios Pinitasde5a1cc2018-02-02 12:52:07 +0000428using CLDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T>;
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100429template <typename T>
430using CLDepthwiseConvolutionLayerQuantizedPerChannelFixture = DepthwiseConvolutionLayerValidationQuantizedPerChannelFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T, int8_t>;
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000431
432TEST_SUITE(Quantized)
433TEST_SUITE(QASYMM8)
Georgios Pinitasde5a1cc2018-02-02 12:52:07 +0000434TEST_SUITE(Generic)
Giorgio Arena76572242018-04-04 17:44:26 +0100435FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100436 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
437 depth_multipliers),
438 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgio14cbfb22019-10-23 10:53:10 +0100439 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10), QuantizationInfo(2.2f, 10) })),
Gian Marco Iodicee5ecd012019-08-28 15:56:36 +0100440 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
Michele Di Giorgio4cd4cde2020-01-06 14:07:44 +0000441 framework::dataset::make("DataLayout", { DataLayout::NHWC })), // NCHW is tested with int8
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100442 ActivationFunctionsDataset))
Georgios Pinitasde5a1cc2018-02-02 12:52:07 +0000443{
444 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
445}
Giorgio Arena76572242018-04-04 17:44:26 +0100446FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100447 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100448 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100449 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgio14cbfb22019-10-23 10:53:10 +0100450 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
Gian Marco Iodicee5ecd012019-08-28 15:56:36 +0100451 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 2) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100452 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
453 ActivationFunctionsDataset))
Georgios Pinitasde5a1cc2018-02-02 12:52:07 +0000454{
455 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
456}
Usama Arife73686a2019-04-08 17:30:48 +0100457TEST_SUITE(Dilation)
458FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100459 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
460 depth_multipliers),
461 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgio14cbfb22019-10-23 10:53:10 +0100462 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100463 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8, 1) })),
Michele Di Giorgio4cd4cde2020-01-06 14:07:44 +0000464 framework::dataset::make("DataLayout", { DataLayout::NHWC })), // NCHW is tested with int8
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100465 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100466{
467 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
468}
469FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100470 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100471 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100472 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgio14cbfb22019-10-23 10:53:10 +0100473 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(1.3f, 10) })),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100474 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100475 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
476 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100477{
478 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
479}
480TEST_SUITE_END() // Dilation
481TEST_SUITE_END() // Generic
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000482TEST_SUITE(W3x3)
Pablo Tello8bf622a2018-12-03 15:54:49 +0000483FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100484 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
485 depth_multipliers),
486 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgio14cbfb22019-10-23 10:53:10 +0100487 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10), QuantizationInfo(2.2f, 10) })),
Gian Marco Iodicee5ecd012019-08-28 15:56:36 +0100488 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100489 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
490 ActivationFunctionsDataset))
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000491{
492 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
493}
Pablo Tello8bf622a2018-12-03 15:54:49 +0000494FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100495 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100496 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100497 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgio14cbfb22019-10-23 10:53:10 +0100498 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100499 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100500 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
501 ActivationFunctionsDataset))
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000502{
503 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
504}
Usama Arife73686a2019-04-08 17:30:48 +0100505TEST_SUITE(Dilation)
506FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100507 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
508 depth_multipliers),
509 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgio14cbfb22019-10-23 10:53:10 +0100510 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100511 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100512 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
513 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100514{
515 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
516}
517FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100518 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100519 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100520 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgio14cbfb22019-10-23 10:53:10 +0100521 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100522 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100523 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
524 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100525{
526 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
527}
528TEST_SUITE_END() // Dilation
529TEST_SUITE_END() // W3x3
530TEST_SUITE_END() // QASYMM8
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100531
Michele Di Giorgio4cd4cde2020-01-06 14:07:44 +0000532TEST_SUITE(QASYMM8_SIGNED)
533TEST_SUITE(Generic)
534FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
535 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
536 depth_multipliers),
537 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
538 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10), QuantizationInfo(2.2f, 10) })),
539 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
540 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
541 ActivationFunctionsDataset))
542{
543 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
544}
545TEST_SUITE(Dilation)
546FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
547 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
548 depth_multipliers),
549 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
550 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })),
551 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8, 1) })),
552 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
553 ActivationFunctionsDataset))
554{
555 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
556}
557TEST_SUITE_END() // Dilation
558TEST_SUITE_END() // Generic
559TEST_SUITE_END() // QASYMM8_SIGNED
560
Michele Di Giorgiodf4cf572019-10-09 15:32:39 +0100561TEST_SUITE(QSYMM8_PER_CHANNEL)
562TEST_SUITE(Generic)
563FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
564 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
565 depth_multipliers),
566 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
567 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
568 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
569 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
570 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
571 ActivationFunctionsDataset))
572{
573 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
574}
575FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
576 combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
577 large_depth_multipliers),
578 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
579 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
580 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
581 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 2) })),
582 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
583 ActivationFunctionsDataset))
584{
585 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
586}
587TEST_SUITE(Dilation)
588FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
589 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
590 depth_multipliers),
591 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
592 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
593 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
594 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8, 1) })),
595 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
596 ActivationFunctionsDataset))
597{
598 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
599}
600FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
601 combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
602 large_depth_multipliers),
603 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
604 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
605 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
606 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
607 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
608 ActivationFunctionsDataset))
609{
610 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
611}
612TEST_SUITE_END() // Dilation
613TEST_SUITE_END() // Generic
614TEST_SUITE(W3x3)
615FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
616 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
617 depth_multipliers),
618 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
619 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
620 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
621 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
622 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
623 ActivationFunctionsDataset))
624{
625 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
626}
627FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
628 combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
629 large_depth_multipliers),
630 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
631 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
632 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
633 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
634 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
635 ActivationFunctionsDataset))
636{
637 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
638}
639TEST_SUITE(Dilation)
640FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
641 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
642 depth_multipliers),
643 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
644 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
645 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
646 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
647 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
648 ActivationFunctionsDataset))
649{
650 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
651}
652FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
653 combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
654 large_depth_multipliers),
655 framework::dataset::make("SrcDataType", DataType::QASYMM8)),
656 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
657 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
658 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
659 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
660 ActivationFunctionsDataset))
661{
662 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
663}
664TEST_SUITE_END() // Dilation
665TEST_SUITE_END() // W3x3
666TEST_SUITE_END() // QSYMM8_PER_CHANNEL
Usama Arife73686a2019-04-08 17:30:48 +0100667TEST_SUITE_END() // Quantized
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000668
Usama Arife73686a2019-04-08 17:30:48 +0100669TEST_SUITE_END() // DepthwiseConvolutionLayer
670TEST_SUITE_END() // CL
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000671} // namespace validation
672} // namespace test
673} // namespace arm_compute