Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 1 | /* |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 2 | * Copyright (c) 2017-2019 ARM Limited. |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 3 | * |
| 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 | */ |
| 24 | #include "arm_compute/core/CL/kernels/CLFillBorderKernel.h" |
| 25 | #include "arm_compute/core/Types.h" |
Michele Di Giorgio | ed5a492 | 2018-09-13 16:22:01 +0100 | [diff] [blame] | 26 | #include "arm_compute/core/utils/misc/ShapeCalculator.h" |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 27 | #include "arm_compute/runtime/CL/CLTensor.h" |
| 28 | #include "arm_compute/runtime/CL/CLTensorAllocator.h" |
| 29 | #include "arm_compute/runtime/CL/functions/CLDeconvolutionLayer.h" |
| 30 | #include "tests/CL/CLAccessor.h" |
| 31 | #include "tests/PaddingCalculator.h" |
| 32 | #include "tests/datasets/ShapeDatasets.h" |
| 33 | #include "tests/framework/Asserts.h" |
| 34 | #include "tests/framework/Macros.h" |
| 35 | #include "tests/framework/datasets/Datasets.h" |
| 36 | #include "tests/validation/Validation.h" |
| 37 | #include "tests/validation/fixtures/DeconvolutionLayerFixture.h" |
| 38 | |
| 39 | namespace arm_compute |
| 40 | { |
| 41 | namespace test |
| 42 | { |
| 43 | namespace validation |
| 44 | { |
| 45 | namespace |
| 46 | { |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 47 | constexpr AbsoluteTolerance<float> tolerance_fp32(0.001f); /**< Tolerance for floating point tests */ |
| 48 | RelativeTolerance<half_float::half> tolerance_f16(half_float::half(0.2)); /**< Tolerance value for comparing reference's for DataType::F16 */ |
Michele Di Giorgio | ed5a492 | 2018-09-13 16:22:01 +0100 | [diff] [blame] | 49 | constexpr AbsoluteTolerance<float> tolerance_qasymm8(0.0); /**< Tolerance value for comparing reference's output against implementation's output for quantized data types */ |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 50 | constexpr float tolerance_num = 0.07f; /**< Tolerance number */ |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 51 | |
Michalis Spyrou | 5ce99a2 | 2019-01-25 14:17:49 +0000 | [diff] [blame] | 52 | const auto data4x4 = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 4) * framework::dataset::make("StrideY", 1, 4) * framework::dataset::make("PadX", 0, 3) |
giuros01 | a69a88b | 2019-01-31 16:29:19 +0000 | [diff] [blame] | 53 | * framework::dataset::make("PadY", 0, 3) * framework::dataset::make("NumKernels", { 3 }); |
Georgios Pinitas | ced7a8d | 2018-02-01 16:31:33 +0000 | [diff] [blame] | 54 | |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 55 | const auto data3x3 = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 4) * framework::dataset::make("StrideY", 1, 4) * framework::dataset::make("PadX", 0, 2) |
giuros01 | a69a88b | 2019-01-31 16:29:19 +0000 | [diff] [blame] | 56 | * framework::dataset::make("PadY", 0, 2) * framework::dataset::make("NumKernels", { 3 }); |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 57 | |
Matthew Jackson | b9070a4 | 2019-08-22 16:13:27 +0100 | [diff] [blame] | 58 | const auto data3x3_asymm = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 2) * framework::dataset::make("StrideY", 1, 2) * framework::dataset::make("PadLeft", 0, 1) |
| 59 | * framework::dataset::make("PadRight", 0, 1) * framework::dataset::make("PadTop", 0, 1) * framework::dataset::make("PadBottom", 0, 1) * framework::dataset::make("NumKernels", { 3 }); |
| 60 | |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 61 | const auto data3x3_precommit = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 2) * framework::dataset::make("StrideY", 1, 2) * framework::dataset::make("PadX", 0, 2) |
giuros01 | a69a88b | 2019-01-31 16:29:19 +0000 | [diff] [blame] | 62 | * framework::dataset::make("PadY", 0, 2) * framework::dataset::make("NumKernels", { 3 }); |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 63 | |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 64 | const auto data2x2_precommit = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 2) * framework::dataset::make("StrideY", 2) * framework::dataset::make("PadX", 1) |
| 65 | * framework::dataset::make("PadY", 1) * framework::dataset::make("NumKernels", { 3 }); |
| 66 | |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 67 | const auto data1x1 = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 4) * framework::dataset::make("StrideY", 1, 4) * framework::dataset::make("PadX", 0, 1) |
giuros01 | a69a88b | 2019-01-31 16:29:19 +0000 | [diff] [blame] | 68 | * framework::dataset::make("PadY", 0, 1) * framework::dataset::make("NumKernels", { 3 }); |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 69 | |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 70 | const auto data_layouts_dataset = framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }); |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 71 | |
| 72 | const auto add_bias_dataset = framework::dataset::make("AddBias", { true, false }); |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 73 | } // namespace |
| 74 | |
| 75 | TEST_SUITE(CL) |
| 76 | TEST_SUITE(DeconvolutionLayer) |
| 77 | |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 78 | // *INDENT-OFF* |
| 79 | // clang-format off |
Manuel Bottini | c1b76fa | 2019-06-17 12:04:40 +0100 | [diff] [blame] | 80 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip( |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 81 | framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type |
| 82 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid weights shape |
Manuel Bottini | c1b76fa | 2019-06-17 12:04:40 +0100 | [diff] [blame] | 83 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F16), // Non supported data type |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 84 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid bias shape |
| 85 | TensorInfo(TensorShape(13U, 11U, 4U, 3U), 1, DataType::F32), // Window shrink |
| 86 | TensorInfo(TensorShape(32U, 16U, 2U), 1, DataType::F32), |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 87 | }), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 88 | framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16), |
| 89 | TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32), |
Manuel Bottini | c1b76fa | 2019-06-17 12:04:40 +0100 | [diff] [blame] | 90 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 91 | TensorInfo(TensorShape(3U, 2U, 2U, 2U), 1, DataType::F32), |
| 92 | TensorInfo(TensorShape(3U, 3U, 4U), 1, DataType::F32), |
| 93 | TensorInfo(TensorShape(1U, 1U, 2U, 4U), 1, DataType::F32), |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 94 | })), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 95 | framework::dataset::make("BiasInfo", { TensorInfo(TensorShape(1U), 1, DataType::F16), |
| 96 | TensorInfo(TensorShape(1U), 1, DataType::F32), |
Manuel Bottini | c1b76fa | 2019-06-17 12:04:40 +0100 | [diff] [blame] | 97 | TensorInfo(TensorShape(1U), 1, DataType::F32), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 98 | TensorInfo(TensorShape(25U, 11U), 1, DataType::F32), |
| 99 | TensorInfo(TensorShape(1U), 1, DataType::F32), |
| 100 | TensorInfo(TensorShape(4U), 1, DataType::F32), |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 101 | })), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 102 | framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F16), |
| 103 | TensorInfo(TensorShape(25U, 10U, 2U), 1, DataType::F32), |
Manuel Bottini | c1b76fa | 2019-06-17 12:04:40 +0100 | [diff] [blame] | 104 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 105 | TensorInfo(TensorShape(13U, 13U, 2U), 1, DataType::F32), |
| 106 | TensorInfo(TensorShape(11U, 9U, 1U, 3U), 1, DataType::F32), |
| 107 | TensorInfo(TensorShape(32U, 16U, 4U), 1, DataType::F32), |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 108 | })), |
| 109 | framework::dataset::make("PadStrideInfo", { PadStrideInfo(1, 1, 0, 0), |
| 110 | PadStrideInfo(1, 1, 0, 0), |
| 111 | PadStrideInfo(1, 1, 0, 0), |
Manuel Bottini | c1b76fa | 2019-06-17 12:04:40 +0100 | [diff] [blame] | 112 | PadStrideInfo(1, 1, 0, 0), |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 113 | PadStrideInfo(1, 1, 1, 1), |
| 114 | PadStrideInfo(1, 1, 0, 0), |
| 115 | })), |
Manuel Bottini | c1b76fa | 2019-06-17 12:04:40 +0100 | [diff] [blame] | 116 | framework::dataset::make("Expected", { false, false, false, false, false, true })), |
| 117 | input_info, weights_info, bias_info, output_info, pad_info, expected) |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 118 | { |
Manuel Bottini | c1b76fa | 2019-06-17 12:04:40 +0100 | [diff] [blame] | 119 | 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 Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 120 | ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS); |
| 121 | } |
| 122 | // clang-format on |
| 123 | // *INDENT-ON* |
| 124 | |
| 125 | template <typename T> |
Matthew Jackson | b9070a4 | 2019-08-22 16:13:27 +0100 | [diff] [blame] | 126 | using CLDeconvolutionLayerFixture4x4 = DeconvolutionValidationFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 4, 4>; |
Georgios Pinitas | ced7a8d | 2018-02-01 16:31:33 +0000 | [diff] [blame] | 127 | |
| 128 | template <typename T> |
Matthew Jackson | b9070a4 | 2019-08-22 16:13:27 +0100 | [diff] [blame] | 129 | using CLDeconvolutionLayerFixture3x3 = DeconvolutionValidationFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 3, 3>; |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 130 | |
| 131 | template <typename T> |
Matthew Jackson | b9070a4 | 2019-08-22 16:13:27 +0100 | [diff] [blame] | 132 | using CLDeconvolutionLayerAsymmFixture3x3 = DeconvolutionValidationAsymmFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 3, 3>; |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 133 | |
| 134 | template <typename T> |
Matthew Jackson | b9070a4 | 2019-08-22 16:13:27 +0100 | [diff] [blame] | 135 | using CLDeconvolutionLayerFixture2x2 = DeconvolutionValidationFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 2, 2>; |
| 136 | |
| 137 | template <typename T> |
| 138 | using CLDeconvolutionLayerFixture1x1 = DeconvolutionValidationFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 1, 1>; |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 139 | |
| 140 | TEST_SUITE(Float) |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 141 | TEST_SUITE(FP32) |
Georgios Pinitas | ced7a8d | 2018-02-01 16:31:33 +0000 | [diff] [blame] | 142 | |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 143 | TEST_SUITE(W4x4) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 144 | FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerFixture4x4<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data4x4, framework::dataset::make("DataType", DataType::F32)), |
| 145 | data_layouts_dataset), |
| 146 | add_bias_dataset)) |
Georgios Pinitas | ced7a8d | 2018-02-01 16:31:33 +0000 | [diff] [blame] | 147 | { |
| 148 | // Validate output |
| 149 | validate(CLAccessor(_target), _reference, tolerance_fp32); |
| 150 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 151 | TEST_SUITE_END() // W4x4 |
Georgios Pinitas | ced7a8d | 2018-02-01 16:31:33 +0000 | [diff] [blame] | 152 | |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 153 | TEST_SUITE(W3x3) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 154 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerFixture3x3<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data3x3_precommit, framework::dataset::make("DataType", |
| 155 | DataType::F32)), |
| 156 | data_layouts_dataset), |
| 157 | add_bias_dataset)) |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 158 | { |
| 159 | // Validate output |
| 160 | validate(CLAccessor(_target), _reference, tolerance_fp32); |
| 161 | } |
Matthew Jackson | b9070a4 | 2019-08-22 16:13:27 +0100 | [diff] [blame] | 162 | FIXTURE_DATA_TEST_CASE(RunAsymm, CLDeconvolutionLayerAsymmFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3_asymm, framework::dataset::make("DataType", |
| 163 | DataType::F32)), |
| 164 | data_layouts_dataset), |
| 165 | add_bias_dataset)) |
| 166 | { |
| 167 | // Validate output |
| 168 | validate(CLAccessor(_target), _reference, tolerance_fp32); |
| 169 | } |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 170 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDeconvolutionLayerFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3, framework::dataset::make("DataType", DataType::F32)), |
| 171 | data_layouts_dataset), |
| 172 | add_bias_dataset)) |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 173 | { |
| 174 | // Validate output |
| 175 | validate(CLAccessor(_target), _reference, tolerance_fp32); |
| 176 | } |
| 177 | TEST_SUITE_END() // W3x3 |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 178 | |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 179 | TEST_SUITE(W2x2) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 180 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerFixture2x2<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data2x2_precommit, framework::dataset::make("DataType", |
| 181 | DataType::F32)), |
| 182 | data_layouts_dataset), |
| 183 | add_bias_dataset)) |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 184 | { |
| 185 | // Validate output |
| 186 | validate(CLAccessor(_target), _reference, tolerance_fp32); |
| 187 | } |
| 188 | TEST_SUITE_END() // W2x2 |
| 189 | |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 190 | TEST_SUITE(W1x1) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 191 | FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerFixture1x1<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data1x1, framework::dataset::make("DataType", DataType::F32)), |
| 192 | data_layouts_dataset), |
| 193 | add_bias_dataset)) |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 194 | { |
| 195 | // Validate output |
| 196 | validate(CLAccessor(_target), _reference, tolerance_fp32); |
| 197 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 198 | TEST_SUITE_END() // W1x1 |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 199 | |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 200 | TEST_SUITE_END() // FP32 |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 201 | |
| 202 | TEST_SUITE(FP16) |
| 203 | |
| 204 | TEST_SUITE(W4x4) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 205 | FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerFixture4x4<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data4x4, framework::dataset::make("DataType", DataType::F16)), |
| 206 | data_layouts_dataset), |
| 207 | add_bias_dataset)) |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 208 | { |
| 209 | // Validate output |
| 210 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num); |
| 211 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 212 | TEST_SUITE_END() // W4x4 |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 213 | |
| 214 | TEST_SUITE(W3x3) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 215 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerFixture3x3<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data3x3_precommit, framework::dataset::make("DataType", |
| 216 | DataType::F16)), |
| 217 | data_layouts_dataset), |
| 218 | add_bias_dataset)) |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 219 | { |
| 220 | // Validate output |
| 221 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num); |
| 222 | } |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 223 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDeconvolutionLayerFixture3x3<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3, framework::dataset::make("DataType", DataType::F16)), |
| 224 | data_layouts_dataset), |
| 225 | add_bias_dataset)) |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 226 | { |
| 227 | // Validate output |
| 228 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num); |
| 229 | } |
| 230 | TEST_SUITE_END() // W3x3 |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 231 | |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 232 | TEST_SUITE(W2x2) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 233 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerFixture2x2<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data2x2_precommit, framework::dataset::make("DataType", |
| 234 | DataType::F16)), |
| 235 | data_layouts_dataset), |
| 236 | add_bias_dataset)) |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 237 | { |
| 238 | // Validate output |
giuros01 | b56d0cd | 2019-05-13 13:24:55 +0100 | [diff] [blame] | 239 | validate(CLAccessor(_target), _reference, tolerance_f16); |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 240 | } |
| 241 | TEST_SUITE_END() // W2x2 |
| 242 | |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 243 | TEST_SUITE(W1x1) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 244 | FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerFixture1x1<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data1x1, framework::dataset::make("DataType", DataType::F16)), |
| 245 | data_layouts_dataset), |
| 246 | add_bias_dataset)) |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 247 | { |
| 248 | // Validate output |
| 249 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num); |
| 250 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 251 | TEST_SUITE_END() // W1x1 |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 252 | |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 253 | TEST_SUITE_END() // FP16 |
| 254 | TEST_SUITE_END() // Float |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 255 | |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 256 | template <typename T> |
| 257 | using CLDeconvolutionLayerQuantizedFixture4x4 = DeconvolutionValidationQuantizedFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 4, 4>; |
| 258 | |
| 259 | template <typename T> |
| 260 | using CLDeconvolutionLayerQuantizedFixture3x3 = DeconvolutionValidationQuantizedFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 3, 3>; |
| 261 | |
| 262 | template <typename T> |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 263 | using CLDeconvolutionLayerQuantizedFixture2x2 = DeconvolutionValidationQuantizedFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 2, 2>; |
| 264 | |
| 265 | template <typename T> |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 266 | using CLDeconvolutionLayerQuantizedFixture1x1 = DeconvolutionValidationQuantizedFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 1, 1>; |
| 267 | |
| 268 | TEST_SUITE(Quantized) |
| 269 | TEST_SUITE(QASYMM8) |
| 270 | |
| 271 | TEST_SUITE(W4x4) |
Manuel Bottini | 279814b | 2019-10-25 10:28:28 +0100 | [diff] [blame] | 272 | FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerQuantizedFixture4x4<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data4x4, framework::dataset::make("DataType", |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 273 | DataType::QASYMM8)), |
| 274 | data_layouts_dataset), |
Manuel Bottini | 279814b | 2019-10-25 10:28:28 +0100 | [diff] [blame] | 275 | framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 0), QuantizationInfo(2.f / 255.f, 0) })), |
| 276 | framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 0), QuantizationInfo(4.f / 255.f, 0) })), |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 277 | add_bias_dataset)) |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 278 | { |
| 279 | // Validate output |
| 280 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 281 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 282 | TEST_SUITE_END() // W4x4 |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 283 | |
| 284 | TEST_SUITE(W3x3) |
Manuel Bottini | 279814b | 2019-10-25 10:28:28 +0100 | [diff] [blame] | 285 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(data3x3_precommit, |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 286 | framework::dataset::make("DataType", |
| 287 | DataType::QASYMM8)), |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 288 | data_layouts_dataset), |
Manuel Bottini | 279814b | 2019-10-25 10:28:28 +0100 | [diff] [blame] | 289 | framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 0), QuantizationInfo(2.f / 255.f, 0) })), |
| 290 | framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 0), QuantizationInfo(4.f / 255.f, 0) })), |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 291 | add_bias_dataset)) |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 292 | { |
| 293 | // Validate output |
| 294 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 295 | } |
Manuel Bottini | 279814b | 2019-10-25 10:28:28 +0100 | [diff] [blame] | 296 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDeconvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data3x3, |
| 297 | framework::dataset::make("DataType", |
| 298 | DataType::QASYMM8)), |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 299 | data_layouts_dataset), |
Manuel Bottini | 279814b | 2019-10-25 10:28:28 +0100 | [diff] [blame] | 300 | framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 0), QuantizationInfo(2.f / 255.f, 0) })), |
| 301 | framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 0), QuantizationInfo(4.f / 255.f, 0) })), |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 302 | add_bias_dataset)) |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 303 | { |
| 304 | // Validate output |
| 305 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 306 | } |
| 307 | TEST_SUITE_END() // W3x3 |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 308 | |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 309 | TEST_SUITE(W2x2) |
Manuel Bottini | 279814b | 2019-10-25 10:28:28 +0100 | [diff] [blame] | 310 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedFixture2x2<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(data2x2_precommit, |
| 311 | framework::dataset::make("DataType", DataType::QASYMM8)), |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 312 | data_layouts_dataset), |
Manuel Bottini | 279814b | 2019-10-25 10:28:28 +0100 | [diff] [blame] | 313 | framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 0), QuantizationInfo(2.f / 255.f, 0) })), |
| 314 | framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 0), QuantizationInfo(4.f / 255.f, 0) })), |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 315 | add_bias_dataset)) |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 316 | { |
| 317 | // Validate output |
| 318 | validate(CLAccessor(_target), _reference, tolerance_fp32); |
| 319 | } |
| 320 | TEST_SUITE_END() // W2x2 |
| 321 | |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 322 | TEST_SUITE(W1x1) |
Manuel Bottini | 279814b | 2019-10-25 10:28:28 +0100 | [diff] [blame] | 323 | FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerQuantizedFixture1x1<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data1x1, framework::dataset::make("DataType", |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 324 | DataType::QASYMM8)), |
| 325 | data_layouts_dataset), |
Manuel Bottini | 279814b | 2019-10-25 10:28:28 +0100 | [diff] [blame] | 326 | framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 0), QuantizationInfo(2.f / 255.f, 0) })), |
| 327 | framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 0), QuantizationInfo(4.f / 255.f, 0) })), |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 328 | add_bias_dataset)) |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 329 | { |
| 330 | // Validate output |
| 331 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 332 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 333 | TEST_SUITE_END() // W1x1 |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 334 | |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 335 | TEST_SUITE_END() // QASYMM8 |
| 336 | TEST_SUITE_END() // Quantized |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 337 | |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 338 | TEST_SUITE_END() // DeconvolutionLayer |
| 339 | TEST_SUITE_END() // CL |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 340 | } // namespace validation |
| 341 | } // namespace test |
| 342 | } // namespace arm_compute |