blob: 6c0f590241e00b6115f1f2533ded4ba1de5f7464 [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"
32#include "tests/framework/Asserts.h"
33#include "tests/framework/Macros.h"
34#include "tests/framework/datasets/Datasets.h"
35#include "tests/validation/Validation.h"
36#include "tests/validation/fixtures/DepthwiseConvolutionLayerFixture.h"
37
38namespace arm_compute
39{
40namespace test
41{
42namespace validation
43{
Jenkinsb3a371b2018-05-23 11:36:53 +010044using namespace arm_compute::misc::shape_calculator;
45
Anthony Barbier8140e1e2017-12-14 23:48:46 +000046namespace
47{
Jenkins514be652019-02-28 12:25:18 +000048constexpr RelativeTolerance<float> tolerance_f32(0.01f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F32 */
49constexpr AbsoluteTolerance<uint8_t> tolerance_qasymm8(1); /**< Tolerance value for comparing reference's output against implementation's output for DataType::QASYMM8 */
50#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
51RelativeTolerance<half_float::half> tolerance_f16(half_float::half(0.01)); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F16 */
52constexpr float tolerance_num = 0.05f; /**< Tolerance number */
53#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
Jenkinsb3a371b2018-05-23 11:36:53 +010054
55const auto depth_multipliers = framework::dataset::make("DepthMultiplier", { 1, 2, 3 });
Anthony Barbier8140e1e2017-12-14 23:48:46 +000056} // namespace
57
58TEST_SUITE(NEON)
Anthony Barbierf45d5a92018-01-24 16:23:15 +000059TEST_SUITE(DepthwiseConvLayer)
Anthony Barbier8140e1e2017-12-14 23:48:46 +000060
Jenkins52ba29e2018-08-29 15:32:11 +000061// *INDENT-OFF*
62// clang-format off
63DATA_TEST_CASE(Validate3x3, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(
64 framework::dataset::make("InputInfo", { TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Mismatching data type input/weights
65 TensorInfo(TensorShape(32U, 18U, 3U), 1, DataType::F32), // Mismatching input feature maps
66 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Unsupported weights dimensions
67 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Mismatching depth multiplier
68 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::QASYMM8), // Invalid stride
69 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid biases size
70 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid biases dimensions
71 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid output size
72 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),
73 }),
74 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16),
75 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
76 TensorInfo(TensorShape(5U, 5U, 2U, 2U), 1, DataType::F32),
77 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
78 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::QASYMM8),
79 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
80 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
81 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
82 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
83 })),
84 framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32),
85 TensorInfo(TensorShape(2U), 1, DataType::F32),
86 TensorInfo(TensorShape(2U), 1, DataType::F32),
87 TensorInfo(TensorShape(2U), 1, DataType::F32),
88 TensorInfo(TensorShape(2U), 1, DataType::S32),
89 TensorInfo(TensorShape(4U), 1, DataType::F32),
90 TensorInfo(TensorShape(2U, 2U), 1, DataType::F32),
91 TensorInfo(TensorShape(2U), 1, DataType::F32),
92 TensorInfo(TensorShape(2U), 1, DataType::F32),
93 })),
94 framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
95 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
96 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
97 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
98 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::QASYMM8),
99 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
100 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
101 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32),
102 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
103 })),
104 framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0),
105 PadStrideInfo(1, 1, 0, 0),
106 PadStrideInfo(1, 1, 0, 0),
107 PadStrideInfo(1, 1, 0, 0),
108 PadStrideInfo(4, 1, 0, 0),
109 PadStrideInfo(1, 1, 0, 0),
110 PadStrideInfo(1, 1, 0, 0),
111 PadStrideInfo(1, 1, 0, 0),
112 PadStrideInfo(1, 1, 0, 0),
113 })),
114 framework::dataset::make("DepthMultiplier", { 1,
115 1,
116 1,
117 3,
118 1,
119 1,
120 1,
121 1,
122 1,
123 })),
124 framework::dataset::make("Expected", { false, false, false, false, false, false, false, false, true })),
125 input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier, expected)
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000126{
Jenkins52ba29e2018-08-29 15:32:11 +0000127 bool is_valid = bool(NEDepthwiseConvolutionLayer3x3::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));
128 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000129}
130
Jenkins52ba29e2018-08-29 15:32:11 +0000131DATA_TEST_CASE(ValidateGeneric, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(
132 framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type input/weights
133 TensorInfo(TensorShape(27U, 13U, 3U), 1, DataType::F32), // Mismatching input feature maps
134 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching depth multiplier
135 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases size
136 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases dimensions
137 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid output size
138 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32),
139 TensorInfo(TensorShape(32U, 13U, 8U), 1, DataType::QASYMM8),
140 }),
141 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F16),
142 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
143 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
144 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
145 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
146 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
147 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
148 TensorInfo(TensorShape(3U, 3U, 24U), 1, DataType::QASYMM8),
149 })),
150 framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32),
151 TensorInfo(TensorShape(2U), 1, DataType::F32),
152 TensorInfo(TensorShape(2U), 1, DataType::F32),
153 TensorInfo(TensorShape(4U), 1, DataType::F32),
154 TensorInfo(TensorShape(2U, 2U), 1, DataType::F32),
155 TensorInfo(TensorShape(2U), 1, DataType::F32),
156 TensorInfo(TensorShape(16U), 1, DataType::F32),
157 TensorInfo(TensorShape(24U), 1, DataType::S32),
158 })),
159 framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
160 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
161 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
162 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
163 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
164 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),
165 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
166 TensorInfo(TensorShape(32U, 11U, 24U), 1, DataType::QASYMM8),
167 })),
168 framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0),
169 PadStrideInfo(1, 1, 0, 0),
170 PadStrideInfo(1, 1, 0, 0),
171 PadStrideInfo(1, 1, 0, 0),
172 PadStrideInfo(1, 1, 0, 0),
173 PadStrideInfo(1, 1, 0, 0),
174 PadStrideInfo(1, 1, 0, 0),
175 PadStrideInfo(1, 1, 1, 0),
176 })),
177 framework::dataset::make("DepthMultiplier", { 1,
178 1,
179 3,
180 1,
181 1,
182 1,
183 2,
184 3,
185 })),
186 framework::dataset::make("Expected", { false, false, false, false, false, false, true, true })),
187 input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier, expected)
188{
189 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));
190 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
191}
192// clang-format on
193// *INDENT-ON*
194
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000195TEST_SUITE(Float)
196TEST_SUITE(F32)
197TEST_SUITE(Generic)
198template <typename T>
199using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Jenkinsb3a371b2018-05-23 11:36:53 +0100200FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
201 depth_multipliers),
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000202 framework::dataset::make("DataType",
Jenkinsb3a371b2018-05-23 11:36:53 +0100203 DataType::F32)),
Jenkins52ba29e2018-08-29 15:32:11 +0000204 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000205{
206 validate(Accessor(_target), _reference, tolerance_f32);
207}
Jenkinsb3a371b2018-05-23 11:36:53 +0100208FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
209 depth_multipliers),
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000210 framework::dataset::make("DataType",
Jenkinsb3a371b2018-05-23 11:36:53 +0100211 DataType::F32)),
Jenkins52ba29e2018-08-29 15:32:11 +0000212 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000213{
214 validate(Accessor(_target), _reference, tolerance_f32);
215}
Jenkinsb9abeae2018-11-22 11:58:08 +0000216TEST_SUITE_END() // Generic
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000217
218TEST_SUITE(W3x3)
219template <typename T>
220using NEDepthwiseConvolutionLayerFixture3x3 = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer3x3, T>;
Jenkinsb3a371b2018-05-23 11:36:53 +0100221FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::ALL, combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
222 depth_multipliers),
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000223 framework::dataset::make("DataType",
Jenkinsb3a371b2018-05-23 11:36:53 +0100224 DataType::F32)),
Jenkins52ba29e2018-08-29 15:32:11 +0000225 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000226{
227 validate(Accessor(_target), _reference, tolerance_f32);
228}
Jenkinsb3a371b2018-05-23 11:36:53 +0100229FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
230 depth_multipliers),
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000231 framework::dataset::make("DataType",
Jenkinsb3a371b2018-05-23 11:36:53 +0100232 DataType::F32)),
Jenkins52ba29e2018-08-29 15:32:11 +0000233 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000234{
235 validate(Accessor(_target), _reference, tolerance_f32);
236}
Jenkins514be652019-02-28 12:25:18 +0000237FIXTURE_DATA_TEST_CASE(RunOptimizedSmall, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::PRECOMMIT,
238 combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
239 framework::dataset::make("DepthMultiplier", 1)),
240 framework::dataset::make("DataType",
241 DataType::F32)),
242 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
243{
244 validate(Accessor(_target), _reference, tolerance_f32);
245}
246FIXTURE_DATA_TEST_CASE(RunOptimizedLarge, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::NIGHTLY,
247 combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
248 framework::dataset::make("DepthMultiplier", 1)),
249 framework::dataset::make("DataType",
250 DataType::F32)),
251 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Anthony Barbier06ea0482018-02-22 15:45:35 +0000252{
253 validate(Accessor(_target), _reference, tolerance_f32);
254}
Jenkinsb9abeae2018-11-22 11:58:08 +0000255TEST_SUITE_END() // W3x3
256TEST_SUITE_END() // F32
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000257
Jenkinsb9abeae2018-11-22 11:58:08 +0000258#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
259TEST_SUITE(F16)
Jenkins514be652019-02-28 12:25:18 +0000260TEST_SUITE(Generic)
261template <typename T>
262using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
263FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
264 depth_multipliers),
265 framework::dataset::make("DataType",
266 DataType::F16)),
267 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
268{
269 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
270}
271FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
272 depth_multipliers),
273 framework::dataset::make("DataType",
274 DataType::F16)),
275 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
276{
277 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
278}
279TEST_SUITE_END() // Generic
Jenkinsb9abeae2018-11-22 11:58:08 +0000280TEST_SUITE(W3x3)
281template <typename T>
282using NEDepthwiseConvolutionLayerFixture3x3 = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer3x3, T>;
283FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::ALL, combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
284 depth_multipliers),
285 framework::dataset::make("DataType",
286 DataType::F16)),
287 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
288{
289 validate(Accessor(_target), _reference, tolerance_f16);
290}
291FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
292 depth_multipliers),
293 framework::dataset::make("DataType",
294 DataType::F16)),
295 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
296{
297 validate(Accessor(_target), _reference, tolerance_f16);
298}
Jenkins514be652019-02-28 12:25:18 +0000299FIXTURE_DATA_TEST_CASE(RunOptimizedSmall, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::PRECOMMIT,
300 combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
301 framework::dataset::make("DepthMultiplier", 1)),
302 framework::dataset::make("DataType",
303 DataType::F16)),
304 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
305{
306 validate(Accessor(_target), _reference, tolerance_f16);
307}
308FIXTURE_DATA_TEST_CASE(RunOptimizedLarge, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::NIGHTLY,
309 combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
310 framework::dataset::make("DepthMultiplier", 1)),
311 framework::dataset::make("DataType",
312 DataType::F16)),
313 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Jenkinsb9abeae2018-11-22 11:58:08 +0000314{
315 validate(Accessor(_target), _reference, tolerance_f16);
316}
317TEST_SUITE_END() // W3x3
318TEST_SUITE_END() // FP16
319#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
320
321TEST_SUITE_END() // Float
Anthony Barbierf45d5a92018-01-24 16:23:15 +0000322
323template <typename T>
324using NEDepthwiseConvolutionLayerQuantizedFixture3x3 = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer3x3, T>;
Anthony Barbier06ea0482018-02-22 15:45:35 +0000325template <typename T>
326using NEDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Anthony Barbierf45d5a92018-01-24 16:23:15 +0000327
328TEST_SUITE(Quantized)
329TEST_SUITE(QASYMM8)
Anthony Barbier06ea0482018-02-22 15:45:35 +0000330TEST_SUITE(Generic)
Jenkinsb3a371b2018-05-23 11:36:53 +0100331FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
332 combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
333 depth_multipliers),
334 framework::dataset::make("DataType", DataType::QASYMM8)),
335 framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Jenkins52ba29e2018-08-29 15:32:11 +0000336 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Anthony Barbier06ea0482018-02-22 15:45:35 +0000337{
338 validate(Accessor(_target), _reference, tolerance_qasymm8);
339}
Jenkins514be652019-02-28 12:25:18 +0000340TEST_SUITE_END() // Generic
Anthony Barbierf45d5a92018-01-24 16:23:15 +0000341TEST_SUITE(W3x3)
Jenkinsb3a371b2018-05-23 11:36:53 +0100342FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::PRECOMMIT,
343 combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers),
344 framework::dataset::make("DataType", DataType::QASYMM8)),
345 framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Jenkins52ba29e2018-08-29 15:32:11 +0000346 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Anthony Barbierf45d5a92018-01-24 16:23:15 +0000347{
348 validate(Accessor(_target), _reference, tolerance_qasymm8);
349}
Jenkins514be652019-02-28 12:25:18 +0000350FIXTURE_DATA_TEST_CASE(RunOptimizedSmall, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::PRECOMMIT,
351 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
352 framework::dataset::make("DepthMultiplier", 1)),
353 framework::dataset::make("DataType",
354 DataType::QASYMM8)),
355 framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })),
356 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
357{
358 validate(Accessor(_target), _reference, tolerance_qasymm8);
359}
360FIXTURE_DATA_TEST_CASE(RunOptimizedLarge, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY,
361 combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
Jenkinsb9abeae2018-11-22 11:58:08 +0000362 framework::dataset::make("DepthMultiplier", 1)),
363 framework::dataset::make("DataType",
364 DataType::QASYMM8)),
365 framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })),
366 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
367{
368 validate(Accessor(_target), _reference, tolerance_qasymm8);
369}
Jenkinsb3a371b2018-05-23 11:36:53 +0100370FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY,
371 combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
372 depth_multipliers),
373 framework::dataset::make("DataType", DataType::QASYMM8)),
374 framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Jenkins52ba29e2018-08-29 15:32:11 +0000375 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Anthony Barbierf45d5a92018-01-24 16:23:15 +0000376{
377 validate(Accessor(_target), _reference, tolerance_qasymm8);
378}
Jenkins514be652019-02-28 12:25:18 +0000379TEST_SUITE_END() // W3x3
380TEST_SUITE_END() // QASYMM8
381TEST_SUITE_END() // Quantized
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000382
Jenkins514be652019-02-28 12:25:18 +0000383TEST_SUITE_END() // DepthwiseConvLayer
384TEST_SUITE_END() // NEON
Anthony Barbier8140e1e2017-12-14 23:48:46 +0000385} // namespace validation
386} // namespace test
387} // namespace arm_compute