blob: f4f568cffdeffa346e66101506261e6b5c005c00 [file] [log] [blame]
Michalis Spyrou7362f0d2017-10-18 17:58:22 +01001/*
Michele Di Giorgio13ec5f02020-01-02 12:11:13 +00002 * 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) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100528 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
529 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) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100541 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
542 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) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100552 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
553 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) })),
616 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
617 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) })),
628 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
629 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) })),
640 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
641 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)
649TEST_SUITE(W3x3)
650FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT,
651 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers),
652 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
653 input_qinfo_dataset),
654 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
655 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
656 ActivationFunctionsDataset))
657{
658 validate(Accessor(_target), _reference, tolerance_qasymm8);
659}
660FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::NIGHTLY,
661 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
662 large_depth_multipliers),
663 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
664 input_qinfo_dataset),
665 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
666 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
667 ActivationFunctionsDataset))
668{
669 validate(Accessor(_target), _reference, tolerance_qasymm8);
670}
671
672TEST_SUITE(Dilation)
673FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT,
674 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
675 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
676 input_qinfo_dataset),
677 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 10) })),
678 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
679 ActivationFunctionsDataset))
680{
681 validate(Accessor(_target), _reference, tolerance_qasymm8);
682}
683FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::NIGHTLY,
684 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
685 large_depth_multipliers),
686 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
687 input_qinfo_dataset),
688 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
689 framework::dataset::make("DataLayout", { DataLayout::NCHW })),
690 ActivationFunctionsDataset))
691{
692 validate(Accessor(_target), _reference, tolerance_qasymm8);
693}
694TEST_SUITE_END() // Dilation
695TEST_SUITE_END() // W3x3
696TEST_SUITE_END() // QASYMM8_SIGNED
697
Giorgio Arenad93e2632019-10-15 11:09:33 +0100698TEST_SUITE(QSYMM8_PER_CHANNEL)
699TEST_SUITE(Generic)
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000700FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT,
Giorgio Arenad93e2632019-10-15 11:09:33 +0100701 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
702 depth_multipliers),
703 framework::dataset::make("InputDataType", DataType::QASYMM8)),
704 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000705 input_qinfo_dataset),
Giorgio Arenad93e2632019-10-15 11:09:33 +0100706 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
707 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
708 ActivationFunctionsDataset))
709{
710 validate(Accessor(_target), _reference, tolerance_qasymm8);
711}
712
713TEST_SUITE(Dilation)
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000714FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT,
Giorgio Arenad93e2632019-10-15 11:09:33 +0100715 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
716 depth_multipliers),
717 framework::dataset::make("InputDataType", DataType::QASYMM8)),
718 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000719 input_qinfo_dataset),
Giorgio Arenad93e2632019-10-15 11:09:33 +0100720 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
721 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
722 ActivationFunctionsDataset))
723{
724 validate(Accessor(_target), _reference, tolerance_qasymm8);
725}
726FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY,
727 combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
728 depth_multipliers),
729 framework::dataset::make("InputDataType", DataType::QASYMM8)),
730 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000731 input_qinfo_dataset),
Giorgio Arenad93e2632019-10-15 11:09:33 +0100732 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
733 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
734 ActivationFunctionsDataset))
735{
736 validate(Accessor(_target), _reference, tolerance_qasymm8);
737}
738TEST_SUITE_END() // Dilation
739TEST_SUITE_END() // Generic
Giuseppe Rossinif01201a2019-11-06 14:57:49 +0000740
741TEST_SUITE(Optimized)
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000742FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT,
Giuseppe Rossinif01201a2019-11-06 14:57:49 +0000743 combine(combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
744 framework::dataset::make("DepthMultiplier", 1)),
745 framework::dataset::make("InputDataType", DataType::QASYMM8)),
746 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000747 input_qinfo_dataset),
Giuseppe Rossinif01201a2019-11-06 14:57:49 +0000748 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
749 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
750 ActivationFunctionsDataset))
751{
752 validate(Accessor(_target), _reference, tolerance_qasymm8);
753}
754FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY,
755 combine(combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
756 framework::dataset::make("DepthMultiplier", 1)),
757 framework::dataset::make("InputDataType", DataType::QASYMM8)),
758 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
Michele Di Giorgiof29d1b72019-10-29 10:58:13 +0000759 input_qinfo_dataset),
Giuseppe Rossinif01201a2019-11-06 14:57:49 +0000760 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
761 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
762 ActivationFunctionsDataset))
763{
764 validate(Accessor(_target), _reference, tolerance_qasymm8);
765}
766TEST_SUITE_END() // Optimized
Giorgio Arenad93e2632019-10-15 11:09:33 +0100767TEST_SUITE_END() // QSYMM8_PER_CHANNEL
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000768TEST_SUITE_END() // Quantized
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000769
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000770TEST_SUITE_END() // DepthwiseConvLayer
771TEST_SUITE_END() // NEON
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100772} // namespace validation
773} // namespace test
774} // namespace arm_compute