blob: 6bb40be036bbbf8ba46c09d6dd91916f63168b2f [file] [log] [blame]
Michalis Spyrou7362f0d2017-10-18 17:58:22 +01001/*
Sheri Zhangac6499a2021-02-10 15:32:38 +00002 * Copyright (c) 2017-2021 Arm Limited.
Michalis Spyrou7362f0d2017-10-18 17:58:22 +01003 *
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,
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +000021 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
Michalis Spyrou7362f0d2017-10-18 17:58:22 +010022 * SOFTWARE.
23 */
24#include "arm_compute/core/Types.h"
Giorgio Arena76572242018-04-04 17:44:26 +010025#include "arm_compute/core/utils/misc/ShapeCalculator.h"
Giorgio Arena04a8f8c2017-11-23 11:45:24 +000026#include "arm_compute/runtime/NEON/functions/NEDepthwiseConvolutionLayer.h"
Michalis Spyrou7362f0d2017-10-18 17:58:22 +010027#include "arm_compute/runtime/Tensor.h"
28#include "arm_compute/runtime/TensorAllocator.h"
29#include "tests/NEON/Accessor.h"
30#include "tests/PaddingCalculator.h"
Giorgio Arena04a8f8c2017-11-23 11:45:24 +000031#include "tests/datasets/DepthwiseConvolutionLayerDataset.h"
Usama Arif881f2de2019-04-12 10:29:17 +010032#include "tests/datasets/DilatedDepthwiseConvolutionLayerDataset.h"
Michalis Spyrou7362f0d2017-10-18 17:58:22 +010033#include "tests/framework/Asserts.h"
34#include "tests/framework/Macros.h"
35#include "tests/framework/datasets/Datasets.h"
36#include "tests/validation/Validation.h"
Giorgio Arena04a8f8c2017-11-23 11:45:24 +000037#include "tests/validation/fixtures/DepthwiseConvolutionLayerFixture.h"
Michalis Spyrou7362f0d2017-10-18 17:58:22 +010038
39namespace arm_compute
40{
41namespace test
42{
43namespace validation
44{
Giorgio Arena76572242018-04-04 17:44:26 +010045using namespace arm_compute::misc::shape_calculator;
46
Michalis Spyrou7362f0d2017-10-18 17:58:22 +010047namespace
48{
Georgios Pinitas8cffcd62018-11-16 17:11:50 +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 */
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +000054#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
Giorgio Arena76572242018-04-04 17:44:26 +010055
Giorgio Arena3737c792020-11-23 17:47:23 +000056const auto depth_multipliers = framework::dataset::make("DepthMultiplier", { 1, 2, 8 });
57const auto large_depth_multipliers = framework::dataset::make("DepthMultiplier", { 1, 2, 5, 32 });
Manuel Bottinia788c2f2019-04-08 13:18:00 +010058
59//Activation Functions
60const auto ActivationFunctionsDataset = framework::dataset::make("ActivationInfo",
61{
62 ActivationLayerInfo(),
63 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)
64});
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +000065
66const auto input_qinfo_dataset = framework::dataset::make("InputQInfo",
67{
68 QuantizationInfo(0.3f, 10),
69 QuantizationInfo(2.2f, 10),
70});
Michalis Spyrou7362f0d2017-10-18 17:58:22 +010071} // namespace
72
73TEST_SUITE(NEON)
Manuel Bottinia788c2f2019-04-08 13:18:00 +010074TEST_SUITE(DepthwiseConvolutionLayer)
Michalis Spyrou7362f0d2017-10-18 17:58:22 +010075
Abe Mbise7784c832018-05-31 16:48:41 +010076// *INDENT-OFF*
77// clang-format off
Usama Arif881f2de2019-04-12 10:29:17 +010078DATA_TEST_CASE(Validate3x3, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
Abe Mbise7784c832018-05-31 16:48:41 +010079 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
Giorgio Arena66cbafb2018-08-23 14:51:00 +010083 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::QASYMM8), // Invalid stride
Abe Mbise7784c832018-05-31 16:48:41 +010084 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
Usama Arif881f2de2019-04-12 10:29:17 +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
Giorgio Arena66cbafb2018-08-23 14:51:00 +010089 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +010090 }),
Giorgio Arena66cbafb2018-08-23 14:51:00 +010091 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),
Usama Arif881f2de2019-04-12 10:29:17 +0100100 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
101 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +0100102 })),
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),
Giorgio Arena66cbafb2018-08-23 14:51:00 +0100107 TensorInfo(TensorShape(2U), 1, DataType::S32),
Abe Mbise7784c832018-05-31 16:48:41 +0100108 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),
Usama Arif881f2de2019-04-12 10:29:17 +0100112 TensorInfo(TensorShape(2U), 1, DataType::F32),
113 TensorInfo(TensorShape(2U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +0100114 })),
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),
Giorgio Arena66cbafb2018-08-23 14:51:00 +0100119 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::QASYMM8),
Abe Mbise7784c832018-05-31 16:48:41 +0100120 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),
Usama Arif881f2de2019-04-12 10:29:17 +0100124 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
125 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +0100126 })),
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),
Usama Arif881f2de2019-04-12 10:29:17 +0100136 PadStrideInfo(1, 1, 0, 0),
137 PadStrideInfo(1, 1, 0, 0),
Abe Mbise7784c832018-05-31 16:48:41 +0100138 })),
139 framework::dataset::make("DepthMultiplier", { 1,
140 1,
141 1,
142 3,
143 1,
144 1,
145 1,
146 1,
147 1,
Usama Arif881f2de2019-04-12 10:29:17 +0100148 1,
149 1,
Abe Mbise7784c832018-05-31 16:48:41 +0100150 })),
Usama Arif881f2de2019-04-12 10:29:17 +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)
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100165{
Manuel Bottini05069f02019-09-26 17:18:26 +0100166 bool is_valid = bool(NEDepthwiseConvolutionLayer::validate(&input_info.clone()->set_is_resizable(false),
Usama Arif881f2de2019-04-12 10:29:17 +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));
Abe Mbise7784c832018-05-31 16:48:41 +0100168 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100169}
170
Usama Arif881f2de2019-04-12 10:29:17 +0100171DATA_TEST_CASE(ValidateGeneric, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
Giorgio Arenad93e2632019-10-15 11:09:33 +0100172 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
Abe Mbise7784c832018-05-31 16:48:41 +0100180 }),
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),
Usama Arif881f2de2019-04-12 10:29:17 +0100188 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +0100189 })),
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),
Usama Arif881f2de2019-04-12 10:29:17 +0100197 TensorInfo(TensorShape(16U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +0100198 })),
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),
Usama Arif881f2de2019-04-12 10:29:17 +0100206 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +0100207 })),
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),
Usama Arif881f2de2019-04-12 10:29:17 +0100215 PadStrideInfo(1, 1, 0, 0),
Abe Mbise7784c832018-05-31 16:48:41 +0100216 })),
217 framework::dataset::make("DepthMultiplier", { 1,
218 1,
219 3,
220 1,
221 1,
222 1,
223 2,
Usama Arif881f2de2019-04-12 10:29:17 +0100224 2,
Abe Mbise7784c832018-05-31 16:48:41 +0100225 })),
Usama Arif881f2de2019-04-12 10:29:17 +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),
Usama Arif881f2de2019-04-12 10:29:17 +0100234 })),
Sang-Hoon Parke4558b52020-10-01 10:13:07 +0100235 framework::dataset::make("Expected", { false, false, false, false, false, false, false, false})),
Usama Arif881f2de2019-04-12 10:29:17 +0100236 input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier,dilation, expected)
Abe Mbise7784c832018-05-31 16:48:41 +0100237{
Usama Arif881f2de2019-04-12 10:29:17 +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));
Abe Mbise7784c832018-05-31 16:48:41 +0100239 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
240}
241// clang-format on
242// *INDENT-ON*
Manuel Bottini05069f02019-09-26 17:18:26 +0100243template <typename T>
244using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Abe Mbise7784c832018-05-31 16:48:41 +0100245
Dmitry Savenkod7295b72017-11-20 22:00:08 +0700246TEST_SUITE(Float)
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100247TEST_SUITE(F32)
Michalis Spyroub7b31532017-11-23 12:10:21 +0000248TEST_SUITE(Generic)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000249FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
250 depth_multipliers),
251 framework::dataset::make("DataType",
252 DataType::F32)),
253 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
254 ActivationFunctionsDataset))
Michalis Spyroub7b31532017-11-23 12:10:21 +0000255{
256 validate(Accessor(_target), _reference, tolerance_f32);
257}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000258FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
259 large_depth_multipliers),
260 framework::dataset::make("DataType",
261 DataType::F32)),
262 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
263 ActivationFunctionsDataset))
Michalis Spyroub7b31532017-11-23 12:10:21 +0000264{
265 validate(Accessor(_target), _reference, tolerance_f32);
266}
Usama Arif881f2de2019-04-12 10:29:17 +0100267
268TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000269FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
270 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
271 depth_multipliers),
272 framework::dataset::make("DataType",
273 DataType::F32)),
274 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
275 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100276{
277 validate(Accessor(_target), _reference, tolerance_f32);
278}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000279FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
280 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
281 large_depth_multipliers),
282 framework::dataset::make("DataType",
283 DataType::F32)),
284 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
285 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100286{
287 validate(Accessor(_target), _reference, tolerance_f32);
288}
289TEST_SUITE_END() // Dilation
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100290TEST_SUITE_END() // Generic
Michalis Spyroub7b31532017-11-23 12:10:21 +0000291
Georgios Pinitas4c758512019-07-10 19:49:11 +0100292TEST_SUITE(W3x3)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000293FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
294 depth_multipliers),
295 framework::dataset::make("DataType",
296 DataType::F32)),
297 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
298 ActivationFunctionsDataset))
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100299{
300 validate(Accessor(_target), _reference, tolerance_f32);
301}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000302FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
303 combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
304 large_depth_multipliers),
305 framework::dataset::make("DataType",
306 DataType::F32)),
307 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
308 ActivationFunctionsDataset))
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100309{
310 validate(Accessor(_target), _reference, tolerance_f32);
311}
Usama Arif881f2de2019-04-12 10:29:17 +0100312TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000313FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
314 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
315 depth_multipliers),
316 framework::dataset::make("DataType",
317 DataType::F32)),
318 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
319 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100320{
321 validate(Accessor(_target), _reference, tolerance_f32);
322}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000323FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
324 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
325 large_depth_multipliers),
326 framework::dataset::make("DataType",
327 DataType::F32)),
328 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
329 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100330{
331 validate(Accessor(_target), _reference, tolerance_f32);
332}
333
334TEST_SUITE_END() // Dilation
Georgios Pinitas4c758512019-07-10 19:49:11 +0100335TEST_SUITE_END() // W3x3
Usama Arif881f2de2019-04-12 10:29:17 +0100336
Georgios Pinitas4c758512019-07-10 19:49:11 +0100337TEST_SUITE(Optimized)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000338FIXTURE_DATA_TEST_CASE_NEW(RunSmall3x3, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
339 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
340 framework::dataset::make("DepthMultiplier", 1)),
341 framework::dataset::make("DataType",
342 DataType::F32)),
343 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
344 ActivationFunctionsDataset))
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000345{
346 validate(Accessor(_target), _reference, tolerance_f32);
347}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000348FIXTURE_DATA_TEST_CASE_NEW(RunSmall5x5, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
349 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
350 framework::dataset::make("DepthMultiplier", 1)),
351 framework::dataset::make("DataType",
352 DataType::F32)),
353 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
354 ActivationFunctionsDataset))
Georgios Pinitas4c758512019-07-10 19:49:11 +0100355{
356 validate(Accessor(_target), _reference, tolerance_f32);
357}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000358FIXTURE_DATA_TEST_CASE_NEW(RunLarge3x3, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
359 combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
360 framework::dataset::make("DepthMultiplier", 1)),
361 framework::dataset::make("DataType",
362 DataType::F32)),
363 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
364 ActivationFunctionsDataset))
Georgios Pinitas4074c992018-01-30 18:13:46 +0000365{
366 validate(Accessor(_target), _reference, tolerance_f32);
367}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100368TEST_SUITE_END() // Optimized
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100369TEST_SUITE_END() // F32
Pablo Tello941cd702017-12-12 14:35:00 +0000370
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100371#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
372TEST_SUITE(F16)
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000373TEST_SUITE(Generic)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000374FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
375 depth_multipliers),
376 framework::dataset::make("DataType",
377 DataType::F16)),
378 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
379 ActivationFunctionsDataset))
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000380{
381 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
382}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000383FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
384 large_depth_multipliers),
385 framework::dataset::make("DataType",
386 DataType::F16)),
387 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
388 ActivationFunctionsDataset))
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000389{
390 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
391}
Usama Arif881f2de2019-04-12 10:29:17 +0100392
393TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000394FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
395 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
396 depth_multipliers),
397 framework::dataset::make("DataType",
398 DataType::F16)),
399 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
400 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100401{
402 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
403}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000404FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
405 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
406 large_depth_multipliers),
407 framework::dataset::make("DataType",
408 DataType::F16)),
409 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
410 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100411{
412 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
413}
414TEST_SUITE_END() // Dilation
415
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000416TEST_SUITE_END() // Generic
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100417template <typename T>
Manuel Bottini05069f02019-09-26 17:18:26 +0100418using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Georgios Pinitas4c758512019-07-10 19:49:11 +0100419TEST_SUITE(W3x3)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000420FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
421 depth_multipliers),
422 framework::dataset::make("DataType",
423 DataType::F16)),
424 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
425 ActivationFunctionsDataset))
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100426{
427 validate(Accessor(_target), _reference, tolerance_f16);
428}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000429FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
430 combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
431 large_depth_multipliers),
432 framework::dataset::make("DataType",
433 DataType::F16)),
434 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
435 ActivationFunctionsDataset))
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100436{
437 validate(Accessor(_target), _reference, tolerance_f16);
438}
Usama Arif881f2de2019-04-12 10:29:17 +0100439
440TEST_SUITE(Dilation)
441
Giorgio Arena68e29da2021-02-08 16:31:10 +0000442FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
443 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
444 depth_multipliers),
445 framework::dataset::make("DataType",
446 DataType::F16)),
447 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
448 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100449{
450 validate(Accessor(_target), _reference, tolerance_f16);
451}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000452FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
453 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
454 large_depth_multipliers),
455 framework::dataset::make("DataType",
456 DataType::F16)),
457 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
458 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100459{
460 validate(Accessor(_target), _reference, tolerance_f16);
461}
462
463TEST_SUITE_END() // Dilation
Georgios Pinitas4c758512019-07-10 19:49:11 +0100464TEST_SUITE_END() // W3x3
Usama Arif881f2de2019-04-12 10:29:17 +0100465
Georgios Pinitas4c758512019-07-10 19:49:11 +0100466TEST_SUITE(Optimized)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000467FIXTURE_DATA_TEST_CASE_NEW(RunSmallW3x3, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
468 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
469 framework::dataset::make("DepthMultiplier", 1)),
470 framework::dataset::make("DataType",
471 DataType::F16)),
472 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
473 ActivationFunctionsDataset))
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000474{
475 validate(Accessor(_target), _reference, tolerance_f16);
476}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000477FIXTURE_DATA_TEST_CASE_NEW(RunSmallW5x5, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
478 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
479 framework::dataset::make("DepthMultiplier", 1)),
480 framework::dataset::make("DataType",
481 DataType::F16)),
482 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
483 ActivationFunctionsDataset))
Georgios Pinitas4c758512019-07-10 19:49:11 +0100484{
485 validate(Accessor(_target), _reference, tolerance_f16);
486}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000487FIXTURE_DATA_TEST_CASE_NEW(RunLargeW3x3, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
488 combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
489 framework::dataset::make("DepthMultiplier", 1)),
490 framework::dataset::make("DataType",
491 DataType::F16)),
492 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
493 ActivationFunctionsDataset))
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100494{
495 validate(Accessor(_target), _reference, tolerance_f16);
496}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100497TEST_SUITE_END() // Optimized
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100498TEST_SUITE_END() // FP16
499#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
500
501TEST_SUITE_END() // Float
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100502
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000503template <typename T>
Manuel Bottini05069f02019-09-26 17:18:26 +0100504using NEDepthwiseConvolutionLayerQuantizedFixtureOptimized = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Georgios Pinitasd05dce42018-01-22 16:29:17 +0000505template <typename T>
Giorgio Arenad93e2632019-10-15 11:09:33 +0100506using NEDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
507using NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture = DepthwiseConvolutionLayerValidationQuantizedPerChannelFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, uint8_t, int8_t>;
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000508
509TEST_SUITE(Quantized)
510TEST_SUITE(QASYMM8)
Georgios Pinitasd05dce42018-01-22 16:29:17 +0000511TEST_SUITE(Generic)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000512FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
513 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
514 depth_multipliers),
515 framework::dataset::make("DataType", DataType::QASYMM8)),
516 input_qinfo_dataset),
517 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
518 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
519 ActivationFunctionsDataset))
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000520{
521 validate(Accessor(_target), _reference, tolerance_qasymm8);
522}
Usama Arif881f2de2019-04-12 10:29:17 +0100523
524TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000525FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
526 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
527 depth_multipliers),
528 framework::dataset::make("DataType", DataType::QASYMM8)),
529 input_qinfo_dataset),
530 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8f, 1) })),
531 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
532 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100533{
534 validate(Accessor(_target), _reference, tolerance_qasymm8);
535}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000536FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
537 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
538 large_depth_multipliers),
539 framework::dataset::make("DataType", DataType::QASYMM8)),
540 input_qinfo_dataset),
541 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
542 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
543 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100544{
545 validate(Accessor(_target), _reference, tolerance_qasymm8);
546}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100547TEST_SUITE_END() // Dilation
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000548TEST_SUITE_END() // Generic
Giorgio Arena76572242018-04-04 17:44:26 +0100549TEST_SUITE(W3x3)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000550FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
551 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers),
552 framework::dataset::make("DataType", DataType::QASYMM8)),
553 input_qinfo_dataset),
554 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
555 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
556 ActivationFunctionsDataset))
Giorgio Arena76572242018-04-04 17:44:26 +0100557{
558 validate(Accessor(_target), _reference, tolerance_qasymm8);
559}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000560FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
561 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
562 large_depth_multipliers),
563 framework::dataset::make("DataType", DataType::QASYMM8)),
564 input_qinfo_dataset),
565 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
566 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
567 ActivationFunctionsDataset))
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000568{
569 validate(Accessor(_target), _reference, tolerance_qasymm8);
570}
Usama Arif881f2de2019-04-12 10:29:17 +0100571
572TEST_SUITE(Dilation)
573
Giorgio Arena68e29da2021-02-08 16:31:10 +0000574FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
575 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
576 framework::dataset::make("DataType", DataType::QASYMM8)),
577 input_qinfo_dataset),
578 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 10) })),
579 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
580 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100581{
582 validate(Accessor(_target), _reference, tolerance_qasymm8);
583}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000584FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
585 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
586 large_depth_multipliers),
587 framework::dataset::make("DataType", DataType::QASYMM8)),
588 input_qinfo_dataset),
589 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
590 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
591 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100592{
593 validate(Accessor(_target), _reference, tolerance_qasymm8);
594}
595TEST_SUITE_END() // Dilation
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000596TEST_SUITE_END() // W3x3
Georgios Pinitas4c758512019-07-10 19:49:11 +0100597
598TEST_SUITE(Optimized)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000599FIXTURE_DATA_TEST_CASE_NEW(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
600 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
601 framework::dataset::make("DepthMultiplier", 1)),
602 framework::dataset::make("DataType",
603 DataType::QASYMM8)),
604 input_qinfo_dataset),
605 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
606 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
607 ActivationFunctionsDataset))
Georgios Pinitas4c758512019-07-10 19:49:11 +0100608{
609 validate(Accessor(_target), _reference, tolerance_qasymm8);
610}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000611FIXTURE_DATA_TEST_CASE_NEW(RunSmall5x5, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
612 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
613 framework::dataset::make("DepthMultiplier", 1)),
614 framework::dataset::make("DataType",
615 DataType::QASYMM8)),
616 input_qinfo_dataset),
617 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
618 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
619 ActivationFunctionsDataset))
Georgios Pinitas4c758512019-07-10 19:49:11 +0100620{
621 validate(Accessor(_target), _reference, tolerance_qasymm8);
622}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000623FIXTURE_DATA_TEST_CASE_NEW(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
624 combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
625 framework::dataset::make("DepthMultiplier", 1)),
626 framework::dataset::make("DataType",
627 DataType::QASYMM8)),
628 input_qinfo_dataset),
629 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
630 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
631 ActivationFunctionsDataset))
Georgios Pinitas4c758512019-07-10 19:49:11 +0100632{
633 validate(Accessor(_target), _reference, tolerance_qasymm8);
634}
635TEST_SUITE_END() // Optimized
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000636TEST_SUITE_END() // QASYMM8
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000637
638TEST_SUITE(QASYMM8_SIGNED)
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000639TEST_SUITE(Generic)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000640FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
641 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
642 depth_multipliers),
643 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
644 input_qinfo_dataset),
645 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
646 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
647 ActivationFunctionsDataset))
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000648{
649 validate(Accessor(_target), _reference, tolerance_qasymm8);
650}
651
652TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000653FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
654 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
655 depth_multipliers),
656 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
657 input_qinfo_dataset),
658 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8f, 1) })),
659 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
660 ActivationFunctionsDataset))
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000661{
662 validate(Accessor(_target), _reference, tolerance_qasymm8);
663}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000664FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::NIGHTLY,
665 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
666 large_depth_multipliers),
667 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
668 input_qinfo_dataset),
669 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
670 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
671 ActivationFunctionsDataset))
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000672{
673 validate(Accessor(_target), _reference, tolerance_qasymm8);
674}
675TEST_SUITE_END() // Dilation
676TEST_SUITE_END() // Generic
677
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000678TEST_SUITE(W3x3)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000679FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT,
680 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers),
681 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
682 input_qinfo_dataset),
683 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
684 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
685 ActivationFunctionsDataset))
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000686{
687 validate(Accessor(_target), _reference, tolerance_qasymm8);
688}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000689FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::NIGHTLY,
690 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
691 large_depth_multipliers),
692 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
693 input_qinfo_dataset),
694 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
695 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
696 ActivationFunctionsDataset))
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000697{
698 validate(Accessor(_target), _reference, tolerance_qasymm8);
699}
700
701TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000702FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT,
703 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
704 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
705 input_qinfo_dataset),
706 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 10) })),
707 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
708 ActivationFunctionsDataset))
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000709{
710 validate(Accessor(_target), _reference, tolerance_qasymm8);
711}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000712FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::NIGHTLY,
713 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
714 large_depth_multipliers),
715 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
716 input_qinfo_dataset),
717 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
718 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
719 ActivationFunctionsDataset))
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000720{
721 validate(Accessor(_target), _reference, tolerance_qasymm8);
722}
723TEST_SUITE_END() // Dilation
724TEST_SUITE_END() // W3x3
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000725
726TEST_SUITE(Optimized)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000727FIXTURE_DATA_TEST_CASE_NEW(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT,
728 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
729 framework::dataset::make("DepthMultiplier", 1)),
730 framework::dataset::make("DataType",
731 DataType::QASYMM8_SIGNED)),
732 input_qinfo_dataset),
733 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
734 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
735 ActivationFunctionsDataset))
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000736{
737 validate(Accessor(_target), _reference, tolerance_qasymm8);
738}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000739FIXTURE_DATA_TEST_CASE_NEW(RunSmall5x5, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT,
740 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
741 framework::dataset::make("DepthMultiplier", 1)),
742 framework::dataset::make("DataType",
743 DataType::QASYMM8_SIGNED)),
744 input_qinfo_dataset),
745 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
746 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
747 ActivationFunctionsDataset))
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000748{
749 validate(Accessor(_target), _reference, tolerance_qasymm8);
750}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000751FIXTURE_DATA_TEST_CASE_NEW(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::NIGHTLY,
752 combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
753 framework::dataset::make("DepthMultiplier", 1)),
754 framework::dataset::make("DataType",
755 DataType::QASYMM8_SIGNED)),
756 input_qinfo_dataset),
757 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
758 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
759 ActivationFunctionsDataset))
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000760{
761 validate(Accessor(_target), _reference, tolerance_qasymm8);
762}
763TEST_SUITE_END() // Optimized
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000764TEST_SUITE_END() // QASYMM8_SIGNED
765
Giorgio Arenad93e2632019-10-15 11:09:33 +0100766TEST_SUITE(QSYMM8_PER_CHANNEL)
767TEST_SUITE(Generic)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000768FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT,
769 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
770 depth_multipliers),
771 framework::dataset::make("InputDataType", DataType::QASYMM8)),
772 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
773 input_qinfo_dataset),
774 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
775 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
776 ActivationFunctionsDataset))
Giorgio Arenad93e2632019-10-15 11:09:33 +0100777{
778 validate(Accessor(_target), _reference, tolerance_qasymm8);
779}
780
781TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000782FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT,
783 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
784 depth_multipliers),
785 framework::dataset::make("InputDataType", DataType::QASYMM8)),
786 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
787 input_qinfo_dataset),
788 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
789 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
790 ActivationFunctionsDataset))
Giorgio Arenad93e2632019-10-15 11:09:33 +0100791{
792 validate(Accessor(_target), _reference, tolerance_qasymm8);
793}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000794FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY,
795 combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
796 depth_multipliers),
797 framework::dataset::make("InputDataType", DataType::QASYMM8)),
798 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
799 input_qinfo_dataset),
800 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
801 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
802 ActivationFunctionsDataset))
Giorgio Arenad93e2632019-10-15 11:09:33 +0100803{
804 validate(Accessor(_target), _reference, tolerance_qasymm8);
805}
806TEST_SUITE_END() // Dilation
807TEST_SUITE_END() // Generic
Giuseppe Rossinif01201a2019-11-06 14:57:49 +0000808
809TEST_SUITE(Optimized)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000810FIXTURE_DATA_TEST_CASE_NEW(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT,
811 combine(combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
812 framework::dataset::make("DepthMultiplier", 1)),
813 framework::dataset::make("InputDataType", DataType::QASYMM8)),
814 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
815 input_qinfo_dataset),
816 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
817 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
818 ActivationFunctionsDataset))
Giuseppe Rossinif01201a2019-11-06 14:57:49 +0000819{
820 validate(Accessor(_target), _reference, tolerance_qasymm8);
821}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000822FIXTURE_DATA_TEST_CASE_NEW(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY,
823 combine(combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
824 framework::dataset::make("DepthMultiplier", 1)),
825 framework::dataset::make("InputDataType", DataType::QASYMM8)),
826 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
827 input_qinfo_dataset),
828 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
829 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
830 ActivationFunctionsDataset))
Giuseppe Rossinif01201a2019-11-06 14:57:49 +0000831{
832 validate(Accessor(_target), _reference, tolerance_qasymm8);
833}
834TEST_SUITE_END() // Optimized
Giorgio Arenad93e2632019-10-15 11:09:33 +0100835TEST_SUITE_END() // QSYMM8_PER_CHANNEL
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000836TEST_SUITE_END() // Quantized
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000837
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000838TEST_SUITE_END() // DepthwiseConvLayer
Sheri Zhangac6499a2021-02-10 15:32:38 +0000839TEST_SUITE_END() // Neon
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100840} // namespace validation
841} // namespace test
842} // namespace arm_compute