blob: 8f87a7d6361d8e01896a9f4aa5afd8470aef00d3 [file] [log] [blame]
Michalis Spyrou7362f0d2017-10-18 17:58:22 +01001/*
Georgios Pinitasf72f9362018-01-12 16:29:45 +00002 * Copyright (c) 2017-2018 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,
21 * OUT OF OR IN CONCLCTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * 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"
Michalis Spyrou7362f0d2017-10-18 17:58:22 +010032#include "tests/framework/Asserts.h"
33#include "tests/framework/Macros.h"
34#include "tests/framework/datasets/Datasets.h"
35#include "tests/validation/Validation.h"
Giorgio Arena04a8f8c2017-11-23 11:45:24 +000036#include "tests/validation/fixtures/DepthwiseConvolutionLayerFixture.h"
Michalis Spyrou7362f0d2017-10-18 17:58:22 +010037
38namespace arm_compute
39{
40namespace test
41{
42namespace validation
43{
Giorgio Arena76572242018-04-04 17:44:26 +010044using namespace arm_compute::misc::shape_calculator;
45
Michalis Spyrou7362f0d2017-10-18 17:58:22 +010046namespace
47{
Georgios Pinitas20c246a2018-09-12 16:45:53 +010048RelativeTolerance<half_float::half> tolerance_f16(half_float::half(0.001)); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F16 */
49constexpr 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 */
Giorgio Arena76572242018-04-04 17:44:26 +010051
52const auto depth_multipliers = framework::dataset::make("DepthMultiplier", { 1, 2, 3 });
Michalis Spyrou7362f0d2017-10-18 17:58:22 +010053} // namespace
54
55TEST_SUITE(NEON)
Pablo Tello941cd702017-12-12 14:35:00 +000056TEST_SUITE(DepthwiseConvLayer)
Michalis Spyrou7362f0d2017-10-18 17:58:22 +010057
Abe Mbise7784c832018-05-31 16:48:41 +010058// *INDENT-OFF*
59// clang-format off
60DATA_TEST_CASE(Validate3x3, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(
61 framework::dataset::make("InputInfo", { TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Mismatching data type input/weights
62 TensorInfo(TensorShape(32U, 18U, 3U), 1, DataType::F32), // Mismatching input feature maps
63 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Unsupported weights dimensions
64 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Mismatching depth multiplier
Giorgio Arena66cbafb2018-08-23 14:51:00 +010065 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::QASYMM8), // Invalid stride
Abe Mbise7784c832018-05-31 16:48:41 +010066 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid biases size
67 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid biases dimensions
68 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid output size
Giorgio Arena66cbafb2018-08-23 14:51:00 +010069 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +010070 }),
Giorgio Arena66cbafb2018-08-23 14:51:00 +010071 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16),
72 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
73 TensorInfo(TensorShape(5U, 5U, 2U, 2U), 1, DataType::F32),
74 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
75 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::QASYMM8),
76 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
77 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
78 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
79 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +010080 })),
81 framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32),
82 TensorInfo(TensorShape(2U), 1, DataType::F32),
83 TensorInfo(TensorShape(2U), 1, DataType::F32),
84 TensorInfo(TensorShape(2U), 1, DataType::F32),
Giorgio Arena66cbafb2018-08-23 14:51:00 +010085 TensorInfo(TensorShape(2U), 1, DataType::S32),
Abe Mbise7784c832018-05-31 16:48:41 +010086 TensorInfo(TensorShape(4U), 1, DataType::F32),
87 TensorInfo(TensorShape(2U, 2U), 1, DataType::F32),
88 TensorInfo(TensorShape(2U), 1, DataType::F32),
89 TensorInfo(TensorShape(2U), 1, DataType::F32),
90 })),
91 framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
92 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
93 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
94 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
Giorgio Arena66cbafb2018-08-23 14:51:00 +010095 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::QASYMM8),
Abe Mbise7784c832018-05-31 16:48:41 +010096 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
97 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
98 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32),
99 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
100 })),
101 framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0),
102 PadStrideInfo(1, 1, 0, 0),
103 PadStrideInfo(1, 1, 0, 0),
104 PadStrideInfo(1, 1, 0, 0),
105 PadStrideInfo(4, 1, 0, 0),
106 PadStrideInfo(1, 1, 0, 0),
107 PadStrideInfo(1, 1, 0, 0),
108 PadStrideInfo(1, 1, 0, 0),
109 PadStrideInfo(1, 1, 0, 0),
110 })),
111 framework::dataset::make("DepthMultiplier", { 1,
112 1,
113 1,
114 3,
115 1,
116 1,
117 1,
118 1,
119 1,
120 })),
Giorgio Arena66cbafb2018-08-23 14:51:00 +0100121 framework::dataset::make("Expected", { false, false, false, false, false, false, false, false, true })),
Abe Mbise7784c832018-05-31 16:48:41 +0100122 input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier, expected)
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100123{
Abe Mbise7784c832018-05-31 16:48:41 +0100124 bool is_valid = bool(NEDepthwiseConvolutionLayer3x3::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));
125 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100126}
127
Abe Mbise7784c832018-05-31 16:48:41 +0100128DATA_TEST_CASE(ValidateGeneric, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(
129 framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type input/weights
130 TensorInfo(TensorShape(27U, 13U, 3U), 1, DataType::F32), // Mismatching input feature maps
131 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching depth multiplier
132 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases size
133 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases dimensions
134 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid output size
135 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32),
136 TensorInfo(TensorShape(32U, 13U, 8U), 1, DataType::QASYMM8),
137 }),
138 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F16),
139 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
140 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
141 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
142 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
143 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
144 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
145 TensorInfo(TensorShape(3U, 3U, 24U), 1, DataType::QASYMM8),
146 })),
147 framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32),
148 TensorInfo(TensorShape(2U), 1, DataType::F32),
149 TensorInfo(TensorShape(2U), 1, DataType::F32),
150 TensorInfo(TensorShape(4U), 1, DataType::F32),
151 TensorInfo(TensorShape(2U, 2U), 1, DataType::F32),
152 TensorInfo(TensorShape(2U), 1, DataType::F32),
153 TensorInfo(TensorShape(16U), 1, DataType::F32),
154 TensorInfo(TensorShape(24U), 1, DataType::S32),
155 })),
156 framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
157 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
158 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
159 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
160 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
161 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),
162 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
163 TensorInfo(TensorShape(32U, 11U, 24U), 1, DataType::QASYMM8),
164 })),
165 framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0),
166 PadStrideInfo(1, 1, 0, 0),
167 PadStrideInfo(1, 1, 0, 0),
168 PadStrideInfo(1, 1, 0, 0),
169 PadStrideInfo(1, 1, 0, 0),
170 PadStrideInfo(1, 1, 0, 0),
171 PadStrideInfo(1, 1, 0, 0),
172 PadStrideInfo(1, 1, 1, 0),
173 })),
174 framework::dataset::make("DepthMultiplier", { 1,
175 1,
176 3,
177 1,
178 1,
179 1,
180 2,
181 3,
182 })),
183 framework::dataset::make("Expected", { false, false, false, false, false, false, true, true })),
184 input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier, expected)
185{
186 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));
187 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
188}
189// clang-format on
190// *INDENT-ON*
191
Dmitry Savenkod7295b72017-11-20 22:00:08 +0700192TEST_SUITE(Float)
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100193TEST_SUITE(F32)
Michalis Spyroub7b31532017-11-23 12:10:21 +0000194TEST_SUITE(Generic)
195template <typename T>
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000196using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Giorgio Arena76572242018-04-04 17:44:26 +0100197FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
198 depth_multipliers),
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000199 framework::dataset::make("DataType",
Giorgio Arena1ed1fc62018-03-26 16:20:05 +0100200 DataType::F32)),
Giorgio Arena26b22162018-08-13 15:49:49 +0100201 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Michalis Spyroub7b31532017-11-23 12:10:21 +0000202{
203 validate(Accessor(_target), _reference, tolerance_f32);
204}
Giorgio Arena76572242018-04-04 17:44:26 +0100205FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
206 depth_multipliers),
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000207 framework::dataset::make("DataType",
Giorgio Arena1ed1fc62018-03-26 16:20:05 +0100208 DataType::F32)),
Giorgio Arena26b22162018-08-13 15:49:49 +0100209 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Michalis Spyroub7b31532017-11-23 12:10:21 +0000210{
211 validate(Accessor(_target), _reference, tolerance_f32);
212}
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100213TEST_SUITE_END() // Generic
Michalis Spyroub7b31532017-11-23 12:10:21 +0000214
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100215TEST_SUITE(W3x3)
Michalis Spyroub7b31532017-11-23 12:10:21 +0000216template <typename T>
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000217using NEDepthwiseConvolutionLayerFixture3x3 = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer3x3, T>;
Giorgio Arena76572242018-04-04 17:44:26 +0100218FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::ALL, combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
219 depth_multipliers),
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000220 framework::dataset::make("DataType",
Giorgio Arena1ed1fc62018-03-26 16:20:05 +0100221 DataType::F32)),
Giorgio Arena26b22162018-08-13 15:49:49 +0100222 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100223{
224 validate(Accessor(_target), _reference, tolerance_f32);
225}
Giorgio Arena76572242018-04-04 17:44:26 +0100226FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
227 depth_multipliers),
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000228 framework::dataset::make("DataType",
Giorgio Arena1ed1fc62018-03-26 16:20:05 +0100229 DataType::F32)),
Giorgio Arena26b22162018-08-13 15:49:49 +0100230 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100231{
232 validate(Accessor(_target), _reference, tolerance_f32);
233}
Giorgio Arena76572242018-04-04 17:44:26 +0100234FIXTURE_DATA_TEST_CASE(RunOptimized, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::ALL, combine(combine(combine(datasets::OptimizedDepthwiseConvolutionLayerDataset3x3(),
235 framework::dataset::make("DepthMultiplier", 1)),
Georgios Pinitas4074c992018-01-30 18:13:46 +0000236 framework::dataset::make("DataType",
Giorgio Arena1ed1fc62018-03-26 16:20:05 +0100237 DataType::F32)),
238 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Georgios Pinitas4074c992018-01-30 18:13:46 +0000239{
240 validate(Accessor(_target), _reference, tolerance_f32);
241}
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100242TEST_SUITE_END() // W3x3
243TEST_SUITE_END() // F32
Pablo Tello941cd702017-12-12 14:35:00 +0000244
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100245#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
246TEST_SUITE(F16)
247TEST_SUITE(W3x3)
248template <typename T>
249using NEDepthwiseConvolutionLayerFixture3x3 = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer3x3, T>;
250FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::ALL, combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
251 depth_multipliers),
252 framework::dataset::make("DataType",
253 DataType::F16)),
254 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
255{
256 validate(Accessor(_target), _reference, tolerance_f16);
257}
258FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
259 depth_multipliers),
260 framework::dataset::make("DataType",
261 DataType::F16)),
262 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
263{
264 validate(Accessor(_target), _reference, tolerance_f16);
265}
266FIXTURE_DATA_TEST_CASE(RunOptimized, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::ALL, combine(combine(combine(datasets::OptimizedDepthwiseConvolutionLayerDataset3x3(),
267 framework::dataset::make("DepthMultiplier", 1)),
268 framework::dataset::make("DataType",
269 DataType::F16)),
270 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
271{
272 validate(Accessor(_target), _reference, tolerance_f16);
273}
274TEST_SUITE_END() // W3x3
275TEST_SUITE_END() // FP16
276#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
277
278TEST_SUITE_END() // Float
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100279
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000280template <typename T>
281using NEDepthwiseConvolutionLayerQuantizedFixture3x3 = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer3x3, T>;
Georgios Pinitasd05dce42018-01-22 16:29:17 +0000282template <typename T>
283using NEDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000284
285TEST_SUITE(Quantized)
286TEST_SUITE(QASYMM8)
Georgios Pinitasd05dce42018-01-22 16:29:17 +0000287TEST_SUITE(Generic)
Giorgio Arena76572242018-04-04 17:44:26 +0100288FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
289 combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
290 depth_multipliers),
Giorgio Arenadfca60b2018-01-31 10:30:59 +0000291 framework::dataset::make("DataType", DataType::QASYMM8)),
292 framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Giorgio Arena26b22162018-08-13 15:49:49 +0100293 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000294{
295 validate(Accessor(_target), _reference, tolerance_qasymm8);
296}
Giorgio Arena76572242018-04-04 17:44:26 +0100297TEST_SUITE_END()
298TEST_SUITE(W3x3)
299FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::PRECOMMIT,
300 combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers),
301 framework::dataset::make("DataType", DataType::QASYMM8)),
302 framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Giorgio Arena26b22162018-08-13 15:49:49 +0100303 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Giorgio Arena76572242018-04-04 17:44:26 +0100304{
305 validate(Accessor(_target), _reference, tolerance_qasymm8);
306}
Georgios Pinitasa799ce02018-09-12 20:11:34 +0100307FIXTURE_DATA_TEST_CASE(RunOptimized, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::ALL,
308 combine(combine(combine(combine(datasets::OptimizedDepthwiseConvolutionLayerDataset3x3(),
309 framework::dataset::make("DepthMultiplier", 1)),
310 framework::dataset::make("DataType",
311 DataType::QASYMM8)),
312 framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })),
313 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
314{
315 validate(Accessor(_target), _reference, tolerance_qasymm8);
316}
Giorgio Arena76572242018-04-04 17:44:26 +0100317FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY,
318 combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
319 depth_multipliers),
320 framework::dataset::make("DataType", DataType::QASYMM8)),
321 framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Giorgio Arena26b22162018-08-13 15:49:49 +0100322 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000323{
324 validate(Accessor(_target), _reference, tolerance_qasymm8);
325}
326TEST_SUITE_END()
327TEST_SUITE_END()
328TEST_SUITE_END()
329
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100330TEST_SUITE_END()
331TEST_SUITE_END()
332} // namespace validation
333} // namespace test
334} // namespace arm_compute