blob: 37563046ccc94eacda77c098ab7717421e9bb1ad [file] [log] [blame]
Giorgio Arena04a8f8c2017-11-23 11:45:24 +00001/*
Usama Arife73686a2019-04-08 17:30:48 +01002 * Copyright (c) 2017-2019 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 Giorgio51a9c3c2019-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
Usama Arife73686a2019-04-08 17:30:48 +010067DATA_TEST_CASE(Validate3x3, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(zip(
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +010068 framework::dataset::make("InputInfo", { TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Mismatching data type input/weights
69 TensorInfo(TensorShape(32U, 18U, 3U), 1, DataType::F32), // Mismatching input feature maps
70 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Unsupported weights dimensions
71 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::QASYMM8), // Unsupported activation
72 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Mismatching depth multiplier
73 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid stride
74 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid biases size
75 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid biases dimensions
76 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid output size
77 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Window shrink
Usama Arife73686a2019-04-08 17:30:48 +010078 TensorInfo(TensorShape(32U, 18U, 8U), 1, DataType::F32), // patch size bigger than input width
79 TensorInfo(TensorShape(32U, 18U, 8U), 1, DataType::F32), // dilation < 1
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +010080 TensorInfo(TensorShape(32U, 18U, 8U), 1, DataType::F32),
81 TensorInfo(TensorShape(50U, 32U, 8U), 1, DataType::QASYMM8),
Giorgio Arenaad0c7382018-04-23 16:16:21 +010082 }),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +010083 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F16),
84 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
85 TensorInfo(TensorShape(5U, 5U, 2U), 1, DataType::F32),
86 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::QASYMM8),
87 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
88 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
89 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
90 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
91 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
92 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
93 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
Usama Arife73686a2019-04-08 17:30:48 +010094 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
95 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +010096 TensorInfo(TensorShape(3U, 3U, 24U), 1, DataType::QASYMM8),
Giorgio Arenaad0c7382018-04-23 16:16:21 +010097 })),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +010098 framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32),
99 TensorInfo(TensorShape(2U), 1, DataType::F32),
100 TensorInfo(TensorShape(2U), 1, DataType::F32),
101 TensorInfo(TensorShape(2U), 1, DataType::S32),
102 TensorInfo(TensorShape(2U), 1, DataType::F32),
103 TensorInfo(TensorShape(2U), 1, DataType::F32),
104 TensorInfo(TensorShape(4U), 1, DataType::F32),
105 TensorInfo(TensorShape(2U, 2U), 1, DataType::F32),
106 TensorInfo(TensorShape(2U), 1, DataType::F32),
107 TensorInfo(TensorShape(2U), 1, DataType::F32),
108 TensorInfo(TensorShape(16U), 1, DataType::F32),
Usama Arife73686a2019-04-08 17:30:48 +0100109 TensorInfo(TensorShape(16U), 1, DataType::F32),
110 TensorInfo(TensorShape(16U), 1, DataType::F32),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100111 TensorInfo(TensorShape(24U), 1, DataType::S32),
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100112 })),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100113 framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
114 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
115 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
116 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::QASYMM8),
117 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
118 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
119 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
120 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
121 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32),
122 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
123 TensorInfo(TensorShape(30U, 16U, 16U), 1, DataType::F32),
Usama Arife73686a2019-04-08 17:30:48 +0100124 TensorInfo(TensorShape(30U, 16U, 16U), 1, DataType::F32),
125 TensorInfo(TensorShape(30U, 16U, 16U), 1, DataType::F32),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100126 TensorInfo(TensorShape(48U, 30U, 24U), 1, DataType::QASYMM8),
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100127 })),
128 framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0),
129 PadStrideInfo(1, 1, 0, 0),
130 PadStrideInfo(1, 1, 0, 0),
131 PadStrideInfo(1, 1, 0, 0),
132 PadStrideInfo(1, 1, 0, 0),
133 PadStrideInfo(4, 1, 0, 0),
134 PadStrideInfo(1, 1, 0, 0),
135 PadStrideInfo(1, 1, 0, 0),
136 PadStrideInfo(1, 1, 0, 0),
137 PadStrideInfo(1, 1, 0, 0),
138 PadStrideInfo(1, 1, 0, 0),
139 PadStrideInfo(1, 1, 0, 0),
Usama Arife73686a2019-04-08 17:30:48 +0100140 PadStrideInfo(1, 1, 0, 0),
141 PadStrideInfo(1, 1, 0, 0),
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100142 })),
143 framework::dataset::make("DepthMultiplier", { 1,
144 1,
145 1,
146 1,
147 3,
148 1,
149 1,
150 1,
151 1,
152 1,
153 2,
Usama Arife73686a2019-04-08 17:30:48 +0100154 2,
155 2,
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100156 3,
157 })),
158 framework::dataset::make("ActivationInfo", { ActivationLayerInfo(),
159 ActivationLayerInfo(),
160 ActivationLayerInfo(),
161 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LINEAR),
162 ActivationLayerInfo(),
163 ActivationLayerInfo(),
164 ActivationLayerInfo(),
165 ActivationLayerInfo(),
166 ActivationLayerInfo(),
167 ActivationLayerInfo(),
168 ActivationLayerInfo(),
Usama Arife73686a2019-04-08 17:30:48 +0100169 ActivationLayerInfo(),
170 ActivationLayerInfo(),
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100171 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU),
172 })),
Usama Arife73686a2019-04-08 17:30:48 +0100173 framework::dataset::make("Dilation", { Size2D(1U, 1U),
174 Size2D(1U, 1U),
175 Size2D(1U, 1U),
176 Size2D(1U, 1U),
177 Size2D(1U, 1U),
178 Size2D(1U, 1U),
179 Size2D(1U, 1U),
180 Size2D(1U, 1U),
181 Size2D(1U, 1U),
182 Size2D(1U, 1U),
183 Size2D(20U, 1U),
184 Size2D(0U, 1U),
185 Size2D(1U, 1U),
186 Size2D(1U, 1U),
187 })),
188 framework::dataset::make("Expected", { false, false, false, false, false, false, false, false, false, false, false, false, true, true })),
189 input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier, act_info, dilation, expected)
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100190{
Usama Arife73686a2019-04-08 17:30:48 +0100191 bool is_valid = bool(CLDepthwiseConvolutionLayer3x3::validate(&input_info.clone()->set_is_resizable(false), &weights_info.clone()->set_is_resizable(false), &biases_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), conv_info, depth_multiplier, act_info,GPUTarget::MIDGARD, dilation));
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100192 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
193}
194
Usama Arife73686a2019-04-08 17:30:48 +0100195DATA_TEST_CASE(ValidateGeneric, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100196 framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type input/weights
197 TensorInfo(TensorShape(27U, 13U, 3U), 1, DataType::F32), // Mismatching input feature maps
198 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching depth multiplier
199 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases size
200 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases dimensions
201 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid output size
Usama Arife73686a2019-04-08 17:30:48 +0100202 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // patch size bigger than input width
203 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // dilation < 1
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100204 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32),
205 TensorInfo(TensorShape(32U, 13U, 8U), 1, DataType::QASYMM8),
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100206 }),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100207 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F16),
208 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
209 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
210 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
211 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
212 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
213 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
Usama Arife73686a2019-04-08 17:30:48 +0100214 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
215 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100216 TensorInfo(TensorShape(3U, 3U, 24U), 1, DataType::QASYMM8),
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100217 })),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100218 framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32),
219 TensorInfo(TensorShape(2U), 1, DataType::F32),
220 TensorInfo(TensorShape(2U), 1, DataType::F32),
221 TensorInfo(TensorShape(4U), 1, DataType::F32),
222 TensorInfo(TensorShape(2U, 2U), 1, DataType::F32),
223 TensorInfo(TensorShape(2U), 1, DataType::F32),
224 TensorInfo(TensorShape(16U), 1, DataType::F32),
Usama Arife73686a2019-04-08 17:30:48 +0100225 TensorInfo(TensorShape(16U), 1, DataType::F32),
226 TensorInfo(TensorShape(16U), 1, DataType::F32),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100227 TensorInfo(TensorShape(24U), 1, DataType::S32),
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100228 })),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100229 framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
230 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
231 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
232 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
233 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
234 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),
235 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
Usama Arife73686a2019-04-08 17:30:48 +0100236 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
237 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100238 TensorInfo(TensorShape(32U, 11U, 24U), 1, DataType::QASYMM8),
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100239 })),
240 framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0),
241 PadStrideInfo(1, 1, 0, 0),
242 PadStrideInfo(1, 1, 0, 0),
243 PadStrideInfo(1, 1, 0, 0),
244 PadStrideInfo(1, 1, 0, 0),
245 PadStrideInfo(1, 1, 0, 0),
246 PadStrideInfo(1, 1, 0, 0),
Usama Arife73686a2019-04-08 17:30:48 +0100247 PadStrideInfo(1, 1, 0, 0),
248 PadStrideInfo(1, 1, 0, 0),
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100249 PadStrideInfo(1, 1, 1, 0),
250 })),
251 framework::dataset::make("DepthMultiplier", { 1,
252 1,
253 3,
254 1,
255 1,
256 1,
257 2,
Usama Arife73686a2019-04-08 17:30:48 +0100258 2,
259 2,
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100260 3,
261 })),
Usama Arife73686a2019-04-08 17:30:48 +0100262 framework::dataset::make("Dilation", { Size2D(1U, 1U),
263 Size2D(1U, 1U),
264 Size2D(1U, 1U),
265 Size2D(1U, 1U),
266 Size2D(1U, 1U),
267 Size2D(1U, 1U),
268 Size2D(20U, 1U),
269 Size2D(0U, 1U),
270 Size2D(1U, 1U),
271 Size2D(1U, 1U),
272 })),
273 framework::dataset::make("Expected", { false, false, false, false, false, false, false, false, true, true })),
274 input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier, dilation, expected)
Giorgio Arenaad0c7382018-04-23 16:16:21 +0100275{
Michele Di Giorgio51a9c3c2019-08-22 16:20:04 +0100276 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 +0100277 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
278}
279// clang-format on
280// *INDENT-ON*
281
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000282template <typename T>
283using CLDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T>;
284
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000285TEST_SUITE(Float)
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100286TEST_SUITE(FP16)
Michele Di Giorgio933fe862018-02-19 15:42:12 +0000287TEST_SUITE(W3x3)
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100288TEST_SUITE(NCHW)
Pablo Tello8bf622a2018-12-03 15:54:49 +0000289FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100290 combine(combine(combine(combine(framework::dataset::concat(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
291 datasets::SmallDepthwiseConvolutionLayerDataset3x3NCHW()),
292 depth_multipliers),
293 framework::dataset::make("DataType",
294 DataType::F16)),
295 framework::dataset::make("DataLayout", DataLayout::NCHW)),
296 ActivationFunctionsDataset))
Michele Di Giorgio933fe862018-02-19 15:42:12 +0000297{
298 validate(CLAccessor(_target), _reference, tolerance_f16);
299}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100300FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100301 large_depth_multipliers),
Pablo Tello8bf622a2018-12-03 15:54:49 +0000302 framework::dataset::make("DataType",
303 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100304 framework::dataset::make("DataLayout", DataLayout::NCHW)),
305 ActivationFunctionsDataset))
Michele Di Giorgio933fe862018-02-19 15:42:12 +0000306{
307 validate(CLAccessor(_target), _reference, tolerance_f16);
308}
Usama Arife73686a2019-04-08 17:30:48 +0100309TEST_SUITE(Dilation)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100310FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
Usama Arife73686a2019-04-08 17:30:48 +0100311 depth_multipliers),
312 framework::dataset::make("DataType",
313 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100314 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
315 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100316{
317 validate(CLAccessor(_target), _reference, tolerance_f16);
318}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100319FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100320 large_depth_multipliers),
Usama Arife73686a2019-04-08 17:30:48 +0100321 framework::dataset::make("DataType",
322 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100323 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
324 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100325{
326 validate(CLAccessor(_target), _reference, tolerance_f16);
327}
328TEST_SUITE_END() // Dilation
329TEST_SUITE_END() // NCHW
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100330
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100331TEST_SUITE(NHWC)
Pablo Tello8bf622a2018-12-03 15:54:49 +0000332FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100333 combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
334 depth_multipliers),
335 framework::dataset::make("DataType",
336 DataType::F16)),
337 framework::dataset::make("DataLayout", DataLayout::NHWC)),
338 ActivationFunctionsDataset))
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100339{
340 validate(CLAccessor(_target), _reference, tolerance_f16);
341}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100342FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100343 large_depth_multipliers),
Pablo Tello8bf622a2018-12-03 15:54:49 +0000344 framework::dataset::make("DataType",
345 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100346 framework::dataset::make("DataLayout", DataLayout::NHWC)),
347 ActivationFunctionsDataset))
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100348{
349 validate(CLAccessor(_target), _reference, tolerance_f16);
350}
Usama Arife73686a2019-04-08 17:30:48 +0100351TEST_SUITE(Dilation)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100352FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
Usama Arife73686a2019-04-08 17:30:48 +0100353 depth_multipliers),
354 framework::dataset::make("DataType",
355 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100356 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
357 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100358{
359 validate(CLAccessor(_target), _reference, tolerance_f16);
360}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100361FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100362 large_depth_multipliers),
Usama Arife73686a2019-04-08 17:30:48 +0100363 framework::dataset::make("DataType",
364 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100365 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
366 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100367{
368 validate(CLAccessor(_target), _reference, tolerance_f16);
369}
370TEST_SUITE_END() // Dilation
371TEST_SUITE_END() // NHWC
372TEST_SUITE_END() // W3x3
Giorgio Arenae6bb3c62018-08-23 11:19:11 +0100373
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100374TEST_SUITE(Generic)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100375FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
376 depth_multipliers),
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100377 framework::dataset::make("DataType",
378 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100379 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
380 ActivationFunctionsDataset))
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100381{
382 validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
383}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100384FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100385 large_depth_multipliers),
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100386 framework::dataset::make("DataType",
387 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100388 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
389 ActivationFunctionsDataset))
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100390{
391 validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
392}
Usama Arife73686a2019-04-08 17:30:48 +0100393
394TEST_SUITE(Dilation)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100395FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
Usama Arife73686a2019-04-08 17:30:48 +0100396 depth_multipliers),
397 framework::dataset::make("DataType",
398 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100399 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
400 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100401{
402 validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
403}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100404FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100405 large_depth_multipliers),
Usama Arife73686a2019-04-08 17:30:48 +0100406 framework::dataset::make("DataType",
407 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100408 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
409 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100410{
411 validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
412}
413TEST_SUITE_END() // Dilation
414TEST_SUITE_END() // Generic
415TEST_SUITE_END() // FP16
Michele Di Giorgio933fe862018-02-19 15:42:12 +0000416
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000417TEST_SUITE(FP32)
418TEST_SUITE(W3x3)
Giorgio Arenad051e972018-06-20 11:46:42 +0100419TEST_SUITE(NCHW)
Pablo Tello8bf622a2018-12-03 15:54:49 +0000420FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100421 combine(combine(combine(combine(framework::dataset::concat(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
422 datasets::SmallDepthwiseConvolutionLayerDataset3x3NCHW()),
423 depth_multipliers),
424 framework::dataset::make("DataType",
425 DataType::F32)),
426 framework::dataset::make("DataLayout", DataLayout::NCHW)),
427 ActivationFunctionsDataset))
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000428{
429 validate(CLAccessor(_target), _reference, tolerance_f32);
430}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100431FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100432 large_depth_multipliers),
Pablo Tello8bf622a2018-12-03 15:54:49 +0000433 framework::dataset::make("DataType",
434 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100435 framework::dataset::make("DataLayout", DataLayout::NCHW)),
436 ActivationFunctionsDataset))
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000437{
438 validate(CLAccessor(_target), _reference, tolerance_f32);
439}
Usama Arife73686a2019-04-08 17:30:48 +0100440TEST_SUITE(Dilation)
441FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100442 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
443 framework::dataset::make("DataType",
444 DataType::F32)),
445 framework::dataset::make("DataLayout", DataLayout::NCHW)),
446 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100447{
448 validate(CLAccessor(_target), _reference, tolerance_f32);
449}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100450FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
451 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100452 large_depth_multipliers),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100453 framework::dataset::make("DataType",
454 DataType::F32)),
455 framework::dataset::make("DataLayout", DataLayout::NCHW)),
456 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100457{
458 validate(CLAccessor(_target), _reference, tolerance_f32);
459}
460
461TEST_SUITE_END() // Dilation
462TEST_SUITE_END() // NCHW
Giorgio Arenad051e972018-06-20 11:46:42 +0100463TEST_SUITE(NHWC)
Pablo Tello8bf622a2018-12-03 15:54:49 +0000464FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100465 combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
466 depth_multipliers),
467 framework::dataset::make("DataType",
468 DataType::F32)),
469 framework::dataset::make("DataLayout", DataLayout::NHWC)),
470 ActivationFunctionsDataset))
Giorgio Arenad051e972018-06-20 11:46:42 +0100471{
472 validate(CLAccessor(_target), _reference, tolerance_f32);
473}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100474FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100475 large_depth_multipliers),
Pablo Tello8bf622a2018-12-03 15:54:49 +0000476 framework::dataset::make("DataType",
477 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100478 framework::dataset::make("DataLayout", DataLayout::NHWC)),
479 ActivationFunctionsDataset))
Giorgio Arenad051e972018-06-20 11:46:42 +0100480{
481 validate(CLAccessor(_target), _reference, tolerance_f32);
482}
Usama Arife73686a2019-04-08 17:30:48 +0100483TEST_SUITE(Dilation)
484
485FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100486 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
487 depth_multipliers),
488 framework::dataset::make("DataType",
489 DataType::F32)),
490 framework::dataset::make("DataLayout", DataLayout::NHWC)),
491 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100492{
493 validate(CLAccessor(_target), _reference, tolerance_f32);
494}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100495FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
496 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100497 large_depth_multipliers),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100498 framework::dataset::make("DataType",
499 DataType::F32)),
500 framework::dataset::make("DataLayout", DataLayout::NHWC)),
501 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100502{
503 validate(CLAccessor(_target), _reference, tolerance_f32);
504}
505TEST_SUITE_END() // Dilation
506TEST_SUITE_END() // NHWC
507TEST_SUITE_END() // W3x3
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100508
509TEST_SUITE(Generic)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100510FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
511 depth_multipliers),
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100512 framework::dataset::make("DataType",
513 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100514 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
515 ActivationFunctionsDataset))
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100516{
517 validate(CLAccessor(_target), _reference, tolerance_f32);
518}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100519FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100520 large_depth_multipliers),
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100521 framework::dataset::make("DataType",
522 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100523 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
524 ActivationFunctionsDataset))
Michele Di Giorgiod24af8a2018-05-08 17:23:52 +0100525{
526 validate(CLAccessor(_target), _reference, tolerance_f32);
527}
Usama Arife73686a2019-04-08 17:30:48 +0100528
529TEST_SUITE(Dilation)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100530FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
Usama Arife73686a2019-04-08 17:30:48 +0100531 depth_multipliers),
532 framework::dataset::make("DataType",
533 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100534 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
535 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100536{
537 validate(CLAccessor(_target), _reference, tolerance_f32);
538}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100539FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
540 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100541 large_depth_multipliers),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100542 framework::dataset::make("DataType",
543 DataType::F32)),
544 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
545 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100546{
547 validate(CLAccessor(_target), _reference, tolerance_f32);
548}
549TEST_SUITE_END() // Dilation
550TEST_SUITE_END() // Generic
551TEST_SUITE_END() // FP32
552TEST_SUITE_END() // Float
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000553
554template <typename T>
Georgios Pinitasde5a1cc2018-02-02 12:52:07 +0000555using CLDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T>;
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000556
557TEST_SUITE(Quantized)
558TEST_SUITE(QASYMM8)
Georgios Pinitasde5a1cc2018-02-02 12:52:07 +0000559TEST_SUITE(Generic)
Giorgio Arena76572242018-04-04 17:44:26 +0100560FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100561 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
562 depth_multipliers),
563 framework::dataset::make("DataType", DataType::QASYMM8)),
Gian Marco Iodice7243fc32019-08-28 15:56:36 +0100564 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
565 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100566 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
567 ActivationFunctionsDataset))
Georgios Pinitasde5a1cc2018-02-02 12:52:07 +0000568{
569 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
570}
Giorgio Arena76572242018-04-04 17:44:26 +0100571FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100572 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100573 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100574 framework::dataset::make("DataType", DataType::QASYMM8)),
575 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Gian Marco Iodice7243fc32019-08-28 15:56:36 +0100576 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 2) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100577 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
578 ActivationFunctionsDataset))
Georgios Pinitasde5a1cc2018-02-02 12:52:07 +0000579{
580 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
581}
Usama Arife73686a2019-04-08 17:30:48 +0100582TEST_SUITE(Dilation)
583FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100584 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
585 depth_multipliers),
586 framework::dataset::make("DataType", DataType::QASYMM8)),
587 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
588 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8, 1) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100589 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
590 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100591{
592 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
593}
594FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100595 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100596 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100597 framework::dataset::make("DataType", DataType::QASYMM8)),
598 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
599 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100600 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
601 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100602{
603 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
604}
605TEST_SUITE_END() // Dilation
606TEST_SUITE_END() // Generic
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000607TEST_SUITE(W3x3)
Pablo Tello8bf622a2018-12-03 15:54:49 +0000608FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100609 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
610 depth_multipliers),
611 framework::dataset::make("DataType", DataType::QASYMM8)),
Gian Marco Iodice7243fc32019-08-28 15:56:36 +0100612 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
613 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100614 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
615 ActivationFunctionsDataset))
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000616{
617 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
618}
Pablo Tello8bf622a2018-12-03 15:54:49 +0000619FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100620 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100621 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100622 framework::dataset::make("DataType", DataType::QASYMM8)),
623 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
624 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100625 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
626 ActivationFunctionsDataset))
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000627{
628 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
629}
Usama Arife73686a2019-04-08 17:30:48 +0100630TEST_SUITE(Dilation)
631FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100632 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
633 depth_multipliers),
634 framework::dataset::make("DataType", DataType::QASYMM8)),
635 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
636 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100637 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
638 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100639{
640 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
641}
642FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100643 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100644 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100645 framework::dataset::make("DataType", DataType::QASYMM8)),
646 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
647 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100648 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
649 ActivationFunctionsDataset))
Usama Arife73686a2019-04-08 17:30:48 +0100650{
651 validate(CLAccessor(_target), _reference, tolerance_qasymm8);
652}
653TEST_SUITE_END() // Dilation
654TEST_SUITE_END() // W3x3
655TEST_SUITE_END() // QASYMM8
656TEST_SUITE_END() // Quantized
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000657
Usama Arife73686a2019-04-08 17:30:48 +0100658TEST_SUITE_END() // DepthwiseConvolutionLayer
659TEST_SUITE_END() // CL
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000660} // namespace validation
661} // namespace test
662} // namespace arm_compute