blob: d1508fd90221ecc382b267c13c2c698a724206cd [file] [log] [blame]
Michalis Spyrou780db4e2017-11-23 09:49:51 +00001/*
Viet-Hoa Do019a7d92023-06-27 16:33:57 +01002 * Copyright (c) 2017-2023 Arm Limited.
Michalis Spyrou780db4e2017-11-23 09:49:51 +00003 *
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 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
Michalis Spyrou780db4e2017-11-23 09:49:51 +000024#include "arm_compute/core/Types.h"
Michele Di Giorgioed5a4922018-09-13 16:22:01 +010025#include "arm_compute/core/utils/misc/ShapeCalculator.h"
Michalis Spyrou780db4e2017-11-23 09:49:51 +000026#include "arm_compute/runtime/CL/CLTensor.h"
27#include "arm_compute/runtime/CL/CLTensorAllocator.h"
28#include "arm_compute/runtime/CL/functions/CLDeconvolutionLayer.h"
29#include "tests/CL/CLAccessor.h"
30#include "tests/PaddingCalculator.h"
31#include "tests/datasets/ShapeDatasets.h"
32#include "tests/framework/Asserts.h"
33#include "tests/framework/Macros.h"
34#include "tests/framework/datasets/Datasets.h"
35#include "tests/validation/Validation.h"
36#include "tests/validation/fixtures/DeconvolutionLayerFixture.h"
37
38namespace arm_compute
39{
40namespace test
41{
42namespace validation
43{
44namespace
45{
Georgios Pinitas793f87d2018-05-18 20:08:58 +010046constexpr AbsoluteTolerance<float> tolerance_fp32(0.001f); /**< Tolerance for floating point tests */
47RelativeTolerance<half_float::half> tolerance_f16(half_float::half(0.2)); /**< Tolerance value for comparing reference's for DataType::F16 */
Giuseppe Rossini0a958cb2020-01-16 16:38:56 +000048constexpr AbsoluteTolerance<float> tolerance_qasymm8(1.0); /**< Tolerance value for comparing reference's output against implementation's output for quantized data types */
Georgios Pinitas793f87d2018-05-18 20:08:58 +010049constexpr float tolerance_num = 0.07f; /**< Tolerance number */
Michalis Spyrou780db4e2017-11-23 09:49:51 +000050
Manuel Bottini6e10aa32020-04-30 13:28:23 +010051const auto data9x9_small_asymm = framework::dataset::make("InputShape", TensorShape{ 10U, 10U, 1U, 1U }) *framework::dataset::make("StrideX", 2) *framework::dataset::make("StrideY",
52 2)
53 *framework::dataset::make("PadLeft", 3)
54 *framework::dataset::make("PadRight", 4) *framework::dataset::make("PadTop", 3) *framework::dataset::make("PadBottom", 4) *framework::dataset::make("NumKernels", { 1 });
55
Gunes Bayirc6137d22023-10-09 20:47:16 +010056const auto data4x4 = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 4, 2) * framework::dataset::make("StrideY", 2, 4) * framework::dataset::make("PadX", 1, 3)
giuros01a69a88b2019-01-31 16:29:19 +000057 * framework::dataset::make("PadY", 0, 2) * framework::dataset::make("NumKernels", { 3 });
Michalis Spyrou780db4e2017-11-23 09:49:51 +000058
Gunes Bayirc6137d22023-10-09 20:47:16 +010059const auto data3x3 = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 2, 4) * framework::dataset::make("StrideY", 1, 4, 2) * framework::dataset::make("PadX", 1, 2)
60 * framework::dataset::make("PadY", 1, 3) * framework::dataset::make("NumKernels", { 3 });
61
Matthew Jacksonb9070a42019-08-22 16:13:27 +010062const auto data3x3_asymm = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 2) * framework::dataset::make("StrideY", 1, 2) * framework::dataset::make("PadLeft", 0, 1)
63 * framework::dataset::make("PadRight", 0, 1) * framework::dataset::make("PadTop", 0, 1) * framework::dataset::make("PadBottom", 0, 1) * framework::dataset::make("NumKernels", { 3 });
64
Michalis Spyrou064add62018-11-01 18:14:27 +000065const auto data3x3_precommit = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 2) * framework::dataset::make("StrideY", 1, 2) * framework::dataset::make("PadX", 0, 2)
giuros01a69a88b2019-01-31 16:29:19 +000066 * framework::dataset::make("PadY", 0, 2) * framework::dataset::make("NumKernels", { 3 });
Michalis Spyrou064add62018-11-01 18:14:27 +000067
Gunes Bayirc6137d22023-10-09 20:47:16 +010068const auto data3x3_precommit_large_channels = datasets::SmallDeconvolutionShapesWithLargerChannels() * framework::dataset::make("StrideX", 2) * framework::dataset::make("StrideY", 2)
Gunes Bayir59450702022-12-12 09:29:06 +000069 * framework::dataset::make("PadX", 1)
Gunes Bayirec0113d2022-11-09 09:26:27 +000070 * framework::dataset::make("PadY", 2) * framework::dataset::make("NumKernels", { 5 });
71
giuros0146a49a02019-04-01 13:50:22 +010072const auto data2x2_precommit = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 2) * framework::dataset::make("StrideY", 2) * framework::dataset::make("PadX", 1)
73 * framework::dataset::make("PadY", 1) * framework::dataset::make("NumKernels", { 3 });
74
Gunes Bayirc6137d22023-10-09 20:47:16 +010075const auto data1x1 = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 4, 2) * framework::dataset::make("StrideY", 2, 4) * framework::dataset::make("PadX", 0, 1)
giuros01a69a88b2019-01-31 16:29:19 +000076 * framework::dataset::make("PadY", 0, 1) * framework::dataset::make("NumKernels", { 3 });
Michalis Spyrou780db4e2017-11-23 09:49:51 +000077
Gunes Bayirc6137d22023-10-09 20:47:16 +010078const auto data5x1 = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 2, 4) * framework::dataset::make("StrideY", 1, 4, 2) * framework::dataset::make("PadX", 0, 1)
Viet-Hoa Do019a7d92023-06-27 16:33:57 +010079 * framework::dataset::make("PadY", 0, 1) * framework::dataset::make("NumKernels", { 3 });
80
giuros0146a49a02019-04-01 13:50:22 +010081const auto data_layouts_dataset = framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC });
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +010082
83const auto add_bias_dataset = framework::dataset::make("AddBias", { true, false });
Michalis Spyrou780db4e2017-11-23 09:49:51 +000084} // namespace
85
86TEST_SUITE(CL)
87TEST_SUITE(DeconvolutionLayer)
88
Michalis Spyrou780db4e2017-11-23 09:49:51 +000089// *INDENT-OFF*
90// clang-format off
Manuel Bottinic1b76fa2019-06-17 12:04:40 +010091DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(
Freddie Liardete92b0452021-04-22 14:55:17 +010092 framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type
93 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid weights shape
94 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F16), // Non supported data type
Gunes Bayirec0113d2022-11-09 09:26:27 +000095 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid bias shape
Freddie Liardete92b0452021-04-22 14:55:17 +010096 TensorInfo(TensorShape(13U, 11U, 4U, 3U), 1, DataType::F32), // Window shrink
97 TensorInfo(TensorShape(32U, 16U, 2U), 1, DataType::F32),
Gunes Bayirec0113d2022-11-09 09:26:27 +000098 TensorInfo(TensorShape(2U, 13U, 27U), 1, DataType::F32, DataLayout::NHWC), // Mismatching data type
99 TensorInfo(TensorShape(2U, 13U, 27U), 1, DataType::F32, DataLayout::NHWC), // Invalid weights shape
100 TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F16, DataLayout::NHWC), // Non supported data type
101 TensorInfo(TensorShape(2U, 13U, 27U), 1, DataType::F32, DataLayout::NHWC), // Invalid bias shape
102 TensorInfo(TensorShape(4U, 11U, 13U, 3U), 1, DataType::F32, DataLayout::NHWC), // Window shrink
103 TensorInfo(TensorShape(2U, 16U, 32U), 1, DataType::F32, DataLayout::NHWC),
Freddie Liardete92b0452021-04-22 14:55:17 +0100104 }),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100105 framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16),
Freddie Liardete92b0452021-04-22 14:55:17 +0100106 TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32),
107 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16),
108 TensorInfo(TensorShape(3U, 2U, 2U, 2U), 1, DataType::F32),
109 TensorInfo(TensorShape(3U, 3U, 4U), 1, DataType::F32),
Vidhya Sudhan Loganathan7485d5a2018-07-04 09:34:00 +0100110 TensorInfo(TensorShape(1U, 1U, 2U, 4U), 1, DataType::F32),
Gunes Bayirec0113d2022-11-09 09:26:27 +0000111 TensorInfo(TensorShape(2U, 3U, 3U, 2U), 1, DataType::F16, DataLayout::NHWC),
112 TensorInfo(TensorShape(2U, 3U, 3U, 4U), 1, DataType::F32, DataLayout::NHWC),
113 TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16, DataLayout::NHWC),
114 TensorInfo(TensorShape(2U, 2U, 3U, 2U), 1, DataType::F32, DataLayout::NHWC),
115 TensorInfo(TensorShape(4U, 3U, 3U), 1, DataType::F32, DataLayout::NHWC),
116 TensorInfo(TensorShape(2U, 2U, 2U, 4U), 1, DataType::F32, DataLayout::NHWC),
Freddie Liardete92b0452021-04-22 14:55:17 +0100117 })),
118 framework::dataset::make("BiasInfo", { TensorInfo(TensorShape(1U), 1, DataType::F16),
119 TensorInfo(TensorShape(1U), 1, DataType::F32),
120 TensorInfo(TensorShape(1U), 1, DataType::F32),
121 TensorInfo(TensorShape(25U, 11U), 1, DataType::F32),
122 TensorInfo(TensorShape(1U), 1, DataType::F32),
123 TensorInfo(TensorShape(4U), 1, DataType::F32),
Gunes Bayirec0113d2022-11-09 09:26:27 +0000124 TensorInfo(TensorShape(1U), 1, DataType::F16, DataLayout::NHWC),
125 TensorInfo(TensorShape(1U), 1, DataType::F32, DataLayout::NHWC),
126 TensorInfo(TensorShape(1U), 1, DataType::F32, DataLayout::NHWC),
127 TensorInfo(TensorShape(25U, 11U), 1, DataType::F32, DataLayout::NHWC),
128 TensorInfo(TensorShape(1U), 1, DataType::F32, DataLayout::NHWC),
129 TensorInfo(TensorShape(4U), 1, DataType::F32, DataLayout::NHWC),
Freddie Liardete92b0452021-04-22 14:55:17 +0100130 })),
131 framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F16),
132 TensorInfo(TensorShape(25U, 10U, 2U), 1, DataType::F32),
133 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32),
134 TensorInfo(TensorShape(13U, 13U, 2U), 1, DataType::F32),
135 TensorInfo(TensorShape(11U, 9U, 1U, 3U), 1, DataType::F32),
136 TensorInfo(TensorShape(32U, 16U, 4U), 1, DataType::F32),
Gunes Bayirec0113d2022-11-09 09:26:27 +0000137 TensorInfo(TensorShape(2U, 11U, 25U), 1, DataType::F16, DataLayout::NHWC),
138 TensorInfo(TensorShape(2U, 10U, 25U), 1, DataType::F32, DataLayout::NHWC),
139 TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32, DataLayout::NHWC),
140 TensorInfo(TensorShape(2U, 13U, 13U), 1, DataType::F32, DataLayout::NHWC),
141 TensorInfo(TensorShape(1U, 9U, 11U, 3U), 1, DataType::F32, DataLayout::NHWC),
142 TensorInfo(TensorShape(4U, 43U, 91U), 1, DataType::F32, DataLayout::NHWC),
Freddie Liardete92b0452021-04-22 14:55:17 +0100143 })),
Michalis Spyrou780db4e2017-11-23 09:49:51 +0000144 framework::dataset::make("PadStrideInfo", { PadStrideInfo(1, 1, 0, 0),
145 PadStrideInfo(1, 1, 0, 0),
146 PadStrideInfo(1, 1, 0, 0),
Manuel Bottinic1b76fa2019-06-17 12:04:40 +0100147 PadStrideInfo(1, 1, 0, 0),
Michalis Spyrou780db4e2017-11-23 09:49:51 +0000148 PadStrideInfo(1, 1, 1, 1),
149 PadStrideInfo(1, 1, 0, 0),
Gunes Bayirec0113d2022-11-09 09:26:27 +0000150 PadStrideInfo(1, 1, 0, 0),
151 PadStrideInfo(1, 1, 0, 0),
152 PadStrideInfo(1, 1, 0, 0),
153 PadStrideInfo(1, 1, 0, 0),
154 PadStrideInfo(1, 1, 1, 1),
155 PadStrideInfo(3, 3, 2, 2),
Michalis Spyrou780db4e2017-11-23 09:49:51 +0000156 })),
Gunes Bayirec0113d2022-11-09 09:26:27 +0000157 framework::dataset::make("Expected", { false, false, false, false, false, true, // NCHW
158 false, false, false, false, false, true })), // NHWC
Manuel Bottinic1b76fa2019-06-17 12:04:40 +0100159 input_info, weights_info, bias_info, output_info, pad_info, expected)
Michalis Spyrou780db4e2017-11-23 09:49:51 +0000160{
Manuel Bottinic1b76fa2019-06-17 12:04:40 +0100161 bool is_valid = bool(CLDeconvolutionLayer::validate(&input_info.clone()->set_is_resizable(false), &weights_info.clone()->set_is_resizable(false), &bias_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), pad_info));
Michalis Spyrou780db4e2017-11-23 09:49:51 +0000162 ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS);
163}
164// clang-format on
165// *INDENT-ON*
166
167template <typename T>
Michele Di Giorgio14cbfb22019-10-23 10:53:10 +0100168using CLDeconvolutionLayerFixture4x4 = DeconvolutionValidationFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 4, 4>;
Georgios Pinitasced7a8d2018-02-01 16:31:33 +0000169
170template <typename T>
Michele Di Giorgio14cbfb22019-10-23 10:53:10 +0100171using CLDeconvolutionLayerFixture3x3 = DeconvolutionValidationFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 3, 3>;
Michalis Spyrou780db4e2017-11-23 09:49:51 +0000172
173template <typename T>
Matthew Jacksonb9070a42019-08-22 16:13:27 +0100174using CLDeconvolutionLayerAsymmFixture3x3 = DeconvolutionValidationAsymmFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 3, 3>;
giuros0146a49a02019-04-01 13:50:22 +0100175
176template <typename T>
Michele Di Giorgio14cbfb22019-10-23 10:53:10 +0100177using CLDeconvolutionLayerFixture2x2 = DeconvolutionValidationFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 2, 2>;
Matthew Jacksonb9070a42019-08-22 16:13:27 +0100178
179template <typename T>
Michele Di Giorgio14cbfb22019-10-23 10:53:10 +0100180using CLDeconvolutionLayerFixture1x1 = DeconvolutionValidationFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 1, 1>;
Michalis Spyrou780db4e2017-11-23 09:49:51 +0000181
Manuel Bottini6e10aa32020-04-30 13:28:23 +0100182template <typename T>
183using CLDeconvolutionLayerAsymmFixture9x9 = DeconvolutionValidationAsymmFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 9, 9>;
184
Viet-Hoa Do019a7d92023-06-27 16:33:57 +0100185template <typename T>
186using CLDeconvolutionLayerFixture5x1 = DeconvolutionValidationFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 5, 1>;
187
Michalis Spyrou780db4e2017-11-23 09:49:51 +0000188TEST_SUITE(Float)
Michalis Spyrou780db4e2017-11-23 09:49:51 +0000189TEST_SUITE(FP32)
Georgios Pinitasced7a8d2018-02-01 16:31:33 +0000190
Georgios Pinitas793f87d2018-05-18 20:08:58 +0100191TEST_SUITE(W4x4)
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100192FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerFixture4x4<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data4x4, framework::dataset::make("DataType", DataType::F32)),
193 data_layouts_dataset),
194 add_bias_dataset))
Georgios Pinitasced7a8d2018-02-01 16:31:33 +0000195{
196 // Validate output
197 validate(CLAccessor(_target), _reference, tolerance_fp32);
198}
Michalis Spyrou064add62018-11-01 18:14:27 +0000199TEST_SUITE_END() // W4x4
Georgios Pinitasced7a8d2018-02-01 16:31:33 +0000200
Michalis Spyrou780db4e2017-11-23 09:49:51 +0000201TEST_SUITE(W3x3)
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100202FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerFixture3x3<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data3x3_precommit, framework::dataset::make("DataType",
203 DataType::F32)),
204 data_layouts_dataset),
205 add_bias_dataset))
Michalis Spyrou780db4e2017-11-23 09:49:51 +0000206{
207 // Validate output
208 validate(CLAccessor(_target), _reference, tolerance_fp32);
209}
Gunes Bayirec0113d2022-11-09 09:26:27 +0000210
211FIXTURE_DATA_TEST_CASE(RunSmallWithLargeChannels, CLDeconvolutionLayerFixture3x3<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data3x3_precommit_large_channels,
212 framework::dataset::make("DataType",
213 DataType::F32)),
214 data_layouts_dataset),
215 framework::dataset::make("AddBias", { true })))
216{
217 // Validate output
218 validate(CLAccessor(_target), _reference, tolerance_fp32);
219}
220
Matthew Jacksonb9070a42019-08-22 16:13:27 +0100221FIXTURE_DATA_TEST_CASE(RunAsymm, CLDeconvolutionLayerAsymmFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3_asymm, framework::dataset::make("DataType",
222 DataType::F32)),
223 data_layouts_dataset),
224 add_bias_dataset))
225{
226 // Validate output
227 validate(CLAccessor(_target), _reference, tolerance_fp32);
228}
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100229FIXTURE_DATA_TEST_CASE(RunLarge, CLDeconvolutionLayerFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3, framework::dataset::make("DataType", DataType::F32)),
Gunes Bayirc6137d22023-10-09 20:47:16 +0100230 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
231 framework::dataset::make("AddBias", { true })))
Michalis Spyrou064add62018-11-01 18:14:27 +0000232{
233 // Validate output
234 validate(CLAccessor(_target), _reference, tolerance_fp32);
235}
236TEST_SUITE_END() // W3x3
Michalis Spyrou780db4e2017-11-23 09:49:51 +0000237
giuros0146a49a02019-04-01 13:50:22 +0100238TEST_SUITE(W2x2)
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100239FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerFixture2x2<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data2x2_precommit, framework::dataset::make("DataType",
240 DataType::F32)),
241 data_layouts_dataset),
242 add_bias_dataset))
giuros0146a49a02019-04-01 13:50:22 +0100243{
244 // Validate output
245 validate(CLAccessor(_target), _reference, tolerance_fp32);
246}
247TEST_SUITE_END() // W2x2
248
Michalis Spyrou780db4e2017-11-23 09:49:51 +0000249TEST_SUITE(W1x1)
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100250FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerFixture1x1<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data1x1, framework::dataset::make("DataType", DataType::F32)),
251 data_layouts_dataset),
Gunes Bayirc6137d22023-10-09 20:47:16 +0100252 framework::dataset::make("AddBias", { true })))
Michalis Spyrou780db4e2017-11-23 09:49:51 +0000253{
254 // Validate output
255 validate(CLAccessor(_target), _reference, tolerance_fp32);
256}
Michalis Spyrou064add62018-11-01 18:14:27 +0000257TEST_SUITE_END() // W1x1
Manuel Bottini6e10aa32020-04-30 13:28:23 +0100258TEST_SUITE(W9x9)
259FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerAsymmFixture9x9<float>, framework::DatasetMode::ALL, combine(combine(combine(data9x9_small_asymm, framework::dataset::make("DataType",
260 DataType::F32)),
261 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
262 framework::dataset::make("AddBias", { false })))
263{
264 // Validate output
265 validate(CLAccessor(_target), _reference, tolerance_fp32);
266}
267TEST_SUITE_END() // W9x9
Viet-Hoa Do019a7d92023-06-27 16:33:57 +0100268
269TEST_SUITE(W5x1)
270FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerFixture5x1<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data5x1, framework::dataset::make("DataType", DataType::F32)),
271 data_layouts_dataset),
Gunes Bayirc6137d22023-10-09 20:47:16 +0100272 framework::dataset::make("AddBias", { true })))
Viet-Hoa Do019a7d92023-06-27 16:33:57 +0100273{
274 // Validate output
275 validate(CLAccessor(_target), _reference, tolerance_fp32);
276}
277TEST_SUITE_END() // W5x1
278
Michalis Spyrou064add62018-11-01 18:14:27 +0000279TEST_SUITE_END() // FP32
Georgios Pinitas793f87d2018-05-18 20:08:58 +0100280
281TEST_SUITE(FP16)
282
283TEST_SUITE(W4x4)
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100284FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerFixture4x4<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data4x4, framework::dataset::make("DataType", DataType::F16)),
285 data_layouts_dataset),
Gunes Bayirc6137d22023-10-09 20:47:16 +0100286 framework::dataset::make("AddBias", { true })))
Georgios Pinitas793f87d2018-05-18 20:08:58 +0100287{
288 // Validate output
289 validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
290}
Michalis Spyrou064add62018-11-01 18:14:27 +0000291TEST_SUITE_END() // W4x4
Georgios Pinitas793f87d2018-05-18 20:08:58 +0100292
293TEST_SUITE(W3x3)
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100294FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerFixture3x3<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data3x3_precommit, framework::dataset::make("DataType",
295 DataType::F16)),
296 data_layouts_dataset),
297 add_bias_dataset))
Georgios Pinitas793f87d2018-05-18 20:08:58 +0100298{
299 // Validate output
300 validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
301}
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100302FIXTURE_DATA_TEST_CASE(RunLarge, CLDeconvolutionLayerFixture3x3<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3, framework::dataset::make("DataType", DataType::F16)),
Gunes Bayirc6137d22023-10-09 20:47:16 +0100303 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
304 framework::dataset::make("AddBias", { true })))
Michalis Spyrou064add62018-11-01 18:14:27 +0000305{
306 // Validate output
307 validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
308}
309TEST_SUITE_END() // W3x3
Georgios Pinitas793f87d2018-05-18 20:08:58 +0100310
giuros0146a49a02019-04-01 13:50:22 +0100311TEST_SUITE(W2x2)
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100312FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerFixture2x2<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data2x2_precommit, framework::dataset::make("DataType",
313 DataType::F16)),
314 data_layouts_dataset),
315 add_bias_dataset))
giuros0146a49a02019-04-01 13:50:22 +0100316{
317 // Validate output
giuros01b56d0cd2019-05-13 13:24:55 +0100318 validate(CLAccessor(_target), _reference, tolerance_f16);
giuros0146a49a02019-04-01 13:50:22 +0100319}
320TEST_SUITE_END() // W2x2
321
Georgios Pinitas793f87d2018-05-18 20:08:58 +0100322TEST_SUITE(W1x1)
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100323FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerFixture1x1<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data1x1, framework::dataset::make("DataType", DataType::F16)),
324 data_layouts_dataset),
Gunes Bayirc6137d22023-10-09 20:47:16 +0100325 framework::dataset::make("AddBias", { true })))
Georgios Pinitas793f87d2018-05-18 20:08:58 +0100326{
327 // Validate output
328 validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
329}
Michalis Spyrou064add62018-11-01 18:14:27 +0000330TEST_SUITE_END() // W1x1
Georgios Pinitas793f87d2018-05-18 20:08:58 +0100331
Viet-Hoa Do019a7d92023-06-27 16:33:57 +0100332TEST_SUITE(W5x1)
333FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerFixture5x1<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data5x1, framework::dataset::make("DataType", DataType::F16)),
334 data_layouts_dataset),
Gunes Bayirc6137d22023-10-09 20:47:16 +0100335 framework::dataset::make("AddBias", { true })))
Viet-Hoa Do019a7d92023-06-27 16:33:57 +0100336{
337 // Validate output
338 validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num);
339}
340TEST_SUITE_END() // W5x1
341
Michalis Spyrou064add62018-11-01 18:14:27 +0000342TEST_SUITE_END() // FP16
343TEST_SUITE_END() // Float
Michalis Spyrou780db4e2017-11-23 09:49:51 +0000344
Michele Di Giorgio9fef38a2018-07-06 18:06:58 +0100345template <typename T>
346using CLDeconvolutionLayerQuantizedFixture4x4 = DeconvolutionValidationQuantizedFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 4, 4>;
347
348template <typename T>
349using CLDeconvolutionLayerQuantizedFixture3x3 = DeconvolutionValidationQuantizedFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 3, 3>;
350
351template <typename T>
giuros0146a49a02019-04-01 13:50:22 +0100352using CLDeconvolutionLayerQuantizedFixture2x2 = DeconvolutionValidationQuantizedFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 2, 2>;
353
354template <typename T>
Michele Di Giorgio9fef38a2018-07-06 18:06:58 +0100355using CLDeconvolutionLayerQuantizedFixture1x1 = DeconvolutionValidationQuantizedFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 1, 1>;
356
Freddie Liardete92b0452021-04-22 14:55:17 +0100357template <typename T>
Viet-Hoa Do019a7d92023-06-27 16:33:57 +0100358using CLDeconvolutionLayerQuantizedFixture5x1 = DeconvolutionValidationQuantizedFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 5, 1>;
359
360template <typename T>
Freddie Liardete92b0452021-04-22 14:55:17 +0100361using CLDeconvolutionLayerQuantizedPerChannelFixture4x4 = DeconvolutionValidationQuantizedPerChannelFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, int8_t, 4, 4>;
362
363template <typename T>
364using CLDeconvolutionLayerQuantizedPerChannelFixture3x3 = DeconvolutionValidationQuantizedPerChannelFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, int8_t, 3, 3>;
365
366template <typename T>
367using CLDeconvolutionLayerQuantizedPerChannelFixture2x2 = DeconvolutionValidationQuantizedPerChannelFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, int8_t, 2, 2>;
368
369template <typename T>
370using CLDeconvolutionLayerQuantizedPerChannelFixture1x1 = DeconvolutionValidationQuantizedPerChannelFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, int8_t, 1, 1>;
371
Viet-Hoa Do019a7d92023-06-27 16:33:57 +0100372template <typename T>
373using CLDeconvolutionLayerQuantizedPerChannelFixture5x1 = DeconvolutionValidationQuantizedPerChannelFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, int8_t, 5, 1>;
374
Michele Di Giorgio9fef38a2018-07-06 18:06:58 +0100375TEST_SUITE(Quantized)
376TEST_SUITE(QASYMM8)
377
378TEST_SUITE(W4x4)
Manuel Bottini279814b2019-10-25 10:28:28 +0100379FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerQuantizedFixture4x4<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data4x4, framework::dataset::make("DataType",
Michalis Spyrou064add62018-11-01 18:14:27 +0000380 DataType::QASYMM8)),
381 data_layouts_dataset),
Giuseppe Rossini0a958cb2020-01-16 16:38:56 +0000382 framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 10), QuantizationInfo(2.f / 255.f, 5) })),
383 framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 5), QuantizationInfo(4.f / 255.f, 10) })),
Gunes Bayirc6137d22023-10-09 20:47:16 +0100384 framework::dataset::make("AddBias", { true })))
Michele Di Giorgio9fef38a2018-07-06 18:06:58 +0100385{
386 // Validate output
387 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
388}
Michalis Spyrou064add62018-11-01 18:14:27 +0000389TEST_SUITE_END() // W4x4
Michele Di Giorgio9fef38a2018-07-06 18:06:58 +0100390
391TEST_SUITE(W3x3)
Manuel Bottini279814b2019-10-25 10:28:28 +0100392FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(data3x3_precommit,
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100393 framework::dataset::make("DataType",
394 DataType::QASYMM8)),
Michalis Spyrou064add62018-11-01 18:14:27 +0000395 data_layouts_dataset),
Giuseppe Rossini0a958cb2020-01-16 16:38:56 +0000396 framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 10), QuantizationInfo(2.f / 255.f, 4) })),
397 framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 10), QuantizationInfo(4.f / 255.f, 5) })),
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100398 add_bias_dataset))
Michele Di Giorgio9fef38a2018-07-06 18:06:58 +0100399{
400 // Validate output
401 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
402}
Manuel Bottini279814b2019-10-25 10:28:28 +0100403FIXTURE_DATA_TEST_CASE(RunLarge, CLDeconvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data3x3,
Gunes Bayirc6137d22023-10-09 20:47:16 +0100404 framework::dataset::make("DataType", DataType::QASYMM8)),
405 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Giuseppe Rossini0a958cb2020-01-16 16:38:56 +0000406 framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 10), QuantizationInfo(2.f / 255.f, 128) })),
407 framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 128), QuantizationInfo(4.f / 255.f, 128) })),
Gunes Bayirc6137d22023-10-09 20:47:16 +0100408 framework::dataset::make("AddBias", { true })))
Michalis Spyrou064add62018-11-01 18:14:27 +0000409{
410 // Validate output
411 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
412}
413TEST_SUITE_END() // W3x3
Michele Di Giorgio9fef38a2018-07-06 18:06:58 +0100414
giuros0146a49a02019-04-01 13:50:22 +0100415TEST_SUITE(W2x2)
Manuel Bottini279814b2019-10-25 10:28:28 +0100416FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedFixture2x2<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(data2x2_precommit,
417 framework::dataset::make("DataType", DataType::QASYMM8)),
giuros0146a49a02019-04-01 13:50:22 +0100418 data_layouts_dataset),
Giuseppe Rossini0a958cb2020-01-16 16:38:56 +0000419 framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 128), QuantizationInfo(2.f / 255.f, 128) })),
420 framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 64), QuantizationInfo(4.f / 255.f, 128) })),
Manuel Bottini9f0d5ec2019-08-19 13:31:38 +0100421 add_bias_dataset))
giuros0146a49a02019-04-01 13:50:22 +0100422{
423 // Validate output
Giuseppe Rossini0a958cb2020-01-16 16:38:56 +0000424 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
giuros0146a49a02019-04-01 13:50:22 +0100425}
426TEST_SUITE_END() // W2x2
427
Michele Di Giorgio9fef38a2018-07-06 18:06:58 +0100428TEST_SUITE(W1x1)
Manuel Bottini279814b2019-10-25 10:28:28 +0100429FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerQuantizedFixture1x1<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data1x1, framework::dataset::make("DataType",
Michalis Spyrou064add62018-11-01 18:14:27 +0000430 DataType::QASYMM8)),
431 data_layouts_dataset),
Giuseppe Rossini0a958cb2020-01-16 16:38:56 +0000432 framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 0), QuantizationInfo(2.f / 255.f, 0) })),
433 framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 0), QuantizationInfo(4.f / 255.f, 0) })),
Gunes Bayirc6137d22023-10-09 20:47:16 +0100434 framework::dataset::make("AddBias", { true })))
Michele Di Giorgio9fef38a2018-07-06 18:06:58 +0100435{
436 // Validate output
437 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
438}
Michalis Spyrou064add62018-11-01 18:14:27 +0000439TEST_SUITE_END() // W1x1
Michele Di Giorgio9fef38a2018-07-06 18:06:58 +0100440
Viet-Hoa Do019a7d92023-06-27 16:33:57 +0100441TEST_SUITE(W5x1)
442FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerQuantizedFixture5x1<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data5x1, framework::dataset::make("DataType",
443 DataType::QASYMM8)),
444 data_layouts_dataset),
445 framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 10), QuantizationInfo(2.f / 255.f, 5) })),
446 framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 5), QuantizationInfo(4.f / 255.f, 10) })),
Gunes Bayirc6137d22023-10-09 20:47:16 +0100447 framework::dataset::make("AddBias", { true })))
Viet-Hoa Do019a7d92023-06-27 16:33:57 +0100448{
449 // Validate output
450 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
451}
452TEST_SUITE_END() // W5x1
453
Michalis Spyrou064add62018-11-01 18:14:27 +0000454TEST_SUITE_END() // QASYMM8
Sheri Zhanga14817a2020-02-26 10:30:15 +0000455
456TEST_SUITE(QASYMM8_SIGNED)
457
458// QASYMM8_SIGNED: zero-point in range [-128, 127]
459// QASYMM8 : zero-point in range [0 , 255]
460
461TEST_SUITE(W4x4)
462FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerQuantizedFixture4x4<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data4x4, framework::dataset::make("DataType",
463 DataType::QASYMM8_SIGNED)),
464 data_layouts_dataset),
465 framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 10), QuantizationInfo(2.f / 255.f, 5) })),
466 framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 5), QuantizationInfo(4.f / 255.f, 10) })),
Gunes Bayirc6137d22023-10-09 20:47:16 +0100467 framework::dataset::make("AddBias", { true })))
Sheri Zhanga14817a2020-02-26 10:30:15 +0000468{
469 // Validate output
470 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
471}
472TEST_SUITE_END() // W4x4
473
474TEST_SUITE(W3x3)
475// DirectDeconvolution
476FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedFixture3x3<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(data3x3_precommit,
477 framework::dataset::make("DataType",
478 DataType::QASYMM8_SIGNED)),
479 data_layouts_dataset),
480 framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 10), QuantizationInfo(2.f / 255.f, 4) })),
481 framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 10), QuantizationInfo(4.f / 255.f, 5) })),
482 add_bias_dataset))
483{
484 // Validate output
485 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
486}
487
488FIXTURE_DATA_TEST_CASE(RunLarge, CLDeconvolutionLayerQuantizedFixture3x3<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data3x3,
Gunes Bayirc6137d22023-10-09 20:47:16 +0100489 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
490 framework::dataset::make("DataLayout", { DataLayout::NHWC })),
Sheri Zhanga14817a2020-02-26 10:30:15 +0000491 framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, -10), QuantizationInfo(2.f / 255.f, 127) })),
492 framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 64), QuantizationInfo(4.f / 255.f, -128) })),
Gunes Bayirc6137d22023-10-09 20:47:16 +0100493 framework::dataset::make("AddBias", { true })))
Sheri Zhanga14817a2020-02-26 10:30:15 +0000494{
495 // Validate output
496 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
497}
498TEST_SUITE_END() // W3x3
499
500TEST_SUITE(W2x2) // GEMMDeconvolution
501FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedFixture2x2<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(data2x2_precommit,
502 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
503 data_layouts_dataset),
504 framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 127), QuantizationInfo(2.f / 255.f, -128) })),
505 framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, -10), QuantizationInfo(4.f / 255.f, 64) })),
506 add_bias_dataset))
507{
508 // Validate output
509 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
510}
511TEST_SUITE_END() // W2x2
512
513TEST_SUITE(W1x1) // DirectDeconvolution and GEMMDeconvolution
Freddie Liardete92b0452021-04-22 14:55:17 +0100514FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerQuantizedFixture1x1<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data1x1,
515 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
Sheri Zhanga14817a2020-02-26 10:30:15 +0000516 data_layouts_dataset),
517 framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 0), QuantizationInfo(2.f / 255.f, 0) })),
518 framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 0), QuantizationInfo(4.f / 255.f, 0) })),
Gunes Bayirc6137d22023-10-09 20:47:16 +0100519 framework::dataset::make("AddBias", { true })))
Sheri Zhanga14817a2020-02-26 10:30:15 +0000520{
521 // Validate output
522 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
523}
524TEST_SUITE_END() // W1x1
525
Viet-Hoa Do019a7d92023-06-27 16:33:57 +0100526TEST_SUITE(W5x1)
527FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerQuantizedFixture5x1<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data5x1, framework::dataset::make("DataType",
528 DataType::QASYMM8_SIGNED)),
529 data_layouts_dataset),
530 framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 10), QuantizationInfo(2.f / 255.f, 5) })),
531 framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 5), QuantizationInfo(4.f / 255.f, 10) })),
Gunes Bayirc6137d22023-10-09 20:47:16 +0100532 framework::dataset::make("AddBias", { true })))
Viet-Hoa Do019a7d92023-06-27 16:33:57 +0100533{
534 // Validate output
535 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
536}
537TEST_SUITE_END() // W5x1
538
Sheri Zhanga14817a2020-02-26 10:30:15 +0000539TEST_SUITE_END() // QASYMM8_SIGNED
540
Freddie Liardete92b0452021-04-22 14:55:17 +0100541const auto input_qinfo_dataset = framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 10) });
542const auto output_qinfo_dataset = framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 0) });
543const auto input_signed_qinfo_dataset = framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, -10) });
544const auto output_signed_qinfo_dataset = framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 10) });
545
546TEST_SUITE(QSYMM8_PER_CHANNEL)
547
548TEST_SUITE(W4x4)
Gunes Bayir59450702022-12-12 09:29:06 +0000549FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedPerChannelFixture4x4<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(data4x4,
Freddie Liardete92b0452021-04-22 14:55:17 +0100550 framework::dataset::make("DataType", DataType::QASYMM8)),
551 data_layouts_dataset),
552 input_qinfo_dataset),
553 output_qinfo_dataset),
Gunes Bayirc6137d22023-10-09 20:47:16 +0100554 framework::dataset::make("AddBias", { true })),
Freddie Liardete92b0452021-04-22 14:55:17 +0100555 framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
556{
557 // Validate output
558 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
559}
Gunes Bayir59450702022-12-12 09:29:06 +0000560FIXTURE_DATA_TEST_CASE(RunSmallSigned, CLDeconvolutionLayerQuantizedPerChannelFixture4x4<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(data4x4,
Freddie Liardete92b0452021-04-22 14:55:17 +0100561 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
562 data_layouts_dataset),
563 input_signed_qinfo_dataset),
564 output_signed_qinfo_dataset),
Gunes Bayirc6137d22023-10-09 20:47:16 +0100565 framework::dataset::make("AddBias", { true })),
Freddie Liardete92b0452021-04-22 14:55:17 +0100566 framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
567{
568 // Validate output
569 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
570}
571TEST_SUITE_END() // W4x4
572
573TEST_SUITE(W3x3)
Gunes Bayir59450702022-12-12 09:29:06 +0000574FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedPerChannelFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(data3x3,
Freddie Liardete92b0452021-04-22 14:55:17 +0100575 framework::dataset::make("DataType", DataType::QASYMM8)),
576 data_layouts_dataset),
577 input_qinfo_dataset),
578 output_qinfo_dataset),
Gunes Bayirc6137d22023-10-09 20:47:16 +0100579 framework::dataset::make("AddBias", { true })),
Freddie Liardete92b0452021-04-22 14:55:17 +0100580 framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
581{
582 // Validate output
583 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
584}
Gunes Bayir59450702022-12-12 09:29:06 +0000585FIXTURE_DATA_TEST_CASE(RunSmallSigned, CLDeconvolutionLayerQuantizedPerChannelFixture3x3<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(data3x3,
Freddie Liardete92b0452021-04-22 14:55:17 +0100586 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
587 data_layouts_dataset),
588 input_signed_qinfo_dataset),
589 output_signed_qinfo_dataset),
Gunes Bayirc6137d22023-10-09 20:47:16 +0100590 framework::dataset::make("AddBias", { true })),
Freddie Liardete92b0452021-04-22 14:55:17 +0100591 framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
592{
593 // Validate output
594 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
595}
Gunes Bayir59450702022-12-12 09:29:06 +0000596
597FIXTURE_DATA_TEST_CASE(RunSmallSignedPrecommit, CLDeconvolutionLayerQuantizedPerChannelFixture2x2<int8_t>, framework::DatasetMode::PRECOMMIT,
598 combine(combine(combine(combine(combine(combine(data3x3_precommit,
599 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
600 data_layouts_dataset),
601 input_signed_qinfo_dataset),
602 output_signed_qinfo_dataset),
603 add_bias_dataset),
604 framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
605{
606 // Validate output
607 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
608}
Freddie Liardete92b0452021-04-22 14:55:17 +0100609TEST_SUITE_END() // W3x3
610
Gunes Bayir59450702022-12-12 09:29:06 +0000611FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedPerChannelFixture2x2<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(combine(data3x3_precommit,
Freddie Liardete92b0452021-04-22 14:55:17 +0100612 framework::dataset::make("DataType", DataType::QASYMM8)),
613 data_layouts_dataset),
614 input_qinfo_dataset),
615 output_qinfo_dataset),
616 add_bias_dataset),
617 framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
618{
619 // Validate output
620 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
621}
Gunes Bayir59450702022-12-12 09:29:06 +0000622
623TEST_SUITE(W2x2)
624FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedPerChannelFixture2x2<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(combine(data2x2_precommit,
625 framework::dataset::make("DataType", DataType::QASYMM8)),
626 data_layouts_dataset),
627 input_qinfo_dataset),
628 output_qinfo_dataset),
629 add_bias_dataset),
630 framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
631{
632 // Validate output
633 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
634}
635FIXTURE_DATA_TEST_CASE(RunSmallSigned, CLDeconvolutionLayerQuantizedPerChannelFixture2x2<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(combine(data2x2_precommit,
Freddie Liardete92b0452021-04-22 14:55:17 +0100636 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
637 data_layouts_dataset),
638 input_signed_qinfo_dataset),
639 output_signed_qinfo_dataset),
640 add_bias_dataset),
641 framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
642{
643 // Validate output
644 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
645}
646TEST_SUITE_END() // W2x2
647
648TEST_SUITE(W1x1)
Gunes Bayir59450702022-12-12 09:29:06 +0000649FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedPerChannelFixture1x1<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(data1x1,
Freddie Liardete92b0452021-04-22 14:55:17 +0100650 framework::dataset::make("DataType", DataType::QASYMM8)),
651 data_layouts_dataset),
652 input_qinfo_dataset),
653 output_qinfo_dataset),
Gunes Bayirc6137d22023-10-09 20:47:16 +0100654 framework::dataset::make("AddBias", { false })),
Freddie Liardete92b0452021-04-22 14:55:17 +0100655 framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
656{
657 // Validate output
658 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
659}
Gunes Bayir59450702022-12-12 09:29:06 +0000660FIXTURE_DATA_TEST_CASE(RunSmallSigned, CLDeconvolutionLayerQuantizedPerChannelFixture1x1<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(data1x1,
Freddie Liardete92b0452021-04-22 14:55:17 +0100661 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
662 data_layouts_dataset),
663 input_signed_qinfo_dataset),
664 output_signed_qinfo_dataset),
Gunes Bayirc6137d22023-10-09 20:47:16 +0100665 framework::dataset::make("AddBias", { true })),
Freddie Liardete92b0452021-04-22 14:55:17 +0100666 framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
667{
668 // Validate output
669 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
670}
671TEST_SUITE_END() // W1x1
672
Viet-Hoa Do019a7d92023-06-27 16:33:57 +0100673TEST_SUITE(W5x1)
674FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedPerChannelFixture5x1<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(data5x1,
675 framework::dataset::make("DataType", DataType::QASYMM8)),
676 data_layouts_dataset),
677 input_qinfo_dataset),
678 output_qinfo_dataset),
Gunes Bayirc6137d22023-10-09 20:47:16 +0100679 framework::dataset::make("AddBias", { true })),
Viet-Hoa Do019a7d92023-06-27 16:33:57 +0100680 framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
681{
682 // Validate output
683 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
684}
685FIXTURE_DATA_TEST_CASE(RunSmallSigned, CLDeconvolutionLayerQuantizedPerChannelFixture5x1<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(data5x1,
686 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
687 data_layouts_dataset),
688 input_signed_qinfo_dataset),
689 output_signed_qinfo_dataset),
Gunes Bayirc6137d22023-10-09 20:47:16 +0100690 framework::dataset::make("AddBias", { false })),
Viet-Hoa Do019a7d92023-06-27 16:33:57 +0100691 framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL })))
692{
693 // Validate output
694 validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num);
695}
696TEST_SUITE_END() // W5x1
697
Freddie Liardete92b0452021-04-22 14:55:17 +0100698TEST_SUITE_END() // QSYMM8_PER_CHANNEL
699
Michalis Spyrou064add62018-11-01 18:14:27 +0000700TEST_SUITE_END() // Quantized
Michele Di Giorgio9fef38a2018-07-06 18:06:58 +0100701
Michalis Spyrou064add62018-11-01 18:14:27 +0000702TEST_SUITE_END() // DeconvolutionLayer
703TEST_SUITE_END() // CL
Michalis Spyrou780db4e2017-11-23 09:49:51 +0000704} // namespace validation
705} // namespace test
706} // namespace arm_compute