blob: e255fc7b4d9540f982823d8f358f534195ac6de2 [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
Jenkins52ba29e2018-08-29 15:32:11 +0000180 }),
181 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F16),
182 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
183 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
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, 16U), 1, DataType::F32),
Jenkins4ba87db2019-05-23 17:11:51 +0100188 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
Jenkins52ba29e2018-08-29 15:32:11 +0000189 })),
190 framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32),
191 TensorInfo(TensorShape(2U), 1, DataType::F32),
192 TensorInfo(TensorShape(2U), 1, DataType::F32),
193 TensorInfo(TensorShape(4U), 1, DataType::F32),
194 TensorInfo(TensorShape(2U, 2U), 1, DataType::F32),
195 TensorInfo(TensorShape(2U), 1, DataType::F32),
196 TensorInfo(TensorShape(16U), 1, DataType::F32),
Jenkins4ba87db2019-05-23 17:11:51 +0100197 TensorInfo(TensorShape(16U), 1, DataType::F32),
Jenkins52ba29e2018-08-29 15:32:11 +0000198 })),
199 framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
200 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
201 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
202 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
203 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
204 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),
205 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
Jenkins4ba87db2019-05-23 17:11:51 +0100206 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
Jenkins52ba29e2018-08-29 15:32:11 +0000207 })),
208 framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0),
209 PadStrideInfo(1, 1, 0, 0),
210 PadStrideInfo(1, 1, 0, 0),
211 PadStrideInfo(1, 1, 0, 0),
212 PadStrideInfo(1, 1, 0, 0),
213 PadStrideInfo(1, 1, 0, 0),
214 PadStrideInfo(1, 1, 0, 0),
Jenkins4ba87db2019-05-23 17:11:51 +0100215 PadStrideInfo(1, 1, 0, 0),
Jenkins52ba29e2018-08-29 15:32:11 +0000216 })),
217 framework::dataset::make("DepthMultiplier", { 1,
218 1,
219 3,
220 1,
221 1,
222 1,
223 2,
Jenkins4ba87db2019-05-23 17:11:51 +0100224 2,
Jenkins52ba29e2018-08-29 15:32:11 +0000225 })),
Jenkins4ba87db2019-05-23 17:11:51 +0100226 framework::dataset::make("Dilation", { Size2D(1U, 1U),
227 Size2D(1U, 1U),
228 Size2D(1U, 1U),
229 Size2D(1U, 1U),
230 Size2D(1U, 1U),
231 Size2D(1U, 1U),
232 Size2D(25U, 1U),
233 Size2D(0U, 1U),
Jenkins4ba87db2019-05-23 17:11:51 +0100234 })),
Jenkins49b8f902020-11-27 12:49:11 +0000235 framework::dataset::make("Expected", { false, false, false, false, false, false, false, false})),
Jenkins4ba87db2019-05-23 17:11:51 +0100236 input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier,dilation, expected)
Jenkins52ba29e2018-08-29 15:32:11 +0000237{
Jenkins4ba87db2019-05-23 17:11:51 +0100238 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 +0000239 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
240}
241// clang-format on
242// *INDENT-ON*
Jenkins0e205f72019-11-28 16:53:35 +0000243template <typename T>
244using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Jenkins52ba29e2018-08-29 15:32:11 +0000245
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000246TEST_SUITE(Float)
247TEST_SUITE(F32)
248TEST_SUITE(Generic)
Jenkins4ba87db2019-05-23 17:11:51 +0100249FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
Jenkinsb3a371b2018-05-23 11:36:53 +0100250 depth_multipliers),
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000251 framework::dataset::make("DataType",
Jenkinsb3a371b2018-05-23 11:36:53 +0100252 DataType::F32)),
Jenkins4ba87db2019-05-23 17:11:51 +0100253 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
254 ActivationFunctionsDataset))
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000255{
256 validate(Accessor(_target), _reference, tolerance_f32);
257}
Jenkins4ba87db2019-05-23 17:11:51 +0100258FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Jenkins975dfe12019-09-02 11:47:54 +0100259 large_depth_multipliers),
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000260 framework::dataset::make("DataType",
Jenkinsb3a371b2018-05-23 11:36:53 +0100261 DataType::F32)),
Jenkins4ba87db2019-05-23 17:11:51 +0100262 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
263 ActivationFunctionsDataset))
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000264{
265 validate(Accessor(_target), _reference, tolerance_f32);
266}
Jenkins4ba87db2019-05-23 17:11:51 +0100267
268TEST_SUITE(Dilation)
Jenkins36ccc902020-02-21 11:10:48 +0000269FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
270 depth_multipliers),
271 framework::dataset::make("DataType",
272 DataType::F32)),
273 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
274 ActivationFunctionsDataset))
Jenkins4ba87db2019-05-23 17:11:51 +0100275{
276 validate(Accessor(_target), _reference, tolerance_f32);
277}
278FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Jenkins975dfe12019-09-02 11:47:54 +0100279 large_depth_multipliers),
Jenkins4ba87db2019-05-23 17:11:51 +0100280 framework::dataset::make("DataType",
281 DataType::F32)),
282 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
283 ActivationFunctionsDataset))
284{
285 validate(Accessor(_target), _reference, tolerance_f32);
286}
287TEST_SUITE_END() // Dilation
Jenkinsb9abeae2018-11-22 11:58:08 +0000288TEST_SUITE_END() // Generic
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000289
Jenkins975dfe12019-09-02 11:47:54 +0100290TEST_SUITE(W3x3)
Jenkins36ccc902020-02-21 11:10:48 +0000291FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
292 depth_multipliers),
293 framework::dataset::make("DataType",
294 DataType::F32)),
295 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
296 ActivationFunctionsDataset))
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000297{
298 validate(Accessor(_target), _reference, tolerance_f32);
299}
Jenkins0e205f72019-11-28 16:53:35 +0000300FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
Jenkins975dfe12019-09-02 11:47:54 +0100301 combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
302 large_depth_multipliers),
303 framework::dataset::make("DataType",
304 DataType::F32)),
305 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
306 ActivationFunctionsDataset))
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000307{
308 validate(Accessor(_target), _reference, tolerance_f32);
309}
Jenkins4ba87db2019-05-23 17:11:51 +0100310TEST_SUITE(Dilation)
Jenkins36ccc902020-02-21 11:10:48 +0000311FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
Jenkins975dfe12019-09-02 11:47:54 +0100312 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
313 depth_multipliers),
314 framework::dataset::make("DataType",
315 DataType::F32)),
316 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
317 ActivationFunctionsDataset))
Jenkins4ba87db2019-05-23 17:11:51 +0100318{
319 validate(Accessor(_target), _reference, tolerance_f32);
320}
Jenkins0e205f72019-11-28 16:53:35 +0000321FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
Jenkins4ba87db2019-05-23 17:11:51 +0100322 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Jenkins975dfe12019-09-02 11:47:54 +0100323 large_depth_multipliers),
Jenkins4ba87db2019-05-23 17:11:51 +0100324 framework::dataset::make("DataType",
325 DataType::F32)),
326 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
327 ActivationFunctionsDataset))
328{
329 validate(Accessor(_target), _reference, tolerance_f32);
330}
331
332TEST_SUITE_END() // Dilation
Jenkins975dfe12019-09-02 11:47:54 +0100333TEST_SUITE_END() // W3x3
Jenkins4ba87db2019-05-23 17:11:51 +0100334
Jenkins975dfe12019-09-02 11:47:54 +0100335TEST_SUITE(Optimized)
Jenkins0e205f72019-11-28 16:53:35 +0000336FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
Jenkins4ba87db2019-05-23 17:11:51 +0100337 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
338 framework::dataset::make("DepthMultiplier", 1)),
339 framework::dataset::make("DataType",
340 DataType::F32)),
341 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
342 ActivationFunctionsDataset))
Jenkins514be652019-02-28 12:25:18 +0000343{
344 validate(Accessor(_target), _reference, tolerance_f32);
345}
Jenkins0e205f72019-11-28 16:53:35 +0000346FIXTURE_DATA_TEST_CASE(RunSmall5x5, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
Jenkins975dfe12019-09-02 11:47:54 +0100347 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
348 framework::dataset::make("DepthMultiplier", 1)),
349 framework::dataset::make("DataType",
350 DataType::F32)),
351 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
352 ActivationFunctionsDataset))
353{
354 validate(Accessor(_target), _reference, tolerance_f32);
355}
Jenkins0e205f72019-11-28 16:53:35 +0000356FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
Jenkins4ba87db2019-05-23 17:11:51 +0100357 combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
358 framework::dataset::make("DepthMultiplier", 1)),
359 framework::dataset::make("DataType",
360 DataType::F32)),
361 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
362 ActivationFunctionsDataset))
Anthony Barbier06ea0482018-02-22 15:45:35 +0000363{
364 validate(Accessor(_target), _reference, tolerance_f32);
365}
Jenkins975dfe12019-09-02 11:47:54 +0100366TEST_SUITE_END() // Optimized
Jenkinsb9abeae2018-11-22 11:58:08 +0000367TEST_SUITE_END() // F32
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000368
Jenkinsb9abeae2018-11-22 11:58:08 +0000369#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
370TEST_SUITE(F16)
Jenkins514be652019-02-28 12:25:18 +0000371TEST_SUITE(Generic)
Jenkins4ba87db2019-05-23 17:11:51 +0100372FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
Jenkins514be652019-02-28 12:25:18 +0000373 depth_multipliers),
374 framework::dataset::make("DataType",
375 DataType::F16)),
Jenkins4ba87db2019-05-23 17:11:51 +0100376 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
377 ActivationFunctionsDataset))
Jenkins514be652019-02-28 12:25:18 +0000378{
379 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
380}
Jenkins4ba87db2019-05-23 17:11:51 +0100381FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Jenkins975dfe12019-09-02 11:47:54 +0100382 large_depth_multipliers),
Jenkins514be652019-02-28 12:25:18 +0000383 framework::dataset::make("DataType",
384 DataType::F16)),
Jenkins4ba87db2019-05-23 17:11:51 +0100385 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
386 ActivationFunctionsDataset))
Jenkins514be652019-02-28 12:25:18 +0000387{
388 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
389}
Jenkins4ba87db2019-05-23 17:11:51 +0100390
391TEST_SUITE(Dilation)
Jenkins36ccc902020-02-21 11:10:48 +0000392FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
393 depth_multipliers),
394 framework::dataset::make("DataType",
395 DataType::F16)),
396 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
397 ActivationFunctionsDataset))
Jenkins4ba87db2019-05-23 17:11:51 +0100398{
399 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
400}
401FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Jenkins975dfe12019-09-02 11:47:54 +0100402 large_depth_multipliers),
Jenkins4ba87db2019-05-23 17:11:51 +0100403 framework::dataset::make("DataType",
404 DataType::F16)),
405 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
406 ActivationFunctionsDataset))
407{
408 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
409}
410TEST_SUITE_END() // Dilation
411
Jenkins514be652019-02-28 12:25:18 +0000412TEST_SUITE_END() // Generic
Jenkinsb9abeae2018-11-22 11:58:08 +0000413template <typename T>
Jenkins0e205f72019-11-28 16:53:35 +0000414using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Jenkins975dfe12019-09-02 11:47:54 +0100415TEST_SUITE(W3x3)
Jenkins36ccc902020-02-21 11:10:48 +0000416FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
417 depth_multipliers),
418 framework::dataset::make("DataType",
419 DataType::F16)),
420 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
421 ActivationFunctionsDataset))
Jenkinsb9abeae2018-11-22 11:58:08 +0000422{
423 validate(Accessor(_target), _reference, tolerance_f16);
424}
Jenkins0e205f72019-11-28 16:53:35 +0000425FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
Jenkins975dfe12019-09-02 11:47:54 +0100426 combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
427 large_depth_multipliers),
428 framework::dataset::make("DataType",
429 DataType::F16)),
430 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
431 ActivationFunctionsDataset))
Jenkinsb9abeae2018-11-22 11:58:08 +0000432{
433 validate(Accessor(_target), _reference, tolerance_f16);
434}
Jenkins4ba87db2019-05-23 17:11:51 +0100435
436TEST_SUITE(Dilation)
437
Jenkins36ccc902020-02-21 11:10:48 +0000438FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
Jenkins975dfe12019-09-02 11:47:54 +0100439 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
440 depth_multipliers),
441 framework::dataset::make("DataType",
442 DataType::F16)),
443 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
444 ActivationFunctionsDataset))
Jenkins4ba87db2019-05-23 17:11:51 +0100445{
446 validate(Accessor(_target), _reference, tolerance_f16);
447}
Jenkins0e205f72019-11-28 16:53:35 +0000448FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
Jenkins4ba87db2019-05-23 17:11:51 +0100449 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Jenkins975dfe12019-09-02 11:47:54 +0100450 large_depth_multipliers),
Jenkins4ba87db2019-05-23 17:11:51 +0100451 framework::dataset::make("DataType",
452 DataType::F16)),
453 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
454 ActivationFunctionsDataset))
455{
456 validate(Accessor(_target), _reference, tolerance_f16);
457}
458
459TEST_SUITE_END() // Dilation
Jenkins975dfe12019-09-02 11:47:54 +0100460TEST_SUITE_END() // W3x3
Jenkins4ba87db2019-05-23 17:11:51 +0100461
Jenkins975dfe12019-09-02 11:47:54 +0100462TEST_SUITE(Optimized)
Jenkins0e205f72019-11-28 16:53:35 +0000463FIXTURE_DATA_TEST_CASE(RunSmallW3x3, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
Jenkins4ba87db2019-05-23 17:11:51 +0100464 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
465 framework::dataset::make("DepthMultiplier", 1)),
466 framework::dataset::make("DataType",
467 DataType::F16)),
468 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
469 ActivationFunctionsDataset))
Jenkins514be652019-02-28 12:25:18 +0000470{
471 validate(Accessor(_target), _reference, tolerance_f16);
472}
Jenkins0e205f72019-11-28 16:53:35 +0000473FIXTURE_DATA_TEST_CASE(RunSmallW5x5, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
Jenkins975dfe12019-09-02 11:47:54 +0100474 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
475 framework::dataset::make("DepthMultiplier", 1)),
476 framework::dataset::make("DataType",
477 DataType::F16)),
478 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
479 ActivationFunctionsDataset))
480{
481 validate(Accessor(_target), _reference, tolerance_f16);
482}
Jenkins0e205f72019-11-28 16:53:35 +0000483FIXTURE_DATA_TEST_CASE(RunLargeW3x3, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
Jenkins4ba87db2019-05-23 17:11:51 +0100484 combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
485 framework::dataset::make("DepthMultiplier", 1)),
486 framework::dataset::make("DataType",
487 DataType::F16)),
488 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
489 ActivationFunctionsDataset))
Jenkinsb9abeae2018-11-22 11:58:08 +0000490{
491 validate(Accessor(_target), _reference, tolerance_f16);
492}
Jenkins975dfe12019-09-02 11:47:54 +0100493TEST_SUITE_END() // Optimized
Jenkinsb9abeae2018-11-22 11:58:08 +0000494TEST_SUITE_END() // FP16
495#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
496
497TEST_SUITE_END() // Float
Anthony Barbierf45d5a92018-01-24 16:23:15 +0000498
499template <typename T>
Jenkins0e205f72019-11-28 16:53:35 +0000500using NEDepthwiseConvolutionLayerQuantizedFixtureOptimized = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Anthony Barbier06ea0482018-02-22 15:45:35 +0000501template <typename T>
Jenkins0e205f72019-11-28 16:53:35 +0000502using NEDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
503using NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture = DepthwiseConvolutionLayerValidationQuantizedPerChannelFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, uint8_t, int8_t>;
Anthony Barbierf45d5a92018-01-24 16:23:15 +0000504
505TEST_SUITE(Quantized)
506TEST_SUITE(QASYMM8)
Anthony Barbier06ea0482018-02-22 15:45:35 +0000507TEST_SUITE(Generic)
Jenkinsb3a371b2018-05-23 11:36:53 +0100508FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Jenkins975dfe12019-09-02 11:47:54 +0100509 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
510 depth_multipliers),
511 framework::dataset::make("DataType", DataType::QASYMM8)),
Jenkins36ccc902020-02-21 11:10:48 +0000512 input_qinfo_dataset),
Jenkins975dfe12019-09-02 11:47:54 +0100513 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
Jenkins36ccc902020-02-21 11:10:48 +0000514 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Jenkins4ba87db2019-05-23 17:11:51 +0100515 ActivationFunctionsDataset))
Anthony Barbier06ea0482018-02-22 15:45:35 +0000516{
517 validate(Accessor(_target), _reference, tolerance_qasymm8);
518}
Jenkins4ba87db2019-05-23 17:11:51 +0100519
520TEST_SUITE(Dilation)
521FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Jenkins975dfe12019-09-02 11:47:54 +0100522 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
523 depth_multipliers),
524 framework::dataset::make("DataType", DataType::QASYMM8)),
Jenkins36ccc902020-02-21 11:10:48 +0000525 input_qinfo_dataset),
Jenkins975dfe12019-09-02 11:47:54 +0100526 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8f, 1) })),
Jenkins36ccc902020-02-21 11:10:48 +0000527 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Jenkins4ba87db2019-05-23 17:11:51 +0100528 ActivationFunctionsDataset))
529{
530 validate(Accessor(_target), _reference, tolerance_qasymm8);
531}
532FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
Jenkins975dfe12019-09-02 11:47:54 +0100533 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
534 large_depth_multipliers),
535 framework::dataset::make("DataType", DataType::QASYMM8)),
Jenkins36ccc902020-02-21 11:10:48 +0000536 input_qinfo_dataset),
Jenkins975dfe12019-09-02 11:47:54 +0100537 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
Jenkins36ccc902020-02-21 11:10:48 +0000538 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Jenkins4ba87db2019-05-23 17:11:51 +0100539 ActivationFunctionsDataset))
540{
541 validate(Accessor(_target), _reference, tolerance_qasymm8);
542}
Jenkins975dfe12019-09-02 11:47:54 +0100543TEST_SUITE_END() // Dilation
Jenkins514be652019-02-28 12:25:18 +0000544TEST_SUITE_END() // Generic
Anthony Barbierf45d5a92018-01-24 16:23:15 +0000545TEST_SUITE(W3x3)
Jenkins975dfe12019-09-02 11:47:54 +0100546FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
547 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers),
548 framework::dataset::make("DataType", DataType::QASYMM8)),
Jenkins36ccc902020-02-21 11:10:48 +0000549 input_qinfo_dataset),
Jenkins975dfe12019-09-02 11:47:54 +0100550 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Jenkins36ccc902020-02-21 11:10:48 +0000551 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Jenkins4ba87db2019-05-23 17:11:51 +0100552 ActivationFunctionsDataset))
Anthony Barbierf45d5a92018-01-24 16:23:15 +0000553{
554 validate(Accessor(_target), _reference, tolerance_qasymm8);
555}
Jenkins975dfe12019-09-02 11:47:54 +0100556FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
557 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
558 large_depth_multipliers),
559 framework::dataset::make("DataType", DataType::QASYMM8)),
Jenkins36ccc902020-02-21 11:10:48 +0000560 input_qinfo_dataset),
Jenkins975dfe12019-09-02 11:47:54 +0100561 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Jenkins36ccc902020-02-21 11:10:48 +0000562 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Jenkins4ba87db2019-05-23 17:11:51 +0100563 ActivationFunctionsDataset))
Anthony Barbierf45d5a92018-01-24 16:23:15 +0000564{
565 validate(Accessor(_target), _reference, tolerance_qasymm8);
566}
Jenkins4ba87db2019-05-23 17:11:51 +0100567
568TEST_SUITE(Dilation)
569
Jenkins975dfe12019-09-02 11:47:54 +0100570FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
571 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
572 framework::dataset::make("DataType", DataType::QASYMM8)),
Jenkins36ccc902020-02-21 11:10:48 +0000573 input_qinfo_dataset),
Jenkins975dfe12019-09-02 11:47:54 +0100574 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 10) })),
Jenkins36ccc902020-02-21 11:10:48 +0000575 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Jenkins4ba87db2019-05-23 17:11:51 +0100576 ActivationFunctionsDataset))
577{
578 validate(Accessor(_target), _reference, tolerance_qasymm8);
579}
Jenkins975dfe12019-09-02 11:47:54 +0100580FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
581 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
582 large_depth_multipliers),
583 framework::dataset::make("DataType", DataType::QASYMM8)),
Jenkins36ccc902020-02-21 11:10:48 +0000584 input_qinfo_dataset),
Jenkins975dfe12019-09-02 11:47:54 +0100585 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Jenkins36ccc902020-02-21 11:10:48 +0000586 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Jenkins4ba87db2019-05-23 17:11:51 +0100587 ActivationFunctionsDataset))
588{
589 validate(Accessor(_target), _reference, tolerance_qasymm8);
590}
591TEST_SUITE_END() // Dilation
Jenkins514be652019-02-28 12:25:18 +0000592TEST_SUITE_END() // W3x3
Jenkins975dfe12019-09-02 11:47:54 +0100593
594TEST_SUITE(Optimized)
595FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
596 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
597 framework::dataset::make("DepthMultiplier", 1)),
598 framework::dataset::make("DataType",
599 DataType::QASYMM8)),
Jenkins36ccc902020-02-21 11:10:48 +0000600 input_qinfo_dataset),
Jenkins975dfe12019-09-02 11:47:54 +0100601 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Jenkins36ccc902020-02-21 11:10:48 +0000602 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Jenkins975dfe12019-09-02 11:47:54 +0100603 ActivationFunctionsDataset))
604{
605 validate(Accessor(_target), _reference, tolerance_qasymm8);
606}
607FIXTURE_DATA_TEST_CASE(RunSmall5x5, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
608 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
609 framework::dataset::make("DepthMultiplier", 1)),
610 framework::dataset::make("DataType",
611 DataType::QASYMM8)),
Jenkins36ccc902020-02-21 11:10:48 +0000612 input_qinfo_dataset),
Jenkins975dfe12019-09-02 11:47:54 +0100613 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Jenkins36ccc902020-02-21 11:10:48 +0000614 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Jenkins975dfe12019-09-02 11:47:54 +0100615 ActivationFunctionsDataset))
616{
617 validate(Accessor(_target), _reference, tolerance_qasymm8);
618}
619FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
620 combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
621 framework::dataset::make("DepthMultiplier", 1)),
622 framework::dataset::make("DataType",
623 DataType::QASYMM8)),
Jenkins36ccc902020-02-21 11:10:48 +0000624 input_qinfo_dataset),
Jenkins975dfe12019-09-02 11:47:54 +0100625 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Jenkins36ccc902020-02-21 11:10:48 +0000626 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Jenkins975dfe12019-09-02 11:47:54 +0100627 ActivationFunctionsDataset))
628{
629 validate(Accessor(_target), _reference, tolerance_qasymm8);
630}
631TEST_SUITE_END() // Optimized
Jenkins514be652019-02-28 12:25:18 +0000632TEST_SUITE_END() // QASYMM8
Jenkins36ccc902020-02-21 11:10:48 +0000633
634TEST_SUITE(QASYMM8_SIGNED)
635TEST_SUITE(Generic)
636FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
637 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
638 depth_multipliers),
639 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
640 input_qinfo_dataset),
641 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
642 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
643 ActivationFunctionsDataset))
644{
645 validate(Accessor(_target), _reference, tolerance_qasymm8);
646}
647
648TEST_SUITE(Dilation)
649FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
650 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
651 depth_multipliers),
652 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
653 input_qinfo_dataset),
654 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8f, 1) })),
655 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
656 ActivationFunctionsDataset))
657{
658 validate(Accessor(_target), _reference, tolerance_qasymm8);
659}
660FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::NIGHTLY,
661 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
662 large_depth_multipliers),
663 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
664 input_qinfo_dataset),
665 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
666 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
667 ActivationFunctionsDataset))
668{
669 validate(Accessor(_target), _reference, tolerance_qasymm8);
670}
671TEST_SUITE_END() // Dilation
672TEST_SUITE_END() // Generic
673
674TEST_SUITE(W3x3)
675FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT,
676 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers),
677 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
678 input_qinfo_dataset),
679 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
680 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
681 ActivationFunctionsDataset))
682{
683 validate(Accessor(_target), _reference, tolerance_qasymm8);
684}
685FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::NIGHTLY,
686 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
687 large_depth_multipliers),
688 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
689 input_qinfo_dataset),
690 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
691 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
692 ActivationFunctionsDataset))
693{
694 validate(Accessor(_target), _reference, tolerance_qasymm8);
695}
696
697TEST_SUITE(Dilation)
698FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT,
699 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
700 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
701 input_qinfo_dataset),
702 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 10) })),
703 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
704 ActivationFunctionsDataset))
705{
706 validate(Accessor(_target), _reference, tolerance_qasymm8);
707}
708FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::NIGHTLY,
709 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
710 large_depth_multipliers),
711 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
712 input_qinfo_dataset),
713 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
714 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
715 ActivationFunctionsDataset))
716{
717 validate(Accessor(_target), _reference, tolerance_qasymm8);
718}
719TEST_SUITE_END() // Dilation
720TEST_SUITE_END() // W3x3
721
722TEST_SUITE(Optimized)
723FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT,
724 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
725 framework::dataset::make("DepthMultiplier", 1)),
726 framework::dataset::make("DataType",
727 DataType::QASYMM8_SIGNED)),
728 input_qinfo_dataset),
729 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
730 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
731 ActivationFunctionsDataset))
732{
733 validate(Accessor(_target), _reference, tolerance_qasymm8);
734}
735FIXTURE_DATA_TEST_CASE(RunSmall5x5, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT,
736 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
737 framework::dataset::make("DepthMultiplier", 1)),
738 framework::dataset::make("DataType",
739 DataType::QASYMM8_SIGNED)),
740 input_qinfo_dataset),
741 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
742 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
743 ActivationFunctionsDataset))
744{
745 validate(Accessor(_target), _reference, tolerance_qasymm8);
746}
747FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::NIGHTLY,
748 combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
749 framework::dataset::make("DepthMultiplier", 1)),
750 framework::dataset::make("DataType",
751 DataType::QASYMM8_SIGNED)),
752 input_qinfo_dataset),
753 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
754 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
755 ActivationFunctionsDataset))
756{
757 validate(Accessor(_target), _reference, tolerance_qasymm8);
758}
759TEST_SUITE_END() // Optimized
760TEST_SUITE_END() // QASYMM8_SIGNED
761
Jenkins0e205f72019-11-28 16:53:35 +0000762TEST_SUITE(QSYMM8_PER_CHANNEL)
763TEST_SUITE(Generic)
Jenkins36ccc902020-02-21 11:10:48 +0000764FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT,
Jenkins0e205f72019-11-28 16:53:35 +0000765 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
766 depth_multipliers),
767 framework::dataset::make("InputDataType", DataType::QASYMM8)),
768 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
Jenkins36ccc902020-02-21 11:10:48 +0000769 input_qinfo_dataset),
Jenkins0e205f72019-11-28 16:53:35 +0000770 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
771 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
772 ActivationFunctionsDataset))
773{
774 validate(Accessor(_target), _reference, tolerance_qasymm8);
775}
776
777TEST_SUITE(Dilation)
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::SmallDepthwiseDilatedConvolutionLayerDataset(),
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}
790FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY,
791 combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
792 depth_multipliers),
793 framework::dataset::make("InputDataType", DataType::QASYMM8)),
794 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
Jenkins36ccc902020-02-21 11:10:48 +0000795 input_qinfo_dataset),
Jenkins0e205f72019-11-28 16:53:35 +0000796 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
797 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
798 ActivationFunctionsDataset))
799{
800 validate(Accessor(_target), _reference, tolerance_qasymm8);
801}
802TEST_SUITE_END() // Dilation
803TEST_SUITE_END() // Generic
Jenkins36ccc902020-02-21 11:10:48 +0000804
805TEST_SUITE(Optimized)
806FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT,
807 combine(combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
808 framework::dataset::make("DepthMultiplier", 1)),
809 framework::dataset::make("InputDataType", DataType::QASYMM8)),
810 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
811 input_qinfo_dataset),
812 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
813 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
814 ActivationFunctionsDataset))
815{
816 validate(Accessor(_target), _reference, tolerance_qasymm8);
817}
818FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY,
819 combine(combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
820 framework::dataset::make("DepthMultiplier", 1)),
821 framework::dataset::make("InputDataType", DataType::QASYMM8)),
822 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
823 input_qinfo_dataset),
824 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
825 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
826 ActivationFunctionsDataset))
827{
828 validate(Accessor(_target), _reference, tolerance_qasymm8);
829}
830TEST_SUITE_END() // Optimized
Jenkins0e205f72019-11-28 16:53:35 +0000831TEST_SUITE_END() // QSYMM8_PER_CHANNEL
Jenkins514be652019-02-28 12:25:18 +0000832TEST_SUITE_END() // Quantized
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000833
Jenkins514be652019-02-28 12:25:18 +0000834TEST_SUITE_END() // DepthwiseConvLayer
835TEST_SUITE_END() // NEON
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000836} // namespace validation
837} // namespace test
838} // namespace arm_compute