Sanghoon Lee | c8a85ba | 2017-11-29 11:23:14 +0000 | [diff] [blame] | 1 | /* |
Michalis Spyrou | d175ece | 2020-07-30 23:39:32 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017-2020 Arm Limited. |
Sanghoon Lee | c8a85ba | 2017-11-29 11:23:14 +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/Types.h" |
| 25 | #include "arm_compute/runtime/NEON/functions/NEConvolution.h" |
| 26 | #include "arm_compute/runtime/Tensor.h" |
| 27 | #include "arm_compute/runtime/TensorAllocator.h" |
| 28 | #include "tests/NEON/Accessor.h" |
| 29 | #include "tests/PaddingCalculator.h" |
| 30 | #include "tests/datasets/BorderModeDataset.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/ConvolutionFixture.h" |
| 37 | |
| 38 | namespace arm_compute |
| 39 | { |
| 40 | namespace test |
| 41 | { |
| 42 | namespace validation |
| 43 | { |
| 44 | namespace |
| 45 | { |
Georgios Pinitas | acacc32 | 2017-12-13 12:48:44 +0000 | [diff] [blame] | 46 | /** Tolerance value for comparing reference's output against implementation |
| 47 | * |
| 48 | * This is due to the fact that NEON target performs multiplication with reciprocal of scale, |
| 49 | * while reference performs direct division with scale. |
| 50 | */ |
| 51 | constexpr AbsoluteTolerance<uint8_t> tolerance_u8(1); |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 52 | constexpr AbsoluteTolerance<int16_t> tolerance_s16(1); |
Sanghoon Lee | c8a85ba | 2017-11-29 11:23:14 +0000 | [diff] [blame] | 53 | } // namespace |
| 54 | |
| 55 | TEST_SUITE(NEON) |
| 56 | TEST_SUITE(CustomConvolution) |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 57 | TEST_SUITE(Square3x3) |
Sanghoon Lee | c8a85ba | 2017-11-29 11:23:14 +0000 | [diff] [blame] | 58 | template <typename T> |
Sanghoon Lee | d7ba539 | 2017-12-13 11:28:50 +0000 | [diff] [blame] | 59 | using NEConvolutionFixture = ConvolutionSquareValidationFixture<Tensor, Accessor, NEConvolution3x3, T>; |
Sanghoon Lee | c8a85ba | 2017-11-29 11:23:14 +0000 | [diff] [blame] | 60 | |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 61 | TEST_SUITE(U8) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 62 | FIXTURE_DATA_TEST_CASE(RunLarge, NEConvolutionFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), |
| 63 | framework::dataset::make("DataType", |
| 64 | DataType::U8)), |
Sanghoon Lee | d7ba539 | 2017-12-13 11:28:50 +0000 | [diff] [blame] | 65 | datasets::BorderModes()), |
| 66 | framework::dataset::make("filter_size", { 3 }))) |
Sanghoon Lee | c8a85ba | 2017-11-29 11:23:14 +0000 | [diff] [blame] | 67 | { |
| 68 | // Validate output |
Sanghoon Lee | d7ba539 | 2017-12-13 11:28:50 +0000 | [diff] [blame] | 69 | validate(Accessor(_target), _reference, shape_to_valid_region(_reference.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(_height / 2, _width / 2)), tolerance_u8); |
Sanghoon Lee | c8a85ba | 2017-11-29 11:23:14 +0000 | [diff] [blame] | 70 | } |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 71 | TEST_SUITE_END() // U8 |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 72 | |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 73 | TEST_SUITE(S16) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 74 | FIXTURE_DATA_TEST_CASE(RunLarge, NEConvolutionFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), |
| 75 | framework::dataset::make("DataType", |
| 76 | DataType::S16)), |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 77 | datasets::BorderModes()), |
| 78 | framework::dataset::make("filter_size", { 3 }))) |
| 79 | { |
| 80 | // Validate output |
| 81 | validate(Accessor(_target), _reference, shape_to_valid_region(_reference.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(_height / 2, _width / 2)), tolerance_s16); |
| 82 | } |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 83 | TEST_SUITE_END() // S16 |
| 84 | TEST_SUITE_END() // Square3x3 |
Sanghoon Lee | c8a85ba | 2017-11-29 11:23:14 +0000 | [diff] [blame] | 85 | |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 86 | TEST_SUITE(Square5x5) |
Sanghoon Lee | c8a85ba | 2017-11-29 11:23:14 +0000 | [diff] [blame] | 87 | template <typename T> |
Sanghoon Lee | d7ba539 | 2017-12-13 11:28:50 +0000 | [diff] [blame] | 88 | using NEConvolutionFixture = ConvolutionSquareValidationFixture<Tensor, Accessor, NEConvolution5x5, T>; |
Sanghoon Lee | c8a85ba | 2017-11-29 11:23:14 +0000 | [diff] [blame] | 89 | |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 90 | TEST_SUITE(U8) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 91 | FIXTURE_DATA_TEST_CASE(RunLarge, NEConvolutionFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), |
| 92 | framework::dataset::make("DataType", |
| 93 | DataType::U8)), |
Sanghoon Lee | d7ba539 | 2017-12-13 11:28:50 +0000 | [diff] [blame] | 94 | datasets::BorderModes()), |
| 95 | framework::dataset::make("filter_size", { 5 }))) |
Sanghoon Lee | c8a85ba | 2017-11-29 11:23:14 +0000 | [diff] [blame] | 96 | { |
| 97 | // Validate output |
Sanghoon Lee | d7ba539 | 2017-12-13 11:28:50 +0000 | [diff] [blame] | 98 | validate(Accessor(_target), _reference, shape_to_valid_region(_reference.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(_height / 2, _width / 2)), tolerance_u8); |
Sanghoon Lee | c8a85ba | 2017-11-29 11:23:14 +0000 | [diff] [blame] | 99 | } |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 100 | TEST_SUITE_END() // U8 |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 101 | |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 102 | TEST_SUITE(S16) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 103 | FIXTURE_DATA_TEST_CASE(RunLarge, NEConvolutionFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), |
| 104 | framework::dataset::make("DataType", |
| 105 | DataType::S16)), |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 106 | datasets::BorderModes()), |
| 107 | framework::dataset::make("filter_size", { 5 }))) |
| 108 | { |
| 109 | // Validate output |
| 110 | validate(Accessor(_target), _reference, shape_to_valid_region(_reference.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(_height / 2, _width / 2)), tolerance_s16); |
| 111 | } |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 112 | TEST_SUITE_END() // S16 |
| 113 | TEST_SUITE_END() // Square5x5 |
Sanghoon Lee | c8a85ba | 2017-11-29 11:23:14 +0000 | [diff] [blame] | 114 | |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 115 | TEST_SUITE(Square7x7) |
Sanghoon Lee | c8a85ba | 2017-11-29 11:23:14 +0000 | [diff] [blame] | 116 | template <typename T> |
Sanghoon Lee | d7ba539 | 2017-12-13 11:28:50 +0000 | [diff] [blame] | 117 | using NEConvolutionFixture = ConvolutionSquareValidationFixture<Tensor, Accessor, NEConvolution7x7, T>; |
Sanghoon Lee | c8a85ba | 2017-11-29 11:23:14 +0000 | [diff] [blame] | 118 | |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 119 | TEST_SUITE(U8) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 120 | FIXTURE_DATA_TEST_CASE(RunLarge, NEConvolutionFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), |
| 121 | framework::dataset::make("DataType", |
| 122 | DataType::U8)), |
Sanghoon Lee | d7ba539 | 2017-12-13 11:28:50 +0000 | [diff] [blame] | 123 | datasets::BorderModes()), |
| 124 | framework::dataset::make("filter_size", { 7 }))) |
Sanghoon Lee | c8a85ba | 2017-11-29 11:23:14 +0000 | [diff] [blame] | 125 | { |
| 126 | // Validate output |
Sanghoon Lee | d7ba539 | 2017-12-13 11:28:50 +0000 | [diff] [blame] | 127 | validate(Accessor(_target), _reference, shape_to_valid_region(_reference.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(_height / 2, _width / 2)), tolerance_u8); |
Sanghoon Lee | c8a85ba | 2017-11-29 11:23:14 +0000 | [diff] [blame] | 128 | } |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 129 | TEST_SUITE_END() // U8 |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 130 | |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 131 | TEST_SUITE(S16) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 132 | FIXTURE_DATA_TEST_CASE(RunLarge, NEConvolutionFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), |
| 133 | framework::dataset::make("DataType", |
| 134 | DataType::S16)), |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 135 | datasets::BorderModes()), |
| 136 | framework::dataset::make("filter_size", { 7 }))) |
| 137 | { |
| 138 | // Validate output |
| 139 | validate(Accessor(_target), _reference, shape_to_valid_region(_reference.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(_height / 2, _width / 2)), tolerance_s16); |
| 140 | } |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 141 | TEST_SUITE_END() // S16 |
| 142 | TEST_SUITE_END() // Square7x7 |
Sanghoon Lee | c8a85ba | 2017-11-29 11:23:14 +0000 | [diff] [blame] | 143 | |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 144 | TEST_SUITE(Square9x9) |
Sanghoon Lee | c8a85ba | 2017-11-29 11:23:14 +0000 | [diff] [blame] | 145 | template <typename T> |
Sanghoon Lee | d7ba539 | 2017-12-13 11:28:50 +0000 | [diff] [blame] | 146 | using NEConvolutionFixture = ConvolutionSquareValidationFixture<Tensor, Accessor, NEConvolution9x9, T>; |
Sanghoon Lee | c8a85ba | 2017-11-29 11:23:14 +0000 | [diff] [blame] | 147 | |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 148 | TEST_SUITE(U8) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 149 | FIXTURE_DATA_TEST_CASE(RunLarge, NEConvolutionFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), |
| 150 | framework::dataset::make("DataType", |
| 151 | DataType::U8)), |
Sanghoon Lee | d7ba539 | 2017-12-13 11:28:50 +0000 | [diff] [blame] | 152 | datasets::BorderModes()), |
| 153 | framework::dataset::make("filter_size", { 9 }))) |
Sanghoon Lee | c8a85ba | 2017-11-29 11:23:14 +0000 | [diff] [blame] | 154 | { |
| 155 | // Validate output |
Sanghoon Lee | d7ba539 | 2017-12-13 11:28:50 +0000 | [diff] [blame] | 156 | validate(Accessor(_target), _reference, shape_to_valid_region(_reference.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(_height / 2, _width / 2)), tolerance_u8); |
Sanghoon Lee | c8a85ba | 2017-11-29 11:23:14 +0000 | [diff] [blame] | 157 | } |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 158 | TEST_SUITE_END() // U8 |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 159 | |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 160 | TEST_SUITE(S16) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 161 | FIXTURE_DATA_TEST_CASE(RunLarge, NEConvolutionFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), |
| 162 | framework::dataset::make("DataType", |
| 163 | DataType::S16)), |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 164 | datasets::BorderModes()), |
| 165 | framework::dataset::make("filter_size", { 9 }))) |
| 166 | { |
| 167 | // Validate output |
| 168 | validate(Accessor(_target), _reference, shape_to_valid_region(_reference.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(_height / 2, _width / 2)), tolerance_s16); |
| 169 | } |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 170 | TEST_SUITE_END() // S16 |
| 171 | TEST_SUITE_END() // Square9x9 |
Sanghoon Lee | d7ba539 | 2017-12-13 11:28:50 +0000 | [diff] [blame] | 172 | |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 173 | TEST_SUITE(Rectangle) |
Sanghoon Lee | d7ba539 | 2017-12-13 11:28:50 +0000 | [diff] [blame] | 174 | template <typename T> |
| 175 | using NEConvolutionFixture = ConvolutionRectangleValidationFixture<Tensor, Accessor, NEConvolutionRectangle, T>; |
| 176 | |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 177 | TEST_SUITE(U8) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 178 | FIXTURE_DATA_TEST_CASE(RunLarge, NEConvolutionFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), |
| 179 | framework::dataset::make("DataType", |
| 180 | DataType::U8)), |
Sanghoon Lee | d7ba539 | 2017-12-13 11:28:50 +0000 | [diff] [blame] | 181 | datasets::BorderModes()), |
| 182 | framework::dataset::make("filter_width", { 3, 5, 7, 9 })), |
| 183 | framework::dataset::make("filter_height", { 3, 5, 7, 9 }))) |
| 184 | { |
| 185 | // Validate output |
| 186 | validate(Accessor(_target), _reference, shape_to_valid_region(_reference.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(_height / 2, _width / 2)), tolerance_u8); |
| 187 | } |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 188 | TEST_SUITE_END() // U8 |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 189 | |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 190 | TEST_SUITE(S16) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 191 | FIXTURE_DATA_TEST_CASE(RunLarge, NEConvolutionFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), |
| 192 | framework::dataset::make("DataType", |
| 193 | DataType::S16)), |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 194 | datasets::BorderModes()), |
| 195 | framework::dataset::make("filter_width", { 3, 5, 7, 9 })), |
| 196 | framework::dataset::make("filter_height", { 3, 5, 7, 9 }))) |
| 197 | { |
| 198 | // Validate output |
| 199 | validate(Accessor(_target), _reference, shape_to_valid_region(_reference.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(_height / 2, _width / 2)), tolerance_s16); |
| 200 | } |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 201 | TEST_SUITE_END() // S16 |
| 202 | TEST_SUITE_END() // Rectangle |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 203 | |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 204 | TEST_SUITE(Separable5x5) |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 205 | template <typename T> |
| 206 | using NEConvolutionFixture = ConvolutionSeparableValidationFixture<Tensor, Accessor, NEConvolution5x5, T>; |
| 207 | |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 208 | TEST_SUITE(U8) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 209 | FIXTURE_DATA_TEST_CASE(RunLarge, NEConvolutionFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), |
| 210 | framework::dataset::make("DataType", |
| 211 | DataType::U8)), |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 212 | datasets::BorderModes()), |
| 213 | framework::dataset::make("filter_size", { 5 }))) |
| 214 | { |
| 215 | // Validate output |
| 216 | validate(Accessor(_target), _reference, shape_to_valid_region(_reference.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(_height / 2, _width / 2)), tolerance_u8); |
| 217 | } |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 218 | TEST_SUITE_END() // U8 |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 219 | |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 220 | TEST_SUITE(S16) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 221 | FIXTURE_DATA_TEST_CASE(RunLarge, NEConvolutionFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), |
| 222 | framework::dataset::make("DataType", |
| 223 | DataType::S16)), |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 224 | datasets::BorderModes()), |
| 225 | framework::dataset::make("filter_size", { 5 }))) |
| 226 | { |
| 227 | // Validate output |
| 228 | validate(Accessor(_target), _reference, shape_to_valid_region(_reference.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(_height / 2, _width / 2)), tolerance_s16); |
| 229 | } |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 230 | TEST_SUITE_END() // S16 |
| 231 | TEST_SUITE_END() // Separable5x5 |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 232 | |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 233 | TEST_SUITE(Separable7x7) |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 234 | template <typename T> |
| 235 | using NEConvolutionFixture = ConvolutionSeparableValidationFixture<Tensor, Accessor, NEConvolution7x7, T>; |
| 236 | |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 237 | TEST_SUITE(U8) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 238 | FIXTURE_DATA_TEST_CASE(RunLarge, NEConvolutionFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), |
| 239 | framework::dataset::make("DataType", |
| 240 | DataType::U8)), |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 241 | datasets::BorderModes()), |
| 242 | framework::dataset::make("filter_size", { 7 }))) |
| 243 | { |
| 244 | // Validate output |
| 245 | validate(Accessor(_target), _reference, shape_to_valid_region(_reference.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(_height / 2, _width / 2)), tolerance_u8); |
| 246 | } |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 247 | TEST_SUITE_END() // U8 |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 248 | |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 249 | TEST_SUITE(S16) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 250 | FIXTURE_DATA_TEST_CASE(RunLarge, NEConvolutionFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), |
| 251 | framework::dataset::make("DataType", |
| 252 | DataType::S16)), |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 253 | datasets::BorderModes()), |
| 254 | framework::dataset::make("filter_size", { 7 }))) |
| 255 | { |
| 256 | // Validate output |
| 257 | validate(Accessor(_target), _reference, shape_to_valid_region(_reference.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(_height / 2, _width / 2)), tolerance_s16); |
| 258 | } |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 259 | TEST_SUITE_END() // S16 |
| 260 | TEST_SUITE_END() // Separable7x7 |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 261 | |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 262 | TEST_SUITE(Separable9x9) |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 263 | template <typename T> |
| 264 | using NEConvolutionFixture = ConvolutionSeparableValidationFixture<Tensor, Accessor, NEConvolution9x9, T>; |
| 265 | |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 266 | TEST_SUITE(U8) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 267 | FIXTURE_DATA_TEST_CASE(RunLarge, NEConvolutionFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), |
| 268 | framework::dataset::make("DataType", |
| 269 | DataType::U8)), |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 270 | datasets::BorderModes()), |
| 271 | framework::dataset::make("filter_size", { 9 }))) |
| 272 | { |
| 273 | // Validate output |
| 274 | validate(Accessor(_target), _reference, shape_to_valid_region(_reference.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(_height / 2, _width / 2)), tolerance_u8); |
| 275 | } |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 276 | TEST_SUITE_END() // U8 |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 277 | |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 278 | TEST_SUITE(S16) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 279 | FIXTURE_DATA_TEST_CASE(RunLarge, NEConvolutionFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(concat(datasets::SmallShapes(), datasets::LargeShapes()), |
| 280 | framework::dataset::make("DataType", |
| 281 | DataType::S16)), |
Sanghoon Lee | c8d2316 | 2018-01-12 16:19:10 +0000 | [diff] [blame] | 282 | datasets::BorderModes()), |
| 283 | framework::dataset::make("filter_size", { 9 }))) |
| 284 | { |
| 285 | // Validate output |
| 286 | validate(Accessor(_target), _reference, shape_to_valid_region(_reference.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(_height / 2, _width / 2)), tolerance_s16); |
| 287 | } |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 288 | TEST_SUITE_END() // S16 |
| 289 | TEST_SUITE_END() // Separable9x9 |
Sanghoon Lee | c0079e9 | 2018-01-29 17:28:49 +0000 | [diff] [blame] | 290 | |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 291 | TEST_SUITE_END() // CustomConvolution |
| 292 | TEST_SUITE_END() // NEON |
Sanghoon Lee | c8a85ba | 2017-11-29 11:23:14 +0000 | [diff] [blame] | 293 | } // namespace validation |
| 294 | } // namespace test |
| 295 | } // namespace arm_compute |