blob: 37d2373d7bbd179f017fb9a552f710fcf897ced6 [file] [log] [blame]
Anthony Barbier8140e1e2017-12-14 23:48:46 +00001/*
Jenkins514be652019-02-28 12:25:18 +00002 * Copyright (c) 2017-2019 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});
Anthony Barbier8140e1e2017-12-14 23:48:46 +000065} // namespace
66
67TEST_SUITE(NEON)
Jenkins4ba87db2019-05-23 17:11:51 +010068TEST_SUITE(DepthwiseConvolutionLayer)
Anthony Barbier8140e1e2017-12-14 23:48:46 +000069
Jenkins52ba29e2018-08-29 15:32:11 +000070// *INDENT-OFF*
71// clang-format off
Jenkins4ba87db2019-05-23 17:11:51 +010072DATA_TEST_CASE(Validate3x3, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
Jenkins52ba29e2018-08-29 15:32:11 +000073 framework::dataset::make("InputInfo", { TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Mismatching data type input/weights
74 TensorInfo(TensorShape(32U, 18U, 3U), 1, DataType::F32), // Mismatching input feature maps
75 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Unsupported weights dimensions
76 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Mismatching depth multiplier
77 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::QASYMM8), // Invalid stride
78 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid biases size
79 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid biases dimensions
80 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid output size
Jenkins4ba87db2019-05-23 17:11:51 +010081 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // patch size bigger than input width
82 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // dilation < 1
Jenkins52ba29e2018-08-29 15:32:11 +000083 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),
84 }),
85 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16),
86 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
87 TensorInfo(TensorShape(5U, 5U, 2U, 2U), 1, DataType::F32),
88 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
89 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::QASYMM8),
90 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
91 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
92 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
93 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
Jenkins4ba87db2019-05-23 17:11:51 +010094 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
95 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
Jenkins52ba29e2018-08-29 15:32:11 +000096 })),
97 framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32),
98 TensorInfo(TensorShape(2U), 1, DataType::F32),
99 TensorInfo(TensorShape(2U), 1, DataType::F32),
100 TensorInfo(TensorShape(2U), 1, DataType::F32),
101 TensorInfo(TensorShape(2U), 1, DataType::S32),
102 TensorInfo(TensorShape(4U), 1, DataType::F32),
103 TensorInfo(TensorShape(2U, 2U), 1, DataType::F32),
104 TensorInfo(TensorShape(2U), 1, DataType::F32),
105 TensorInfo(TensorShape(2U), 1, DataType::F32),
Jenkins4ba87db2019-05-23 17:11:51 +0100106 TensorInfo(TensorShape(2U), 1, DataType::F32),
107 TensorInfo(TensorShape(2U), 1, DataType::F32),
Jenkins52ba29e2018-08-29 15:32:11 +0000108 })),
109 framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
110 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
111 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
112 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
113 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::QASYMM8),
114 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
115 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
116 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32),
117 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
Jenkins4ba87db2019-05-23 17:11:51 +0100118 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
119 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
Jenkins52ba29e2018-08-29 15:32:11 +0000120 })),
121 framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0),
122 PadStrideInfo(1, 1, 0, 0),
123 PadStrideInfo(1, 1, 0, 0),
124 PadStrideInfo(1, 1, 0, 0),
125 PadStrideInfo(4, 1, 0, 0),
126 PadStrideInfo(1, 1, 0, 0),
127 PadStrideInfo(1, 1, 0, 0),
128 PadStrideInfo(1, 1, 0, 0),
129 PadStrideInfo(1, 1, 0, 0),
Jenkins4ba87db2019-05-23 17:11:51 +0100130 PadStrideInfo(1, 1, 0, 0),
131 PadStrideInfo(1, 1, 0, 0),
Jenkins52ba29e2018-08-29 15:32:11 +0000132 })),
133 framework::dataset::make("DepthMultiplier", { 1,
134 1,
135 1,
136 3,
137 1,
138 1,
139 1,
140 1,
141 1,
Jenkins4ba87db2019-05-23 17:11:51 +0100142 1,
143 1,
Jenkins52ba29e2018-08-29 15:32:11 +0000144 })),
Jenkins4ba87db2019-05-23 17:11:51 +0100145 framework::dataset::make("Dilation", { Size2D(1U, 1U),
146 Size2D(1U, 1U),
147 Size2D(1U, 1U),
148 Size2D(1U, 1U),
149 Size2D(1U, 1U),
150 Size2D(1U, 1U),
151 Size2D(1U, 1U),
152 Size2D(1U, 1U),
153 Size2D(25U, 1U),
154 Size2D(0U, 1U),
155 Size2D(1U, 1U),
156 })),
157 framework::dataset::make("Expected", { false, false, false, false, false, false, false, false, false, false, true })),
158 input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier,dilation, expected)
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000159{
Jenkins0e205f72019-11-28 16:53:35 +0000160 bool is_valid = bool(NEDepthwiseConvolutionLayer::validate(&input_info.clone()->set_is_resizable(false),
Jenkins4ba87db2019-05-23 17:11:51 +0100161 &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 +0000162 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000163}
164
Jenkins4ba87db2019-05-23 17:11:51 +0100165DATA_TEST_CASE(ValidateGeneric, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
Jenkins0e205f72019-11-28 16:53:35 +0000166 framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type input/weights
167 TensorInfo(TensorShape(27U, 13U, 3U), 1, DataType::F32), // Mismatching input feature maps
168 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching depth multiplier
169 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases size
170 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases dimensions
171 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid output size
172 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // Patch size bigger than input width
173 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // Dilation < 1
174 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // Window shrinking
175 TensorInfo(TensorShape(32U, 13U, 8U), 1, DataType::QASYMM8), // Window shrinking
Jenkins52ba29e2018-08-29 15:32:11 +0000176 }),
177 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F16),
178 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
179 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
180 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
181 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
182 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
183 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
Jenkins4ba87db2019-05-23 17:11:51 +0100184 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
185 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
Jenkins52ba29e2018-08-29 15:32:11 +0000186 TensorInfo(TensorShape(3U, 3U, 24U), 1, DataType::QASYMM8),
187 })),
188 framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32),
189 TensorInfo(TensorShape(2U), 1, DataType::F32),
190 TensorInfo(TensorShape(2U), 1, DataType::F32),
191 TensorInfo(TensorShape(4U), 1, DataType::F32),
192 TensorInfo(TensorShape(2U, 2U), 1, DataType::F32),
193 TensorInfo(TensorShape(2U), 1, DataType::F32),
194 TensorInfo(TensorShape(16U), 1, DataType::F32),
Jenkins4ba87db2019-05-23 17:11:51 +0100195 TensorInfo(TensorShape(16U), 1, DataType::F32),
196 TensorInfo(TensorShape(16U), 1, DataType::F32),
Jenkins52ba29e2018-08-29 15:32:11 +0000197 TensorInfo(TensorShape(24U), 1, DataType::S32),
198 })),
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),
207 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
Jenkins52ba29e2018-08-29 15:32:11 +0000208 TensorInfo(TensorShape(32U, 11U, 24U), 1, DataType::QASYMM8),
209 })),
210 framework::dataset::make("ConvInfo", { 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),
215 PadStrideInfo(1, 1, 0, 0),
216 PadStrideInfo(1, 1, 0, 0),
Jenkins4ba87db2019-05-23 17:11:51 +0100217 PadStrideInfo(1, 1, 0, 0),
218 PadStrideInfo(1, 1, 0, 0),
Jenkins52ba29e2018-08-29 15:32:11 +0000219 PadStrideInfo(1, 1, 1, 0),
220 })),
221 framework::dataset::make("DepthMultiplier", { 1,
222 1,
223 3,
224 1,
225 1,
226 1,
227 2,
Jenkins4ba87db2019-05-23 17:11:51 +0100228 2,
229 2,
Jenkins52ba29e2018-08-29 15:32:11 +0000230 3,
231 })),
Jenkins4ba87db2019-05-23 17:11:51 +0100232 framework::dataset::make("Dilation", { Size2D(1U, 1U),
233 Size2D(1U, 1U),
234 Size2D(1U, 1U),
235 Size2D(1U, 1U),
236 Size2D(1U, 1U),
237 Size2D(1U, 1U),
238 Size2D(25U, 1U),
239 Size2D(0U, 1U),
240 Size2D(1U, 1U),
241 Size2D(1U, 1U),
242 })),
Jenkins0e205f72019-11-28 16:53:35 +0000243 framework::dataset::make("Expected", { false, false, false, false, false, false,false, false, false, false })),
Jenkins4ba87db2019-05-23 17:11:51 +0100244 input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier,dilation, expected)
Jenkins52ba29e2018-08-29 15:32:11 +0000245{
Jenkins4ba87db2019-05-23 17:11:51 +0100246 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 +0000247 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
248}
249// clang-format on
250// *INDENT-ON*
Jenkins0e205f72019-11-28 16:53:35 +0000251template <typename T>
252using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Jenkins52ba29e2018-08-29 15:32:11 +0000253
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000254TEST_SUITE(Float)
255TEST_SUITE(F32)
256TEST_SUITE(Generic)
Jenkins4ba87db2019-05-23 17:11:51 +0100257FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
Jenkinsb3a371b2018-05-23 11:36:53 +0100258 depth_multipliers),
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000259 framework::dataset::make("DataType",
Jenkinsb3a371b2018-05-23 11:36:53 +0100260 DataType::F32)),
Jenkins4ba87db2019-05-23 17:11:51 +0100261 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
262 ActivationFunctionsDataset))
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000263{
264 validate(Accessor(_target), _reference, tolerance_f32);
265}
Jenkins4ba87db2019-05-23 17:11:51 +0100266FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Jenkins975dfe12019-09-02 11:47:54 +0100267 large_depth_multipliers),
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000268 framework::dataset::make("DataType",
Jenkinsb3a371b2018-05-23 11:36:53 +0100269 DataType::F32)),
Jenkins4ba87db2019-05-23 17:11:51 +0100270 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
271 ActivationFunctionsDataset))
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000272{
273 validate(Accessor(_target), _reference, tolerance_f32);
274}
Jenkins4ba87db2019-05-23 17:11:51 +0100275
276TEST_SUITE(Dilation)
277FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
278 depth_multipliers),
279 framework::dataset::make("DataType",
280 DataType::F32)),
281 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
282 ActivationFunctionsDataset))
283{
284 validate(Accessor(_target), _reference, tolerance_f32);
285}
286FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Jenkins975dfe12019-09-02 11:47:54 +0100287 large_depth_multipliers),
Jenkins4ba87db2019-05-23 17:11:51 +0100288 framework::dataset::make("DataType",
289 DataType::F32)),
290 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
291 ActivationFunctionsDataset))
292{
293 validate(Accessor(_target), _reference, tolerance_f32);
294}
295TEST_SUITE_END() // Dilation
Jenkinsb9abeae2018-11-22 11:58:08 +0000296TEST_SUITE_END() // Generic
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000297
Jenkins975dfe12019-09-02 11:47:54 +0100298TEST_SUITE(W3x3)
Jenkins0e205f72019-11-28 16:53:35 +0000299FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
300 depth_multipliers),
301 framework::dataset::make("DataType",
302 DataType::F32)),
303 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
304 ActivationFunctionsDataset))
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000305{
306 validate(Accessor(_target), _reference, tolerance_f32);
307}
Jenkins0e205f72019-11-28 16:53:35 +0000308FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
Jenkins975dfe12019-09-02 11:47:54 +0100309 combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
310 large_depth_multipliers),
311 framework::dataset::make("DataType",
312 DataType::F32)),
313 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
314 ActivationFunctionsDataset))
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000315{
316 validate(Accessor(_target), _reference, tolerance_f32);
317}
Jenkins4ba87db2019-05-23 17:11:51 +0100318TEST_SUITE(Dilation)
Jenkins0e205f72019-11-28 16:53:35 +0000319FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL,
Jenkins975dfe12019-09-02 11:47:54 +0100320 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
321 depth_multipliers),
322 framework::dataset::make("DataType",
323 DataType::F32)),
324 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
325 ActivationFunctionsDataset))
Jenkins4ba87db2019-05-23 17:11:51 +0100326{
327 validate(Accessor(_target), _reference, tolerance_f32);
328}
Jenkins0e205f72019-11-28 16:53:35 +0000329FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
Jenkins4ba87db2019-05-23 17:11:51 +0100330 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Jenkins975dfe12019-09-02 11:47:54 +0100331 large_depth_multipliers),
Jenkins4ba87db2019-05-23 17:11:51 +0100332 framework::dataset::make("DataType",
333 DataType::F32)),
334 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
335 ActivationFunctionsDataset))
336{
337 validate(Accessor(_target), _reference, tolerance_f32);
338}
339
340TEST_SUITE_END() // Dilation
Jenkins975dfe12019-09-02 11:47:54 +0100341TEST_SUITE_END() // W3x3
Jenkins4ba87db2019-05-23 17:11:51 +0100342
Jenkins975dfe12019-09-02 11:47:54 +0100343TEST_SUITE(Optimized)
Jenkins0e205f72019-11-28 16:53:35 +0000344FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
Jenkins4ba87db2019-05-23 17:11:51 +0100345 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
346 framework::dataset::make("DepthMultiplier", 1)),
347 framework::dataset::make("DataType",
348 DataType::F32)),
349 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
350 ActivationFunctionsDataset))
Jenkins514be652019-02-28 12:25:18 +0000351{
352 validate(Accessor(_target), _reference, tolerance_f32);
353}
Jenkins0e205f72019-11-28 16:53:35 +0000354FIXTURE_DATA_TEST_CASE(RunSmall5x5, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
Jenkins975dfe12019-09-02 11:47:54 +0100355 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
356 framework::dataset::make("DepthMultiplier", 1)),
357 framework::dataset::make("DataType",
358 DataType::F32)),
359 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
360 ActivationFunctionsDataset))
361{
362 validate(Accessor(_target), _reference, tolerance_f32);
363}
Jenkins0e205f72019-11-28 16:53:35 +0000364FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
Jenkins4ba87db2019-05-23 17:11:51 +0100365 combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
366 framework::dataset::make("DepthMultiplier", 1)),
367 framework::dataset::make("DataType",
368 DataType::F32)),
369 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
370 ActivationFunctionsDataset))
Anthony Barbier06ea0482018-02-22 15:45:35 +0000371{
372 validate(Accessor(_target), _reference, tolerance_f32);
373}
Jenkins975dfe12019-09-02 11:47:54 +0100374TEST_SUITE_END() // Optimized
Jenkinsb9abeae2018-11-22 11:58:08 +0000375TEST_SUITE_END() // F32
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000376
Jenkinsb9abeae2018-11-22 11:58:08 +0000377#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
378TEST_SUITE(F16)
Jenkins514be652019-02-28 12:25:18 +0000379TEST_SUITE(Generic)
Jenkins4ba87db2019-05-23 17:11:51 +0100380FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
Jenkins514be652019-02-28 12:25:18 +0000381 depth_multipliers),
382 framework::dataset::make("DataType",
383 DataType::F16)),
Jenkins4ba87db2019-05-23 17:11:51 +0100384 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
385 ActivationFunctionsDataset))
Jenkins514be652019-02-28 12:25:18 +0000386{
387 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
388}
Jenkins4ba87db2019-05-23 17:11:51 +0100389FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Jenkins975dfe12019-09-02 11:47:54 +0100390 large_depth_multipliers),
Jenkins514be652019-02-28 12:25:18 +0000391 framework::dataset::make("DataType",
392 DataType::F16)),
Jenkins4ba87db2019-05-23 17:11:51 +0100393 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
394 ActivationFunctionsDataset))
Jenkins514be652019-02-28 12:25:18 +0000395{
396 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
397}
Jenkins4ba87db2019-05-23 17:11:51 +0100398
399TEST_SUITE(Dilation)
400FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
401 depth_multipliers),
402 framework::dataset::make("DataType",
403 DataType::F16)),
404 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
405 ActivationFunctionsDataset))
406{
407 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
408}
409FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Jenkins975dfe12019-09-02 11:47:54 +0100410 large_depth_multipliers),
Jenkins4ba87db2019-05-23 17:11:51 +0100411 framework::dataset::make("DataType",
412 DataType::F16)),
413 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
414 ActivationFunctionsDataset))
415{
416 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
417}
418TEST_SUITE_END() // Dilation
419
Jenkins514be652019-02-28 12:25:18 +0000420TEST_SUITE_END() // Generic
Jenkinsb9abeae2018-11-22 11:58:08 +0000421template <typename T>
Jenkins0e205f72019-11-28 16:53:35 +0000422using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Jenkins975dfe12019-09-02 11:47:54 +0100423TEST_SUITE(W3x3)
Jenkins0e205f72019-11-28 16:53:35 +0000424FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
425 depth_multipliers),
426 framework::dataset::make("DataType",
427 DataType::F16)),
428 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
429 ActivationFunctionsDataset))
Jenkinsb9abeae2018-11-22 11:58:08 +0000430{
431 validate(Accessor(_target), _reference, tolerance_f16);
432}
Jenkins0e205f72019-11-28 16:53:35 +0000433FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
Jenkins975dfe12019-09-02 11:47:54 +0100434 combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
435 large_depth_multipliers),
436 framework::dataset::make("DataType",
437 DataType::F16)),
438 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
439 ActivationFunctionsDataset))
Jenkinsb9abeae2018-11-22 11:58:08 +0000440{
441 validate(Accessor(_target), _reference, tolerance_f16);
442}
Jenkins4ba87db2019-05-23 17:11:51 +0100443
444TEST_SUITE(Dilation)
445
Jenkins0e205f72019-11-28 16:53:35 +0000446FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL,
Jenkins975dfe12019-09-02 11:47:54 +0100447 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
448 depth_multipliers),
449 framework::dataset::make("DataType",
450 DataType::F16)),
451 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
452 ActivationFunctionsDataset))
Jenkins4ba87db2019-05-23 17:11:51 +0100453{
454 validate(Accessor(_target), _reference, tolerance_f16);
455}
Jenkins0e205f72019-11-28 16:53:35 +0000456FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
Jenkins4ba87db2019-05-23 17:11:51 +0100457 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Jenkins975dfe12019-09-02 11:47:54 +0100458 large_depth_multipliers),
Jenkins4ba87db2019-05-23 17:11:51 +0100459 framework::dataset::make("DataType",
460 DataType::F16)),
461 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
462 ActivationFunctionsDataset))
463{
464 validate(Accessor(_target), _reference, tolerance_f16);
465}
466
467TEST_SUITE_END() // Dilation
Jenkins975dfe12019-09-02 11:47:54 +0100468TEST_SUITE_END() // W3x3
Jenkins4ba87db2019-05-23 17:11:51 +0100469
Jenkins975dfe12019-09-02 11:47:54 +0100470TEST_SUITE(Optimized)
Jenkins0e205f72019-11-28 16:53:35 +0000471FIXTURE_DATA_TEST_CASE(RunSmallW3x3, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
Jenkins4ba87db2019-05-23 17:11:51 +0100472 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
473 framework::dataset::make("DepthMultiplier", 1)),
474 framework::dataset::make("DataType",
475 DataType::F16)),
476 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
477 ActivationFunctionsDataset))
Jenkins514be652019-02-28 12:25:18 +0000478{
479 validate(Accessor(_target), _reference, tolerance_f16);
480}
Jenkins0e205f72019-11-28 16:53:35 +0000481FIXTURE_DATA_TEST_CASE(RunSmallW5x5, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
Jenkins975dfe12019-09-02 11:47:54 +0100482 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
483 framework::dataset::make("DepthMultiplier", 1)),
484 framework::dataset::make("DataType",
485 DataType::F16)),
486 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
487 ActivationFunctionsDataset))
488{
489 validate(Accessor(_target), _reference, tolerance_f16);
490}
Jenkins0e205f72019-11-28 16:53:35 +0000491FIXTURE_DATA_TEST_CASE(RunLargeW3x3, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
Jenkins4ba87db2019-05-23 17:11:51 +0100492 combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
493 framework::dataset::make("DepthMultiplier", 1)),
494 framework::dataset::make("DataType",
495 DataType::F16)),
496 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
497 ActivationFunctionsDataset))
Jenkinsb9abeae2018-11-22 11:58:08 +0000498{
499 validate(Accessor(_target), _reference, tolerance_f16);
500}
Jenkins975dfe12019-09-02 11:47:54 +0100501TEST_SUITE_END() // Optimized
Jenkinsb9abeae2018-11-22 11:58:08 +0000502TEST_SUITE_END() // FP16
503#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
504
505TEST_SUITE_END() // Float
Anthony Barbierf45d5a92018-01-24 16:23:15 +0000506
507template <typename T>
Jenkins0e205f72019-11-28 16:53:35 +0000508using NEDepthwiseConvolutionLayerQuantizedFixtureOptimized = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Anthony Barbier06ea0482018-02-22 15:45:35 +0000509template <typename T>
Jenkins0e205f72019-11-28 16:53:35 +0000510using NEDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
511using NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture = DepthwiseConvolutionLayerValidationQuantizedPerChannelFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, uint8_t, int8_t>;
Anthony Barbierf45d5a92018-01-24 16:23:15 +0000512
513TEST_SUITE(Quantized)
514TEST_SUITE(QASYMM8)
Anthony Barbier06ea0482018-02-22 15:45:35 +0000515TEST_SUITE(Generic)
Jenkinsb3a371b2018-05-23 11:36:53 +0100516FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Jenkins975dfe12019-09-02 11:47:54 +0100517 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
518 depth_multipliers),
519 framework::dataset::make("DataType", DataType::QASYMM8)),
520 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
521 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
Jenkins4ba87db2019-05-23 17:11:51 +0100522 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
523 ActivationFunctionsDataset))
Anthony Barbier06ea0482018-02-22 15:45:35 +0000524{
525 validate(Accessor(_target), _reference, tolerance_qasymm8);
526}
Jenkins4ba87db2019-05-23 17:11:51 +0100527
528TEST_SUITE(Dilation)
529FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Jenkins975dfe12019-09-02 11:47:54 +0100530 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
531 depth_multipliers),
532 framework::dataset::make("DataType", DataType::QASYMM8)),
533 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
534 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8f, 1) })),
Jenkins4ba87db2019-05-23 17:11:51 +0100535 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
536 ActivationFunctionsDataset))
537{
538 validate(Accessor(_target), _reference, tolerance_qasymm8);
539}
540FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
Jenkins975dfe12019-09-02 11:47:54 +0100541 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
542 large_depth_multipliers),
543 framework::dataset::make("DataType", DataType::QASYMM8)),
544 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
545 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
Jenkins4ba87db2019-05-23 17:11:51 +0100546 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
547 ActivationFunctionsDataset))
548{
549 validate(Accessor(_target), _reference, tolerance_qasymm8);
550}
Jenkins975dfe12019-09-02 11:47:54 +0100551TEST_SUITE_END() // Dilation
Jenkins514be652019-02-28 12:25:18 +0000552TEST_SUITE_END() // Generic
Anthony Barbierf45d5a92018-01-24 16:23:15 +0000553TEST_SUITE(W3x3)
Jenkins975dfe12019-09-02 11:47:54 +0100554FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
555 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers),
556 framework::dataset::make("DataType", DataType::QASYMM8)),
557 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
558 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Jenkins4ba87db2019-05-23 17:11:51 +0100559 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
560 ActivationFunctionsDataset))
Anthony Barbierf45d5a92018-01-24 16:23:15 +0000561{
562 validate(Accessor(_target), _reference, tolerance_qasymm8);
563}
Jenkins975dfe12019-09-02 11:47:54 +0100564FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
565 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
566 large_depth_multipliers),
567 framework::dataset::make("DataType", DataType::QASYMM8)),
568 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
569 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Jenkins4ba87db2019-05-23 17:11:51 +0100570 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
571 ActivationFunctionsDataset))
Anthony Barbierf45d5a92018-01-24 16:23:15 +0000572{
573 validate(Accessor(_target), _reference, tolerance_qasymm8);
574}
Jenkins4ba87db2019-05-23 17:11:51 +0100575
576TEST_SUITE(Dilation)
577
Jenkins975dfe12019-09-02 11:47:54 +0100578FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
579 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
580 framework::dataset::make("DataType", DataType::QASYMM8)),
581 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
582 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 10) })),
Jenkins4ba87db2019-05-23 17:11:51 +0100583 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
584 ActivationFunctionsDataset))
585{
586 validate(Accessor(_target), _reference, tolerance_qasymm8);
587}
Jenkins975dfe12019-09-02 11:47:54 +0100588FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
589 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
590 large_depth_multipliers),
591 framework::dataset::make("DataType", DataType::QASYMM8)),
592 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
593 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Jenkins4ba87db2019-05-23 17:11:51 +0100594 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
595 ActivationFunctionsDataset))
596{
597 validate(Accessor(_target), _reference, tolerance_qasymm8);
598}
599TEST_SUITE_END() // Dilation
Jenkins514be652019-02-28 12:25:18 +0000600TEST_SUITE_END() // W3x3
Jenkins975dfe12019-09-02 11:47:54 +0100601
602TEST_SUITE(Optimized)
603FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
604 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
605 framework::dataset::make("DepthMultiplier", 1)),
606 framework::dataset::make("DataType",
607 DataType::QASYMM8)),
608 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
609 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
610 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
611 ActivationFunctionsDataset))
612{
613 validate(Accessor(_target), _reference, tolerance_qasymm8);
614}
615FIXTURE_DATA_TEST_CASE(RunSmall5x5, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
616 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
617 framework::dataset::make("DepthMultiplier", 1)),
618 framework::dataset::make("DataType",
619 DataType::QASYMM8)),
620 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
621 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
622 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
623 ActivationFunctionsDataset))
624{
625 validate(Accessor(_target), _reference, tolerance_qasymm8);
626}
627FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
628 combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
629 framework::dataset::make("DepthMultiplier", 1)),
630 framework::dataset::make("DataType",
631 DataType::QASYMM8)),
632 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
633 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
634 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
635 ActivationFunctionsDataset))
636{
637 validate(Accessor(_target), _reference, tolerance_qasymm8);
638}
639TEST_SUITE_END() // Optimized
Jenkins514be652019-02-28 12:25:18 +0000640TEST_SUITE_END() // QASYMM8
Jenkins0e205f72019-11-28 16:53:35 +0000641TEST_SUITE(QSYMM8_PER_CHANNEL)
642TEST_SUITE(Generic)
643FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::ALL,
644 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
645 depth_multipliers),
646 framework::dataset::make("InputDataType", DataType::QASYMM8)),
647 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
648 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
649 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
650 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
651 ActivationFunctionsDataset))
652{
653 validate(Accessor(_target), _reference, tolerance_qasymm8);
654}
655
656TEST_SUITE(Dilation)
657FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::ALL,
658 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
659 depth_multipliers),
660 framework::dataset::make("InputDataType", DataType::QASYMM8)),
661 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
662 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
663 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
664 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
665 ActivationFunctionsDataset))
666{
667 validate(Accessor(_target), _reference, tolerance_qasymm8);
668}
669FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY,
670 combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
671 depth_multipliers),
672 framework::dataset::make("InputDataType", DataType::QASYMM8)),
673 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
674 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
675 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
676 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
677 ActivationFunctionsDataset))
678{
679 validate(Accessor(_target), _reference, tolerance_qasymm8);
680}
681TEST_SUITE_END() // Dilation
682TEST_SUITE_END() // Generic
683TEST_SUITE_END() // QSYMM8_PER_CHANNEL
Jenkins514be652019-02-28 12:25:18 +0000684TEST_SUITE_END() // Quantized
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000685
Jenkins514be652019-02-28 12:25:18 +0000686TEST_SUITE_END() // DepthwiseConvLayer
687TEST_SUITE_END() // NEON
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000688} // namespace validation
689} // namespace test
690} // namespace arm_compute