blob: 773ebdeacc0571ab7c18d16cb1942adccdaadea0 [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
56const auto depth_multipliers = framework::dataset::make("DepthMultiplier", { 1, 2, 3 });
Manuel Bottinia788c2f2019-04-08 13:18:00 +010057
58//Activation Functions
59const auto ActivationFunctionsDataset = framework::dataset::make("ActivationInfo",
60{
61 ActivationLayerInfo(),
62 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)
63});
Michalis Spyrou7362f0d2017-10-18 17:58:22 +010064} // namespace
65
66TEST_SUITE(NEON)
Manuel Bottinia788c2f2019-04-08 13:18:00 +010067TEST_SUITE(DepthwiseConvolutionLayer)
Michalis Spyrou7362f0d2017-10-18 17:58:22 +010068
Abe Mbise7784c832018-05-31 16:48:41 +010069// *INDENT-OFF*
70// clang-format off
Usama Arif881f2de2019-04-12 10:29:17 +010071DATA_TEST_CASE(Validate3x3, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
Abe Mbise7784c832018-05-31 16:48:41 +010072 framework::dataset::make("InputInfo", { TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Mismatching data type input/weights
73 TensorInfo(TensorShape(32U, 18U, 3U), 1, DataType::F32), // Mismatching input feature maps
74 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Unsupported weights dimensions
75 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Mismatching depth multiplier
Giorgio Arena66cbafb2018-08-23 14:51:00 +010076 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::QASYMM8), // Invalid stride
Abe Mbise7784c832018-05-31 16:48:41 +010077 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid biases size
78 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid biases dimensions
79 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid output size
Usama Arif881f2de2019-04-12 10:29:17 +010080 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // patch size bigger than input width
81 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // dilation < 1
Giorgio Arena66cbafb2018-08-23 14:51:00 +010082 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +010083 }),
Giorgio Arena66cbafb2018-08-23 14:51:00 +010084 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16),
85 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
86 TensorInfo(TensorShape(5U, 5U, 2U, 2U), 1, DataType::F32),
87 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
88 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::QASYMM8),
89 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
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),
Usama Arif881f2de2019-04-12 10:29:17 +010093 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
94 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +010095 })),
96 framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32),
97 TensorInfo(TensorShape(2U), 1, DataType::F32),
98 TensorInfo(TensorShape(2U), 1, DataType::F32),
99 TensorInfo(TensorShape(2U), 1, DataType::F32),
Giorgio Arena66cbafb2018-08-23 14:51:00 +0100100 TensorInfo(TensorShape(2U), 1, DataType::S32),
Abe Mbise7784c832018-05-31 16:48:41 +0100101 TensorInfo(TensorShape(4U), 1, DataType::F32),
102 TensorInfo(TensorShape(2U, 2U), 1, DataType::F32),
103 TensorInfo(TensorShape(2U), 1, DataType::F32),
104 TensorInfo(TensorShape(2U), 1, DataType::F32),
Usama Arif881f2de2019-04-12 10:29:17 +0100105 TensorInfo(TensorShape(2U), 1, DataType::F32),
106 TensorInfo(TensorShape(2U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +0100107 })),
108 framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
109 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),
Giorgio Arena66cbafb2018-08-23 14:51:00 +0100112 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::QASYMM8),
Abe Mbise7784c832018-05-31 16:48:41 +0100113 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
114 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
115 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32),
116 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
Usama Arif881f2de2019-04-12 10:29:17 +0100117 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
118 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +0100119 })),
120 framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0),
121 PadStrideInfo(1, 1, 0, 0),
122 PadStrideInfo(1, 1, 0, 0),
123 PadStrideInfo(1, 1, 0, 0),
124 PadStrideInfo(4, 1, 0, 0),
125 PadStrideInfo(1, 1, 0, 0),
126 PadStrideInfo(1, 1, 0, 0),
127 PadStrideInfo(1, 1, 0, 0),
128 PadStrideInfo(1, 1, 0, 0),
Usama Arif881f2de2019-04-12 10:29:17 +0100129 PadStrideInfo(1, 1, 0, 0),
130 PadStrideInfo(1, 1, 0, 0),
Abe Mbise7784c832018-05-31 16:48:41 +0100131 })),
132 framework::dataset::make("DepthMultiplier", { 1,
133 1,
134 1,
135 3,
136 1,
137 1,
138 1,
139 1,
140 1,
Usama Arif881f2de2019-04-12 10:29:17 +0100141 1,
142 1,
Abe Mbise7784c832018-05-31 16:48:41 +0100143 })),
Usama Arif881f2de2019-04-12 10:29:17 +0100144 framework::dataset::make("Dilation", { Size2D(1U, 1U),
145 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(25U, 1U),
153 Size2D(0U, 1U),
154 Size2D(1U, 1U),
155 })),
156 framework::dataset::make("Expected", { false, false, false, false, false, false, false, false, false, false, true })),
157 input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier,dilation, expected)
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100158{
Usama Arif881f2de2019-04-12 10:29:17 +0100159 bool is_valid = bool(NEDepthwiseConvolutionLayer3x3::validate(&input_info.clone()->set_is_resizable(false),
160 &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 +0100161 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100162}
163
Usama Arif881f2de2019-04-12 10:29:17 +0100164DATA_TEST_CASE(ValidateGeneric, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip(
Abe Mbise7784c832018-05-31 16:48:41 +0100165 framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type input/weights
166 TensorInfo(TensorShape(27U, 13U, 3U), 1, DataType::F32), // Mismatching input feature maps
167 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching depth multiplier
168 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases size
169 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases dimensions
170 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid output size
Usama Arif881f2de2019-04-12 10:29:17 +0100171 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // patch size bigger than input width
172 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // dilation < 1
Abe Mbise7784c832018-05-31 16:48:41 +0100173 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32),
174 TensorInfo(TensorShape(32U, 13U, 8U), 1, DataType::QASYMM8),
175 }),
176 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F16),
177 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
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, 16U), 1, DataType::F32),
Usama Arif881f2de2019-04-12 10:29:17 +0100183 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
184 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +0100185 TensorInfo(TensorShape(3U, 3U, 24U), 1, DataType::QASYMM8),
186 })),
187 framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32),
188 TensorInfo(TensorShape(2U), 1, DataType::F32),
189 TensorInfo(TensorShape(2U), 1, DataType::F32),
190 TensorInfo(TensorShape(4U), 1, DataType::F32),
191 TensorInfo(TensorShape(2U, 2U), 1, DataType::F32),
192 TensorInfo(TensorShape(2U), 1, DataType::F32),
193 TensorInfo(TensorShape(16U), 1, DataType::F32),
Usama Arif881f2de2019-04-12 10:29:17 +0100194 TensorInfo(TensorShape(16U), 1, DataType::F32),
195 TensorInfo(TensorShape(16U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +0100196 TensorInfo(TensorShape(24U), 1, DataType::S32),
197 })),
198 framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
199 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(27U, 13U, 2U), 1, DataType::F32),
204 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
Usama Arif881f2de2019-04-12 10:29:17 +0100205 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
206 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +0100207 TensorInfo(TensorShape(32U, 11U, 24U), 1, DataType::QASYMM8),
208 })),
209 framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0),
210 PadStrideInfo(1, 1, 0, 0),
211 PadStrideInfo(1, 1, 0, 0),
212 PadStrideInfo(1, 1, 0, 0),
213 PadStrideInfo(1, 1, 0, 0),
214 PadStrideInfo(1, 1, 0, 0),
215 PadStrideInfo(1, 1, 0, 0),
Usama Arif881f2de2019-04-12 10:29:17 +0100216 PadStrideInfo(1, 1, 0, 0),
217 PadStrideInfo(1, 1, 0, 0),
Abe Mbise7784c832018-05-31 16:48:41 +0100218 PadStrideInfo(1, 1, 1, 0),
219 })),
220 framework::dataset::make("DepthMultiplier", { 1,
221 1,
222 3,
223 1,
224 1,
225 1,
226 2,
Usama Arif881f2de2019-04-12 10:29:17 +0100227 2,
228 2,
Abe Mbise7784c832018-05-31 16:48:41 +0100229 3,
230 })),
Usama Arif881f2de2019-04-12 10:29:17 +0100231 framework::dataset::make("Dilation", { Size2D(1U, 1U),
232 Size2D(1U, 1U),
233 Size2D(1U, 1U),
234 Size2D(1U, 1U),
235 Size2D(1U, 1U),
236 Size2D(1U, 1U),
237 Size2D(25U, 1U),
238 Size2D(0U, 1U),
239 Size2D(1U, 1U),
240 Size2D(1U, 1U),
241 })),
242 framework::dataset::make("Expected", { false, false, false, false, false, false,false, false, true, true })),
243 input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier,dilation, expected)
Abe Mbise7784c832018-05-31 16:48:41 +0100244{
Usama Arif881f2de2019-04-12 10:29:17 +0100245 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 +0100246 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
247}
248// clang-format on
249// *INDENT-ON*
250
Dmitry Savenkod7295b72017-11-20 22:00:08 +0700251TEST_SUITE(Float)
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100252TEST_SUITE(F32)
Michalis Spyroub7b31532017-11-23 12:10:21 +0000253TEST_SUITE(Generic)
254template <typename T>
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000255using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100256FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
Giorgio Arena76572242018-04-04 17:44:26 +0100257 depth_multipliers),
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000258 framework::dataset::make("DataType",
Giorgio Arena1ed1fc62018-03-26 16:20:05 +0100259 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100260 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
261 ActivationFunctionsDataset))
Michalis Spyroub7b31532017-11-23 12:10:21 +0000262{
263 validate(Accessor(_target), _reference, tolerance_f32);
264}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100265FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Giorgio Arena76572242018-04-04 17:44:26 +0100266 depth_multipliers),
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000267 framework::dataset::make("DataType",
Giorgio Arena1ed1fc62018-03-26 16:20:05 +0100268 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100269 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
270 ActivationFunctionsDataset))
Michalis Spyroub7b31532017-11-23 12:10:21 +0000271{
272 validate(Accessor(_target), _reference, tolerance_f32);
273}
Usama Arif881f2de2019-04-12 10:29:17 +0100274
275TEST_SUITE(Dilation)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100276FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
Usama Arif881f2de2019-04-12 10:29:17 +0100277 depth_multipliers),
278 framework::dataset::make("DataType",
279 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100280 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
281 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100282{
283 validate(Accessor(_target), _reference, tolerance_f32);
284}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100285FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Usama Arif881f2de2019-04-12 10:29:17 +0100286 depth_multipliers),
287 framework::dataset::make("DataType",
288 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100289 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
290 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100291{
292 validate(Accessor(_target), _reference, tolerance_f32);
293}
294TEST_SUITE_END() // Dilation
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100295TEST_SUITE_END() // Generic
Michalis Spyroub7b31532017-11-23 12:10:21 +0000296
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100297TEST_SUITE(W3x3)
Michalis Spyroub7b31532017-11-23 12:10:21 +0000298template <typename T>
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000299using NEDepthwiseConvolutionLayerFixture3x3 = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer3x3, T>;
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100300FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
Giorgio Arena76572242018-04-04 17:44:26 +0100301 depth_multipliers),
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000302 framework::dataset::make("DataType",
Giorgio Arena1ed1fc62018-03-26 16:20:05 +0100303 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100304 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
305 ActivationFunctionsDataset))
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100306{
307 validate(Accessor(_target), _reference, tolerance_f32);
308}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100309FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Giorgio Arena76572242018-04-04 17:44:26 +0100310 depth_multipliers),
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000311 framework::dataset::make("DataType",
Giorgio Arena1ed1fc62018-03-26 16:20:05 +0100312 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100313 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 Bottinia788c2f2019-04-08 13:18:00 +0100319FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
Usama Arif881f2de2019-04-12 10:29:17 +0100320 depth_multipliers),
321 framework::dataset::make("DataType",
322 DataType::F32)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100323 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
324 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100325{
326 validate(Accessor(_target), _reference, tolerance_f32);
327}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100328FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::NIGHTLY,
329 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
330 depth_multipliers),
331 framework::dataset::make("DataType",
332 DataType::F32)),
333 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
334 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100335{
336 validate(Accessor(_target), _reference, tolerance_f32);
337}
338
339TEST_SUITE_END() // Dilation
340
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000341FIXTURE_DATA_TEST_CASE(RunOptimizedSmall, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::PRECOMMIT,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100342 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
343 framework::dataset::make("DepthMultiplier", 1)),
344 framework::dataset::make("DataType",
345 DataType::F32)),
346 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
347 ActivationFunctionsDataset))
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000348{
349 validate(Accessor(_target), _reference, tolerance_f32);
350}
351FIXTURE_DATA_TEST_CASE(RunOptimizedLarge, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::NIGHTLY,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100352 combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
353 framework::dataset::make("DepthMultiplier", 1)),
354 framework::dataset::make("DataType",
355 DataType::F32)),
356 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
357 ActivationFunctionsDataset))
Georgios Pinitas4074c992018-01-30 18:13:46 +0000358{
359 validate(Accessor(_target), _reference, tolerance_f32);
360}
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100361TEST_SUITE_END() // W3x3
362TEST_SUITE_END() // F32
Pablo Tello941cd702017-12-12 14:35:00 +0000363
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100364#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
365TEST_SUITE(F16)
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000366TEST_SUITE(Generic)
367template <typename T>
368using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100369FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000370 depth_multipliers),
371 framework::dataset::make("DataType",
372 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100373 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
374 ActivationFunctionsDataset))
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000375{
376 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
377}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100378FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000379 depth_multipliers),
380 framework::dataset::make("DataType",
381 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100382 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
383 ActivationFunctionsDataset))
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000384{
385 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
386}
Usama Arif881f2de2019-04-12 10:29:17 +0100387
388TEST_SUITE(Dilation)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100389FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
Usama Arif881f2de2019-04-12 10:29:17 +0100390 depth_multipliers),
391 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))
Usama Arif881f2de2019-04-12 10:29:17 +0100395{
396 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
397}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100398FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Usama Arif881f2de2019-04-12 10:29:17 +0100399 depth_multipliers),
400 framework::dataset::make("DataType",
401 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100402 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
403 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100404{
405 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
406}
407TEST_SUITE_END() // Dilation
408
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000409TEST_SUITE_END() // Generic
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100410TEST_SUITE(W3x3)
411template <typename T>
412using NEDepthwiseConvolutionLayerFixture3x3 = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer3x3, T>;
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100413FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100414 depth_multipliers),
415 framework::dataset::make("DataType",
416 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100417 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
418 ActivationFunctionsDataset))
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100419{
420 validate(Accessor(_target), _reference, tolerance_f16);
421}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100422FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100423 depth_multipliers),
424 framework::dataset::make("DataType",
425 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100426 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
427 ActivationFunctionsDataset))
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100428{
429 validate(Accessor(_target), _reference, tolerance_f16);
430}
Usama Arif881f2de2019-04-12 10:29:17 +0100431
432TEST_SUITE(Dilation)
433
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100434FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
Usama Arif881f2de2019-04-12 10:29:17 +0100435 depth_multipliers),
436 framework::dataset::make("DataType",
437 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100438 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
439 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100440{
441 validate(Accessor(_target), _reference, tolerance_f16);
442}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100443FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::NIGHTLY,
444 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
445 depth_multipliers),
446 framework::dataset::make("DataType",
447 DataType::F16)),
448 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
449 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100450{
451 validate(Accessor(_target), _reference, tolerance_f16);
452}
453
454TEST_SUITE_END() // Dilation
455
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000456FIXTURE_DATA_TEST_CASE(RunOptimizedSmall, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::PRECOMMIT,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100457 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
458 framework::dataset::make("DepthMultiplier", 1)),
459 framework::dataset::make("DataType",
460 DataType::F16)),
461 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
462 ActivationFunctionsDataset))
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000463{
464 validate(Accessor(_target), _reference, tolerance_f16);
465}
466FIXTURE_DATA_TEST_CASE(RunOptimizedLarge, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::NIGHTLY,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100467 combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
468 framework::dataset::make("DepthMultiplier", 1)),
469 framework::dataset::make("DataType",
470 DataType::F16)),
471 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
472 ActivationFunctionsDataset))
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100473{
474 validate(Accessor(_target), _reference, tolerance_f16);
475}
476TEST_SUITE_END() // W3x3
477TEST_SUITE_END() // FP16
478#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
479
480TEST_SUITE_END() // Float
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100481
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000482template <typename T>
483using NEDepthwiseConvolutionLayerQuantizedFixture3x3 = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer3x3, T>;
Georgios Pinitasd05dce42018-01-22 16:29:17 +0000484template <typename T>
485using NEDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000486
487TEST_SUITE(Quantized)
488TEST_SUITE(QASYMM8)
Georgios Pinitasd05dce42018-01-22 16:29:17 +0000489TEST_SUITE(Generic)
Giorgio Arena76572242018-04-04 17:44:26 +0100490FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100491 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
492 depth_multipliers),
493 framework::dataset::make("DataType", DataType::QASYMM8)),
494 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
495 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.3f, 4) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100496 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
497 ActivationFunctionsDataset))
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000498{
499 validate(Accessor(_target), _reference, tolerance_qasymm8);
500}
Usama Arif881f2de2019-04-12 10:29:17 +0100501
502TEST_SUITE(Dilation)
503FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100504 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
505 depth_multipliers),
506 framework::dataset::make("DataType", DataType::QASYMM8)),
507 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
508 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8f, 1) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100509 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
510 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100511{
512 validate(Accessor(_target), _reference, tolerance_qasymm8);
513}
514FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100515 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
516 depth_multipliers),
517 framework::dataset::make("DataType", DataType::QASYMM8)),
518 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
519 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100520 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
521 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100522{
523 validate(Accessor(_target), _reference, tolerance_qasymm8);
524}
525TEST_SUITE_END() //Dilation
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000526TEST_SUITE_END() // Generic
Giorgio Arena76572242018-04-04 17:44:26 +0100527TEST_SUITE(W3x3)
528FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100529 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers),
530 framework::dataset::make("DataType", DataType::QASYMM8)),
531 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
532 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100533 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
534 ActivationFunctionsDataset))
Giorgio Arena76572242018-04-04 17:44:26 +0100535{
536 validate(Accessor(_target), _reference, tolerance_qasymm8);
537}
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000538FIXTURE_DATA_TEST_CASE(RunOptimizedSmall, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100539 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
540 framework::dataset::make("DepthMultiplier", 1)),
541 framework::dataset::make("DataType",
542 DataType::QASYMM8)),
543 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
544 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100545 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
546 ActivationFunctionsDataset))
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000547{
548 validate(Accessor(_target), _reference, tolerance_qasymm8);
549}
550FIXTURE_DATA_TEST_CASE(RunOptimizedLarge, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100551 combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
552 framework::dataset::make("DepthMultiplier", 1)),
553 framework::dataset::make("DataType",
554 DataType::QASYMM8)),
555 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
556 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100557 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
558 ActivationFunctionsDataset))
Georgios Pinitasa799ce02018-09-12 20:11:34 +0100559{
560 validate(Accessor(_target), _reference, tolerance_qasymm8);
561}
Giorgio Arena76572242018-04-04 17:44:26 +0100562FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100563 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
564 depth_multipliers),
565 framework::dataset::make("DataType", DataType::QASYMM8)),
566 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
567 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100568 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
569 ActivationFunctionsDataset))
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000570{
571 validate(Accessor(_target), _reference, tolerance_qasymm8);
572}
Usama Arif881f2de2019-04-12 10:29:17 +0100573
574TEST_SUITE(Dilation)
575
576FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100577 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
578 framework::dataset::make("DataType", DataType::QASYMM8)),
579 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
580 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100581 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
582 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100583{
584 validate(Accessor(_target), _reference, tolerance_qasymm8);
585}
586FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100587 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
588 depth_multipliers),
589 framework::dataset::make("DataType", DataType::QASYMM8)),
590 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
591 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100592 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
593 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100594{
595 validate(Accessor(_target), _reference, tolerance_qasymm8);
596}
597TEST_SUITE_END() // Dilation
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000598TEST_SUITE_END() // W3x3
599TEST_SUITE_END() // QASYMM8
600TEST_SUITE_END() // Quantized
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000601
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000602TEST_SUITE_END() // DepthwiseConvLayer
603TEST_SUITE_END() // NEON
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100604} // namespace validation
605} // namespace test
606} // namespace arm_compute