blob: 407ebe362a335619d150192aca71f85860909ff0 [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
180 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // Window shrinking
181 TensorInfo(TensorShape(32U, 13U, 8U), 1, DataType::QASYMM8), // Window shrinking
Abe Mbise7784c832018-05-31 16:48:41 +0100182 }),
183 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F16),
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, 2U), 1, DataType::F32),
188 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
189 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
Usama Arif881f2de2019-04-12 10:29:17 +0100190 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
191 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +0100192 TensorInfo(TensorShape(3U, 3U, 24U), 1, DataType::QASYMM8),
193 })),
194 framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32),
195 TensorInfo(TensorShape(2U), 1, DataType::F32),
196 TensorInfo(TensorShape(2U), 1, DataType::F32),
197 TensorInfo(TensorShape(4U), 1, DataType::F32),
198 TensorInfo(TensorShape(2U, 2U), 1, DataType::F32),
199 TensorInfo(TensorShape(2U), 1, DataType::F32),
200 TensorInfo(TensorShape(16U), 1, DataType::F32),
Usama Arif881f2de2019-04-12 10:29:17 +0100201 TensorInfo(TensorShape(16U), 1, DataType::F32),
202 TensorInfo(TensorShape(16U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +0100203 TensorInfo(TensorShape(24U), 1, DataType::S32),
204 })),
205 framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
206 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
207 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
208 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
209 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
210 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),
211 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
Usama Arif881f2de2019-04-12 10:29:17 +0100212 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
213 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +0100214 TensorInfo(TensorShape(32U, 11U, 24U), 1, DataType::QASYMM8),
215 })),
216 framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0),
217 PadStrideInfo(1, 1, 0, 0),
218 PadStrideInfo(1, 1, 0, 0),
219 PadStrideInfo(1, 1, 0, 0),
220 PadStrideInfo(1, 1, 0, 0),
221 PadStrideInfo(1, 1, 0, 0),
222 PadStrideInfo(1, 1, 0, 0),
Usama Arif881f2de2019-04-12 10:29:17 +0100223 PadStrideInfo(1, 1, 0, 0),
224 PadStrideInfo(1, 1, 0, 0),
Abe Mbise7784c832018-05-31 16:48:41 +0100225 PadStrideInfo(1, 1, 1, 0),
226 })),
227 framework::dataset::make("DepthMultiplier", { 1,
228 1,
229 3,
230 1,
231 1,
232 1,
233 2,
Usama Arif881f2de2019-04-12 10:29:17 +0100234 2,
235 2,
Abe Mbise7784c832018-05-31 16:48:41 +0100236 3,
237 })),
Usama Arif881f2de2019-04-12 10:29:17 +0100238 framework::dataset::make("Dilation", { Size2D(1U, 1U),
239 Size2D(1U, 1U),
240 Size2D(1U, 1U),
241 Size2D(1U, 1U),
242 Size2D(1U, 1U),
243 Size2D(1U, 1U),
244 Size2D(25U, 1U),
245 Size2D(0U, 1U),
246 Size2D(1U, 1U),
247 Size2D(1U, 1U),
248 })),
Giorgio Arenad93e2632019-10-15 11:09:33 +0100249 framework::dataset::make("Expected", { false, false, false, false, false, false,false, false, false, false })),
Usama Arif881f2de2019-04-12 10:29:17 +0100250 input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier,dilation, expected)
Abe Mbise7784c832018-05-31 16:48:41 +0100251{
Usama Arif881f2de2019-04-12 10:29:17 +0100252 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 +0100253 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
254}
255// clang-format on
256// *INDENT-ON*
Manuel Bottini05069f02019-09-26 17:18:26 +0100257template <typename T>
258using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Abe Mbise7784c832018-05-31 16:48:41 +0100259
Dmitry Savenkod7295b72017-11-20 22:00:08 +0700260TEST_SUITE(Float)
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100261TEST_SUITE(F32)
Michalis Spyroub7b31532017-11-23 12:10:21 +0000262TEST_SUITE(Generic)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100263FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
Giorgio Arena76572242018-04-04 17:44:26 +0100264 depth_multipliers),
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000265 framework::dataset::make("DataType",
Giorgio Arena1ed1fc62018-03-26 16:20:05 +0100266 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100267 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
268 ActivationFunctionsDataset))
Michalis Spyroub7b31532017-11-23 12:10:21 +0000269{
270 validate(Accessor(_target), _reference, tolerance_f32);
271}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100272FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100273 large_depth_multipliers),
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000274 framework::dataset::make("DataType",
Giorgio Arena1ed1fc62018-03-26 16:20:05 +0100275 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100276 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
277 ActivationFunctionsDataset))
Michalis Spyroub7b31532017-11-23 12:10:21 +0000278{
279 validate(Accessor(_target), _reference, tolerance_f32);
280}
Usama Arif881f2de2019-04-12 10:29:17 +0100281
282TEST_SUITE(Dilation)
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000283FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
284 depth_multipliers),
285 framework::dataset::make("DataType",
286 DataType::F32)),
287 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
288 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100289{
290 validate(Accessor(_target), _reference, tolerance_f32);
291}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100292FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100293 large_depth_multipliers),
Usama Arif881f2de2019-04-12 10:29:17 +0100294 framework::dataset::make("DataType",
295 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100296 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
297 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100298{
299 validate(Accessor(_target), _reference, tolerance_f32);
300}
301TEST_SUITE_END() // Dilation
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100302TEST_SUITE_END() // Generic
Michalis Spyroub7b31532017-11-23 12:10:21 +0000303
Georgios Pinitas4c758512019-07-10 19:49:11 +0100304TEST_SUITE(W3x3)
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000305FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
306 depth_multipliers),
307 framework::dataset::make("DataType",
308 DataType::F32)),
309 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
310 ActivationFunctionsDataset))
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100311{
312 validate(Accessor(_target), _reference, tolerance_f32);
313}
Manuel Bottini05069f02019-09-26 17:18:26 +0100314FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
Georgios Pinitas4c758512019-07-10 19:49:11 +0100315 combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100316 large_depth_multipliers),
Georgios Pinitas4c758512019-07-10 19:49:11 +0100317 framework::dataset::make("DataType",
318 DataType::F32)),
319 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
320 ActivationFunctionsDataset))
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100321{
322 validate(Accessor(_target), _reference, tolerance_f32);
323}
Usama Arif881f2de2019-04-12 10:29:17 +0100324TEST_SUITE(Dilation)
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000325FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
Georgios Pinitas4c758512019-07-10 19:49:11 +0100326 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
327 depth_multipliers),
328 framework::dataset::make("DataType",
329 DataType::F32)),
330 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
331 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100332{
333 validate(Accessor(_target), _reference, tolerance_f32);
334}
Manuel Bottini05069f02019-09-26 17:18:26 +0100335FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100336 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100337 large_depth_multipliers),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100338 framework::dataset::make("DataType",
339 DataType::F32)),
340 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
341 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100342{
343 validate(Accessor(_target), _reference, tolerance_f32);
344}
345
346TEST_SUITE_END() // Dilation
Georgios Pinitas4c758512019-07-10 19:49:11 +0100347TEST_SUITE_END() // W3x3
Usama Arif881f2de2019-04-12 10:29:17 +0100348
Georgios Pinitas4c758512019-07-10 19:49:11 +0100349TEST_SUITE(Optimized)
Manuel Bottini05069f02019-09-26 17:18:26 +0100350FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100351 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
352 framework::dataset::make("DepthMultiplier", 1)),
353 framework::dataset::make("DataType",
354 DataType::F32)),
355 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
356 ActivationFunctionsDataset))
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000357{
358 validate(Accessor(_target), _reference, tolerance_f32);
359}
Manuel Bottini05069f02019-09-26 17:18:26 +0100360FIXTURE_DATA_TEST_CASE(RunSmall5x5, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
Georgios Pinitas4c758512019-07-10 19:49:11 +0100361 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
362 framework::dataset::make("DepthMultiplier", 1)),
363 framework::dataset::make("DataType",
364 DataType::F32)),
365 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
366 ActivationFunctionsDataset))
367{
368 validate(Accessor(_target), _reference, tolerance_f32);
369}
Manuel Bottini05069f02019-09-26 17:18:26 +0100370FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100371 combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
372 framework::dataset::make("DepthMultiplier", 1)),
373 framework::dataset::make("DataType",
374 DataType::F32)),
375 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
376 ActivationFunctionsDataset))
Georgios Pinitas4074c992018-01-30 18:13:46 +0000377{
378 validate(Accessor(_target), _reference, tolerance_f32);
379}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100380TEST_SUITE_END() // Optimized
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100381TEST_SUITE_END() // F32
Pablo Tello941cd702017-12-12 14:35:00 +0000382
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100383#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
384TEST_SUITE(F16)
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000385TEST_SUITE(Generic)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100386FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000387 depth_multipliers),
388 framework::dataset::make("DataType",
389 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100390 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
391 ActivationFunctionsDataset))
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000392{
393 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
394}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100395FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100396 large_depth_multipliers),
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000397 framework::dataset::make("DataType",
398 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100399 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
400 ActivationFunctionsDataset))
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000401{
402 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
403}
Usama Arif881f2de2019-04-12 10:29:17 +0100404
405TEST_SUITE(Dilation)
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000406FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
407 depth_multipliers),
408 framework::dataset::make("DataType",
409 DataType::F16)),
410 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
411 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100412{
413 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
414}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100415FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100416 large_depth_multipliers),
Usama Arif881f2de2019-04-12 10:29:17 +0100417 framework::dataset::make("DataType",
418 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100419 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
420 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100421{
422 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
423}
424TEST_SUITE_END() // Dilation
425
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000426TEST_SUITE_END() // Generic
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100427template <typename T>
Manuel Bottini05069f02019-09-26 17:18:26 +0100428using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Georgios Pinitas4c758512019-07-10 19:49:11 +0100429TEST_SUITE(W3x3)
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000430FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
431 depth_multipliers),
432 framework::dataset::make("DataType",
433 DataType::F16)),
434 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
435 ActivationFunctionsDataset))
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100436{
437 validate(Accessor(_target), _reference, tolerance_f16);
438}
Manuel Bottini05069f02019-09-26 17:18:26 +0100439FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
Georgios Pinitas4c758512019-07-10 19:49:11 +0100440 combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100441 large_depth_multipliers),
Georgios Pinitas4c758512019-07-10 19:49:11 +0100442 framework::dataset::make("DataType",
443 DataType::F16)),
444 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
445 ActivationFunctionsDataset))
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100446{
447 validate(Accessor(_target), _reference, tolerance_f16);
448}
Usama Arif881f2de2019-04-12 10:29:17 +0100449
450TEST_SUITE(Dilation)
451
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000452FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
Georgios Pinitas4c758512019-07-10 19:49:11 +0100453 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
454 depth_multipliers),
455 framework::dataset::make("DataType",
456 DataType::F16)),
457 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
458 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100459{
460 validate(Accessor(_target), _reference, tolerance_f16);
461}
Manuel Bottini05069f02019-09-26 17:18:26 +0100462FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100463 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100464 large_depth_multipliers),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100465 framework::dataset::make("DataType",
466 DataType::F16)),
467 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
468 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100469{
470 validate(Accessor(_target), _reference, tolerance_f16);
471}
472
473TEST_SUITE_END() // Dilation
Georgios Pinitas4c758512019-07-10 19:49:11 +0100474TEST_SUITE_END() // W3x3
Usama Arif881f2de2019-04-12 10:29:17 +0100475
Georgios Pinitas4c758512019-07-10 19:49:11 +0100476TEST_SUITE(Optimized)
Manuel Bottini05069f02019-09-26 17:18:26 +0100477FIXTURE_DATA_TEST_CASE(RunSmallW3x3, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100478 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
479 framework::dataset::make("DepthMultiplier", 1)),
480 framework::dataset::make("DataType",
481 DataType::F16)),
482 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
483 ActivationFunctionsDataset))
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000484{
485 validate(Accessor(_target), _reference, tolerance_f16);
486}
Manuel Bottini05069f02019-09-26 17:18:26 +0100487FIXTURE_DATA_TEST_CASE(RunSmallW5x5, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
Georgios Pinitas4c758512019-07-10 19:49:11 +0100488 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
489 framework::dataset::make("DepthMultiplier", 1)),
490 framework::dataset::make("DataType",
491 DataType::F16)),
492 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
493 ActivationFunctionsDataset))
494{
495 validate(Accessor(_target), _reference, tolerance_f16);
496}
Manuel Bottini05069f02019-09-26 17:18:26 +0100497FIXTURE_DATA_TEST_CASE(RunLargeW3x3, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100498 combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
499 framework::dataset::make("DepthMultiplier", 1)),
500 framework::dataset::make("DataType",
501 DataType::F16)),
502 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
503 ActivationFunctionsDataset))
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100504{
505 validate(Accessor(_target), _reference, tolerance_f16);
506}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100507TEST_SUITE_END() // Optimized
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100508TEST_SUITE_END() // FP16
509#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
510
511TEST_SUITE_END() // Float
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100512
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000513template <typename T>
Manuel Bottini05069f02019-09-26 17:18:26 +0100514using NEDepthwiseConvolutionLayerQuantizedFixtureOptimized = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Georgios Pinitasd05dce42018-01-22 16:29:17 +0000515template <typename T>
Giorgio Arenad93e2632019-10-15 11:09:33 +0100516using NEDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
517using NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture = DepthwiseConvolutionLayerValidationQuantizedPerChannelFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, uint8_t, int8_t>;
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000518
519TEST_SUITE(Quantized)
520TEST_SUITE(QASYMM8)
Georgios Pinitasd05dce42018-01-22 16:29:17 +0000521TEST_SUITE(Generic)
Giorgio Arena76572242018-04-04 17:44:26 +0100522FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100523 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
524 depth_multipliers),
525 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000526 input_qinfo_dataset),
Gian Marco Iodicee5ecd012019-08-28 15:56:36 +0100527 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000528 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100529 ActivationFunctionsDataset))
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000530{
531 validate(Accessor(_target), _reference, tolerance_qasymm8);
532}
Usama Arif881f2de2019-04-12 10:29:17 +0100533
534TEST_SUITE(Dilation)
535FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100536 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
537 depth_multipliers),
538 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000539 input_qinfo_dataset),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100540 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8f, 1) })),
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000541 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100542 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100543{
544 validate(Accessor(_target), _reference, tolerance_qasymm8);
545}
546FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100547 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100548 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100549 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000550 input_qinfo_dataset),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100551 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000552 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100553 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100554{
555 validate(Accessor(_target), _reference, tolerance_qasymm8);
556}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100557TEST_SUITE_END() // Dilation
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000558TEST_SUITE_END() // Generic
Giorgio Arena76572242018-04-04 17:44:26 +0100559TEST_SUITE(W3x3)
Georgios Pinitas4c758512019-07-10 19:49:11 +0100560FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100561 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers),
562 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000563 input_qinfo_dataset),
Gian Marco Iodicee5ecd012019-08-28 15:56:36 +0100564 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000565 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100566 ActivationFunctionsDataset))
Giorgio Arena76572242018-04-04 17:44:26 +0100567{
568 validate(Accessor(_target), _reference, tolerance_qasymm8);
569}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100570FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100571 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100572 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100573 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000574 input_qinfo_dataset),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100575 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000576 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100577 ActivationFunctionsDataset))
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000578{
579 validate(Accessor(_target), _reference, tolerance_qasymm8);
580}
Usama Arif881f2de2019-04-12 10:29:17 +0100581
582TEST_SUITE(Dilation)
583
Georgios Pinitas4c758512019-07-10 19:49:11 +0100584FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100585 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
586 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000587 input_qinfo_dataset),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100588 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 10) })),
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000589 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100590 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100591{
592 validate(Accessor(_target), _reference, tolerance_qasymm8);
593}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100594FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100595 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100596 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100597 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000598 input_qinfo_dataset),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100599 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000600 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100601 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100602{
603 validate(Accessor(_target), _reference, tolerance_qasymm8);
604}
605TEST_SUITE_END() // Dilation
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000606TEST_SUITE_END() // W3x3
Georgios Pinitas4c758512019-07-10 19:49:11 +0100607
608TEST_SUITE(Optimized)
609FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
610 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
611 framework::dataset::make("DepthMultiplier", 1)),
612 framework::dataset::make("DataType",
613 DataType::QASYMM8)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000614 input_qinfo_dataset),
Georgios Pinitas4c758512019-07-10 19:49:11 +0100615 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000616 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Georgios Pinitas4c758512019-07-10 19:49:11 +0100617 ActivationFunctionsDataset))
618{
619 validate(Accessor(_target), _reference, tolerance_qasymm8);
620}
621FIXTURE_DATA_TEST_CASE(RunSmall5x5, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
622 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
623 framework::dataset::make("DepthMultiplier", 1)),
624 framework::dataset::make("DataType",
625 DataType::QASYMM8)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000626 input_qinfo_dataset),
Georgios Pinitas4c758512019-07-10 19:49:11 +0100627 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000628 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Georgios Pinitas4c758512019-07-10 19:49:11 +0100629 ActivationFunctionsDataset))
630{
631 validate(Accessor(_target), _reference, tolerance_qasymm8);
632}
633FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
634 combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
635 framework::dataset::make("DepthMultiplier", 1)),
636 framework::dataset::make("DataType",
637 DataType::QASYMM8)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000638 input_qinfo_dataset),
Georgios Pinitas4c758512019-07-10 19:49:11 +0100639 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000640 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Georgios Pinitas4c758512019-07-10 19:49:11 +0100641 ActivationFunctionsDataset))
642{
643 validate(Accessor(_target), _reference, tolerance_qasymm8);
644}
645TEST_SUITE_END() // Optimized
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000646TEST_SUITE_END() // QASYMM8
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000647
648TEST_SUITE(QASYMM8_SIGNED)
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000649TEST_SUITE(Generic)
650FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
651 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
652 depth_multipliers),
653 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
654 input_qinfo_dataset),
655 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
656 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
657 ActivationFunctionsDataset))
658{
659 validate(Accessor(_target), _reference, tolerance_qasymm8);
660}
661
662TEST_SUITE(Dilation)
663FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT,
664 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
665 depth_multipliers),
666 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
667 input_qinfo_dataset),
668 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8f, 1) })),
669 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
670 ActivationFunctionsDataset))
671{
672 validate(Accessor(_target), _reference, tolerance_qasymm8);
673}
674FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::NIGHTLY,
675 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
676 large_depth_multipliers),
677 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
678 input_qinfo_dataset),
679 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
680 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
681 ActivationFunctionsDataset))
682{
683 validate(Accessor(_target), _reference, tolerance_qasymm8);
684}
685TEST_SUITE_END() // Dilation
686TEST_SUITE_END() // Generic
687
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000688TEST_SUITE(W3x3)
689FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT,
690 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers),
691 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
692 input_qinfo_dataset),
693 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
694 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
695 ActivationFunctionsDataset))
696{
697 validate(Accessor(_target), _reference, tolerance_qasymm8);
698}
699FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::NIGHTLY,
700 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
701 large_depth_multipliers),
702 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
703 input_qinfo_dataset),
704 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
705 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
706 ActivationFunctionsDataset))
707{
708 validate(Accessor(_target), _reference, tolerance_qasymm8);
709}
710
711TEST_SUITE(Dilation)
712FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT,
713 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
714 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
715 input_qinfo_dataset),
716 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 10) })),
717 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
718 ActivationFunctionsDataset))
719{
720 validate(Accessor(_target), _reference, tolerance_qasymm8);
721}
722FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::NIGHTLY,
723 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
724 large_depth_multipliers),
725 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
726 input_qinfo_dataset),
727 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
728 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
729 ActivationFunctionsDataset))
730{
731 validate(Accessor(_target), _reference, tolerance_qasymm8);
732}
733TEST_SUITE_END() // Dilation
734TEST_SUITE_END() // W3x3
Michele Di Giorgio8c837ca2020-01-07 15:06:41 +0000735
736TEST_SUITE(Optimized)
737FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT,
738 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
739 framework::dataset::make("DepthMultiplier", 1)),
740 framework::dataset::make("DataType",
741 DataType::QASYMM8_SIGNED)),
742 input_qinfo_dataset),
743 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
744 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
745 ActivationFunctionsDataset))
746{
747 validate(Accessor(_target), _reference, tolerance_qasymm8);
748}
749FIXTURE_DATA_TEST_CASE(RunSmall5x5, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT,
750 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
751 framework::dataset::make("DepthMultiplier", 1)),
752 framework::dataset::make("DataType",
753 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))
758{
759 validate(Accessor(_target), _reference, tolerance_qasymm8);
760}
761FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::NIGHTLY,
762 combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
763 framework::dataset::make("DepthMultiplier", 1)),
764 framework::dataset::make("DataType",
765 DataType::QASYMM8_SIGNED)),
766 input_qinfo_dataset),
767 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
768 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
769 ActivationFunctionsDataset))
770{
771 validate(Accessor(_target), _reference, tolerance_qasymm8);
772}
773TEST_SUITE_END() // Optimized
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +0000774TEST_SUITE_END() // QASYMM8_SIGNED
775
Giorgio Arenad93e2632019-10-15 11:09:33 +0100776TEST_SUITE(QSYMM8_PER_CHANNEL)
777TEST_SUITE(Generic)
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::SmallDepthwiseConvolutionLayerDataset(),
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}
790
791TEST_SUITE(Dilation)
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000792FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT,
Giorgio Arenad93e2632019-10-15 11:09:33 +0100793 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
794 depth_multipliers),
795 framework::dataset::make("InputDataType", DataType::QASYMM8)),
796 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000797 input_qinfo_dataset),
Giorgio Arenad93e2632019-10-15 11:09:33 +0100798 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
799 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
800 ActivationFunctionsDataset))
801{
802 validate(Accessor(_target), _reference, tolerance_qasymm8);
803}
804FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY,
805 combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
806 depth_multipliers),
807 framework::dataset::make("InputDataType", DataType::QASYMM8)),
808 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000809 input_qinfo_dataset),
Giorgio Arenad93e2632019-10-15 11:09:33 +0100810 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
811 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
812 ActivationFunctionsDataset))
813{
814 validate(Accessor(_target), _reference, tolerance_qasymm8);
815}
816TEST_SUITE_END() // Dilation
817TEST_SUITE_END() // Generic
Giuseppe Rossinif01201a2019-11-06 14:57:49 +0000818
819TEST_SUITE(Optimized)
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000820FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT,
Giuseppe Rossinif01201a2019-11-06 14:57:49 +0000821 combine(combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
822 framework::dataset::make("DepthMultiplier", 1)),
823 framework::dataset::make("InputDataType", DataType::QASYMM8)),
824 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000825 input_qinfo_dataset),
Giuseppe Rossinif01201a2019-11-06 14:57:49 +0000826 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
827 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
828 ActivationFunctionsDataset))
829{
830 validate(Accessor(_target), _reference, tolerance_qasymm8);
831}
832FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY,
833 combine(combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
834 framework::dataset::make("DepthMultiplier", 1)),
835 framework::dataset::make("InputDataType", DataType::QASYMM8)),
836 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000837 input_qinfo_dataset),
Giuseppe Rossinif01201a2019-11-06 14:57:49 +0000838 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
839 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
840 ActivationFunctionsDataset))
841{
842 validate(Accessor(_target), _reference, tolerance_qasymm8);
843}
844TEST_SUITE_END() // Optimized
Giorgio Arenad93e2632019-10-15 11:09:33 +0100845TEST_SUITE_END() // QSYMM8_PER_CHANNEL
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000846TEST_SUITE_END() // Quantized
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000847
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000848TEST_SUITE_END() // DepthwiseConvLayer
849TEST_SUITE_END() // NEON
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100850} // namespace validation
851} // namespace test
852} // namespace arm_compute