blob: 6d8c083c3f77a281a58a6b3fa3efc711a694f2fb [file] [log] [blame]
Michalis Spyrou7362f0d2017-10-18 17:58:22 +01001/*
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +00002 * Copyright (c) 2017-2019 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});
Michalis Spyrou7362f0d2017-10-18 17:58:22 +010065} // namespace
66
67TEST_SUITE(NEON)
Manuel Bottinia788c2f2019-04-08 13:18:00 +010068TEST_SUITE(DepthwiseConvolutionLayer)
Michalis Spyrou7362f0d2017-10-18 17:58:22 +010069
Abe Mbise7784c832018-05-31 16:48:41 +010070// *INDENT-OFF*
71// clang-format off
Usama Arif881f2de2019-04-12 10:29:17 +010072DATA_TEST_CASE(Validate3x3, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
Abe Mbise7784c832018-05-31 16:48:41 +010073 framework::dataset::make("InputInfo", { TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Mismatching data type input/weights
74 TensorInfo(TensorShape(32U, 18U, 3U), 1, DataType::F32), // Mismatching input feature maps
75 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Unsupported weights dimensions
76 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Mismatching depth multiplier
Giorgio Arena66cbafb2018-08-23 14:51:00 +010077 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::QASYMM8), // Invalid stride
Abe Mbise7784c832018-05-31 16:48:41 +010078 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid biases size
79 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid biases dimensions
80 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid output size
Usama Arif881f2de2019-04-12 10:29:17 +010081 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // patch size bigger than input width
82 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // dilation < 1
Giorgio Arena66cbafb2018-08-23 14:51:00 +010083 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +010084 }),
Giorgio Arena66cbafb2018-08-23 14:51:00 +010085 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16),
86 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
87 TensorInfo(TensorShape(5U, 5U, 2U, 2U), 1, DataType::F32),
88 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
89 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::QASYMM8),
90 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
91 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
92 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
93 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
Usama Arif881f2de2019-04-12 10:29:17 +010094 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
95 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +010096 })),
97 framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32),
98 TensorInfo(TensorShape(2U), 1, DataType::F32),
99 TensorInfo(TensorShape(2U), 1, DataType::F32),
100 TensorInfo(TensorShape(2U), 1, DataType::F32),
Giorgio Arena66cbafb2018-08-23 14:51:00 +0100101 TensorInfo(TensorShape(2U), 1, DataType::S32),
Abe Mbise7784c832018-05-31 16:48:41 +0100102 TensorInfo(TensorShape(4U), 1, DataType::F32),
103 TensorInfo(TensorShape(2U, 2U), 1, DataType::F32),
104 TensorInfo(TensorShape(2U), 1, DataType::F32),
105 TensorInfo(TensorShape(2U), 1, DataType::F32),
Usama Arif881f2de2019-04-12 10:29:17 +0100106 TensorInfo(TensorShape(2U), 1, DataType::F32),
107 TensorInfo(TensorShape(2U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +0100108 })),
109 framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
110 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
111 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
112 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
Giorgio Arena66cbafb2018-08-23 14:51:00 +0100113 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::QASYMM8),
Abe Mbise7784c832018-05-31 16:48:41 +0100114 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
115 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
116 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32),
117 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
Usama Arif881f2de2019-04-12 10:29:17 +0100118 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
119 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +0100120 })),
121 framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0),
122 PadStrideInfo(1, 1, 0, 0),
123 PadStrideInfo(1, 1, 0, 0),
124 PadStrideInfo(1, 1, 0, 0),
125 PadStrideInfo(4, 1, 0, 0),
126 PadStrideInfo(1, 1, 0, 0),
127 PadStrideInfo(1, 1, 0, 0),
128 PadStrideInfo(1, 1, 0, 0),
129 PadStrideInfo(1, 1, 0, 0),
Usama Arif881f2de2019-04-12 10:29:17 +0100130 PadStrideInfo(1, 1, 0, 0),
131 PadStrideInfo(1, 1, 0, 0),
Abe Mbise7784c832018-05-31 16:48:41 +0100132 })),
133 framework::dataset::make("DepthMultiplier", { 1,
134 1,
135 1,
136 3,
137 1,
138 1,
139 1,
140 1,
141 1,
Usama Arif881f2de2019-04-12 10:29:17 +0100142 1,
143 1,
Abe Mbise7784c832018-05-31 16:48:41 +0100144 })),
Usama Arif881f2de2019-04-12 10:29:17 +0100145 framework::dataset::make("Dilation", { Size2D(1U, 1U),
146 Size2D(1U, 1U),
147 Size2D(1U, 1U),
148 Size2D(1U, 1U),
149 Size2D(1U, 1U),
150 Size2D(1U, 1U),
151 Size2D(1U, 1U),
152 Size2D(1U, 1U),
153 Size2D(25U, 1U),
154 Size2D(0U, 1U),
155 Size2D(1U, 1U),
156 })),
157 framework::dataset::make("Expected", { false, false, false, false, false, false, false, false, false, false, true })),
158 input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier,dilation, expected)
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100159{
Manuel Bottini05069f02019-09-26 17:18:26 +0100160 bool is_valid = bool(NEDepthwiseConvolutionLayer::validate(&input_info.clone()->set_is_resizable(false),
Usama Arif881f2de2019-04-12 10:29:17 +0100161 &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 +0100162 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100163}
164
Usama Arif881f2de2019-04-12 10:29:17 +0100165DATA_TEST_CASE(ValidateGeneric, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
Giorgio Arenad93e2632019-10-15 11:09:33 +0100166 framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type input/weights
167 TensorInfo(TensorShape(27U, 13U, 3U), 1, DataType::F32), // Mismatching input feature maps
168 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching depth multiplier
169 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases size
170 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases dimensions
171 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid output size
172 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // Patch size bigger than input width
173 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // Dilation < 1
174 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // Window shrinking
175 TensorInfo(TensorShape(32U, 13U, 8U), 1, DataType::QASYMM8), // Window shrinking
Abe Mbise7784c832018-05-31 16:48:41 +0100176 }),
177 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F16),
178 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
179 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
180 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
181 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
182 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
183 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
Usama Arif881f2de2019-04-12 10:29:17 +0100184 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
185 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +0100186 TensorInfo(TensorShape(3U, 3U, 24U), 1, DataType::QASYMM8),
187 })),
188 framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32),
189 TensorInfo(TensorShape(2U), 1, DataType::F32),
190 TensorInfo(TensorShape(2U), 1, DataType::F32),
191 TensorInfo(TensorShape(4U), 1, DataType::F32),
192 TensorInfo(TensorShape(2U, 2U), 1, DataType::F32),
193 TensorInfo(TensorShape(2U), 1, DataType::F32),
194 TensorInfo(TensorShape(16U), 1, DataType::F32),
Usama Arif881f2de2019-04-12 10:29:17 +0100195 TensorInfo(TensorShape(16U), 1, DataType::F32),
196 TensorInfo(TensorShape(16U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +0100197 TensorInfo(TensorShape(24U), 1, DataType::S32),
198 })),
199 framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
200 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
201 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
202 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
203 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
204 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),
205 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
Usama Arif881f2de2019-04-12 10:29:17 +0100206 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
207 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +0100208 TensorInfo(TensorShape(32U, 11U, 24U), 1, DataType::QASYMM8),
209 })),
210 framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0),
211 PadStrideInfo(1, 1, 0, 0),
212 PadStrideInfo(1, 1, 0, 0),
213 PadStrideInfo(1, 1, 0, 0),
214 PadStrideInfo(1, 1, 0, 0),
215 PadStrideInfo(1, 1, 0, 0),
216 PadStrideInfo(1, 1, 0, 0),
Usama Arif881f2de2019-04-12 10:29:17 +0100217 PadStrideInfo(1, 1, 0, 0),
218 PadStrideInfo(1, 1, 0, 0),
Abe Mbise7784c832018-05-31 16:48:41 +0100219 PadStrideInfo(1, 1, 1, 0),
220 })),
221 framework::dataset::make("DepthMultiplier", { 1,
222 1,
223 3,
224 1,
225 1,
226 1,
227 2,
Usama Arif881f2de2019-04-12 10:29:17 +0100228 2,
229 2,
Abe Mbise7784c832018-05-31 16:48:41 +0100230 3,
231 })),
Usama Arif881f2de2019-04-12 10:29:17 +0100232 framework::dataset::make("Dilation", { Size2D(1U, 1U),
233 Size2D(1U, 1U),
234 Size2D(1U, 1U),
235 Size2D(1U, 1U),
236 Size2D(1U, 1U),
237 Size2D(1U, 1U),
238 Size2D(25U, 1U),
239 Size2D(0U, 1U),
240 Size2D(1U, 1U),
241 Size2D(1U, 1U),
242 })),
Giorgio Arenad93e2632019-10-15 11:09:33 +0100243 framework::dataset::make("Expected", { false, false, false, false, false, false,false, false, false, false })),
Usama Arif881f2de2019-04-12 10:29:17 +0100244 input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier,dilation, expected)
Abe Mbise7784c832018-05-31 16:48:41 +0100245{
Usama Arif881f2de2019-04-12 10:29:17 +0100246 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 +0100247 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
248}
249// clang-format on
250// *INDENT-ON*
Manuel Bottini05069f02019-09-26 17:18:26 +0100251template <typename T>
252using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Abe Mbise7784c832018-05-31 16:48:41 +0100253
Dmitry Savenkod7295b72017-11-20 22:00:08 +0700254TEST_SUITE(Float)
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100255TEST_SUITE(F32)
Michalis Spyroub7b31532017-11-23 12:10:21 +0000256TEST_SUITE(Generic)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100257FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
Giorgio Arena76572242018-04-04 17:44:26 +0100258 depth_multipliers),
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000259 framework::dataset::make("DataType",
Giorgio Arena1ed1fc62018-03-26 16:20:05 +0100260 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100261 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
262 ActivationFunctionsDataset))
Michalis Spyroub7b31532017-11-23 12:10:21 +0000263{
264 validate(Accessor(_target), _reference, tolerance_f32);
265}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100266FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100267 large_depth_multipliers),
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000268 framework::dataset::make("DataType",
Giorgio Arena1ed1fc62018-03-26 16:20:05 +0100269 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100270 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
271 ActivationFunctionsDataset))
Michalis Spyroub7b31532017-11-23 12:10:21 +0000272{
273 validate(Accessor(_target), _reference, tolerance_f32);
274}
Usama Arif881f2de2019-04-12 10:29:17 +0100275
276TEST_SUITE(Dilation)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100277FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
Usama Arif881f2de2019-04-12 10:29:17 +0100278 depth_multipliers),
279 framework::dataset::make("DataType",
280 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100281 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
282 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100283{
284 validate(Accessor(_target), _reference, tolerance_f32);
285}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100286FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100287 large_depth_multipliers),
Usama Arif881f2de2019-04-12 10:29:17 +0100288 framework::dataset::make("DataType",
289 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100290 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
291 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100292{
293 validate(Accessor(_target), _reference, tolerance_f32);
294}
295TEST_SUITE_END() // Dilation
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100296TEST_SUITE_END() // Generic
Michalis Spyroub7b31532017-11-23 12:10:21 +0000297
Georgios Pinitas4c758512019-07-10 19:49:11 +0100298TEST_SUITE(W3x3)
Manuel Bottini05069f02019-09-26 17:18:26 +0100299FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
300 depth_multipliers),
301 framework::dataset::make("DataType",
302 DataType::F32)),
303 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
304 ActivationFunctionsDataset))
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100305{
306 validate(Accessor(_target), _reference, tolerance_f32);
307}
Manuel Bottini05069f02019-09-26 17:18:26 +0100308FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
Georgios Pinitas4c758512019-07-10 19:49:11 +0100309 combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100310 large_depth_multipliers),
Georgios Pinitas4c758512019-07-10 19:49:11 +0100311 framework::dataset::make("DataType",
312 DataType::F32)),
313 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
314 ActivationFunctionsDataset))
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100315{
316 validate(Accessor(_target), _reference, tolerance_f32);
317}
Usama Arif881f2de2019-04-12 10:29:17 +0100318TEST_SUITE(Dilation)
Manuel Bottini05069f02019-09-26 17:18:26 +0100319FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL,
Georgios Pinitas4c758512019-07-10 19:49:11 +0100320 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
321 depth_multipliers),
322 framework::dataset::make("DataType",
323 DataType::F32)),
324 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
325 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100326{
327 validate(Accessor(_target), _reference, tolerance_f32);
328}
Manuel Bottini05069f02019-09-26 17:18:26 +0100329FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100330 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100331 large_depth_multipliers),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100332 framework::dataset::make("DataType",
333 DataType::F32)),
334 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
335 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100336{
337 validate(Accessor(_target), _reference, tolerance_f32);
338}
339
340TEST_SUITE_END() // Dilation
Georgios Pinitas4c758512019-07-10 19:49:11 +0100341TEST_SUITE_END() // W3x3
Usama Arif881f2de2019-04-12 10:29:17 +0100342
Georgios Pinitas4c758512019-07-10 19:49:11 +0100343TEST_SUITE(Optimized)
Manuel Bottini05069f02019-09-26 17:18:26 +0100344FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100345 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
346 framework::dataset::make("DepthMultiplier", 1)),
347 framework::dataset::make("DataType",
348 DataType::F32)),
349 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
350 ActivationFunctionsDataset))
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000351{
352 validate(Accessor(_target), _reference, tolerance_f32);
353}
Manuel Bottini05069f02019-09-26 17:18:26 +0100354FIXTURE_DATA_TEST_CASE(RunSmall5x5, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT,
Georgios Pinitas4c758512019-07-10 19:49:11 +0100355 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
356 framework::dataset::make("DepthMultiplier", 1)),
357 framework::dataset::make("DataType",
358 DataType::F32)),
359 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
360 ActivationFunctionsDataset))
361{
362 validate(Accessor(_target), _reference, tolerance_f32);
363}
Manuel Bottini05069f02019-09-26 17:18:26 +0100364FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100365 combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
366 framework::dataset::make("DepthMultiplier", 1)),
367 framework::dataset::make("DataType",
368 DataType::F32)),
369 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
370 ActivationFunctionsDataset))
Georgios Pinitas4074c992018-01-30 18:13:46 +0000371{
372 validate(Accessor(_target), _reference, tolerance_f32);
373}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100374TEST_SUITE_END() // Optimized
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100375TEST_SUITE_END() // F32
Pablo Tello941cd702017-12-12 14:35:00 +0000376
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100377#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
378TEST_SUITE(F16)
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000379TEST_SUITE(Generic)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100380FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000381 depth_multipliers),
382 framework::dataset::make("DataType",
383 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100384 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
385 ActivationFunctionsDataset))
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000386{
387 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
388}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100389FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100390 large_depth_multipliers),
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000391 framework::dataset::make("DataType",
392 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100393 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
394 ActivationFunctionsDataset))
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000395{
396 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
397}
Usama Arif881f2de2019-04-12 10:29:17 +0100398
399TEST_SUITE(Dilation)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100400FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
Usama Arif881f2de2019-04-12 10:29:17 +0100401 depth_multipliers),
402 framework::dataset::make("DataType",
403 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100404 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
405 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100406{
407 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
408}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100409FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100410 large_depth_multipliers),
Usama Arif881f2de2019-04-12 10:29:17 +0100411 framework::dataset::make("DataType",
412 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100413 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
414 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100415{
416 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
417}
418TEST_SUITE_END() // Dilation
419
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000420TEST_SUITE_END() // Generic
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100421template <typename T>
Manuel Bottini05069f02019-09-26 17:18:26 +0100422using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Georgios Pinitas4c758512019-07-10 19:49:11 +0100423TEST_SUITE(W3x3)
Manuel Bottini05069f02019-09-26 17:18:26 +0100424FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
425 depth_multipliers),
426 framework::dataset::make("DataType",
427 DataType::F16)),
428 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
429 ActivationFunctionsDataset))
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100430{
431 validate(Accessor(_target), _reference, tolerance_f16);
432}
Manuel Bottini05069f02019-09-26 17:18:26 +0100433FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
Georgios Pinitas4c758512019-07-10 19:49:11 +0100434 combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100435 large_depth_multipliers),
Georgios Pinitas4c758512019-07-10 19:49:11 +0100436 framework::dataset::make("DataType",
437 DataType::F16)),
438 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
439 ActivationFunctionsDataset))
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100440{
441 validate(Accessor(_target), _reference, tolerance_f16);
442}
Usama Arif881f2de2019-04-12 10:29:17 +0100443
444TEST_SUITE(Dilation)
445
Manuel Bottini05069f02019-09-26 17:18:26 +0100446FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL,
Georgios Pinitas4c758512019-07-10 19:49:11 +0100447 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
448 depth_multipliers),
449 framework::dataset::make("DataType",
450 DataType::F16)),
451 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
452 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100453{
454 validate(Accessor(_target), _reference, tolerance_f16);
455}
Manuel Bottini05069f02019-09-26 17:18:26 +0100456FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100457 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100458 large_depth_multipliers),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100459 framework::dataset::make("DataType",
460 DataType::F16)),
461 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
462 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100463{
464 validate(Accessor(_target), _reference, tolerance_f16);
465}
466
467TEST_SUITE_END() // Dilation
Georgios Pinitas4c758512019-07-10 19:49:11 +0100468TEST_SUITE_END() // W3x3
Usama Arif881f2de2019-04-12 10:29:17 +0100469
Georgios Pinitas4c758512019-07-10 19:49:11 +0100470TEST_SUITE(Optimized)
Manuel Bottini05069f02019-09-26 17:18:26 +0100471FIXTURE_DATA_TEST_CASE(RunSmallW3x3, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100472 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
473 framework::dataset::make("DepthMultiplier", 1)),
474 framework::dataset::make("DataType",
475 DataType::F16)),
476 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
477 ActivationFunctionsDataset))
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000478{
479 validate(Accessor(_target), _reference, tolerance_f16);
480}
Manuel Bottini05069f02019-09-26 17:18:26 +0100481FIXTURE_DATA_TEST_CASE(RunSmallW5x5, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT,
Georgios Pinitas4c758512019-07-10 19:49:11 +0100482 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
483 framework::dataset::make("DepthMultiplier", 1)),
484 framework::dataset::make("DataType",
485 DataType::F16)),
486 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
487 ActivationFunctionsDataset))
488{
489 validate(Accessor(_target), _reference, tolerance_f16);
490}
Manuel Bottini05069f02019-09-26 17:18:26 +0100491FIXTURE_DATA_TEST_CASE(RunLargeW3x3, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100492 combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
493 framework::dataset::make("DepthMultiplier", 1)),
494 framework::dataset::make("DataType",
495 DataType::F16)),
496 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
497 ActivationFunctionsDataset))
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100498{
499 validate(Accessor(_target), _reference, tolerance_f16);
500}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100501TEST_SUITE_END() // Optimized
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100502TEST_SUITE_END() // FP16
503#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
504
505TEST_SUITE_END() // Float
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100506
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000507template <typename T>
Manuel Bottini05069f02019-09-26 17:18:26 +0100508using NEDepthwiseConvolutionLayerQuantizedFixtureOptimized = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Georgios Pinitasd05dce42018-01-22 16:29:17 +0000509template <typename T>
Giorgio Arenad93e2632019-10-15 11:09:33 +0100510using NEDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
511using NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture = DepthwiseConvolutionLayerValidationQuantizedPerChannelFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, uint8_t, int8_t>;
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000512
513TEST_SUITE(Quantized)
514TEST_SUITE(QASYMM8)
Georgios Pinitasd05dce42018-01-22 16:29:17 +0000515TEST_SUITE(Generic)
Giorgio Arena76572242018-04-04 17:44:26 +0100516FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100517 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
518 depth_multipliers),
519 framework::dataset::make("DataType", DataType::QASYMM8)),
Gian Marco Iodicee5ecd012019-08-28 15:56:36 +0100520 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
521 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100522 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
523 ActivationFunctionsDataset))
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000524{
525 validate(Accessor(_target), _reference, tolerance_qasymm8);
526}
Usama Arif881f2de2019-04-12 10:29:17 +0100527
528TEST_SUITE(Dilation)
529FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100530 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
531 depth_multipliers),
532 framework::dataset::make("DataType", DataType::QASYMM8)),
533 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
534 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8f, 1) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100535 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
536 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100537{
538 validate(Accessor(_target), _reference, tolerance_qasymm8);
539}
540FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100541 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100542 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100543 framework::dataset::make("DataType", DataType::QASYMM8)),
544 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
545 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100546 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
547 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100548{
549 validate(Accessor(_target), _reference, tolerance_qasymm8);
550}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100551TEST_SUITE_END() // Dilation
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000552TEST_SUITE_END() // Generic
Giorgio Arena76572242018-04-04 17:44:26 +0100553TEST_SUITE(W3x3)
Georgios Pinitas4c758512019-07-10 19:49:11 +0100554FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100555 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers),
556 framework::dataset::make("DataType", DataType::QASYMM8)),
Gian Marco Iodicee5ecd012019-08-28 15:56:36 +0100557 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
558 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100559 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
560 ActivationFunctionsDataset))
Giorgio Arena76572242018-04-04 17:44:26 +0100561{
562 validate(Accessor(_target), _reference, tolerance_qasymm8);
563}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100564FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100565 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100566 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100567 framework::dataset::make("DataType", DataType::QASYMM8)),
568 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
569 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100570 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
571 ActivationFunctionsDataset))
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000572{
573 validate(Accessor(_target), _reference, tolerance_qasymm8);
574}
Usama Arif881f2de2019-04-12 10:29:17 +0100575
576TEST_SUITE(Dilation)
577
Georgios Pinitas4c758512019-07-10 19:49:11 +0100578FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100579 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
580 framework::dataset::make("DataType", DataType::QASYMM8)),
581 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
582 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100583 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
584 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100585{
586 validate(Accessor(_target), _reference, tolerance_qasymm8);
587}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100588FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100589 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100590 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100591 framework::dataset::make("DataType", DataType::QASYMM8)),
592 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
593 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100594 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
595 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100596{
597 validate(Accessor(_target), _reference, tolerance_qasymm8);
598}
599TEST_SUITE_END() // Dilation
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000600TEST_SUITE_END() // W3x3
Georgios Pinitas4c758512019-07-10 19:49:11 +0100601
602TEST_SUITE(Optimized)
603FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
604 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
605 framework::dataset::make("DepthMultiplier", 1)),
606 framework::dataset::make("DataType",
607 DataType::QASYMM8)),
608 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
609 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
610 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
611 ActivationFunctionsDataset))
612{
613 validate(Accessor(_target), _reference, tolerance_qasymm8);
614}
615FIXTURE_DATA_TEST_CASE(RunSmall5x5, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
616 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
617 framework::dataset::make("DepthMultiplier", 1)),
618 framework::dataset::make("DataType",
619 DataType::QASYMM8)),
620 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
621 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
622 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
623 ActivationFunctionsDataset))
624{
625 validate(Accessor(_target), _reference, tolerance_qasymm8);
626}
627FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
628 combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
629 framework::dataset::make("DepthMultiplier", 1)),
630 framework::dataset::make("DataType",
631 DataType::QASYMM8)),
632 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
633 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
634 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
635 ActivationFunctionsDataset))
636{
637 validate(Accessor(_target), _reference, tolerance_qasymm8);
638}
639TEST_SUITE_END() // Optimized
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000640TEST_SUITE_END() // QASYMM8
Giorgio Arenad93e2632019-10-15 11:09:33 +0100641TEST_SUITE(QSYMM8_PER_CHANNEL)
642TEST_SUITE(Generic)
643FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::ALL,
644 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
645 depth_multipliers),
646 framework::dataset::make("InputDataType", DataType::QASYMM8)),
647 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
648 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
649 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
650 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
651 ActivationFunctionsDataset))
652{
653 validate(Accessor(_target), _reference, tolerance_qasymm8);
654}
655
656TEST_SUITE(Dilation)
657FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::ALL,
658 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
659 depth_multipliers),
660 framework::dataset::make("InputDataType", DataType::QASYMM8)),
661 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
662 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
663 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
664 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
665 ActivationFunctionsDataset))
666{
667 validate(Accessor(_target), _reference, tolerance_qasymm8);
668}
669FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY,
670 combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
671 depth_multipliers),
672 framework::dataset::make("InputDataType", DataType::QASYMM8)),
673 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
674 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
675 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
676 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
677 ActivationFunctionsDataset))
678{
679 validate(Accessor(_target), _reference, tolerance_qasymm8);
680}
681TEST_SUITE_END() // Dilation
682TEST_SUITE_END() // Generic
Giuseppe Rossinif01201a2019-11-06 14:57:49 +0000683
684TEST_SUITE(Optimized)
685FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::ALL,
686 combine(combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
687 framework::dataset::make("DepthMultiplier", 1)),
688 framework::dataset::make("InputDataType", DataType::QASYMM8)),
689 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
690 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
691 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
692 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
693 ActivationFunctionsDataset))
694{
695 validate(Accessor(_target), _reference, tolerance_qasymm8);
696}
697FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY,
698 combine(combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
699 framework::dataset::make("DepthMultiplier", 1)),
700 framework::dataset::make("InputDataType", DataType::QASYMM8)),
701 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
702 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
703 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
704 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
705 ActivationFunctionsDataset))
706{
707 validate(Accessor(_target), _reference, tolerance_qasymm8);
708}
709TEST_SUITE_END() // Optimized
Giorgio Arenad93e2632019-10-15 11:09:33 +0100710TEST_SUITE_END() // QSYMM8_PER_CHANNEL
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000711TEST_SUITE_END() // Quantized
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000712
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000713TEST_SUITE_END() // DepthwiseConvLayer
714TEST_SUITE_END() // NEON
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100715} // namespace validation
716} // namespace test
717} // namespace arm_compute