blob: e255fc7b4d9540f982823d8f358f534195ac6de2 [file] [log] [blame]
Michalis Spyrou7362f0d2017-10-18 17:58:22 +01001/*
Michele Di Giorgiod9eaf612020-07-08 11:12:57 +01002 * Copyright (c) 2017-2020 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
Michele Di Giorgio633d30b2019-10-08 17:17:18 +010056const auto depth_multipliers = framework::dataset::make("DepthMultiplier", { 1, 2, 5 });
Matthew Jackson6c2eac12019-07-23 10:43:10 +010057const auto large_depth_multipliers = framework::dataset::make("DepthMultiplier", { 1, 2, 5, 8 });
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)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100249FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
Giorgio Arena76572242018-04-04 17:44:26 +0100250 depth_multipliers),
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000251 framework::dataset::make("DataType",
Giorgio Arena1ed1fc62018-03-26 16:20:05 +0100252 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100253 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}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100258FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100259 large_depth_multipliers),
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000260 framework::dataset::make("DataType",
Giorgio Arena1ed1fc62018-03-26 16:20:05 +0100261 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100262 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)
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000269FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
270 depth_multipliers),
271 framework::dataset::make("DataType",
272 DataType::F32)),
273 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
274 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100275{
276 validate(Accessor(_target), _reference, tolerance_f32);
277}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100278FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100279 large_depth_multipliers),
Usama Arif881f2de2019-04-12 10:29:17 +0100280 framework::dataset::make("DataType",
281 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100282 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
283 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100284{
285 validate(Accessor(_target), _reference, tolerance_f32);
286}
287TEST_SUITE_END() // Dilation
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100288TEST_SUITE_END() // Generic
Michalis Spyroub7b31532017-11-23 12:10:21 +0000289
Georgios Pinitas4c758512019-07-10 19:49:11 +0100290TEST_SUITE(W3x3)
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000291FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
292 depth_multipliers),
293 framework::dataset::make("DataType",
294 DataType::F32)),
295 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
296 ActivationFunctionsDataset))
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100297{
298 validate(Accessor(_target), _reference, tolerance_f32);
299}
Manuel Bottini05069f02019-09-26 17:18:26 +0100300FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
Georgios Pinitas4c758512019-07-10 19:49:11 +0100301 combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100302 large_depth_multipliers),
Georgios Pinitas4c758512019-07-10 19:49:11 +0100303 framework::dataset::make("DataType",
304 DataType::F32)),
305 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
306 ActivationFunctionsDataset))
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100307{
308 validate(Accessor(_target), _reference, tolerance_f32);
309}
Usama Arif881f2de2019-04-12 10:29:17 +0100310TEST_SUITE(Dilation)
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000311FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
Georgios Pinitas4c758512019-07-10 19:49:11 +0100312 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
313 depth_multipliers),
314 framework::dataset::make("DataType",
315 DataType::F32)),
316 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
317 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100318{
319 validate(Accessor(_target), _reference, tolerance_f32);
320}
Manuel Bottini05069f02019-09-26 17:18:26 +0100321FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100322 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100323 large_depth_multipliers),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100324 framework::dataset::make("DataType",
325 DataType::F32)),
326 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
327 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100328{
329 validate(Accessor(_target), _reference, tolerance_f32);
330}
331
332TEST_SUITE_END() // Dilation
Georgios Pinitas4c758512019-07-10 19:49:11 +0100333TEST_SUITE_END() // W3x3
Usama Arif881f2de2019-04-12 10:29:17 +0100334
Georgios Pinitas4c758512019-07-10 19:49:11 +0100335TEST_SUITE(Optimized)
Manuel Bottini05069f02019-09-26 17:18:26 +0100336FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100337 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
338 framework::dataset::make("DepthMultiplier", 1)),
339 framework::dataset::make("DataType",
340 DataType::F32)),
341 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
342 ActivationFunctionsDataset))
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000343{
344 validate(Accessor(_target), _reference, tolerance_f32);
345}
Manuel Bottini05069f02019-09-26 17:18:26 +0100346FIXTURE_DATA_TEST_CASE(RunSmall5x5, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
Georgios Pinitas4c758512019-07-10 19:49:11 +0100347 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
348 framework::dataset::make("DepthMultiplier", 1)),
349 framework::dataset::make("DataType",
350 DataType::F32)),
351 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
352 ActivationFunctionsDataset))
353{
354 validate(Accessor(_target), _reference, tolerance_f32);
355}
Manuel Bottini05069f02019-09-26 17:18:26 +0100356FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100357 combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
358 framework::dataset::make("DepthMultiplier", 1)),
359 framework::dataset::make("DataType",
360 DataType::F32)),
361 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
362 ActivationFunctionsDataset))
Georgios Pinitas4074c992018-01-30 18:13:46 +0000363{
364 validate(Accessor(_target), _reference, tolerance_f32);
365}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100366TEST_SUITE_END() // Optimized
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100367TEST_SUITE_END() // F32
Pablo Tello941cd702017-12-12 14:35:00 +0000368
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100369#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
370TEST_SUITE(F16)
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000371TEST_SUITE(Generic)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100372FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000373 depth_multipliers),
374 framework::dataset::make("DataType",
375 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100376 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
377 ActivationFunctionsDataset))
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000378{
379 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
380}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100381FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100382 large_depth_multipliers),
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000383 framework::dataset::make("DataType",
384 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100385 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
386 ActivationFunctionsDataset))
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000387{
388 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
389}
Usama Arif881f2de2019-04-12 10:29:17 +0100390
391TEST_SUITE(Dilation)
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000392FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
393 depth_multipliers),
394 framework::dataset::make("DataType",
395 DataType::F16)),
396 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
397 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100398{
399 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
400}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100401FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100402 large_depth_multipliers),
Usama Arif881f2de2019-04-12 10:29:17 +0100403 framework::dataset::make("DataType",
404 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100405 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
406 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100407{
408 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
409}
410TEST_SUITE_END() // Dilation
411
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000412TEST_SUITE_END() // Generic
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100413template <typename T>
Manuel Bottini05069f02019-09-26 17:18:26 +0100414using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Georgios Pinitas4c758512019-07-10 19:49:11 +0100415TEST_SUITE(W3x3)
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000416FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
417 depth_multipliers),
418 framework::dataset::make("DataType",
419 DataType::F16)),
420 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
421 ActivationFunctionsDataset))
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100422{
423 validate(Accessor(_target), _reference, tolerance_f16);
424}
Manuel Bottini05069f02019-09-26 17:18:26 +0100425FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
Georgios Pinitas4c758512019-07-10 19:49:11 +0100426 combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100427 large_depth_multipliers),
Georgios Pinitas4c758512019-07-10 19:49:11 +0100428 framework::dataset::make("DataType",
429 DataType::F16)),
430 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
431 ActivationFunctionsDataset))
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100432{
433 validate(Accessor(_target), _reference, tolerance_f16);
434}
Usama Arif881f2de2019-04-12 10:29:17 +0100435
436TEST_SUITE(Dilation)
437
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000438FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
Georgios Pinitas4c758512019-07-10 19:49:11 +0100439 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
440 depth_multipliers),
441 framework::dataset::make("DataType",
442 DataType::F16)),
443 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
444 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100445{
446 validate(Accessor(_target), _reference, tolerance_f16);
447}
Manuel Bottini05069f02019-09-26 17:18:26 +0100448FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100449 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100450 large_depth_multipliers),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100451 framework::dataset::make("DataType",
452 DataType::F16)),
453 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
454 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100455{
456 validate(Accessor(_target), _reference, tolerance_f16);
457}
458
459TEST_SUITE_END() // Dilation
Georgios Pinitas4c758512019-07-10 19:49:11 +0100460TEST_SUITE_END() // W3x3
Usama Arif881f2de2019-04-12 10:29:17 +0100461
Georgios Pinitas4c758512019-07-10 19:49:11 +0100462TEST_SUITE(Optimized)
Manuel Bottini05069f02019-09-26 17:18:26 +0100463FIXTURE_DATA_TEST_CASE(RunSmallW3x3, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100464 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
465 framework::dataset::make("DepthMultiplier", 1)),
466 framework::dataset::make("DataType",
467 DataType::F16)),
468 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
469 ActivationFunctionsDataset))
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000470{
471 validate(Accessor(_target), _reference, tolerance_f16);
472}
Manuel Bottini05069f02019-09-26 17:18:26 +0100473FIXTURE_DATA_TEST_CASE(RunSmallW5x5, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
Georgios Pinitas4c758512019-07-10 19:49:11 +0100474 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
475 framework::dataset::make("DepthMultiplier", 1)),
476 framework::dataset::make("DataType",
477 DataType::F16)),
478 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
479 ActivationFunctionsDataset))
480{
481 validate(Accessor(_target), _reference, tolerance_f16);
482}
Manuel Bottini05069f02019-09-26 17:18:26 +0100483FIXTURE_DATA_TEST_CASE(RunLargeW3x3, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100484 combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
485 framework::dataset::make("DepthMultiplier", 1)),
486 framework::dataset::make("DataType",
487 DataType::F16)),
488 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
489 ActivationFunctionsDataset))
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100490{
491 validate(Accessor(_target), _reference, tolerance_f16);
492}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100493TEST_SUITE_END() // Optimized
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100494TEST_SUITE_END() // FP16
495#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
496
497TEST_SUITE_END() // Float
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100498
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000499template <typename T>
Manuel Bottini05069f02019-09-26 17:18:26 +0100500using NEDepthwiseConvolutionLayerQuantizedFixtureOptimized = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Georgios Pinitasd05dce42018-01-22 16:29:17 +0000501template <typename T>
Giorgio Arenad93e2632019-10-15 11:09:33 +0100502using NEDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
503using NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture = DepthwiseConvolutionLayerValidationQuantizedPerChannelFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, uint8_t, int8_t>;
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000504
505TEST_SUITE(Quantized)
506TEST_SUITE(QASYMM8)
Georgios Pinitasd05dce42018-01-22 16:29:17 +0000507TEST_SUITE(Generic)
Giorgio Arena76572242018-04-04 17:44:26 +0100508FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100509 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
510 depth_multipliers),
511 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000512 input_qinfo_dataset),
Gian Marco Iodicee5ecd012019-08-28 15:56:36 +0100513 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000514 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100515 ActivationFunctionsDataset))
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000516{
517 validate(Accessor(_target), _reference, tolerance_qasymm8);
518}
Usama Arif881f2de2019-04-12 10:29:17 +0100519
520TEST_SUITE(Dilation)
521FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100522 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
523 depth_multipliers),
524 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000525 input_qinfo_dataset),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100526 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8f, 1) })),
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000527 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100528 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100529{
530 validate(Accessor(_target), _reference, tolerance_qasymm8);
531}
532FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100533 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100534 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100535 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000536 input_qinfo_dataset),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100537 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000538 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100539 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100540{
541 validate(Accessor(_target), _reference, tolerance_qasymm8);
542}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100543TEST_SUITE_END() // Dilation
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000544TEST_SUITE_END() // Generic
Giorgio Arena76572242018-04-04 17:44:26 +0100545TEST_SUITE(W3x3)
Georgios Pinitas4c758512019-07-10 19:49:11 +0100546FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100547 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers),
548 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000549 input_qinfo_dataset),
Gian Marco Iodicee5ecd012019-08-28 15:56:36 +0100550 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000551 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100552 ActivationFunctionsDataset))
Giorgio Arena76572242018-04-04 17:44:26 +0100553{
554 validate(Accessor(_target), _reference, tolerance_qasymm8);
555}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100556FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100557 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100558 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100559 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000560 input_qinfo_dataset),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100561 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000562 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100563 ActivationFunctionsDataset))
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000564{
565 validate(Accessor(_target), _reference, tolerance_qasymm8);
566}
Usama Arif881f2de2019-04-12 10:29:17 +0100567
568TEST_SUITE(Dilation)
569
Georgios Pinitas4c758512019-07-10 19:49:11 +0100570FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100571 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
572 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000573 input_qinfo_dataset),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100574 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 10) })),
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000575 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100576 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100577{
578 validate(Accessor(_target), _reference, tolerance_qasymm8);
579}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100580FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100581 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100582 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100583 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000584 input_qinfo_dataset),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100585 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000586 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100587 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100588{
589 validate(Accessor(_target), _reference, tolerance_qasymm8);
590}
591TEST_SUITE_END() // Dilation
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000592TEST_SUITE_END() // W3x3
Georgios Pinitas4c758512019-07-10 19:49:11 +0100593
594TEST_SUITE(Optimized)
595FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
596 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
597 framework::dataset::make("DepthMultiplier", 1)),
598 framework::dataset::make("DataType",
599 DataType::QASYMM8)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000600 input_qinfo_dataset),
Georgios Pinitas4c758512019-07-10 19:49:11 +0100601 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000602 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Georgios Pinitas4c758512019-07-10 19:49:11 +0100603 ActivationFunctionsDataset))
604{
605 validate(Accessor(_target), _reference, tolerance_qasymm8);
606}
607FIXTURE_DATA_TEST_CASE(RunSmall5x5, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
608 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
609 framework::dataset::make("DepthMultiplier", 1)),
610 framework::dataset::make("DataType",
611 DataType::QASYMM8)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000612 input_qinfo_dataset),
Georgios Pinitas4c758512019-07-10 19:49:11 +0100613 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000614 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Georgios Pinitas4c758512019-07-10 19:49:11 +0100615 ActivationFunctionsDataset))
616{
617 validate(Accessor(_target), _reference, tolerance_qasymm8);
618}
619FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
620 combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
621 framework::dataset::make("DepthMultiplier", 1)),
622 framework::dataset::make("DataType",
623 DataType::QASYMM8)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000624 input_qinfo_dataset),
Georgios Pinitas4c758512019-07-10 19:49:11 +0100625 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000626 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Georgios Pinitas4c758512019-07-10 19:49:11 +0100627 ActivationFunctionsDataset))
628{
629 validate(Accessor(_target), _reference, tolerance_qasymm8);
630}
631TEST_SUITE_END() // Optimized
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000632TEST_SUITE_END() // QASYMM8
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000633
634TEST_SUITE(QASYMM8_SIGNED)
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000635TEST_SUITE(Generic)
636FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
637 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
638 depth_multipliers),
639 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
640 input_qinfo_dataset),
641 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
642 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
643 ActivationFunctionsDataset))
644{
645 validate(Accessor(_target), _reference, tolerance_qasymm8);
646}
647
648TEST_SUITE(Dilation)
649FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
650 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
651 depth_multipliers),
652 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
653 input_qinfo_dataset),
654 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8f, 1) })),
655 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
656 ActivationFunctionsDataset))
657{
658 validate(Accessor(_target), _reference, tolerance_qasymm8);
659}
660FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::NIGHTLY,
661 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
662 large_depth_multipliers),
663 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
664 input_qinfo_dataset),
665 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
666 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
667 ActivationFunctionsDataset))
668{
669 validate(Accessor(_target), _reference, tolerance_qasymm8);
670}
671TEST_SUITE_END() // Dilation
672TEST_SUITE_END() // Generic
673
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000674TEST_SUITE(W3x3)
675FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT,
676 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers),
677 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
678 input_qinfo_dataset),
679 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
680 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
681 ActivationFunctionsDataset))
682{
683 validate(Accessor(_target), _reference, tolerance_qasymm8);
684}
685FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::NIGHTLY,
686 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
687 large_depth_multipliers),
688 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
689 input_qinfo_dataset),
690 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
691 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
692 ActivationFunctionsDataset))
693{
694 validate(Accessor(_target), _reference, tolerance_qasymm8);
695}
696
697TEST_SUITE(Dilation)
698FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT,
699 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
700 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
701 input_qinfo_dataset),
702 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 10) })),
703 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
704 ActivationFunctionsDataset))
705{
706 validate(Accessor(_target), _reference, tolerance_qasymm8);
707}
708FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::NIGHTLY,
709 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
710 large_depth_multipliers),
711 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
712 input_qinfo_dataset),
713 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
714 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
715 ActivationFunctionsDataset))
716{
717 validate(Accessor(_target), _reference, tolerance_qasymm8);
718}
719TEST_SUITE_END() // Dilation
720TEST_SUITE_END() // W3x3
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000721
722TEST_SUITE(Optimized)
723FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT,
724 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
725 framework::dataset::make("DepthMultiplier", 1)),
726 framework::dataset::make("DataType",
727 DataType::QASYMM8_SIGNED)),
728 input_qinfo_dataset),
729 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
730 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
731 ActivationFunctionsDataset))
732{
733 validate(Accessor(_target), _reference, tolerance_qasymm8);
734}
735FIXTURE_DATA_TEST_CASE(RunSmall5x5, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT,
736 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
737 framework::dataset::make("DepthMultiplier", 1)),
738 framework::dataset::make("DataType",
739 DataType::QASYMM8_SIGNED)),
740 input_qinfo_dataset),
741 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
742 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
743 ActivationFunctionsDataset))
744{
745 validate(Accessor(_target), _reference, tolerance_qasymm8);
746}
747FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::NIGHTLY,
748 combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
749 framework::dataset::make("DepthMultiplier", 1)),
750 framework::dataset::make("DataType",
751 DataType::QASYMM8_SIGNED)),
752 input_qinfo_dataset),
753 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
754 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
755 ActivationFunctionsDataset))
756{
757 validate(Accessor(_target), _reference, tolerance_qasymm8);
758}
759TEST_SUITE_END() // Optimized
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000760TEST_SUITE_END() // QASYMM8_SIGNED
761
Giorgio Arenad93e2632019-10-15 11:09:33 +0100762TEST_SUITE(QSYMM8_PER_CHANNEL)
763TEST_SUITE(Generic)
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000764FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT,
Giorgio Arenad93e2632019-10-15 11:09:33 +0100765 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
766 depth_multipliers),
767 framework::dataset::make("InputDataType", DataType::QASYMM8)),
768 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000769 input_qinfo_dataset),
Giorgio Arenad93e2632019-10-15 11:09:33 +0100770 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
771 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
772 ActivationFunctionsDataset))
773{
774 validate(Accessor(_target), _reference, tolerance_qasymm8);
775}
776
777TEST_SUITE(Dilation)
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000778FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT,
Giorgio Arenad93e2632019-10-15 11:09:33 +0100779 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
780 depth_multipliers),
781 framework::dataset::make("InputDataType", DataType::QASYMM8)),
782 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000783 input_qinfo_dataset),
Giorgio Arenad93e2632019-10-15 11:09:33 +0100784 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
785 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
786 ActivationFunctionsDataset))
787{
788 validate(Accessor(_target), _reference, tolerance_qasymm8);
789}
790FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY,
791 combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
792 depth_multipliers),
793 framework::dataset::make("InputDataType", DataType::QASYMM8)),
794 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000795 input_qinfo_dataset),
Giorgio Arenad93e2632019-10-15 11:09:33 +0100796 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
797 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
798 ActivationFunctionsDataset))
799{
800 validate(Accessor(_target), _reference, tolerance_qasymm8);
801}
802TEST_SUITE_END() // Dilation
803TEST_SUITE_END() // Generic
Giuseppe Rossinif01201a2019-11-06 14:57:49 +0000804
805TEST_SUITE(Optimized)
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000806FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT,
Giuseppe Rossinif01201a2019-11-06 14:57:49 +0000807 combine(combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
808 framework::dataset::make("DepthMultiplier", 1)),
809 framework::dataset::make("InputDataType", DataType::QASYMM8)),
810 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000811 input_qinfo_dataset),
Giuseppe Rossinif01201a2019-11-06 14:57:49 +0000812 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
813 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
814 ActivationFunctionsDataset))
815{
816 validate(Accessor(_target), _reference, tolerance_qasymm8);
817}
818FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY,
819 combine(combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
820 framework::dataset::make("DepthMultiplier", 1)),
821 framework::dataset::make("InputDataType", DataType::QASYMM8)),
822 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000823 input_qinfo_dataset),
Giuseppe Rossinif01201a2019-11-06 14:57:49 +0000824 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
825 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
826 ActivationFunctionsDataset))
827{
828 validate(Accessor(_target), _reference, tolerance_qasymm8);
829}
830TEST_SUITE_END() // Optimized
Giorgio Arenad93e2632019-10-15 11:09:33 +0100831TEST_SUITE_END() // QSYMM8_PER_CHANNEL
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000832TEST_SUITE_END() // Quantized
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000833
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000834TEST_SUITE_END() // DepthwiseConvLayer
835TEST_SUITE_END() // NEON
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100836} // namespace validation
837} // namespace test
838} // namespace arm_compute