blob: 0b482ff9b3dae576ea519af9922be467568e11f5 [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{
Georgios Pinitas30271c72019-06-24 14:56:34 +0100160 bool is_valid = bool(NEDepthwiseConvolutionLayerOptimized::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*
251
Dmitry Savenkod7295b72017-11-20 22:00:08 +0700252TEST_SUITE(Float)
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100253TEST_SUITE(F32)
Michalis Spyroub7b31532017-11-23 12:10:21 +0000254TEST_SUITE(Generic)
255template <typename T>
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000256using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
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
Michalis Spyroub7b31532017-11-23 12:10:21 +0000298template <typename T>
Georgios Pinitas4c758512019-07-10 19:49:11 +0100299using NEDepthwiseConvolutionLayerFixtureOptimized = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayerOptimized, T>;
300
301TEST_SUITE(W3x3)
302FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixtureOptimized<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
303 depth_multipliers),
304 framework::dataset::make("DataType",
305 DataType::F32)),
306 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
307 ActivationFunctionsDataset))
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100308{
309 validate(Accessor(_target), _reference, tolerance_f32);
310}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100311FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixtureOptimized<float>, framework::DatasetMode::NIGHTLY,
312 combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100313 large_depth_multipliers),
Georgios Pinitas4c758512019-07-10 19:49:11 +0100314 framework::dataset::make("DataType",
315 DataType::F32)),
316 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
317 ActivationFunctionsDataset))
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100318{
319 validate(Accessor(_target), _reference, tolerance_f32);
320}
Usama Arif881f2de2019-04-12 10:29:17 +0100321TEST_SUITE(Dilation)
Georgios Pinitas4c758512019-07-10 19:49:11 +0100322FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixtureOptimized<float>, framework::DatasetMode::ALL,
323 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
324 depth_multipliers),
325 framework::dataset::make("DataType",
326 DataType::F32)),
327 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
328 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100329{
330 validate(Accessor(_target), _reference, tolerance_f32);
331}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100332FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixtureOptimized<float>, framework::DatasetMode::NIGHTLY,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100333 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100334 large_depth_multipliers),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100335 framework::dataset::make("DataType",
336 DataType::F32)),
337 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
338 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100339{
340 validate(Accessor(_target), _reference, tolerance_f32);
341}
342
343TEST_SUITE_END() // Dilation
Georgios Pinitas4c758512019-07-10 19:49:11 +0100344TEST_SUITE_END() // W3x3
Usama Arif881f2de2019-04-12 10:29:17 +0100345
Georgios Pinitas4c758512019-07-10 19:49:11 +0100346TEST_SUITE(Optimized)
347FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerFixtureOptimized<float>, framework::DatasetMode::PRECOMMIT,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100348 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
349 framework::dataset::make("DepthMultiplier", 1)),
350 framework::dataset::make("DataType",
351 DataType::F32)),
352 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
353 ActivationFunctionsDataset))
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000354{
355 validate(Accessor(_target), _reference, tolerance_f32);
356}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100357FIXTURE_DATA_TEST_CASE(RunSmall5x5, NEDepthwiseConvolutionLayerFixtureOptimized<float>, framework::DatasetMode::PRECOMMIT,
358 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
359 framework::dataset::make("DepthMultiplier", 1)),
360 framework::dataset::make("DataType",
361 DataType::F32)),
362 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
363 ActivationFunctionsDataset))
364{
365 validate(Accessor(_target), _reference, tolerance_f32);
366}
367FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerFixtureOptimized<float>, framework::DatasetMode::NIGHTLY,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100368 combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
369 framework::dataset::make("DepthMultiplier", 1)),
370 framework::dataset::make("DataType",
371 DataType::F32)),
372 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
373 ActivationFunctionsDataset))
Georgios Pinitas4074c992018-01-30 18:13:46 +0000374{
375 validate(Accessor(_target), _reference, tolerance_f32);
376}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100377TEST_SUITE_END() // Optimized
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100378TEST_SUITE_END() // F32
Pablo Tello941cd702017-12-12 14:35:00 +0000379
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100380#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
381TEST_SUITE(F16)
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000382TEST_SUITE(Generic)
383template <typename T>
384using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100385FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000386 depth_multipliers),
387 framework::dataset::make("DataType",
388 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100389 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
390 ActivationFunctionsDataset))
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000391{
392 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
393}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100394FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100395 large_depth_multipliers),
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000396 framework::dataset::make("DataType",
397 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100398 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
399 ActivationFunctionsDataset))
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000400{
401 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
402}
Usama Arif881f2de2019-04-12 10:29:17 +0100403
404TEST_SUITE(Dilation)
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100405FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
Usama Arif881f2de2019-04-12 10:29:17 +0100406 depth_multipliers),
407 framework::dataset::make("DataType",
408 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100409 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
410 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100411{
412 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
413}
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100414FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100415 large_depth_multipliers),
Usama Arif881f2de2019-04-12 10:29:17 +0100416 framework::dataset::make("DataType",
417 DataType::F16)),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100418 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
419 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100420{
421 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
422}
423TEST_SUITE_END() // Dilation
424
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000425TEST_SUITE_END() // Generic
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100426template <typename T>
Georgios Pinitas4c758512019-07-10 19:49:11 +0100427using NEDepthwiseConvolutionLayerFixtureOptimized = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayerOptimized, T>;
428TEST_SUITE(W3x3)
429FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixtureOptimized<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
430 depth_multipliers),
431 framework::dataset::make("DataType",
432 DataType::F16)),
433 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
434 ActivationFunctionsDataset))
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100435{
436 validate(Accessor(_target), _reference, tolerance_f16);
437}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100438FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixtureOptimized<half>, framework::DatasetMode::NIGHTLY,
439 combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100440 large_depth_multipliers),
Georgios Pinitas4c758512019-07-10 19:49:11 +0100441 framework::dataset::make("DataType",
442 DataType::F16)),
443 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
444 ActivationFunctionsDataset))
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100445{
446 validate(Accessor(_target), _reference, tolerance_f16);
447}
Usama Arif881f2de2019-04-12 10:29:17 +0100448
449TEST_SUITE(Dilation)
450
Georgios Pinitas4c758512019-07-10 19:49:11 +0100451FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixtureOptimized<half>, framework::DatasetMode::ALL,
452 combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(),
453 depth_multipliers),
454 framework::dataset::make("DataType",
455 DataType::F16)),
456 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
457 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100458{
459 validate(Accessor(_target), _reference, tolerance_f16);
460}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100461FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixtureOptimized<half>, framework::DatasetMode::NIGHTLY,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100462 combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100463 large_depth_multipliers),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100464 framework::dataset::make("DataType",
465 DataType::F16)),
466 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
467 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100468{
469 validate(Accessor(_target), _reference, tolerance_f16);
470}
471
472TEST_SUITE_END() // Dilation
Georgios Pinitas4c758512019-07-10 19:49:11 +0100473TEST_SUITE_END() // W3x3
Usama Arif881f2de2019-04-12 10:29:17 +0100474
Georgios Pinitas4c758512019-07-10 19:49:11 +0100475TEST_SUITE(Optimized)
476FIXTURE_DATA_TEST_CASE(RunSmallW3x3, NEDepthwiseConvolutionLayerFixtureOptimized<half>, framework::DatasetMode::PRECOMMIT,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100477 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
478 framework::dataset::make("DepthMultiplier", 1)),
479 framework::dataset::make("DataType",
480 DataType::F16)),
481 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
482 ActivationFunctionsDataset))
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000483{
484 validate(Accessor(_target), _reference, tolerance_f16);
485}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100486FIXTURE_DATA_TEST_CASE(RunSmallW5x5, NEDepthwiseConvolutionLayerFixtureOptimized<half>, framework::DatasetMode::PRECOMMIT,
487 combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
488 framework::dataset::make("DepthMultiplier", 1)),
489 framework::dataset::make("DataType",
490 DataType::F16)),
491 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
492 ActivationFunctionsDataset))
493{
494 validate(Accessor(_target), _reference, tolerance_f16);
495}
496FIXTURE_DATA_TEST_CASE(RunLargeW3x3, NEDepthwiseConvolutionLayerFixtureOptimized<half>, framework::DatasetMode::NIGHTLY,
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100497 combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
498 framework::dataset::make("DepthMultiplier", 1)),
499 framework::dataset::make("DataType",
500 DataType::F16)),
501 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
502 ActivationFunctionsDataset))
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100503{
504 validate(Accessor(_target), _reference, tolerance_f16);
505}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100506TEST_SUITE_END() // Optimized
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100507TEST_SUITE_END() // FP16
508#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
509
510TEST_SUITE_END() // Float
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100511
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000512template <typename T>
Georgios Pinitas4c758512019-07-10 19:49:11 +0100513using NEDepthwiseConvolutionLayerQuantizedFixtureOptimized = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayerOptimized, T>;
Georgios Pinitasd05dce42018-01-22 16:29:17 +0000514template <typename T>
Giorgio Arenad93e2632019-10-15 11:09:33 +0100515using NEDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
516using NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture = DepthwiseConvolutionLayerValidationQuantizedPerChannelFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, uint8_t, int8_t>;
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000517
518TEST_SUITE(Quantized)
519TEST_SUITE(QASYMM8)
Georgios Pinitasd05dce42018-01-22 16:29:17 +0000520TEST_SUITE(Generic)
Giorgio Arena76572242018-04-04 17:44:26 +0100521FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100522 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
523 depth_multipliers),
524 framework::dataset::make("DataType", DataType::QASYMM8)),
Gian Marco Iodicee5ecd012019-08-28 15:56:36 +0100525 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
526 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100527 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
528 ActivationFunctionsDataset))
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000529{
530 validate(Accessor(_target), _reference, tolerance_qasymm8);
531}
Usama Arif881f2de2019-04-12 10:29:17 +0100532
533TEST_SUITE(Dilation)
534FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100535 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
536 depth_multipliers),
537 framework::dataset::make("DataType", DataType::QASYMM8)),
538 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
539 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8f, 1) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100540 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
541 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100542{
543 validate(Accessor(_target), _reference, tolerance_qasymm8);
544}
545FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100546 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100547 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100548 framework::dataset::make("DataType", DataType::QASYMM8)),
549 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
550 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100551 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
552 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100553{
554 validate(Accessor(_target), _reference, tolerance_qasymm8);
555}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100556TEST_SUITE_END() // Dilation
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000557TEST_SUITE_END() // Generic
Giorgio Arena76572242018-04-04 17:44:26 +0100558TEST_SUITE(W3x3)
Georgios Pinitas4c758512019-07-10 19:49:11 +0100559FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100560 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers),
561 framework::dataset::make("DataType", DataType::QASYMM8)),
Gian Marco Iodicee5ecd012019-08-28 15:56:36 +0100562 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
563 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100564 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
565 ActivationFunctionsDataset))
Giorgio Arena76572242018-04-04 17:44:26 +0100566{
567 validate(Accessor(_target), _reference, tolerance_qasymm8);
568}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100569FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100570 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100571 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100572 framework::dataset::make("DataType", DataType::QASYMM8)),
573 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
574 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100575 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
576 ActivationFunctionsDataset))
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000577{
578 validate(Accessor(_target), _reference, tolerance_qasymm8);
579}
Usama Arif881f2de2019-04-12 10:29:17 +0100580
581TEST_SUITE(Dilation)
582
Georgios Pinitas4c758512019-07-10 19:49:11 +0100583FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100584 combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers),
585 framework::dataset::make("DataType", DataType::QASYMM8)),
586 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
587 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100588 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
589 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100590{
591 validate(Accessor(_target), _reference, tolerance_qasymm8);
592}
Georgios Pinitas4c758512019-07-10 19:49:11 +0100593FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
Pablo Telloa28aebc2019-06-03 14:59:48 +0100594 combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(),
Matthew Jackson6c2eac12019-07-23 10:43:10 +0100595 large_depth_multipliers),
Pablo Telloa28aebc2019-06-03 14:59:48 +0100596 framework::dataset::make("DataType", DataType::QASYMM8)),
597 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
598 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Manuel Bottinia788c2f2019-04-08 13:18:00 +0100599 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
600 ActivationFunctionsDataset))
Usama Arif881f2de2019-04-12 10:29:17 +0100601{
602 validate(Accessor(_target), _reference, tolerance_qasymm8);
603}
604TEST_SUITE_END() // Dilation
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000605TEST_SUITE_END() // W3x3
Georgios Pinitas4c758512019-07-10 19:49:11 +0100606
607TEST_SUITE(Optimized)
608FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
609 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(),
610 framework::dataset::make("DepthMultiplier", 1)),
611 framework::dataset::make("DataType",
612 DataType::QASYMM8)),
613 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
614 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
615 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
616 ActivationFunctionsDataset))
617{
618 validate(Accessor(_target), _reference, tolerance_qasymm8);
619}
620FIXTURE_DATA_TEST_CASE(RunSmall5x5, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT,
621 combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(),
622 framework::dataset::make("DepthMultiplier", 1)),
623 framework::dataset::make("DataType",
624 DataType::QASYMM8)),
625 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
626 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
627 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
628 ActivationFunctionsDataset))
629{
630 validate(Accessor(_target), _reference, tolerance_qasymm8);
631}
632FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY,
633 combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(),
634 framework::dataset::make("DepthMultiplier", 1)),
635 framework::dataset::make("DataType",
636 DataType::QASYMM8)),
637 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
638 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })),
639 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
640 ActivationFunctionsDataset))
641{
642 validate(Accessor(_target), _reference, tolerance_qasymm8);
643}
644TEST_SUITE_END() // Optimized
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000645TEST_SUITE_END() // QASYMM8
Giorgio Arenad93e2632019-10-15 11:09:33 +0100646TEST_SUITE(QSYMM8_PER_CHANNEL)
647TEST_SUITE(Generic)
648FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::ALL,
649 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
650 depth_multipliers),
651 framework::dataset::make("InputDataType", DataType::QASYMM8)),
652 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
653 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
654 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
655 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
656 ActivationFunctionsDataset))
657{
658 validate(Accessor(_target), _reference, tolerance_qasymm8);
659}
660
661TEST_SUITE(Dilation)
662FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::ALL,
663 combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(),
664 depth_multipliers),
665 framework::dataset::make("InputDataType", DataType::QASYMM8)),
666 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
667 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
668 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
669 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
670 ActivationFunctionsDataset))
671{
672 validate(Accessor(_target), _reference, tolerance_qasymm8);
673}
674FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY,
675 combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(),
676 depth_multipliers),
677 framework::dataset::make("InputDataType", DataType::QASYMM8)),
678 framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)),
679 framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })),
680 framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })),
681 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })),
682 ActivationFunctionsDataset))
683{
684 validate(Accessor(_target), _reference, tolerance_qasymm8);
685}
686TEST_SUITE_END() // Dilation
687TEST_SUITE_END() // Generic
688TEST_SUITE_END() // QSYMM8_PER_CHANNEL
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000689TEST_SUITE_END() // Quantized
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000690
Michalis Spyrouaeebe4a2019-01-09 14:21:03 +0000691TEST_SUITE_END() // DepthwiseConvLayer
692TEST_SUITE_END() // NEON
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100693} // namespace validation
694} // namespace test
695} // namespace arm_compute