blob: a9c4edf5dda4e119dcffb052e7521be6f748643f [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>;
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000245template <typename T>
246using NEDepthwiseConvolutionLayerMixedDataLayoutFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T, true>;
Abe Mbise7784c832018-05-31 16:48:41 +0100247
Dmitry Savenkod7295b72017-11-20 22:00:08 +0700248TEST_SUITE(Float)
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100249TEST_SUITE(F32)
Michalis Spyroub7b31532017-11-23 12:10:21 +0000250TEST_SUITE(Generic)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000251FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
252 depth_multipliers),
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000253 framework::dataset::make("DataType", DataType::F32)),
Giorgio Arena68e29da2021-02-08 16:31:10 +0000254 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
255 ActivationFunctionsDataset))
Michalis Spyroub7b31532017-11-23 12:10:21 +0000256{
257 validate(Accessor(_target), _reference, tolerance_f32);
258}
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000259FIXTURE_DATA_TEST_CASE_NEW(RunMixedDataLayout, NEDepthwiseConvolutionLayerMixedDataLayoutFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
260 framework::dataset::make("DepthMultiplier", { 2 })),
261 framework::dataset::make("DataType", DataType::F32)),
262 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
263 framework::dataset::make("ActivationInfo", ActivationLayerInfo())))
264{
265 validate(Accessor(_target), _reference, tolerance_f32);
266}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000267FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
268 large_depth_multipliers),
269 framework::dataset::make("DataType",
270 DataType::F32)),
271 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
272 ActivationFunctionsDataset))
Michalis Spyroub7b31532017-11-23 12:10:21 +0000273{
274 validate(Accessor(_target), _reference, tolerance_f32);
275}
Usama Arif881f2de2019-04-12 10:29:17 +0100276
277TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000278FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
279 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
280 depth_multipliers),
281 framework::dataset::make("DataType",
282 DataType::F32)),
283 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
284 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100285{
286 validate(Accessor(_target), _reference, tolerance_f32);
287}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000288FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
289 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
290 large_depth_multipliers),
291 framework::dataset::make("DataType",
292 DataType::F32)),
293 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
294 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100295{
296 validate(Accessor(_target), _reference, tolerance_f32);
297}
298TEST_SUITE_END() // Dilation
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100299TEST_SUITE_END() // Generic
Michalis Spyroub7b31532017-11-23 12:10:21 +0000300
Georgios Pinitas4c758512019-07-10 19:49:11 +0100301TEST_SUITE(W3x3)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000302FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
303 depth_multipliers),
304 framework::dataset::make("DataType",
305 DataType::F32)),
306 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
307 ActivationFunctionsDataset))
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100308{
309 validate(Accessor(_target), _reference, tolerance_f32);
310}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000311FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
312 combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
313 large_depth_multipliers),
314 framework::dataset::make("DataType",
315 DataType::F32)),
316 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
317 ActivationFunctionsDataset))
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100318{
319 validate(Accessor(_target), _reference, tolerance_f32);
320}
Usama Arif881f2de2019-04-12 10:29:17 +0100321TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000322FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
323 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
324 depth_multipliers),
325 framework::dataset::make("DataType",
326 DataType::F32)),
327 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
328 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100329{
330 validate(Accessor(_target), _reference, tolerance_f32);
331}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000332FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
333 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
334 large_depth_multipliers),
335 framework::dataset::make("DataType",
336 DataType::F32)),
337 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
338 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100339{
340 validate(Accessor(_target), _reference, tolerance_f32);
341}
342
343TEST_SUITE_END() // Dilation
Georgios Pinitas4c758512019-07-10 19:49:11 +0100344TEST_SUITE_END() // W3x3
Usama Arif881f2de2019-04-12 10:29:17 +0100345
Georgios Pinitas4c758512019-07-10 19:49:11 +0100346TEST_SUITE(Optimized)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000347FIXTURE_DATA_TEST_CASE_NEW(RunSmall3x3, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
348 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
349 framework::dataset::make("DepthMultiplier", 1)),
350 framework::dataset::make("DataType",
351 DataType::F32)),
352 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
353 ActivationFunctionsDataset))
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000354{
355 validate(Accessor(_target), _reference, tolerance_f32);
356}
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000357FIXTURE_DATA_TEST_CASE_NEW(RunMixedDataLayout3x3, NEDepthwiseConvolutionLayerMixedDataLayoutFixture<float>, framework::DatasetMode::PRECOMMIT,
358 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
359 framework::dataset::make("DepthMultiplier", 1)),
360 framework::dataset::make("DataType", DataType::F32)),
361 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
362 framework::dataset::make("ActivationInfo", ActivationLayerInfo())))
363{
364 validate(Accessor(_target), _reference, tolerance_f32);
365}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000366FIXTURE_DATA_TEST_CASE_NEW(RunSmall5x5, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
367 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
368 framework::dataset::make("DepthMultiplier", 1)),
369 framework::dataset::make("DataType",
370 DataType::F32)),
371 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
372 ActivationFunctionsDataset))
Georgios Pinitas4c758512019-07-10 19:49:11 +0100373{
374 validate(Accessor(_target), _reference, tolerance_f32);
375}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000376FIXTURE_DATA_TEST_CASE_NEW(RunLarge3x3, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
377 combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
378 framework::dataset::make("DepthMultiplier", 1)),
379 framework::dataset::make("DataType",
380 DataType::F32)),
381 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
382 ActivationFunctionsDataset))
Georgios Pinitas4074c992018-01-30 18:13:46 +0000383{
384 validate(Accessor(_target), _reference, tolerance_f32);
385}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100386TEST_SUITE_END() // Optimized
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100387TEST_SUITE_END() // F32
Pablo Tello941cd702017-12-12 14:35:00 +0000388
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100389#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
390TEST_SUITE(F16)
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000391TEST_SUITE(Generic)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000392FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
393 depth_multipliers),
394 framework::dataset::make("DataType",
395 DataType::F16)),
396 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
397 ActivationFunctionsDataset))
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000398{
399 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
400}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000401FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
402 large_depth_multipliers),
403 framework::dataset::make("DataType",
404 DataType::F16)),
405 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
406 ActivationFunctionsDataset))
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000407{
408 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
409}
Usama Arif881f2de2019-04-12 10:29:17 +0100410
411TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000412FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
413 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
414 depth_multipliers),
415 framework::dataset::make("DataType",
416 DataType::F16)),
417 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
418 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100419{
420 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
421}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000422FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
423 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
424 large_depth_multipliers),
425 framework::dataset::make("DataType",
426 DataType::F16)),
427 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
428 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100429{
430 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
431}
432TEST_SUITE_END() // Dilation
433
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000434TEST_SUITE_END() // Generic
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100435template <typename T>
Manuel Bottini05069f02019-09-26 17:18:26 +0100436using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Georgios Pinitas4c758512019-07-10 19:49:11 +0100437TEST_SUITE(W3x3)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000438FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
439 depth_multipliers),
440 framework::dataset::make("DataType",
441 DataType::F16)),
442 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
443 ActivationFunctionsDataset))
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100444{
445 validate(Accessor(_target), _reference, tolerance_f16);
446}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000447FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
448 combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
449 large_depth_multipliers),
450 framework::dataset::make("DataType",
451 DataType::F16)),
452 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
453 ActivationFunctionsDataset))
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100454{
455 validate(Accessor(_target), _reference, tolerance_f16);
456}
Usama Arif881f2de2019-04-12 10:29:17 +0100457
458TEST_SUITE(Dilation)
459
Giorgio Arena68e29da2021-02-08 16:31:10 +0000460FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
461 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
462 depth_multipliers),
463 framework::dataset::make("DataType",
464 DataType::F16)),
465 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
466 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100467{
468 validate(Accessor(_target), _reference, tolerance_f16);
469}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000470FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
471 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
472 large_depth_multipliers),
473 framework::dataset::make("DataType",
474 DataType::F16)),
475 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
476 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100477{
478 validate(Accessor(_target), _reference, tolerance_f16);
479}
480
481TEST_SUITE_END() // Dilation
Georgios Pinitas4c758512019-07-10 19:49:11 +0100482TEST_SUITE_END() // W3x3
Usama Arif881f2de2019-04-12 10:29:17 +0100483
Georgios Pinitas4c758512019-07-10 19:49:11 +0100484TEST_SUITE(Optimized)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000485FIXTURE_DATA_TEST_CASE_NEW(RunSmallW3x3, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
486 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
487 framework::dataset::make("DepthMultiplier", 1)),
488 framework::dataset::make("DataType",
489 DataType::F16)),
490 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
491 ActivationFunctionsDataset))
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000492{
493 validate(Accessor(_target), _reference, tolerance_f16);
494}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000495FIXTURE_DATA_TEST_CASE_NEW(RunSmallW5x5, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
496 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
497 framework::dataset::make("DepthMultiplier", 1)),
498 framework::dataset::make("DataType",
499 DataType::F16)),
500 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
501 ActivationFunctionsDataset))
Georgios Pinitas4c758512019-07-10 19:49:11 +0100502{
503 validate(Accessor(_target), _reference, tolerance_f16);
504}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000505FIXTURE_DATA_TEST_CASE_NEW(RunLargeW3x3, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
506 combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
507 framework::dataset::make("DepthMultiplier", 1)),
508 framework::dataset::make("DataType",
509 DataType::F16)),
510 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
511 ActivationFunctionsDataset))
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100512{
513 validate(Accessor(_target), _reference, tolerance_f16);
514}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100515TEST_SUITE_END() // Optimized
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100516TEST_SUITE_END() // FP16
517#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
518
519TEST_SUITE_END() // Float
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100520
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000521template <typename T>
Giorgio Arenad93e2632019-10-15 11:09:33 +0100522using NEDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000523template <typename T>
524using NEDepthwiseConvolutionLayerQuantizedMixedDataLayoutFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T, true>;
Giorgio Arenad93e2632019-10-15 11:09:33 +0100525using NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture = DepthwiseConvolutionLayerValidationQuantizedPerChannelFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, uint8_t, int8_t>;
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000526
527TEST_SUITE(Quantized)
528TEST_SUITE(QASYMM8)
Georgios Pinitasd05dce42018-01-22 16:29:17 +0000529TEST_SUITE(Generic)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000530FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
531 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
532 depth_multipliers),
533 framework::dataset::make("DataType", DataType::QASYMM8)),
534 input_qinfo_dataset),
535 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
536 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
537 ActivationFunctionsDataset))
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000538{
539 validate(Accessor(_target), _reference, tolerance_qasymm8);
540}
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000541FIXTURE_DATA_TEST_CASE_NEW(RunMixedDataLayout, NEDepthwiseConvolutionLayerQuantizedMixedDataLayoutFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
542 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
543 framework::dataset::make("DepthMultiplier", { 2 })),
544 framework::dataset::make("DataType", DataType::QASYMM8)),
545 input_qinfo_dataset),
546 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
547 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
548 framework::dataset::make("ActivationInfo", ActivationLayerInfo())))
549{
550 validate(Accessor(_target), _reference, tolerance_qasymm8);
551}
Usama Arif881f2de2019-04-12 10:29:17 +0100552TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000553FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
554 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
555 depth_multipliers),
556 framework::dataset::make("DataType", DataType::QASYMM8)),
557 input_qinfo_dataset),
558 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8f, 1) })),
559 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
560 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100561{
562 validate(Accessor(_target), _reference, tolerance_qasymm8);
563}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000564FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
565 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
566 large_depth_multipliers),
567 framework::dataset::make("DataType", DataType::QASYMM8)),
568 input_qinfo_dataset),
569 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
570 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
571 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100572{
573 validate(Accessor(_target), _reference, tolerance_qasymm8);
574}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100575TEST_SUITE_END() // Dilation
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000576TEST_SUITE_END() // Generic
Giorgio Arena76572242018-04-04 17:44:26 +0100577TEST_SUITE(W3x3)
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000578FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Giorgio Arena68e29da2021-02-08 16:31:10 +0000579 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers),
580 framework::dataset::make("DataType", DataType::QASYMM8)),
581 input_qinfo_dataset),
582 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
583 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
584 ActivationFunctionsDataset))
Giorgio Arena76572242018-04-04 17:44:26 +0100585{
586 validate(Accessor(_target), _reference, tolerance_qasymm8);
587}
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000588FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
Giorgio Arena68e29da2021-02-08 16:31:10 +0000589 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
590 large_depth_multipliers),
591 framework::dataset::make("DataType", DataType::QASYMM8)),
592 input_qinfo_dataset),
593 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
594 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
595 ActivationFunctionsDataset))
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000596{
597 validate(Accessor(_target), _reference, tolerance_qasymm8);
598}
Usama Arif881f2de2019-04-12 10:29:17 +0100599
600TEST_SUITE(Dilation)
601
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000602FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Giorgio Arena68e29da2021-02-08 16:31:10 +0000603 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
604 framework::dataset::make("DataType", DataType::QASYMM8)),
605 input_qinfo_dataset),
606 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 10) })),
607 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
608 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100609{
610 validate(Accessor(_target), _reference, tolerance_qasymm8);
611}
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000612FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
Giorgio Arena68e29da2021-02-08 16:31:10 +0000613 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
614 large_depth_multipliers),
615 framework::dataset::make("DataType", DataType::QASYMM8)),
616 input_qinfo_dataset),
617 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
618 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
619 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100620{
621 validate(Accessor(_target), _reference, tolerance_qasymm8);
622}
623TEST_SUITE_END() // Dilation
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000624TEST_SUITE_END() // W3x3
Georgios Pinitas4c758512019-07-10 19:49:11 +0100625
626TEST_SUITE(Optimized)
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000627FIXTURE_DATA_TEST_CASE_NEW(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Giorgio Arena68e29da2021-02-08 16:31:10 +0000628 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
629 framework::dataset::make("DepthMultiplier", 1)),
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000630 framework::dataset::make("DataType", DataType::QASYMM8)),
Giorgio Arena68e29da2021-02-08 16:31:10 +0000631 input_qinfo_dataset),
632 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
633 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
634 ActivationFunctionsDataset))
Georgios Pinitas4c758512019-07-10 19:49:11 +0100635{
636 validate(Accessor(_target), _reference, tolerance_qasymm8);
637}
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000638FIXTURE_DATA_TEST_CASE_NEW(RunMixedDataLayout3x3, NEDepthwiseConvolutionLayerQuantizedMixedDataLayoutFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
639 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
640 framework::dataset::make("DepthMultiplier", 1)),
641 framework::dataset::make("DataType", DataType::QASYMM8)),
642 input_qinfo_dataset),
643 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
644 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
645 framework::dataset::make("ActivationInfo", ActivationLayerInfo())))
646{
647 validate(Accessor(_target), _reference, tolerance_qasymm8);
648}
649FIXTURE_DATA_TEST_CASE_NEW(RunSmall5x5, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Giorgio Arena68e29da2021-02-08 16:31:10 +0000650 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
651 framework::dataset::make("DepthMultiplier", 1)),
652 framework::dataset::make("DataType",
653 DataType::QASYMM8)),
654 input_qinfo_dataset),
655 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
656 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
657 ActivationFunctionsDataset))
Georgios Pinitas4c758512019-07-10 19:49:11 +0100658{
659 validate(Accessor(_target), _reference, tolerance_qasymm8);
660}
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000661FIXTURE_DATA_TEST_CASE_NEW(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
Giorgio Arena68e29da2021-02-08 16:31:10 +0000662 combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
663 framework::dataset::make("DepthMultiplier", 1)),
664 framework::dataset::make("DataType",
665 DataType::QASYMM8)),
666 input_qinfo_dataset),
667 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
668 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
669 ActivationFunctionsDataset))
Georgios Pinitas4c758512019-07-10 19:49:11 +0100670{
671 validate(Accessor(_target), _reference, tolerance_qasymm8);
672}
673TEST_SUITE_END() // Optimized
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000674TEST_SUITE_END() // QASYMM8
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000675
676TEST_SUITE(QASYMM8_SIGNED)
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000677TEST_SUITE(Generic)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000678FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
679 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
680 depth_multipliers),
681 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
682 input_qinfo_dataset),
683 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
684 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
685 ActivationFunctionsDataset))
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000686{
687 validate(Accessor(_target), _reference, tolerance_qasymm8);
688}
689
690TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000691FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
692 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
693 depth_multipliers),
694 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
695 input_qinfo_dataset),
696 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8f, 1) })),
697 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
698 ActivationFunctionsDataset))
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000699{
700 validate(Accessor(_target), _reference, tolerance_qasymm8);
701}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000702FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::NIGHTLY,
703 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
704 large_depth_multipliers),
705 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
706 input_qinfo_dataset),
707 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
708 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
709 ActivationFunctionsDataset))
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000710{
711 validate(Accessor(_target), _reference, tolerance_qasymm8);
712}
713TEST_SUITE_END() // Dilation
714TEST_SUITE_END() // Generic
715
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000716TEST_SUITE(W3x3)
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000717FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
Giorgio Arena68e29da2021-02-08 16:31:10 +0000718 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers),
719 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
720 input_qinfo_dataset),
721 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
722 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
723 ActivationFunctionsDataset))
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000724{
725 validate(Accessor(_target), _reference, tolerance_qasymm8);
726}
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000727FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::NIGHTLY,
Giorgio Arena68e29da2021-02-08 16:31:10 +0000728 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
729 large_depth_multipliers),
730 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
731 input_qinfo_dataset),
732 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
733 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
734 ActivationFunctionsDataset))
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000735{
736 validate(Accessor(_target), _reference, tolerance_qasymm8);
737}
738
739TEST_SUITE(Dilation)
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000740FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
Giorgio Arena68e29da2021-02-08 16:31:10 +0000741 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
742 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
743 input_qinfo_dataset),
744 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 10) })),
745 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
746 ActivationFunctionsDataset))
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000747{
748 validate(Accessor(_target), _reference, tolerance_qasymm8);
749}
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000750FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::NIGHTLY,
Giorgio Arena68e29da2021-02-08 16:31:10 +0000751 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
752 large_depth_multipliers),
753 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
754 input_qinfo_dataset),
755 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
756 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
757 ActivationFunctionsDataset))
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000758{
759 validate(Accessor(_target), _reference, tolerance_qasymm8);
760}
761TEST_SUITE_END() // Dilation
762TEST_SUITE_END() // W3x3
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000763
764TEST_SUITE(Optimized)
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000765FIXTURE_DATA_TEST_CASE_NEW(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
Giorgio Arena68e29da2021-02-08 16:31:10 +0000766 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
767 framework::dataset::make("DepthMultiplier", 1)),
768 framework::dataset::make("DataType",
769 DataType::QASYMM8_SIGNED)),
770 input_qinfo_dataset),
771 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
772 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
773 ActivationFunctionsDataset))
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000774{
775 validate(Accessor(_target), _reference, tolerance_qasymm8);
776}
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000777FIXTURE_DATA_TEST_CASE_NEW(RunSmall5x5, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
Giorgio Arena68e29da2021-02-08 16:31:10 +0000778 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
779 framework::dataset::make("DepthMultiplier", 1)),
780 framework::dataset::make("DataType",
781 DataType::QASYMM8_SIGNED)),
782 input_qinfo_dataset),
783 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
784 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
785 ActivationFunctionsDataset))
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000786{
787 validate(Accessor(_target), _reference, tolerance_qasymm8);
788}
Manuel Bottinica62c6f2021-03-23 11:50:34 +0000789FIXTURE_DATA_TEST_CASE_NEW(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::NIGHTLY,
Giorgio Arena68e29da2021-02-08 16:31:10 +0000790 combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
791 framework::dataset::make("DepthMultiplier", 1)),
792 framework::dataset::make("DataType",
793 DataType::QASYMM8_SIGNED)),
794 input_qinfo_dataset),
795 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
796 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
797 ActivationFunctionsDataset))
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000798{
799 validate(Accessor(_target), _reference, tolerance_qasymm8);
800}
801TEST_SUITE_END() // Optimized
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000802TEST_SUITE_END() // QASYMM8_SIGNED
803
Giorgio Arenad93e2632019-10-15 11:09:33 +0100804TEST_SUITE(QSYMM8_PER_CHANNEL)
805TEST_SUITE(Generic)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000806FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT,
807 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
808 depth_multipliers),
809 framework::dataset::make("InputDataType", DataType::QASYMM8)),
810 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
811 input_qinfo_dataset),
812 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
813 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
814 ActivationFunctionsDataset))
Giorgio Arenad93e2632019-10-15 11:09:33 +0100815{
816 validate(Accessor(_target), _reference, tolerance_qasymm8);
817}
818
819TEST_SUITE(Dilation)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000820FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT,
821 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
822 depth_multipliers),
823 framework::dataset::make("InputDataType", DataType::QASYMM8)),
824 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
825 input_qinfo_dataset),
826 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
827 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
828 ActivationFunctionsDataset))
Giorgio Arenad93e2632019-10-15 11:09:33 +0100829{
830 validate(Accessor(_target), _reference, tolerance_qasymm8);
831}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000832FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY,
833 combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
834 depth_multipliers),
835 framework::dataset::make("InputDataType", DataType::QASYMM8)),
836 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
837 input_qinfo_dataset),
838 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
839 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
840 ActivationFunctionsDataset))
Giorgio Arenad93e2632019-10-15 11:09:33 +0100841{
842 validate(Accessor(_target), _reference, tolerance_qasymm8);
843}
844TEST_SUITE_END() // Dilation
845TEST_SUITE_END() // Generic
Giuseppe Rossinif01201a2019-11-06 14:57:49 +0000846
847TEST_SUITE(Optimized)
Giorgio Arena68e29da2021-02-08 16:31:10 +0000848FIXTURE_DATA_TEST_CASE_NEW(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT,
849 combine(combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
850 framework::dataset::make("DepthMultiplier", 1)),
851 framework::dataset::make("InputDataType", DataType::QASYMM8)),
852 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
853 input_qinfo_dataset),
854 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
855 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
856 ActivationFunctionsDataset))
Giuseppe Rossinif01201a2019-11-06 14:57:49 +0000857{
858 validate(Accessor(_target), _reference, tolerance_qasymm8);
859}
Giorgio Arena68e29da2021-02-08 16:31:10 +0000860FIXTURE_DATA_TEST_CASE_NEW(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY,
861 combine(combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
862 framework::dataset::make("DepthMultiplier", 1)),
863 framework::dataset::make("InputDataType", DataType::QASYMM8)),
864 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
865 input_qinfo_dataset),
866 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
867 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
868 ActivationFunctionsDataset))
Giuseppe Rossinif01201a2019-11-06 14:57:49 +0000869{
870 validate(Accessor(_target), _reference, tolerance_qasymm8);
871}
872TEST_SUITE_END() // Optimized
Giorgio Arenad93e2632019-10-15 11:09:33 +0100873TEST_SUITE_END() // QSYMM8_PER_CHANNEL
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000874TEST_SUITE_END() // Quantized
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000875
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000876TEST_SUITE_END() // DepthwiseConvLayer
Sheri Zhangac6499a2021-02-10 15:32:38 +0000877TEST_SUITE_END() // Neon
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100878} // namespace validation
879} // namespace test
880} // namespace arm_compute