blob: 407ebe362a335619d150192aca71f85860909ff0 [file] [log] [blame]
Anthony Barbier8140e1e2017-12-14 23:48:46 +00001/*
Jenkins18b685f2020-08-21 10:26:22 +01002 * Copyright (c) 2017-2020 Arm Limited.
Anthony Barbier8140e1e2017-12-14 23:48:46 +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,
Jenkins514be652019-02-28 12:25:18 +000021 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
Anthony Barbier8140e1e2017-12-14 23:48:46 +000022 * SOFTWARE.
23 */
24#include "arm_compute/core/Types.h"
Jenkinsb3a371b2018-05-23 11:36:53 +010025#include "arm_compute/core/utils/misc/ShapeCalculator.h"
Anthony Barbier8140e1e2017-12-14 23:48:46 +000026#include "arm_compute/runtime/NEON/functions/NEDepthwiseConvolutionLayer.h"
27#include "arm_compute/runtime/Tensor.h"
28#include "arm_compute/runtime/TensorAllocator.h"
29#include "tests/NEON/Accessor.h"
30#include "tests/PaddingCalculator.h"
31#include "tests/datasets/DepthwiseConvolutionLayerDataset.h"
Jenkins4ba87db2019-05-23 17:11:51 +010032#include "tests/datasets/DilatedDepthwiseConvolutionLayerDataset.h"
Anthony Barbier8140e1e2017-12-14 23:48:46 +000033#include "tests/framework/Asserts.h"
34#include "tests/framework/Macros.h"
35#include "tests/framework/datasets/Datasets.h"
36#include "tests/validation/Validation.h"
37#include "tests/validation/fixtures/DepthwiseConvolutionLayerFixture.h"
38
39namespace arm_compute
40{
41namespace test
42{
43namespace validation
44{
Jenkinsb3a371b2018-05-23 11:36:53 +010045using namespace arm_compute::misc::shape_calculator;
46
Anthony Barbier8140e1e2017-12-14 23:48:46 +000047namespace
48{
Jenkins514be652019-02-28 12:25:18 +000049constexpr RelativeTolerance<float> tolerance_f32(0.01f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F32 */
50constexpr AbsoluteTolerance<uint8_t> tolerance_qasymm8(1); /**< Tolerance value for comparing reference's output against implementation's output for DataType::QASYMM8 */
51#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
52RelativeTolerance<half_float::half> tolerance_f16(half_float::half(0.01)); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F16 */
53constexpr float tolerance_num = 0.05f; /**< Tolerance number */
54#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
Jenkinsb3a371b2018-05-23 11:36:53 +010055
Jenkins0e205f72019-11-28 16:53:35 +000056const auto depth_multipliers = framework::dataset::make("DepthMultiplier", { 1, 2, 5 });
Jenkins975dfe12019-09-02 11:47:54 +010057const auto large_depth_multipliers = framework::dataset::make("DepthMultiplier", { 1, 2, 5, 8 });
Jenkins4ba87db2019-05-23 17:11:51 +010058
59//Activation Functions
60const auto ActivationFunctionsDataset = framework::dataset::make("ActivationInfo",
61{
62 ActivationLayerInfo(),
63 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)
64});
Jenkins36ccc902020-02-21 11:10:48 +000065
66const auto input_qinfo_dataset = framework::dataset::make("InputQInfo",
67{
68 QuantizationInfo(0.3f, 10),
69 QuantizationInfo(2.2f, 10),
70});
Anthony Barbier8140e1e2017-12-14 23:48:46 +000071} // namespace
72
73TEST_SUITE(NEON)
Jenkins4ba87db2019-05-23 17:11:51 +010074TEST_SUITE(DepthwiseConvolutionLayer)
Anthony Barbier8140e1e2017-12-14 23:48:46 +000075
Jenkins52ba29e2018-08-29 15:32:11 +000076// *INDENT-OFF*
77// clang-format off
Jenkins4ba87db2019-05-23 17:11:51 +010078DATA_TEST_CASE(Validate3x3, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
Jenkins52ba29e2018-08-29 15:32:11 +000079 framework::dataset::make("InputInfo", { TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Mismatching data type input/weights
80 TensorInfo(TensorShape(32U, 18U, 3U), 1, DataType::F32), // Mismatching input feature maps
81 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Unsupported weights dimensions
82 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Mismatching depth multiplier
83 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::QASYMM8), // Invalid stride
84 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid biases size
85 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid biases dimensions
86 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid output size
Jenkins4ba87db2019-05-23 17:11:51 +010087 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // patch size bigger than input width
88 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // dilation < 1
Jenkins52ba29e2018-08-29 15:32:11 +000089 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),
90 }),
91 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16),
92 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
93 TensorInfo(TensorShape(5U, 5U, 2U, 2U), 1, DataType::F32),
94 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
95 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::QASYMM8),
96 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
97 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
98 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
99 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
Jenkins4ba87db2019-05-23 17:11:51 +0100100 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
101 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
Jenkins52ba29e2018-08-29 15:32:11 +0000102 })),
103 framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32),
104 TensorInfo(TensorShape(2U), 1, DataType::F32),
105 TensorInfo(TensorShape(2U), 1, DataType::F32),
106 TensorInfo(TensorShape(2U), 1, DataType::F32),
107 TensorInfo(TensorShape(2U), 1, DataType::S32),
108 TensorInfo(TensorShape(4U), 1, DataType::F32),
109 TensorInfo(TensorShape(2U, 2U), 1, DataType::F32),
110 TensorInfo(TensorShape(2U), 1, DataType::F32),
111 TensorInfo(TensorShape(2U), 1, DataType::F32),
Jenkins4ba87db2019-05-23 17:11:51 +0100112 TensorInfo(TensorShape(2U), 1, DataType::F32),
113 TensorInfo(TensorShape(2U), 1, DataType::F32),
Jenkins52ba29e2018-08-29 15:32:11 +0000114 })),
115 framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
116 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
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::QASYMM8),
120 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
121 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
122 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32),
123 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
Jenkins4ba87db2019-05-23 17:11:51 +0100124 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
125 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
Jenkins52ba29e2018-08-29 15:32:11 +0000126 })),
127 framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0),
128 PadStrideInfo(1, 1, 0, 0),
129 PadStrideInfo(1, 1, 0, 0),
130 PadStrideInfo(1, 1, 0, 0),
131 PadStrideInfo(4, 1, 0, 0),
132 PadStrideInfo(1, 1, 0, 0),
133 PadStrideInfo(1, 1, 0, 0),
134 PadStrideInfo(1, 1, 0, 0),
135 PadStrideInfo(1, 1, 0, 0),
Jenkins4ba87db2019-05-23 17:11:51 +0100136 PadStrideInfo(1, 1, 0, 0),
137 PadStrideInfo(1, 1, 0, 0),
Jenkins52ba29e2018-08-29 15:32:11 +0000138 })),
139 framework::dataset::make("DepthMultiplier", { 1,
140 1,
141 1,
142 3,
143 1,
144 1,
145 1,
146 1,
147 1,
Jenkins4ba87db2019-05-23 17:11:51 +0100148 1,
149 1,
Jenkins52ba29e2018-08-29 15:32:11 +0000150 })),
Jenkins4ba87db2019-05-23 17:11:51 +0100151 framework::dataset::make("Dilation", { Size2D(1U, 1U),
152 Size2D(1U, 1U),
153 Size2D(1U, 1U),
154 Size2D(1U, 1U),
155 Size2D(1U, 1U),
156 Size2D(1U, 1U),
157 Size2D(1U, 1U),
158 Size2D(1U, 1U),
159 Size2D(25U, 1U),
160 Size2D(0U, 1U),
161 Size2D(1U, 1U),
162 })),
163 framework::dataset::make("Expected", { false, false, false, false, false, false, false, false, false, false, true })),
164 input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier,dilation, expected)
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000165{
Jenkins0e205f72019-11-28 16:53:35 +0000166 bool is_valid = bool(NEDepthwiseConvolutionLayer::validate(&input_info.clone()->set_is_resizable(false),
Jenkins4ba87db2019-05-23 17:11:51 +0100167 &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, ActivationLayerInfo(), dilation));
Jenkins52ba29e2018-08-29 15:32:11 +0000168 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000169}
170
Jenkins4ba87db2019-05-23 17:11:51 +0100171DATA_TEST_CASE(ValidateGeneric, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
Jenkins0e205f72019-11-28 16:53:35 +0000172 framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type input/weights
173 TensorInfo(TensorShape(27U, 13U, 3U), 1, DataType::F32), // Mismatching input feature maps
174 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching depth multiplier
175 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases size
176 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases dimensions
177 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid output size
178 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // Patch size bigger than input width
179 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // Dilation < 1
180 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // Window shrinking
181 TensorInfo(TensorShape(32U, 13U, 8U), 1, DataType::QASYMM8), // Window shrinking
Jenkins52ba29e2018-08-29 15:32:11 +0000182 }),
183 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F16),
184 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
185 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
186 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
187 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
188 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
189 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
Jenkins4ba87db2019-05-23 17:11:51 +0100190 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
191 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
Jenkins52ba29e2018-08-29 15:32:11 +0000192 TensorInfo(TensorShape(3U, 3U, 24U), 1, DataType::QASYMM8),
193 })),
194 framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32),
195 TensorInfo(TensorShape(2U), 1, DataType::F32),
196 TensorInfo(TensorShape(2U), 1, DataType::F32),
197 TensorInfo(TensorShape(4U), 1, DataType::F32),
198 TensorInfo(TensorShape(2U, 2U), 1, DataType::F32),
199 TensorInfo(TensorShape(2U), 1, DataType::F32),
200 TensorInfo(TensorShape(16U), 1, DataType::F32),
Jenkins4ba87db2019-05-23 17:11:51 +0100201 TensorInfo(TensorShape(16U), 1, DataType::F32),
202 TensorInfo(TensorShape(16U), 1, DataType::F32),
Jenkins52ba29e2018-08-29 15:32:11 +0000203 TensorInfo(TensorShape(24U), 1, DataType::S32),
204 })),
205 framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
206 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
207 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
208 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
209 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
210 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),
211 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
Jenkins4ba87db2019-05-23 17:11:51 +0100212 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
213 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
Jenkins52ba29e2018-08-29 15:32:11 +0000214 TensorInfo(TensorShape(32U, 11U, 24U), 1, DataType::QASYMM8),
215 })),
216 framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0),
217 PadStrideInfo(1, 1, 0, 0),
218 PadStrideInfo(1, 1, 0, 0),
219 PadStrideInfo(1, 1, 0, 0),
220 PadStrideInfo(1, 1, 0, 0),
221 PadStrideInfo(1, 1, 0, 0),
222 PadStrideInfo(1, 1, 0, 0),
Jenkins4ba87db2019-05-23 17:11:51 +0100223 PadStrideInfo(1, 1, 0, 0),
224 PadStrideInfo(1, 1, 0, 0),
Jenkins52ba29e2018-08-29 15:32:11 +0000225 PadStrideInfo(1, 1, 1, 0),
226 })),
227 framework::dataset::make("DepthMultiplier", { 1,
228 1,
229 3,
230 1,
231 1,
232 1,
233 2,
Jenkins4ba87db2019-05-23 17:11:51 +0100234 2,
235 2,
Jenkins52ba29e2018-08-29 15:32:11 +0000236 3,
237 })),
Jenkins4ba87db2019-05-23 17:11:51 +0100238 framework::dataset::make("Dilation", { Size2D(1U, 1U),
239 Size2D(1U, 1U),
240 Size2D(1U, 1U),
241 Size2D(1U, 1U),
242 Size2D(1U, 1U),
243 Size2D(1U, 1U),
244 Size2D(25U, 1U),
245 Size2D(0U, 1U),
246 Size2D(1U, 1U),
247 Size2D(1U, 1U),
248 })),
Jenkins0e205f72019-11-28 16:53:35 +0000249 framework::dataset::make("Expected", { false, false, false, false, false, false,false, false, false, false })),
Jenkins4ba87db2019-05-23 17:11:51 +0100250 input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier,dilation, expected)
Jenkins52ba29e2018-08-29 15:32:11 +0000251{
Jenkins4ba87db2019-05-23 17:11:51 +0100252 bool is_valid = bool(NEDepthwiseConvolutionLayer::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, ActivationLayerInfo(), dilation));
Jenkins52ba29e2018-08-29 15:32:11 +0000253 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
254}
255// clang-format on
256// *INDENT-ON*
Jenkins0e205f72019-11-28 16:53:35 +0000257template <typename T>
258using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Jenkins52ba29e2018-08-29 15:32:11 +0000259
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000260TEST_SUITE(Float)
261TEST_SUITE(F32)
262TEST_SUITE(Generic)
Jenkins4ba87db2019-05-23 17:11:51 +0100263FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
Jenkinsb3a371b2018-05-23 11:36:53 +0100264 depth_multipliers),
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000265 framework::dataset::make("DataType",
Jenkinsb3a371b2018-05-23 11:36:53 +0100266 DataType::F32)),
Jenkins4ba87db2019-05-23 17:11:51 +0100267 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
268 ActivationFunctionsDataset))
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000269{
270 validate(Accessor(_target), _reference, tolerance_f32);
271}
Jenkins4ba87db2019-05-23 17:11:51 +0100272FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Jenkins975dfe12019-09-02 11:47:54 +0100273 large_depth_multipliers),
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000274 framework::dataset::make("DataType",
Jenkinsb3a371b2018-05-23 11:36:53 +0100275 DataType::F32)),
Jenkins4ba87db2019-05-23 17:11:51 +0100276 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
277 ActivationFunctionsDataset))
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000278{
279 validate(Accessor(_target), _reference, tolerance_f32);
280}
Jenkins4ba87db2019-05-23 17:11:51 +0100281
282TEST_SUITE(Dilation)
Jenkins36ccc902020-02-21 11:10:48 +0000283FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
284 depth_multipliers),
285 framework::dataset::make("DataType",
286 DataType::F32)),
287 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
288 ActivationFunctionsDataset))
Jenkins4ba87db2019-05-23 17:11:51 +0100289{
290 validate(Accessor(_target), _reference, tolerance_f32);
291}
292FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Jenkins975dfe12019-09-02 11:47:54 +0100293 large_depth_multipliers),
Jenkins4ba87db2019-05-23 17:11:51 +0100294 framework::dataset::make("DataType",
295 DataType::F32)),
296 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
297 ActivationFunctionsDataset))
298{
299 validate(Accessor(_target), _reference, tolerance_f32);
300}
301TEST_SUITE_END() // Dilation
Jenkinsb9abeae2018-11-22 11:58:08 +0000302TEST_SUITE_END() // Generic
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000303
Jenkins975dfe12019-09-02 11:47:54 +0100304TEST_SUITE(W3x3)
Jenkins36ccc902020-02-21 11:10:48 +0000305FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
306 depth_multipliers),
307 framework::dataset::make("DataType",
308 DataType::F32)),
309 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
310 ActivationFunctionsDataset))
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000311{
312 validate(Accessor(_target), _reference, tolerance_f32);
313}
Jenkins0e205f72019-11-28 16:53:35 +0000314FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
Jenkins975dfe12019-09-02 11:47:54 +0100315 combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
316 large_depth_multipliers),
317 framework::dataset::make("DataType",
318 DataType::F32)),
319 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
320 ActivationFunctionsDataset))
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000321{
322 validate(Accessor(_target), _reference, tolerance_f32);
323}
Jenkins4ba87db2019-05-23 17:11:51 +0100324TEST_SUITE(Dilation)
Jenkins36ccc902020-02-21 11:10:48 +0000325FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
Jenkins975dfe12019-09-02 11:47:54 +0100326 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
327 depth_multipliers),
328 framework::dataset::make("DataType",
329 DataType::F32)),
330 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
331 ActivationFunctionsDataset))
Jenkins4ba87db2019-05-23 17:11:51 +0100332{
333 validate(Accessor(_target), _reference, tolerance_f32);
334}
Jenkins0e205f72019-11-28 16:53:35 +0000335FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
Jenkins4ba87db2019-05-23 17:11:51 +0100336 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Jenkins975dfe12019-09-02 11:47:54 +0100337 large_depth_multipliers),
Jenkins4ba87db2019-05-23 17:11:51 +0100338 framework::dataset::make("DataType",
339 DataType::F32)),
340 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
341 ActivationFunctionsDataset))
342{
343 validate(Accessor(_target), _reference, tolerance_f32);
344}
345
346TEST_SUITE_END() // Dilation
Jenkins975dfe12019-09-02 11:47:54 +0100347TEST_SUITE_END() // W3x3
Jenkins4ba87db2019-05-23 17:11:51 +0100348
Jenkins975dfe12019-09-02 11:47:54 +0100349TEST_SUITE(Optimized)
Jenkins0e205f72019-11-28 16:53:35 +0000350FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
Jenkins4ba87db2019-05-23 17:11:51 +0100351 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
352 framework::dataset::make("DepthMultiplier", 1)),
353 framework::dataset::make("DataType",
354 DataType::F32)),
355 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
356 ActivationFunctionsDataset))
Jenkins514be652019-02-28 12:25:18 +0000357{
358 validate(Accessor(_target), _reference, tolerance_f32);
359}
Jenkins0e205f72019-11-28 16:53:35 +0000360FIXTURE_DATA_TEST_CASE(RunSmall5x5, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
Jenkins975dfe12019-09-02 11:47:54 +0100361 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
362 framework::dataset::make("DepthMultiplier", 1)),
363 framework::dataset::make("DataType",
364 DataType::F32)),
365 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
366 ActivationFunctionsDataset))
367{
368 validate(Accessor(_target), _reference, tolerance_f32);
369}
Jenkins0e205f72019-11-28 16:53:35 +0000370FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
Jenkins4ba87db2019-05-23 17:11:51 +0100371 combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
372 framework::dataset::make("DepthMultiplier", 1)),
373 framework::dataset::make("DataType",
374 DataType::F32)),
375 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
376 ActivationFunctionsDataset))
Anthony Barbier06ea0482018-02-22 15:45:35 +0000377{
378 validate(Accessor(_target), _reference, tolerance_f32);
379}
Jenkins975dfe12019-09-02 11:47:54 +0100380TEST_SUITE_END() // Optimized
Jenkinsb9abeae2018-11-22 11:58:08 +0000381TEST_SUITE_END() // F32
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000382
Jenkinsb9abeae2018-11-22 11:58:08 +0000383#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
384TEST_SUITE(F16)
Jenkins514be652019-02-28 12:25:18 +0000385TEST_SUITE(Generic)
Jenkins4ba87db2019-05-23 17:11:51 +0100386FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
Jenkins514be652019-02-28 12:25:18 +0000387 depth_multipliers),
388 framework::dataset::make("DataType",
389 DataType::F16)),
Jenkins4ba87db2019-05-23 17:11:51 +0100390 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
391 ActivationFunctionsDataset))
Jenkins514be652019-02-28 12:25:18 +0000392{
393 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
394}
Jenkins4ba87db2019-05-23 17:11:51 +0100395FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Jenkins975dfe12019-09-02 11:47:54 +0100396 large_depth_multipliers),
Jenkins514be652019-02-28 12:25:18 +0000397 framework::dataset::make("DataType",
398 DataType::F16)),
Jenkins4ba87db2019-05-23 17:11:51 +0100399 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
400 ActivationFunctionsDataset))
Jenkins514be652019-02-28 12:25:18 +0000401{
402 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
403}
Jenkins4ba87db2019-05-23 17:11:51 +0100404
405TEST_SUITE(Dilation)
Jenkins36ccc902020-02-21 11:10:48 +0000406FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
407 depth_multipliers),
408 framework::dataset::make("DataType",
409 DataType::F16)),
410 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
411 ActivationFunctionsDataset))
Jenkins4ba87db2019-05-23 17:11:51 +0100412{
413 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
414}
415FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Jenkins975dfe12019-09-02 11:47:54 +0100416 large_depth_multipliers),
Jenkins4ba87db2019-05-23 17:11:51 +0100417 framework::dataset::make("DataType",
418 DataType::F16)),
419 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
420 ActivationFunctionsDataset))
421{
422 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
423}
424TEST_SUITE_END() // Dilation
425
Jenkins514be652019-02-28 12:25:18 +0000426TEST_SUITE_END() // Generic
Jenkinsb9abeae2018-11-22 11:58:08 +0000427template <typename T>
Jenkins0e205f72019-11-28 16:53:35 +0000428using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Jenkins975dfe12019-09-02 11:47:54 +0100429TEST_SUITE(W3x3)
Jenkins36ccc902020-02-21 11:10:48 +0000430FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
431 depth_multipliers),
432 framework::dataset::make("DataType",
433 DataType::F16)),
434 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
435 ActivationFunctionsDataset))
Jenkinsb9abeae2018-11-22 11:58:08 +0000436{
437 validate(Accessor(_target), _reference, tolerance_f16);
438}
Jenkins0e205f72019-11-28 16:53:35 +0000439FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
Jenkins975dfe12019-09-02 11:47:54 +0100440 combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
441 large_depth_multipliers),
442 framework::dataset::make("DataType",
443 DataType::F16)),
444 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
445 ActivationFunctionsDataset))
Jenkinsb9abeae2018-11-22 11:58:08 +0000446{
447 validate(Accessor(_target), _reference, tolerance_f16);
448}
Jenkins4ba87db2019-05-23 17:11:51 +0100449
450TEST_SUITE(Dilation)
451
Jenkins36ccc902020-02-21 11:10:48 +0000452FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
Jenkins975dfe12019-09-02 11:47:54 +0100453 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
454 depth_multipliers),
455 framework::dataset::make("DataType",
456 DataType::F16)),
457 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
458 ActivationFunctionsDataset))
Jenkins4ba87db2019-05-23 17:11:51 +0100459{
460 validate(Accessor(_target), _reference, tolerance_f16);
461}
Jenkins0e205f72019-11-28 16:53:35 +0000462FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
Jenkins4ba87db2019-05-23 17:11:51 +0100463 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Jenkins975dfe12019-09-02 11:47:54 +0100464 large_depth_multipliers),
Jenkins4ba87db2019-05-23 17:11:51 +0100465 framework::dataset::make("DataType",
466 DataType::F16)),
467 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
468 ActivationFunctionsDataset))
469{
470 validate(Accessor(_target), _reference, tolerance_f16);
471}
472
473TEST_SUITE_END() // Dilation
Jenkins975dfe12019-09-02 11:47:54 +0100474TEST_SUITE_END() // W3x3
Jenkins4ba87db2019-05-23 17:11:51 +0100475
Jenkins975dfe12019-09-02 11:47:54 +0100476TEST_SUITE(Optimized)
Jenkins0e205f72019-11-28 16:53:35 +0000477FIXTURE_DATA_TEST_CASE(RunSmallW3x3, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
Jenkins4ba87db2019-05-23 17:11:51 +0100478 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
479 framework::dataset::make("DepthMultiplier", 1)),
480 framework::dataset::make("DataType",
481 DataType::F16)),
482 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
483 ActivationFunctionsDataset))
Jenkins514be652019-02-28 12:25:18 +0000484{
485 validate(Accessor(_target), _reference, tolerance_f16);
486}
Jenkins0e205f72019-11-28 16:53:35 +0000487FIXTURE_DATA_TEST_CASE(RunSmallW5x5, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
Jenkins975dfe12019-09-02 11:47:54 +0100488 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
489 framework::dataset::make("DepthMultiplier", 1)),
490 framework::dataset::make("DataType",
491 DataType::F16)),
492 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
493 ActivationFunctionsDataset))
494{
495 validate(Accessor(_target), _reference, tolerance_f16);
496}
Jenkins0e205f72019-11-28 16:53:35 +0000497FIXTURE_DATA_TEST_CASE(RunLargeW3x3, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
Jenkins4ba87db2019-05-23 17:11:51 +0100498 combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
499 framework::dataset::make("DepthMultiplier", 1)),
500 framework::dataset::make("DataType",
501 DataType::F16)),
502 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
503 ActivationFunctionsDataset))
Jenkinsb9abeae2018-11-22 11:58:08 +0000504{
505 validate(Accessor(_target), _reference, tolerance_f16);
506}
Jenkins975dfe12019-09-02 11:47:54 +0100507TEST_SUITE_END() // Optimized
Jenkinsb9abeae2018-11-22 11:58:08 +0000508TEST_SUITE_END() // FP16
509#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
510
511TEST_SUITE_END() // Float
Anthony Barbierf45d5a92018-01-24 16:23:15 +0000512
513template <typename T>
Jenkins0e205f72019-11-28 16:53:35 +0000514using NEDepthwiseConvolutionLayerQuantizedFixtureOptimized = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Anthony Barbier06ea0482018-02-22 15:45:35 +0000515template <typename T>
Jenkins0e205f72019-11-28 16:53:35 +0000516using NEDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
517using NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture = DepthwiseConvolutionLayerValidationQuantizedPerChannelFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, uint8_t, int8_t>;
Anthony Barbierf45d5a92018-01-24 16:23:15 +0000518
519TEST_SUITE(Quantized)
520TEST_SUITE(QASYMM8)
Anthony Barbier06ea0482018-02-22 15:45:35 +0000521TEST_SUITE(Generic)
Jenkinsb3a371b2018-05-23 11:36:53 +0100522FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Jenkins975dfe12019-09-02 11:47:54 +0100523 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
524 depth_multipliers),
525 framework::dataset::make("DataType", DataType::QASYMM8)),
Jenkins36ccc902020-02-21 11:10:48 +0000526 input_qinfo_dataset),
Jenkins975dfe12019-09-02 11:47:54 +0100527 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
Jenkins36ccc902020-02-21 11:10:48 +0000528 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Jenkins4ba87db2019-05-23 17:11:51 +0100529 ActivationFunctionsDataset))
Anthony Barbier06ea0482018-02-22 15:45:35 +0000530{
531 validate(Accessor(_target), _reference, tolerance_qasymm8);
532}
Jenkins4ba87db2019-05-23 17:11:51 +0100533
534TEST_SUITE(Dilation)
535FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Jenkins975dfe12019-09-02 11:47:54 +0100536 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
537 depth_multipliers),
538 framework::dataset::make("DataType", DataType::QASYMM8)),
Jenkins36ccc902020-02-21 11:10:48 +0000539 input_qinfo_dataset),
Jenkins975dfe12019-09-02 11:47:54 +0100540 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8f, 1) })),
Jenkins36ccc902020-02-21 11:10:48 +0000541 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Jenkins4ba87db2019-05-23 17:11:51 +0100542 ActivationFunctionsDataset))
543{
544 validate(Accessor(_target), _reference, tolerance_qasymm8);
545}
546FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
Jenkins975dfe12019-09-02 11:47:54 +0100547 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
548 large_depth_multipliers),
549 framework::dataset::make("DataType", DataType::QASYMM8)),
Jenkins36ccc902020-02-21 11:10:48 +0000550 input_qinfo_dataset),
Jenkins975dfe12019-09-02 11:47:54 +0100551 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
Jenkins36ccc902020-02-21 11:10:48 +0000552 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Jenkins4ba87db2019-05-23 17:11:51 +0100553 ActivationFunctionsDataset))
554{
555 validate(Accessor(_target), _reference, tolerance_qasymm8);
556}
Jenkins975dfe12019-09-02 11:47:54 +0100557TEST_SUITE_END() // Dilation
Jenkins514be652019-02-28 12:25:18 +0000558TEST_SUITE_END() // Generic
Anthony Barbierf45d5a92018-01-24 16:23:15 +0000559TEST_SUITE(W3x3)
Jenkins975dfe12019-09-02 11:47:54 +0100560FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
561 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers),
562 framework::dataset::make("DataType", DataType::QASYMM8)),
Jenkins36ccc902020-02-21 11:10:48 +0000563 input_qinfo_dataset),
Jenkins975dfe12019-09-02 11:47:54 +0100564 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Jenkins36ccc902020-02-21 11:10:48 +0000565 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Jenkins4ba87db2019-05-23 17:11:51 +0100566 ActivationFunctionsDataset))
Anthony Barbierf45d5a92018-01-24 16:23:15 +0000567{
568 validate(Accessor(_target), _reference, tolerance_qasymm8);
569}
Jenkins975dfe12019-09-02 11:47:54 +0100570FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
571 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
572 large_depth_multipliers),
573 framework::dataset::make("DataType", DataType::QASYMM8)),
Jenkins36ccc902020-02-21 11:10:48 +0000574 input_qinfo_dataset),
Jenkins975dfe12019-09-02 11:47:54 +0100575 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Jenkins36ccc902020-02-21 11:10:48 +0000576 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Jenkins4ba87db2019-05-23 17:11:51 +0100577 ActivationFunctionsDataset))
Anthony Barbierf45d5a92018-01-24 16:23:15 +0000578{
579 validate(Accessor(_target), _reference, tolerance_qasymm8);
580}
Jenkins4ba87db2019-05-23 17:11:51 +0100581
582TEST_SUITE(Dilation)
583
Jenkins975dfe12019-09-02 11:47:54 +0100584FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
585 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
586 framework::dataset::make("DataType", DataType::QASYMM8)),
Jenkins36ccc902020-02-21 11:10:48 +0000587 input_qinfo_dataset),
Jenkins975dfe12019-09-02 11:47:54 +0100588 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 10) })),
Jenkins36ccc902020-02-21 11:10:48 +0000589 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Jenkins4ba87db2019-05-23 17:11:51 +0100590 ActivationFunctionsDataset))
591{
592 validate(Accessor(_target), _reference, tolerance_qasymm8);
593}
Jenkins975dfe12019-09-02 11:47:54 +0100594FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
595 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
596 large_depth_multipliers),
597 framework::dataset::make("DataType", DataType::QASYMM8)),
Jenkins36ccc902020-02-21 11:10:48 +0000598 input_qinfo_dataset),
Jenkins975dfe12019-09-02 11:47:54 +0100599 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Jenkins36ccc902020-02-21 11:10:48 +0000600 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Jenkins4ba87db2019-05-23 17:11:51 +0100601 ActivationFunctionsDataset))
602{
603 validate(Accessor(_target), _reference, tolerance_qasymm8);
604}
605TEST_SUITE_END() // Dilation
Jenkins514be652019-02-28 12:25:18 +0000606TEST_SUITE_END() // W3x3
Jenkins975dfe12019-09-02 11:47:54 +0100607
608TEST_SUITE(Optimized)
609FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
610 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
611 framework::dataset::make("DepthMultiplier", 1)),
612 framework::dataset::make("DataType",
613 DataType::QASYMM8)),
Jenkins36ccc902020-02-21 11:10:48 +0000614 input_qinfo_dataset),
Jenkins975dfe12019-09-02 11:47:54 +0100615 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Jenkins36ccc902020-02-21 11:10:48 +0000616 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Jenkins975dfe12019-09-02 11:47:54 +0100617 ActivationFunctionsDataset))
618{
619 validate(Accessor(_target), _reference, tolerance_qasymm8);
620}
621FIXTURE_DATA_TEST_CASE(RunSmall5x5, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
622 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
623 framework::dataset::make("DepthMultiplier", 1)),
624 framework::dataset::make("DataType",
625 DataType::QASYMM8)),
Jenkins36ccc902020-02-21 11:10:48 +0000626 input_qinfo_dataset),
Jenkins975dfe12019-09-02 11:47:54 +0100627 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Jenkins36ccc902020-02-21 11:10:48 +0000628 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Jenkins975dfe12019-09-02 11:47:54 +0100629 ActivationFunctionsDataset))
630{
631 validate(Accessor(_target), _reference, tolerance_qasymm8);
632}
633FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
634 combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
635 framework::dataset::make("DepthMultiplier", 1)),
636 framework::dataset::make("DataType",
637 DataType::QASYMM8)),
Jenkins36ccc902020-02-21 11:10:48 +0000638 input_qinfo_dataset),
Jenkins975dfe12019-09-02 11:47:54 +0100639 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Jenkins36ccc902020-02-21 11:10:48 +0000640 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Jenkins975dfe12019-09-02 11:47:54 +0100641 ActivationFunctionsDataset))
642{
643 validate(Accessor(_target), _reference, tolerance_qasymm8);
644}
645TEST_SUITE_END() // Optimized
Jenkins514be652019-02-28 12:25:18 +0000646TEST_SUITE_END() // QASYMM8
Jenkins36ccc902020-02-21 11:10:48 +0000647
648TEST_SUITE(QASYMM8_SIGNED)
649TEST_SUITE(Generic)
650FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
651 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
652 depth_multipliers),
653 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
654 input_qinfo_dataset),
655 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
656 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
657 ActivationFunctionsDataset))
658{
659 validate(Accessor(_target), _reference, tolerance_qasymm8);
660}
661
662TEST_SUITE(Dilation)
663FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
664 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
665 depth_multipliers),
666 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
667 input_qinfo_dataset),
668 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8f, 1) })),
669 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
670 ActivationFunctionsDataset))
671{
672 validate(Accessor(_target), _reference, tolerance_qasymm8);
673}
674FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::NIGHTLY,
675 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
676 large_depth_multipliers),
677 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
678 input_qinfo_dataset),
679 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
680 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
681 ActivationFunctionsDataset))
682{
683 validate(Accessor(_target), _reference, tolerance_qasymm8);
684}
685TEST_SUITE_END() // Dilation
686TEST_SUITE_END() // Generic
687
688TEST_SUITE(W3x3)
689FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT,
690 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers),
691 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
692 input_qinfo_dataset),
693 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
694 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
695 ActivationFunctionsDataset))
696{
697 validate(Accessor(_target), _reference, tolerance_qasymm8);
698}
699FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::NIGHTLY,
700 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
701 large_depth_multipliers),
702 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
703 input_qinfo_dataset),
704 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
705 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
706 ActivationFunctionsDataset))
707{
708 validate(Accessor(_target), _reference, tolerance_qasymm8);
709}
710
711TEST_SUITE(Dilation)
712FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT,
713 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
714 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
715 input_qinfo_dataset),
716 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 10) })),
717 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
718 ActivationFunctionsDataset))
719{
720 validate(Accessor(_target), _reference, tolerance_qasymm8);
721}
722FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::NIGHTLY,
723 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
724 large_depth_multipliers),
725 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
726 input_qinfo_dataset),
727 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
728 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
729 ActivationFunctionsDataset))
730{
731 validate(Accessor(_target), _reference, tolerance_qasymm8);
732}
733TEST_SUITE_END() // Dilation
734TEST_SUITE_END() // W3x3
735
736TEST_SUITE(Optimized)
737FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT,
738 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
739 framework::dataset::make("DepthMultiplier", 1)),
740 framework::dataset::make("DataType",
741 DataType::QASYMM8_SIGNED)),
742 input_qinfo_dataset),
743 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
744 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
745 ActivationFunctionsDataset))
746{
747 validate(Accessor(_target), _reference, tolerance_qasymm8);
748}
749FIXTURE_DATA_TEST_CASE(RunSmall5x5, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT,
750 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
751 framework::dataset::make("DepthMultiplier", 1)),
752 framework::dataset::make("DataType",
753 DataType::QASYMM8_SIGNED)),
754 input_qinfo_dataset),
755 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
756 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
757 ActivationFunctionsDataset))
758{
759 validate(Accessor(_target), _reference, tolerance_qasymm8);
760}
761FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::NIGHTLY,
762 combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
763 framework::dataset::make("DepthMultiplier", 1)),
764 framework::dataset::make("DataType",
765 DataType::QASYMM8_SIGNED)),
766 input_qinfo_dataset),
767 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
768 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
769 ActivationFunctionsDataset))
770{
771 validate(Accessor(_target), _reference, tolerance_qasymm8);
772}
773TEST_SUITE_END() // Optimized
774TEST_SUITE_END() // QASYMM8_SIGNED
775
Jenkins0e205f72019-11-28 16:53:35 +0000776TEST_SUITE(QSYMM8_PER_CHANNEL)
777TEST_SUITE(Generic)
Jenkins36ccc902020-02-21 11:10:48 +0000778FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT,
Jenkins0e205f72019-11-28 16:53:35 +0000779 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
780 depth_multipliers),
781 framework::dataset::make("InputDataType", DataType::QASYMM8)),
782 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
Jenkins36ccc902020-02-21 11:10:48 +0000783 input_qinfo_dataset),
Jenkins0e205f72019-11-28 16:53:35 +0000784 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
785 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
786 ActivationFunctionsDataset))
787{
788 validate(Accessor(_target), _reference, tolerance_qasymm8);
789}
790
791TEST_SUITE(Dilation)
Jenkins36ccc902020-02-21 11:10:48 +0000792FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT,
Jenkins0e205f72019-11-28 16:53:35 +0000793 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
794 depth_multipliers),
795 framework::dataset::make("InputDataType", DataType::QASYMM8)),
796 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
Jenkins36ccc902020-02-21 11:10:48 +0000797 input_qinfo_dataset),
Jenkins0e205f72019-11-28 16:53:35 +0000798 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
799 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
800 ActivationFunctionsDataset))
801{
802 validate(Accessor(_target), _reference, tolerance_qasymm8);
803}
804FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY,
805 combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
806 depth_multipliers),
807 framework::dataset::make("InputDataType", DataType::QASYMM8)),
808 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
Jenkins36ccc902020-02-21 11:10:48 +0000809 input_qinfo_dataset),
Jenkins0e205f72019-11-28 16:53:35 +0000810 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
811 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
812 ActivationFunctionsDataset))
813{
814 validate(Accessor(_target), _reference, tolerance_qasymm8);
815}
816TEST_SUITE_END() // Dilation
817TEST_SUITE_END() // Generic
Jenkins36ccc902020-02-21 11:10:48 +0000818
819TEST_SUITE(Optimized)
820FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT,
821 combine(combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
822 framework::dataset::make("DepthMultiplier", 1)),
823 framework::dataset::make("InputDataType", DataType::QASYMM8)),
824 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
825 input_qinfo_dataset),
826 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
827 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
828 ActivationFunctionsDataset))
829{
830 validate(Accessor(_target), _reference, tolerance_qasymm8);
831}
832FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY,
833 combine(combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
834 framework::dataset::make("DepthMultiplier", 1)),
835 framework::dataset::make("InputDataType", DataType::QASYMM8)),
836 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
837 input_qinfo_dataset),
838 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
839 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
840 ActivationFunctionsDataset))
841{
842 validate(Accessor(_target), _reference, tolerance_qasymm8);
843}
844TEST_SUITE_END() // Optimized
Jenkins0e205f72019-11-28 16:53:35 +0000845TEST_SUITE_END() // QSYMM8_PER_CHANNEL
Jenkins514be652019-02-28 12:25:18 +0000846TEST_SUITE_END() // Quantized
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000847
Jenkins514be652019-02-28 12:25:18 +0000848TEST_SUITE_END() // DepthwiseConvLayer
849TEST_SUITE_END() // NEON
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000850} // namespace validation
851} // namespace test
852} // namespace arm_compute