blob: f2b4650527f0c700fecd8b5594ea8136a4c394f2 [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 Pinitas8cffcd62018-11-16 17:11:50 +000048constexpr RelativeTolerance<float> tolerance_f32(0.01f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F32 */
49constexpr AbsoluteTolerance<uint8_t> tolerance_qasymm8(1); /**< Tolerance value for comparing reference's output against implementation's output for DataType::QASYMM8 */
50#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
51RelativeTolerance<half_float::half> tolerance_f16(half_float::half(0.01)); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F16 */
52constexpr float tolerance_num = 0.05f; /**< Tolerance number */
53#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
Giorgio Arena76572242018-04-04 17:44:26 +010054
55const auto depth_multipliers = framework::dataset::make("DepthMultiplier", { 1, 2, 3 });
Michalis Spyrou7362f0d2017-10-18 17:58:22 +010056} // namespace
57
58TEST_SUITE(NEON)
Pablo Tello941cd702017-12-12 14:35:00 +000059TEST_SUITE(DepthwiseConvLayer)
Michalis Spyrou7362f0d2017-10-18 17:58:22 +010060
Abe Mbise7784c832018-05-31 16:48:41 +010061// *INDENT-OFF*
62// clang-format off
63DATA_TEST_CASE(Validate3x3, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(
64 framework::dataset::make("InputInfo", { TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Mismatching data type input/weights
65 TensorInfo(TensorShape(32U, 18U, 3U), 1, DataType::F32), // Mismatching input feature maps
66 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Unsupported weights dimensions
67 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Mismatching depth multiplier
Giorgio Arena66cbafb2018-08-23 14:51:00 +010068 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::QASYMM8), // Invalid stride
Abe Mbise7784c832018-05-31 16:48:41 +010069 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid biases size
70 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid biases dimensions
71 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid output size
Giorgio Arena66cbafb2018-08-23 14:51:00 +010072 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +010073 }),
Giorgio Arena66cbafb2018-08-23 14:51:00 +010074 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16),
75 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
76 TensorInfo(TensorShape(5U, 5U, 2U, 2U), 1, DataType::F32),
77 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
78 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::QASYMM8),
79 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
80 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
81 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
82 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32),
Abe Mbise7784c832018-05-31 16:48:41 +010083 })),
84 framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32),
85 TensorInfo(TensorShape(2U), 1, DataType::F32),
86 TensorInfo(TensorShape(2U), 1, DataType::F32),
87 TensorInfo(TensorShape(2U), 1, DataType::F32),
Giorgio Arena66cbafb2018-08-23 14:51:00 +010088 TensorInfo(TensorShape(2U), 1, DataType::S32),
Abe Mbise7784c832018-05-31 16:48:41 +010089 TensorInfo(TensorShape(4U), 1, DataType::F32),
90 TensorInfo(TensorShape(2U, 2U), 1, DataType::F32),
91 TensorInfo(TensorShape(2U), 1, DataType::F32),
92 TensorInfo(TensorShape(2U), 1, DataType::F32),
93 })),
94 framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
95 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
96 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
97 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
Giorgio Arena66cbafb2018-08-23 14:51:00 +010098 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::QASYMM8),
Abe Mbise7784c832018-05-31 16:48:41 +010099 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
100 TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32),
101 TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32),
102 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
103 })),
104 framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0),
105 PadStrideInfo(1, 1, 0, 0),
106 PadStrideInfo(1, 1, 0, 0),
107 PadStrideInfo(1, 1, 0, 0),
108 PadStrideInfo(4, 1, 0, 0),
109 PadStrideInfo(1, 1, 0, 0),
110 PadStrideInfo(1, 1, 0, 0),
111 PadStrideInfo(1, 1, 0, 0),
112 PadStrideInfo(1, 1, 0, 0),
113 })),
114 framework::dataset::make("DepthMultiplier", { 1,
115 1,
116 1,
117 3,
118 1,
119 1,
120 1,
121 1,
122 1,
123 })),
Giorgio Arena66cbafb2018-08-23 14:51:00 +0100124 framework::dataset::make("Expected", { false, false, false, false, false, false, false, false, true })),
Abe Mbise7784c832018-05-31 16:48:41 +0100125 input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier, expected)
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100126{
Abe Mbise7784c832018-05-31 16:48:41 +0100127 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));
128 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100129}
130
Abe Mbise7784c832018-05-31 16:48:41 +0100131DATA_TEST_CASE(ValidateGeneric, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(
132 framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type input/weights
133 TensorInfo(TensorShape(27U, 13U, 3U), 1, DataType::F32), // Mismatching input feature maps
134 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching depth multiplier
135 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases size
136 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases dimensions
137 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid output size
138 TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32),
139 TensorInfo(TensorShape(32U, 13U, 8U), 1, DataType::QASYMM8),
140 }),
141 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F16),
142 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
143 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
144 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
145 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
146 TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32),
147 TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32),
148 TensorInfo(TensorShape(3U, 3U, 24U), 1, DataType::QASYMM8),
149 })),
150 framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32),
151 TensorInfo(TensorShape(2U), 1, DataType::F32),
152 TensorInfo(TensorShape(2U), 1, DataType::F32),
153 TensorInfo(TensorShape(4U), 1, DataType::F32),
154 TensorInfo(TensorShape(2U, 2U), 1, DataType::F32),
155 TensorInfo(TensorShape(2U), 1, DataType::F32),
156 TensorInfo(TensorShape(16U), 1, DataType::F32),
157 TensorInfo(TensorShape(24U), 1, DataType::S32),
158 })),
159 framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
160 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
161 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
162 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
163 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
164 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32),
165 TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32),
166 TensorInfo(TensorShape(32U, 11U, 24U), 1, DataType::QASYMM8),
167 })),
168 framework::dataset::make("ConvInfo", { 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, 0, 0),
173 PadStrideInfo(1, 1, 0, 0),
174 PadStrideInfo(1, 1, 0, 0),
175 PadStrideInfo(1, 1, 1, 0),
176 })),
177 framework::dataset::make("DepthMultiplier", { 1,
178 1,
179 3,
180 1,
181 1,
182 1,
183 2,
184 3,
185 })),
186 framework::dataset::make("Expected", { false, false, false, false, false, false, true, true })),
187 input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier, expected)
188{
189 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));
190 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
191}
192// clang-format on
193// *INDENT-ON*
194
Dmitry Savenkod7295b72017-11-20 22:00:08 +0700195TEST_SUITE(Float)
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100196TEST_SUITE(F32)
Michalis Spyroub7b31532017-11-23 12:10:21 +0000197TEST_SUITE(Generic)
198template <typename T>
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000199using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Giorgio Arena76572242018-04-04 17:44:26 +0100200FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
201 depth_multipliers),
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000202 framework::dataset::make("DataType",
Giorgio Arena1ed1fc62018-03-26 16:20:05 +0100203 DataType::F32)),
Giorgio Arena26b22162018-08-13 15:49:49 +0100204 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Michalis Spyroub7b31532017-11-23 12:10:21 +0000205{
206 validate(Accessor(_target), _reference, tolerance_f32);
207}
Giorgio Arena76572242018-04-04 17:44:26 +0100208FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
209 depth_multipliers),
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000210 framework::dataset::make("DataType",
Giorgio Arena1ed1fc62018-03-26 16:20:05 +0100211 DataType::F32)),
Giorgio Arena26b22162018-08-13 15:49:49 +0100212 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Michalis Spyroub7b31532017-11-23 12:10:21 +0000213{
214 validate(Accessor(_target), _reference, tolerance_f32);
215}
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100216TEST_SUITE_END() // Generic
Michalis Spyroub7b31532017-11-23 12:10:21 +0000217
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100218TEST_SUITE(W3x3)
Michalis Spyroub7b31532017-11-23 12:10:21 +0000219template <typename T>
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000220using NEDepthwiseConvolutionLayerFixture3x3 = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer3x3, T>;
Giorgio Arena76572242018-04-04 17:44:26 +0100221FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::ALL, combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
222 depth_multipliers),
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000223 framework::dataset::make("DataType",
Giorgio Arena1ed1fc62018-03-26 16:20:05 +0100224 DataType::F32)),
Giorgio Arena26b22162018-08-13 15:49:49 +0100225 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100226{
227 validate(Accessor(_target), _reference, tolerance_f32);
228}
Giorgio Arena76572242018-04-04 17:44:26 +0100229FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
230 depth_multipliers),
Giorgio Arena04a8f8c2017-11-23 11:45:24 +0000231 framework::dataset::make("DataType",
Giorgio Arena1ed1fc62018-03-26 16:20:05 +0100232 DataType::F32)),
Giorgio Arena26b22162018-08-13 15:49:49 +0100233 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100234{
235 validate(Accessor(_target), _reference, tolerance_f32);
236}
Giorgio Arena76572242018-04-04 17:44:26 +0100237FIXTURE_DATA_TEST_CASE(RunOptimized, NEDepthwiseConvolutionLayerFixture3x3<float>, framework::DatasetMode::ALL, combine(combine(combine(datasets::OptimizedDepthwiseConvolutionLayerDataset3x3(),
238 framework::dataset::make("DepthMultiplier", 1)),
Georgios Pinitas4074c992018-01-30 18:13:46 +0000239 framework::dataset::make("DataType",
Giorgio Arena1ed1fc62018-03-26 16:20:05 +0100240 DataType::F32)),
241 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Georgios Pinitas4074c992018-01-30 18:13:46 +0000242{
243 validate(Accessor(_target), _reference, tolerance_f32);
244}
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100245TEST_SUITE_END() // W3x3
246TEST_SUITE_END() // F32
Pablo Tello941cd702017-12-12 14:35:00 +0000247
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100248#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
249TEST_SUITE(F16)
Georgios Pinitas8cffcd62018-11-16 17:11:50 +0000250TEST_SUITE(Generic)
251template <typename T>
252using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
253FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
254 depth_multipliers),
255 framework::dataset::make("DataType",
256 DataType::F16)),
257 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
258{
259 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
260}
261FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(),
262 depth_multipliers),
263 framework::dataset::make("DataType",
264 DataType::F16)),
265 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
266{
267 validate(Accessor(_target), _reference, tolerance_f16, tolerance_num);
268}
269TEST_SUITE_END() // Generic
Georgios Pinitas20c246a2018-09-12 16:45:53 +0100270TEST_SUITE(W3x3)
271template <typename T>
272using NEDepthwiseConvolutionLayerFixture3x3 = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer3x3, T>;
273FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::ALL, combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(),
274 depth_multipliers),
275 framework::dataset::make("DataType",
276 DataType::F16)),
277 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
278{
279 validate(Accessor(_target), _reference, tolerance_f16);
280}
281FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
282 depth_multipliers),
283 framework::dataset::make("DataType",
284 DataType::F16)),
285 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
286{
287 validate(Accessor(_target), _reference, tolerance_f16);
288}
289FIXTURE_DATA_TEST_CASE(RunOptimized, NEDepthwiseConvolutionLayerFixture3x3<half>, framework::DatasetMode::ALL, combine(combine(combine(datasets::OptimizedDepthwiseConvolutionLayerDataset3x3(),
290 framework::dataset::make("DepthMultiplier", 1)),
291 framework::dataset::make("DataType",
292 DataType::F16)),
293 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
294{
295 validate(Accessor(_target), _reference, tolerance_f16);
296}
297TEST_SUITE_END() // W3x3
298TEST_SUITE_END() // FP16
299#endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
300
301TEST_SUITE_END() // Float
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100302
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000303template <typename T>
304using NEDepthwiseConvolutionLayerQuantizedFixture3x3 = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer3x3, T>;
Georgios Pinitasd05dce42018-01-22 16:29:17 +0000305template <typename T>
306using NEDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>;
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000307
308TEST_SUITE(Quantized)
309TEST_SUITE(QASYMM8)
Georgios Pinitasd05dce42018-01-22 16:29:17 +0000310TEST_SUITE(Generic)
Giorgio Arena76572242018-04-04 17:44:26 +0100311FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT,
312 combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(),
313 depth_multipliers),
Giorgio Arenadfca60b2018-01-31 10:30:59 +0000314 framework::dataset::make("DataType", DataType::QASYMM8)),
315 framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Giorgio Arena26b22162018-08-13 15:49:49 +0100316 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000317{
318 validate(Accessor(_target), _reference, tolerance_qasymm8);
319}
Giorgio Arena76572242018-04-04 17:44:26 +0100320TEST_SUITE_END()
321TEST_SUITE(W3x3)
322FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::PRECOMMIT,
323 combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers),
324 framework::dataset::make("DataType", DataType::QASYMM8)),
325 framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Giorgio Arena26b22162018-08-13 15:49:49 +0100326 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Giorgio Arena76572242018-04-04 17:44:26 +0100327{
328 validate(Accessor(_target), _reference, tolerance_qasymm8);
329}
Georgios Pinitasa799ce02018-09-12 20:11:34 +0100330FIXTURE_DATA_TEST_CASE(RunOptimized, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::ALL,
331 combine(combine(combine(combine(datasets::OptimizedDepthwiseConvolutionLayerDataset3x3(),
332 framework::dataset::make("DepthMultiplier", 1)),
333 framework::dataset::make("DataType",
334 DataType::QASYMM8)),
335 framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })),
336 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
337{
338 validate(Accessor(_target), _reference, tolerance_qasymm8);
339}
Giorgio Arena76572242018-04-04 17:44:26 +0100340FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY,
341 combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(),
342 depth_multipliers),
343 framework::dataset::make("DataType", DataType::QASYMM8)),
344 framework::dataset::make("QuantizationInfo", { QuantizationInfo(0.5f, 10) })),
Giorgio Arena26b22162018-08-13 15:49:49 +0100345 framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })))
Georgios Pinitasf72f9362018-01-12 16:29:45 +0000346{
347 validate(Accessor(_target), _reference, tolerance_qasymm8);
348}
349TEST_SUITE_END()
350TEST_SUITE_END()
351TEST_SUITE_END()
352
Michalis Spyrou7362f0d2017-10-18 17:58:22 +0100353TEST_SUITE_END()
354TEST_SUITE_END()
355} // namespace validation
356} // namespace test
357} // namespace arm_compute