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 | |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 58 | 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] | 59 | * framework::dataset::make("PadY", 0, 2) * framework::dataset::make("NumKernels", { 3 }); |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 60 | |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 61 | const auto data2x2_precommit = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 2) * framework::dataset::make("StrideY", 2) * framework::dataset::make("PadX", 1) |
| 62 | * framework::dataset::make("PadY", 1) * framework::dataset::make("NumKernels", { 3 }); |
| 63 | |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 64 | 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] | 65 | * framework::dataset::make("PadY", 0, 1) * framework::dataset::make("NumKernels", { 3 }); |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 66 | |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 67 | const auto data_layouts_dataset = framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }); |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 68 | } // namespace |
| 69 | |
| 70 | TEST_SUITE(CL) |
| 71 | TEST_SUITE(DeconvolutionLayer) |
| 72 | |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 73 | // *INDENT-OFF* |
| 74 | // clang-format off |
| 75 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip( |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 76 | framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type |
| 77 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid weights shape |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 78 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid bias shape |
| 79 | TensorInfo(TensorShape(13U, 11U, 4U, 3U), 1, DataType::F32), // Window shrink |
giuros01 | a69a88b | 2019-01-31 16:29:19 +0000 | [diff] [blame] | 80 | TensorInfo(TensorShape(32U, 16U, 2U), 1, DataType::F32), // Inner border different from 0 |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 81 | TensorInfo(TensorShape(32U, 16U, 2U), 1, DataType::F32), |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 82 | }), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 83 | framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16), |
| 84 | TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 85 | TensorInfo(TensorShape(3U, 2U, 2U, 2U), 1, DataType::F32), |
| 86 | TensorInfo(TensorShape(3U, 3U, 4U), 1, DataType::F32), |
giuros01 | a69a88b | 2019-01-31 16:29:19 +0000 | [diff] [blame] | 87 | TensorInfo(TensorShape(1U, 1U, 2U, 4U), 1, DataType::F32), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 88 | TensorInfo(TensorShape(1U, 1U, 2U, 4U), 1, DataType::F32), |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 89 | })), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 90 | framework::dataset::make("BiasInfo", { TensorInfo(TensorShape(1U), 1, DataType::F16), |
| 91 | TensorInfo(TensorShape(1U), 1, DataType::F32), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 92 | TensorInfo(TensorShape(25U, 11U), 1, DataType::F32), |
| 93 | TensorInfo(TensorShape(1U), 1, DataType::F32), |
| 94 | TensorInfo(TensorShape(4U), 1, DataType::F32), |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 95 | TensorInfo(TensorShape(4U), 1, DataType::S32), |
giuros01 | a69a88b | 2019-01-31 16:29:19 +0000 | [diff] [blame] | 96 | TensorInfo(TensorShape(4U), 1, DataType::S32), |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 97 | })), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 98 | framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F16), |
| 99 | TensorInfo(TensorShape(25U, 10U, 2U), 1, DataType::F32), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 100 | TensorInfo(TensorShape(13U, 13U, 2U), 1, DataType::F32), |
| 101 | TensorInfo(TensorShape(11U, 9U, 1U, 3U), 1, DataType::F32), |
| 102 | TensorInfo(TensorShape(32U, 16U, 4U), 1, DataType::F32), |
giuros01 | a69a88b | 2019-01-31 16:29:19 +0000 | [diff] [blame] | 103 | TensorInfo(TensorShape(32U, 16U, 4U), 1, DataType::F32), |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 104 | })), |
| 105 | framework::dataset::make("PadStrideInfo", { PadStrideInfo(1, 1, 0, 0), |
| 106 | PadStrideInfo(1, 1, 0, 0), |
| 107 | PadStrideInfo(1, 1, 0, 0), |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 108 | PadStrideInfo(1, 1, 1, 1), |
| 109 | PadStrideInfo(1, 1, 0, 0), |
giuros01 | a69a88b | 2019-01-31 16:29:19 +0000 | [diff] [blame] | 110 | PadStrideInfo(1, 1, 0, 0), |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 111 | })), |
giuros01 | a69a88b | 2019-01-31 16:29:19 +0000 | [diff] [blame] | 112 | framework::dataset::make("ax", { 0U, |
| 113 | 0U, |
| 114 | 0U, |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 115 | 0U, |
| 116 | 0U, |
| 117 | })), |
giuros01 | a69a88b | 2019-01-31 16:29:19 +0000 | [diff] [blame] | 118 | framework::dataset::make("ay", { 0U, |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 119 | 0U, |
| 120 | 0U, |
giuros01 | a69a88b | 2019-01-31 16:29:19 +0000 | [diff] [blame] | 121 | 0U, |
| 122 | 1U, |
| 123 | 0U, |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 124 | })), |
giuros01 | 4a8ec80 | 2019-03-18 13:25:05 +0000 | [diff] [blame] | 125 | framework::dataset::make("Expected", { false, false, false, false, true, true })), |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 126 | input_info, weights_info, bias_info, output_info, pad_info, ax, ay, expected) |
| 127 | { |
| 128 | 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, ax, ay)); |
| 129 | ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS); |
| 130 | } |
| 131 | // clang-format on |
| 132 | // *INDENT-ON* |
| 133 | |
| 134 | template <typename T> |
Georgios Pinitas | ced7a8d | 2018-02-01 16:31:33 +0000 | [diff] [blame] | 135 | using CLDeconvolutionLayerFixture4x4 = DeconvolutionValidationFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 4, 4>; |
| 136 | |
| 137 | template <typename T> |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 138 | using CLDeconvolutionLayerFixture3x3 = DeconvolutionValidationFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 3, 3>; |
| 139 | |
| 140 | template <typename T> |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 141 | using CLDeconvolutionLayerFixture2x2 = DeconvolutionValidationFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 2, 2>; |
| 142 | |
| 143 | template <typename T> |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 144 | using CLDeconvolutionLayerFixture1x1 = DeconvolutionValidationFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 1, 1>; |
| 145 | |
| 146 | TEST_SUITE(Float) |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 147 | TEST_SUITE(FP32) |
Georgios Pinitas | ced7a8d | 2018-02-01 16:31:33 +0000 | [diff] [blame] | 148 | |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 149 | TEST_SUITE(W4x4) |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 150 | FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerFixture4x4<float>, framework::DatasetMode::NIGHTLY, combine(combine(data4x4, framework::dataset::make("DataType", DataType::F32)), |
| 151 | data_layouts_dataset)) |
Georgios Pinitas | ced7a8d | 2018-02-01 16:31:33 +0000 | [diff] [blame] | 152 | { |
| 153 | // Validate output |
| 154 | validate(CLAccessor(_target), _reference, tolerance_fp32); |
| 155 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 156 | TEST_SUITE_END() // W4x4 |
Georgios Pinitas | ced7a8d | 2018-02-01 16:31:33 +0000 | [diff] [blame] | 157 | |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 158 | TEST_SUITE(W3x3) |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 159 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerFixture3x3<float>, framework::DatasetMode::PRECOMMIT, combine(combine(data3x3_precommit, framework::dataset::make("DataType", DataType::F32)), |
| 160 | data_layouts_dataset)) |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 161 | { |
| 162 | // Validate output |
| 163 | validate(CLAccessor(_target), _reference, tolerance_fp32); |
| 164 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 165 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDeconvolutionLayerFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(data3x3, framework::dataset::make("DataType", DataType::F32)), |
| 166 | data_layouts_dataset)) |
| 167 | { |
| 168 | // Validate output |
| 169 | validate(CLAccessor(_target), _reference, tolerance_fp32); |
| 170 | } |
| 171 | TEST_SUITE_END() // W3x3 |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 172 | |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 173 | TEST_SUITE(W2x2) |
| 174 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerFixture2x2<float>, framework::DatasetMode::PRECOMMIT, combine(combine(data2x2_precommit, framework::dataset::make("DataType", DataType::F32)), |
| 175 | data_layouts_dataset)) |
| 176 | { |
| 177 | // Validate output |
| 178 | validate(CLAccessor(_target), _reference, tolerance_fp32); |
| 179 | } |
| 180 | TEST_SUITE_END() // W2x2 |
| 181 | |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 182 | TEST_SUITE(W1x1) |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 183 | FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerFixture1x1<float>, framework::DatasetMode::NIGHTLY, combine(combine(data1x1, framework::dataset::make("DataType", DataType::F32)), |
| 184 | data_layouts_dataset)) |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 185 | { |
| 186 | // Validate output |
| 187 | validate(CLAccessor(_target), _reference, tolerance_fp32); |
| 188 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 189 | TEST_SUITE_END() // W1x1 |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 190 | |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 191 | TEST_SUITE_END() // FP32 |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 192 | |
| 193 | TEST_SUITE(FP16) |
| 194 | |
| 195 | TEST_SUITE(W4x4) |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 196 | FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerFixture4x4<half>, framework::DatasetMode::NIGHTLY, combine(combine(data4x4, framework::dataset::make("DataType", DataType::F16)), data_layouts_dataset)) |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 197 | { |
| 198 | // Validate output |
| 199 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num); |
| 200 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 201 | TEST_SUITE_END() // W4x4 |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 202 | |
| 203 | TEST_SUITE(W3x3) |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 204 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerFixture3x3<half>, framework::DatasetMode::PRECOMMIT, combine(combine(data3x3_precommit, framework::dataset::make("DataType", DataType::F16)), |
| 205 | data_layouts_dataset)) |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 206 | { |
| 207 | // Validate output |
| 208 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num); |
| 209 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 210 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDeconvolutionLayerFixture3x3<half>, framework::DatasetMode::NIGHTLY, combine(combine(data3x3, framework::dataset::make("DataType", DataType::F16)), |
| 211 | data_layouts_dataset)) |
| 212 | { |
| 213 | // Validate output |
| 214 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num); |
| 215 | } |
| 216 | TEST_SUITE_END() // W3x3 |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 217 | |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 218 | TEST_SUITE(W2x2) |
| 219 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerFixture2x2<half>, framework::DatasetMode::PRECOMMIT, combine(combine(data2x2_precommit, framework::dataset::make("DataType", DataType::F16)), |
| 220 | data_layouts_dataset)) |
| 221 | { |
| 222 | // Validate output |
giuros01 | b56d0cd | 2019-05-13 13:24:55 +0100 | [diff] [blame] | 223 | validate(CLAccessor(_target), _reference, tolerance_f16); |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 224 | } |
| 225 | TEST_SUITE_END() // W2x2 |
| 226 | |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 227 | TEST_SUITE(W1x1) |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 228 | FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerFixture1x1<half>, framework::DatasetMode::NIGHTLY, combine(combine(data1x1, framework::dataset::make("DataType", DataType::F16)), data_layouts_dataset)) |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 229 | { |
| 230 | // Validate output |
| 231 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num); |
| 232 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 233 | TEST_SUITE_END() // W1x1 |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 234 | |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 235 | TEST_SUITE_END() // FP16 |
| 236 | TEST_SUITE_END() // Float |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 237 | |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 238 | template <typename T> |
| 239 | using CLDeconvolutionLayerQuantizedFixture4x4 = DeconvolutionValidationQuantizedFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 4, 4>; |
| 240 | |
| 241 | template <typename T> |
| 242 | using CLDeconvolutionLayerQuantizedFixture3x3 = DeconvolutionValidationQuantizedFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 3, 3>; |
| 243 | |
| 244 | template <typename T> |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 245 | using CLDeconvolutionLayerQuantizedFixture2x2 = DeconvolutionValidationQuantizedFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 2, 2>; |
| 246 | |
| 247 | template <typename T> |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 248 | using CLDeconvolutionLayerQuantizedFixture1x1 = DeconvolutionValidationQuantizedFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 1, 1>; |
| 249 | |
| 250 | TEST_SUITE(Quantized) |
| 251 | TEST_SUITE(QASYMM8) |
| 252 | |
| 253 | TEST_SUITE(W4x4) |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 254 | FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerQuantizedFixture4x4<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data4x4, framework::dataset::make("DataType", |
| 255 | DataType::QASYMM8)), |
| 256 | data_layouts_dataset), |
| 257 | framework::dataset::make("QuantizationInfo", QuantizationInfo(2.f / 255.f, 0)))) |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 258 | { |
| 259 | // Validate output |
| 260 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 261 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 262 | TEST_SUITE_END() // W4x4 |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 263 | |
| 264 | TEST_SUITE(W3x3) |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 265 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data3x3_precommit, framework::dataset::make("DataType", |
| 266 | DataType::QASYMM8)), |
| 267 | data_layouts_dataset), |
| 268 | framework::dataset::make("QuantizationInfo", QuantizationInfo(2.f / 255.f, 0)))) |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 269 | { |
| 270 | // Validate output |
| 271 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 272 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 273 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDeconvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3, framework::dataset::make("DataType", |
| 274 | DataType::QASYMM8)), |
| 275 | data_layouts_dataset), |
| 276 | framework::dataset::make("QuantizationInfo", QuantizationInfo(2.f / 255.f, 0)))) |
| 277 | { |
| 278 | // Validate output |
| 279 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 280 | } |
| 281 | TEST_SUITE_END() // W3x3 |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 282 | |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 283 | TEST_SUITE(W2x2) |
| 284 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedFixture2x2<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data2x2_precommit, framework::dataset::make("DataType", |
| 285 | DataType::QASYMM8)), |
| 286 | data_layouts_dataset), |
| 287 | framework::dataset::make("QuantizationInfo", QuantizationInfo(2.f / 255.f, 0)))) |
| 288 | { |
| 289 | // Validate output |
| 290 | validate(CLAccessor(_target), _reference, tolerance_fp32); |
| 291 | } |
| 292 | TEST_SUITE_END() // W2x2 |
| 293 | |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 294 | TEST_SUITE(W1x1) |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 295 | FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerQuantizedFixture1x1<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data1x1, framework::dataset::make("DataType", |
| 296 | DataType::QASYMM8)), |
| 297 | data_layouts_dataset), |
| 298 | framework::dataset::make("QuantizationInfo", QuantizationInfo(2.f / 255.f, 0)))) |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 299 | { |
| 300 | // Validate output |
| 301 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 302 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 303 | TEST_SUITE_END() // W1x1 |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 304 | |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 305 | TEST_SUITE_END() // QASYMM8 |
| 306 | TEST_SUITE_END() // Quantized |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 307 | |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 308 | TEST_SUITE_END() // DeconvolutionLayer |
| 309 | TEST_SUITE_END() // CL |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 310 | } // namespace validation |
| 311 | } // namespace test |
| 312 | } // namespace arm_compute |