Pablo Tello | 299025a | 2017-09-29 11:30:12 +0100 | [diff] [blame] | 1 | /* |
Michele Di Giorgio | d9eaf61 | 2020-07-08 11:12:57 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017-2020 Arm Limited. |
Pablo Tello | 299025a | 2017-09-29 11:30:12 +0100 | [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" |
Gian Marco | e75a02b | 2017-11-08 12:24:09 +0000 | [diff] [blame] | 25 | #include "arm_compute/runtime/NEON/functions/NEGEMMLowpMatrixMultiplyCore.h" |
| 26 | #include "arm_compute/runtime/NEON/functions/NEGEMMLowpOutputStage.h" |
Pablo Tello | 299025a | 2017-09-29 11:30:12 +0100 | [diff] [blame] | 27 | #include "arm_compute/runtime/Tensor.h" |
| 28 | #include "arm_compute/runtime/TensorAllocator.h" |
| 29 | #include "tests/NEON/Accessor.h" |
Gian Marco Iodice | ab18212 | 2017-10-09 15:05:40 +0100 | [diff] [blame] | 30 | #include "tests/NEON/Helper.h" |
Gian Marco | e75a02b | 2017-11-08 12:24:09 +0000 | [diff] [blame] | 31 | #include "tests/PaddingCalculator.h" |
George Wort | 2d7e683 | 2019-02-22 16:37:41 +0000 | [diff] [blame] | 32 | #include "tests/datasets/GEMMLowpFusedOffsetOutputDataset.h" |
Gian Marco | fa4cacd | 2017-10-18 17:05:02 +0100 | [diff] [blame] | 33 | #include "tests/datasets/LargeGEMMLowpDataset.h" |
Gian Marco | e75a02b | 2017-11-08 12:24:09 +0000 | [diff] [blame] | 34 | #include "tests/datasets/ShapeDatasets.h" |
Gian Marco | fa4cacd | 2017-10-18 17:05:02 +0100 | [diff] [blame] | 35 | #include "tests/datasets/SmallGEMMLowpDataset.h" |
Pablo Tello | 299025a | 2017-09-29 11:30:12 +0100 | [diff] [blame] | 36 | #include "tests/framework/Asserts.h" |
| 37 | #include "tests/framework/Macros.h" |
| 38 | #include "tests/framework/datasets/Datasets.h" |
| 39 | #include "tests/validation/Validation.h" |
Pablo Tello | 181e651 | 2017-11-15 13:28:27 +0000 | [diff] [blame] | 40 | #include "tests/validation/fixtures/GEMMLowpAssemblyFixture.h" |
Pablo Tello | 299025a | 2017-09-29 11:30:12 +0100 | [diff] [blame] | 41 | #include "tests/validation/fixtures/GEMMLowpFixture.h" |
| 42 | |
| 43 | namespace arm_compute |
| 44 | { |
| 45 | namespace test |
| 46 | { |
| 47 | namespace validation |
| 48 | { |
| 49 | namespace |
| 50 | { |
Pablo Tello | 181e651 | 2017-11-15 13:28:27 +0000 | [diff] [blame] | 51 | const auto data_matrix_multiply = framework::dataset::make("M", 12, 20) * framework::dataset::make("N", 12, 20) * framework::dataset::make("K", 16); |
Pablo Tello | 299025a | 2017-09-29 11:30:12 +0100 | [diff] [blame] | 52 | } // namespace |
| 53 | |
| 54 | TEST_SUITE(NEON) |
| 55 | TEST_SUITE(GEMMLowp) |
Gian Marco | e75a02b | 2017-11-08 12:24:09 +0000 | [diff] [blame] | 56 | TEST_SUITE(MatrixMultiplyCore) |
| 57 | using NEGEMMLowpMatrixMultiplyCoreFixture = GEMMLowpMatrixMultiplyCoreValidationFixture<Tensor, Accessor, NEGEMMLowpMatrixMultiplyCore>; |
Gian Marco | fa4cacd | 2017-10-18 17:05:02 +0100 | [diff] [blame] | 58 | |
morgolock | 4adaddb | 2020-09-29 14:24:32 +0100 | [diff] [blame] | 59 | DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, framework::dataset::concat(datasets::SmallGEMMLowpDataset(), datasets::LargeGEMMLowpDataset()), |
| 60 | shape_a, shape_b, shape_c, a_offset, b_offset) |
| 61 | { |
| 62 | // Create tensors |
| 63 | Tensor a = create_tensor<Tensor>(shape_a, DataType::QASYMM8); |
| 64 | Tensor b = create_tensor<Tensor>(shape_b, DataType::QASYMM8); |
| 65 | Tensor c = create_tensor<Tensor>(shape_c, DataType::S32); |
| 66 | |
| 67 | a.info()->set_quantization_info(QuantizationInfo(1.0f / 255, a_offset)); |
| 68 | b.info()->set_quantization_info(QuantizationInfo(1.0f / 255, b_offset)); |
| 69 | |
| 70 | ARM_COMPUTE_EXPECT(a.info()->is_resizable(), framework::LogLevel::ERRORS); |
| 71 | ARM_COMPUTE_EXPECT(b.info()->is_resizable(), framework::LogLevel::ERRORS); |
| 72 | ARM_COMPUTE_EXPECT(c.info()->is_resizable(), framework::LogLevel::ERRORS); |
| 73 | |
| 74 | // Create and configure function |
| 75 | NEGEMMLowpMatrixMultiplyCore gemmlowp_mm; |
| 76 | gemmlowp_mm.configure(&a, &b, nullptr, &c); |
| 77 | |
| 78 | // Validate padding is zero |
| 79 | validate(a.info()->padding(), PaddingSize()); |
| 80 | validate(b.info()->padding(), PaddingSize()); |
| 81 | validate(c.info()->padding(), PaddingSize()); |
| 82 | } |
| 83 | |
Georgios Pinitas | a3b1b46 | 2017-11-16 19:24:39 +0000 | [diff] [blame] | 84 | // *INDENT-OFF* |
| 85 | // clang-format off |
| 86 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( |
| 87 | framework::dataset::make("InputAInfo", { TensorInfo(TensorShape(21U, 13U), 1, DataType::QASYMM8, QuantizationInfo(1.f/255, 10)), // Input not a multiple of 4 |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 88 | TensorInfo(TensorShape(21U, 13U), 1, DataType::S32), // Mismatching data type |
Georgios Pinitas | a3b1b46 | 2017-11-16 19:24:39 +0000 | [diff] [blame] | 89 | TensorInfo(TensorShape(20U, 13U), 1, DataType::QASYMM8, QuantizationInfo(1.f/255, 10)), // Invalid dimensions |
| 90 | TensorInfo(TensorShape(21U, 13U), 1, DataType::QASYMM8, QuantizationInfo(1.f/255, 10)), // Invalid dimensions |
| 91 | TensorInfo(TensorShape(16U, 32U), 1, DataType::QASYMM8, QuantizationInfo(1.f/255, 10)), |
| 92 | }), |
| 93 | framework::dataset::make("InputBInfo",{ TensorInfo(TensorShape(33U, 21U), 1, DataType::QASYMM8, QuantizationInfo(1.f/256, 10)), |
| 94 | TensorInfo(TensorShape(33U, 21U), 1, DataType::QASYMM8, QuantizationInfo(1.f/256, 10)), |
| 95 | TensorInfo(TensorShape(33U, 21U), 1, DataType::QASYMM8, QuantizationInfo(1.f/256, 10)), |
| 96 | TensorInfo(TensorShape(33U, 21U), 1, DataType::QASYMM8, QuantizationInfo(1.f/256, 10)), |
| 97 | TensorInfo(TensorShape(64U, 16U), 1, DataType::QASYMM8, QuantizationInfo(1.f/256, 10)), |
| 98 | })), |
| 99 | framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(33U, 13U), 1, DataType::S32), |
| 100 | TensorInfo(TensorShape(33U, 13U), 1, DataType::S32), |
| 101 | TensorInfo(TensorShape(33U, 13U), 1, DataType::S32), |
| 102 | TensorInfo(TensorShape(8U, 11U), 1, DataType::S32), |
| 103 | TensorInfo(TensorShape(64U, 32U), 1, DataType::S32), |
| 104 | })), |
morgolock | 4adaddb | 2020-09-29 14:24:32 +0100 | [diff] [blame] | 105 | framework::dataset::make("Expected", { true, false, false, false, true })), |
Georgios Pinitas | a3b1b46 | 2017-11-16 19:24:39 +0000 | [diff] [blame] | 106 | a_info, b_info, output_info, expected) |
| 107 | { |
| 108 | // Lock tensors |
Georgios Pinitas | 631c41a | 2017-12-06 11:53:03 +0000 | [diff] [blame] | 109 | Status status = NEGEMMLowpMatrixMultiplyCore::validate(&a_info.clone()->set_is_resizable(false), |
| 110 | &b_info.clone()->set_is_resizable(false), |
Gian Marco Iodice | 4b90865 | 2018-10-18 10:21:02 +0100 | [diff] [blame] | 111 | nullptr, |
Georgios Pinitas | 631c41a | 2017-12-06 11:53:03 +0000 | [diff] [blame] | 112 | &output_info.clone()->set_is_resizable(false)); |
| 113 | ARM_COMPUTE_EXPECT(bool(status) == expected, framework::LogLevel::ERRORS); |
Georgios Pinitas | a3b1b46 | 2017-11-16 19:24:39 +0000 | [diff] [blame] | 114 | } |
| 115 | // clang-format on |
| 116 | // *INDENT-ON* |
| 117 | |
Gian Marco | e75a02b | 2017-11-08 12:24:09 +0000 | [diff] [blame] | 118 | FIXTURE_DATA_TEST_CASE(RunSmall, NEGEMMLowpMatrixMultiplyCoreFixture, framework::DatasetMode::ALL, datasets::SmallGEMMLowpDataset()) |
Pablo Tello | 299025a | 2017-09-29 11:30:12 +0100 | [diff] [blame] | 119 | { |
| 120 | // Validate output |
Gian Marco | fa4cacd | 2017-10-18 17:05:02 +0100 | [diff] [blame] | 121 | validate(Accessor(_target), _reference); |
| 122 | } |
| 123 | |
Gian Marco | e75a02b | 2017-11-08 12:24:09 +0000 | [diff] [blame] | 124 | FIXTURE_DATA_TEST_CASE(RunLarge, NEGEMMLowpMatrixMultiplyCoreFixture, framework::DatasetMode::NIGHTLY, datasets::LargeGEMMLowpDataset()) |
Gian Marco | fa4cacd | 2017-10-18 17:05:02 +0100 | [diff] [blame] | 125 | { |
| 126 | // Validate output |
| 127 | validate(Accessor(_target), _reference); |
Pablo Tello | 299025a | 2017-09-29 11:30:12 +0100 | [diff] [blame] | 128 | } |
Pablo Tello | 299025a | 2017-09-29 11:30:12 +0100 | [diff] [blame] | 129 | |
George Wort | 2d7e683 | 2019-02-22 16:37:41 +0000 | [diff] [blame] | 130 | using NEGEMMLowpMatrixMultiplyCoreFusedOffsetOutputFixture = GEMMLowpMatrixMultiplyCoreFusedOffsetOutputValidationFixture<Tensor, Accessor, NEGEMMLowpMatrixMultiplyCore>; |
| 131 | TEST_SUITE(FusedOffsetOutput) |
Manuel Bottini | 959c26d | 2019-12-02 16:22:35 +0000 | [diff] [blame] | 132 | FIXTURE_DATA_TEST_CASE(RunSmall, NEGEMMLowpMatrixMultiplyCoreFusedOffsetOutputFixture, framework::DatasetMode::ALL, combine(datasets::SmallGEMMLowpFusedOffsetOutputUint8Dataset(), |
Vidhya Sudhan Loganathan | 951b8a4 | 2019-11-04 14:42:08 +0000 | [diff] [blame] | 133 | framework::dataset::make("DataType", { DataType::QASYMM8 }))) |
George Wort | 2d7e683 | 2019-02-22 16:37:41 +0000 | [diff] [blame] | 134 | { |
| 135 | // Validate output |
| 136 | validate(Accessor(_target), _reference); |
| 137 | } |
| 138 | |
Manuel Bottini | 959c26d | 2019-12-02 16:22:35 +0000 | [diff] [blame] | 139 | FIXTURE_DATA_TEST_CASE(RunLarge, NEGEMMLowpMatrixMultiplyCoreFusedOffsetOutputFixture, framework::DatasetMode::NIGHTLY, combine(datasets::LargeGEMMLowpFusedOffsetOutputUint8Dataset(), |
Vidhya Sudhan Loganathan | 951b8a4 | 2019-11-04 14:42:08 +0000 | [diff] [blame] | 140 | framework::dataset::make("DataType", { DataType::QASYMM8 }))) |
George Wort | 2d7e683 | 2019-02-22 16:37:41 +0000 | [diff] [blame] | 141 | { |
| 142 | // Validate output |
| 143 | validate(Accessor(_target), _reference); |
| 144 | } |
| 145 | TEST_SUITE_END() // FusedOffsetOutput |
Gian Marco | e75a02b | 2017-11-08 12:24:09 +0000 | [diff] [blame] | 146 | TEST_SUITE_END() // MatrixMultiplyCore |
| 147 | |
| 148 | TEST_SUITE(OutputStage) |
| 149 | |
Luca Foschiani | 4b86953 | 2020-02-13 15:07:36 +0000 | [diff] [blame] | 150 | TEST_SUITE(QuantizeDownInt32Scale) |
| 151 | |
| 152 | TEST_SUITE(QASYMM8) |
Gian Marco | e75a02b | 2017-11-08 12:24:09 +0000 | [diff] [blame] | 153 | |
Gian Marco | 05288a2 | 2017-11-21 10:57:50 +0000 | [diff] [blame] | 154 | const auto quantize_down_int32_to_uint8_scale_cases = framework::dataset::make("result_offset", -2, 1) * framework::dataset::make("result_mult_int", 1, 2) * framework::dataset::make("result_shift", 2, |
Gian Marco | 6b77e91 | 2017-11-17 09:27:57 +0000 | [diff] [blame] | 155 | 3) |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 156 | * framework::dataset::make("min", 0) * framework::dataset::make("max", 255) * framework::dataset::make("addBias", { false, true }); |
Gian Marco | 6b77e91 | 2017-11-17 09:27:57 +0000 | [diff] [blame] | 157 | |
Gian Marco | 05288a2 | 2017-11-21 10:57:50 +0000 | [diff] [blame] | 158 | const auto quantize_down_int32_to_uint8_scale_relu_cases = framework::dataset::make("result_offset", -2, 1) * framework::dataset::make("result_mult_int", 1, |
Gian Marco | 6b77e91 | 2017-11-17 09:27:57 +0000 | [diff] [blame] | 159 | 2) |
| 160 | * framework::dataset::make("result_shift", 2, 3) * framework::dataset::make("min", 0, 2) * framework::dataset::make("max", 171, 174) * framework::dataset::make("addBias", { false, true }); |
| 161 | |
Luca Foschiani | 4b86953 | 2020-02-13 15:07:36 +0000 | [diff] [blame] | 162 | using NEGEMMLowpQuantizeDownInt32ScaleFixture = GEMMLowpQuantizeDownInt32ToUint8ScaleValidationFixture<Tensor, Accessor, NEGEMMLowpOutputStage>; |
Gian Marco | e75a02b | 2017-11-08 12:24:09 +0000 | [diff] [blame] | 163 | |
Gian Marco | 7f0f790 | 2017-12-07 09:26:56 +0000 | [diff] [blame] | 164 | // *INDENT-OFF* |
| 165 | // clang-format off |
| 166 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip( |
| 167 | framework::dataset::make("InputAInfo", { TensorInfo(TensorShape(21U, 13U), 1, DataType::S32), // Input not a multiple of 16 |
Gian Marco | 7f0f790 | 2017-12-07 09:26:56 +0000 | [diff] [blame] | 168 | TensorInfo(TensorShape(20U, 13U), 1, DataType::S32), // Wrong output data type |
| 169 | }), |
| 170 | framework::dataset::make("InputBInfo",{ TensorInfo(TensorShape(21U), 1, DataType::S32), |
Gian Marco | 7f0f790 | 2017-12-07 09:26:56 +0000 | [diff] [blame] | 171 | TensorInfo(TensorShape(20U), 1, DataType::S32), |
| 172 | })), |
| 173 | framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(21U, 13U), 1, DataType::QASYMM8), |
Gian Marco | 7f0f790 | 2017-12-07 09:26:56 +0000 | [diff] [blame] | 174 | TensorInfo(TensorShape(20U, 13U), 1, DataType::S32), |
| 175 | })), |
| 176 | framework::dataset::make("Min",{ 0, |
Gian Marco | 7f0f790 | 2017-12-07 09:26:56 +0000 | [diff] [blame] | 177 | 13, |
| 178 | })), |
| 179 | framework::dataset::make("Max",{ 205, |
Gian Marco | 7f0f790 | 2017-12-07 09:26:56 +0000 | [diff] [blame] | 180 | 180, |
| 181 | })), |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 182 | framework::dataset::make("Expected", { true, false })), |
Gian Marco | 7f0f790 | 2017-12-07 09:26:56 +0000 | [diff] [blame] | 183 | a_info, b_info, output_info, min, max, expected) |
| 184 | { |
Luca Foschiani | 4b86953 | 2020-02-13 15:07:36 +0000 | [diff] [blame] | 185 | |
| 186 | GEMMLowpOutputStageInfo output_stage = GEMMLowpOutputStageInfo(); |
| 187 | output_stage.type = GEMMLowpOutputStageType::QUANTIZE_DOWN; |
| 188 | output_stage.gemmlowp_min_bound = min; |
| 189 | output_stage.gemmlowp_max_bound = max; |
| 190 | output_stage.output_data_type = DataType::QASYMM8; |
| 191 | |
Gian Marco | 7f0f790 | 2017-12-07 09:26:56 +0000 | [diff] [blame] | 192 | // Lock tensors |
Luca Foschiani | 4b86953 | 2020-02-13 15:07:36 +0000 | [diff] [blame] | 193 | Status status = NEGEMMLowpOutputStage::validate(&a_info.clone()->set_is_resizable(false), |
Gian Marco | 7f0f790 | 2017-12-07 09:26:56 +0000 | [diff] [blame] | 194 | &b_info.clone()->set_is_resizable(false), |
| 195 | &output_info.clone()->set_is_resizable(false), |
Luca Foschiani | 4b86953 | 2020-02-13 15:07:36 +0000 | [diff] [blame] | 196 | output_stage); |
Gian Marco | 7f0f790 | 2017-12-07 09:26:56 +0000 | [diff] [blame] | 197 | ARM_COMPUTE_EXPECT(bool(status) == expected, framework::LogLevel::ERRORS); |
| 198 | } |
| 199 | // clang-format on |
| 200 | // *INDENT-ON* |
| 201 | |
morgolock | f110954 | 2020-09-15 14:33:54 +0100 | [diff] [blame] | 202 | TEST_CASE(NoPaddingAdded, framework::DatasetMode::PRECOMMIT) |
| 203 | { |
| 204 | Tensor input1 = create_tensor<Tensor>(TensorShape(21U, 13U), DataType::S32); |
| 205 | Tensor input2 = create_tensor<Tensor>(TensorShape(21U, 1U), DataType::S32); |
| 206 | Tensor output = create_tensor<Tensor>(TensorShape(21U, 13U), DataType::QASYMM8); |
| 207 | |
| 208 | GEMMLowpOutputStageInfo output_stage = GEMMLowpOutputStageInfo(); |
Michalis Spyrou | d175ece | 2020-07-30 23:39:32 +0100 | [diff] [blame] | 209 | output_stage.type = GEMMLowpOutputStageType::QUANTIZE_DOWN; |
| 210 | output_stage.gemmlowp_min_bound = 0; |
| 211 | output_stage.gemmlowp_max_bound = 205; |
| 212 | output_stage.output_data_type = DataType::QASYMM8; |
morgolock | f110954 | 2020-09-15 14:33:54 +0100 | [diff] [blame] | 213 | |
| 214 | NEGEMMLowpOutputStage f; |
| 215 | f.configure(&input1, &input2, &output, output_stage); |
| 216 | |
| 217 | // Validate padding is zero |
| 218 | validate(input1.info()->padding(), PaddingSize()); |
| 219 | validate(input2.info()->padding(), PaddingSize()); |
| 220 | validate(output.info()->padding(), PaddingSize()); |
| 221 | } |
| 222 | |
Luca Foschiani | 4b86953 | 2020-02-13 15:07:36 +0000 | [diff] [blame] | 223 | FIXTURE_DATA_TEST_CASE(RunSmall, NEGEMMLowpQuantizeDownInt32ScaleFixture, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), quantize_down_int32_to_uint8_scale_cases)) |
Gian Marco | e75a02b | 2017-11-08 12:24:09 +0000 | [diff] [blame] | 224 | { |
| 225 | // Validate output |
| 226 | validate(Accessor(_target), _reference); |
| 227 | } |
| 228 | |
Gian Marco | 6b77e91 | 2017-11-17 09:27:57 +0000 | [diff] [blame] | 229 | TEST_SUITE(BoundedReLu) |
Luca Foschiani | 4b86953 | 2020-02-13 15:07:36 +0000 | [diff] [blame] | 230 | FIXTURE_DATA_TEST_CASE(RunSmall, NEGEMMLowpQuantizeDownInt32ScaleFixture, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), quantize_down_int32_to_uint8_scale_relu_cases)) |
Gian Marco | 6b77e91 | 2017-11-17 09:27:57 +0000 | [diff] [blame] | 231 | { |
| 232 | // Validate output |
| 233 | validate(Accessor(_target), _reference); |
| 234 | } |
Gian Marco | e75a02b | 2017-11-08 12:24:09 +0000 | [diff] [blame] | 235 | |
Gian Marco | 6b77e91 | 2017-11-17 09:27:57 +0000 | [diff] [blame] | 236 | TEST_SUITE_END() // BoundedReLu |
| 237 | |
Luca Foschiani | 4b86953 | 2020-02-13 15:07:36 +0000 | [diff] [blame] | 238 | TEST_SUITE_END() // QASYMM8 |
| 239 | |
| 240 | TEST_SUITE(QASYMM8_SIGNED) |
| 241 | |
| 242 | const auto quantize_down_int32_to_int8_scale_cases = framework::dataset::make("result_offset", -2, 1) * framework::dataset::make("result_mult_int", 1, 2) * framework::dataset::make("result_shift", 2, |
| 243 | 3) |
| 244 | * framework::dataset::make("min", 0) * framework::dataset::make("max", 0) * framework::dataset::make("addBias", { false, true }); |
| 245 | |
| 246 | const auto quantize_down_int32_to_int8_scale_relu_cases = framework::dataset::make("result_offset", -2, 1) * framework::dataset::make("result_mult_int", 1, |
| 247 | 2) |
| 248 | * framework::dataset::make("result_shift", 2, 3) * framework::dataset::make("min", -100, -98) * framework::dataset::make("max", 71, 74) * framework::dataset::make("addBias", { false, true }); |
| 249 | |
| 250 | using NEGEMMLowpQuantizeDownInt32ScaleFixture = GEMMLowpQuantizeDownInt32ToInt8ScaleValidationFixture<Tensor, Accessor, NEGEMMLowpOutputStage>; |
| 251 | |
| 252 | // *INDENT-OFF* |
| 253 | // clang-format off |
| 254 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip( |
| 255 | framework::dataset::make("InputAInfo", { TensorInfo(TensorShape(21U, 13U), 1, DataType::S32), // Input not a multiple of 16 |
| 256 | TensorInfo(TensorShape(21U, 13U), 1, DataType::S32), // Invalid min and max |
| 257 | TensorInfo(TensorShape(20U, 13U), 1, DataType::S32), // Wrong output data type |
| 258 | }), |
| 259 | framework::dataset::make("InputBInfo",{ TensorInfo(TensorShape(21U), 1, DataType::S32), |
| 260 | TensorInfo(TensorShape(21U), 1, DataType::S32), |
| 261 | TensorInfo(TensorShape(20U), 1, DataType::S32), |
| 262 | })), |
| 263 | framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(21U, 13U), 1, DataType::QASYMM8_SIGNED), |
| 264 | TensorInfo(TensorShape(21U, 13U), 1, DataType::QASYMM8_SIGNED), |
| 265 | TensorInfo(TensorShape(20U, 13U), 1, DataType::S32), |
| 266 | })), |
| 267 | framework::dataset::make("Min",{ -10, |
| 268 | -200, |
| 269 | -113, |
| 270 | })), |
| 271 | framework::dataset::make("Max",{ 105, |
| 272 | 300, |
| 273 | -18, |
| 274 | })), |
| 275 | framework::dataset::make("Expected", { true, false, false })), |
| 276 | a_info, b_info, output_info, min, max, expected) |
| 277 | { |
| 278 | GEMMLowpOutputStageInfo output_stage = GEMMLowpOutputStageInfo(); |
| 279 | output_stage.type = GEMMLowpOutputStageType::QUANTIZE_DOWN; |
| 280 | output_stage.gemmlowp_min_bound = min; |
| 281 | output_stage.gemmlowp_max_bound = max; |
| 282 | output_stage.output_data_type = DataType::QASYMM8_SIGNED; |
| 283 | |
| 284 | // Lock tensors |
| 285 | Status status = NEGEMMLowpOutputStage::validate(&a_info.clone()->set_is_resizable(false), |
| 286 | &b_info.clone()->set_is_resizable(false), |
| 287 | &output_info.clone()->set_is_resizable(false), |
| 288 | output_stage); |
| 289 | ARM_COMPUTE_EXPECT(bool(status) == expected, framework::LogLevel::ERRORS); |
| 290 | } |
| 291 | // clang-format on |
| 292 | // *INDENT-ON* |
| 293 | |
| 294 | FIXTURE_DATA_TEST_CASE(RunSmall, NEGEMMLowpQuantizeDownInt32ScaleFixture, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), quantize_down_int32_to_int8_scale_cases)) |
| 295 | { |
| 296 | // Validate output |
| 297 | validate(Accessor(_target), _reference); |
| 298 | } |
| 299 | |
| 300 | TEST_SUITE(BoundedReLu) |
| 301 | FIXTURE_DATA_TEST_CASE(RunSmall, NEGEMMLowpQuantizeDownInt32ScaleFixture, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), quantize_down_int32_to_int8_scale_relu_cases)) |
| 302 | { |
| 303 | // Validate output |
| 304 | validate(Accessor(_target), _reference); |
| 305 | } |
| 306 | |
| 307 | TEST_SUITE_END() // BoundedReLu |
| 308 | |
| 309 | TEST_SUITE_END() // QASYMM8_SIGNED |
| 310 | |
| 311 | TEST_SUITE_END() // QuantizeDownInt32Scale |
Gian Marco | 58c5794 | 2017-11-28 09:10:03 +0000 | [diff] [blame] | 312 | |
| 313 | TEST_SUITE(QuantizeDownInt32ToUint8ScaleByFixedPoint) |
| 314 | |
| 315 | const auto quantize_down_int32_to_uint8_scale_by_fixedpoint_cases = framework::dataset::make("result_fixedpoint_multiplier", 254601600, 254601602) * framework::dataset::make("result_shift", 1, |
| 316 | 2) |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 317 | * framework::dataset::make("result_offset_after_shift", 2, 3) * framework::dataset::make("min", 0) * framework::dataset::make("max", 255) * framework::dataset::make("addBias", { false, true }); |
Gian Marco | 58c5794 | 2017-11-28 09:10:03 +0000 | [diff] [blame] | 318 | |
| 319 | const auto quantize_down_int32_to_uint8_scale_by_fixedpoint_relu_cases = framework::dataset::make("result_fixedpoint_multiplier", 254601600, 254601602) * framework::dataset::make("result_shift", 1, |
| 320 | 2) |
| 321 | * framework::dataset::make("result_offset_after_shift", 2, 3) * framework::dataset::make("min", 0, 2) * framework::dataset::make("max", 171, 174) * framework::dataset::make("addBias", { false, true }); |
| 322 | |
| 323 | using NEGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointFixture = |
| 324 | GEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointValidationFixture<Tensor, Accessor, NEGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPoint>; |
| 325 | |
Gian Marco Iodice | bc415af | 2019-06-13 15:58:32 +0100 | [diff] [blame] | 326 | using NEGEMMLowpQuantizeDownInt32ToInt16ScaleByFixedPointFixture = |
| 327 | GEMMLowpQuantizeDownInt32ToInt16ScaleByFixedPointValidationFixture<Tensor, Accessor, NEGEMMLowpQuantizeDownInt32ToInt16ScaleByFixedPoint>; |
| 328 | |
Gian Marco | 7f0f790 | 2017-12-07 09:26:56 +0000 | [diff] [blame] | 329 | // *INDENT-OFF* |
| 330 | // clang-format off |
| 331 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip( |
| 332 | framework::dataset::make("InputAInfo", { TensorInfo(TensorShape(21U, 13U), 1, DataType::S32), // Input not a multiple of 16 |
Gian Marco | 7f0f790 | 2017-12-07 09:26:56 +0000 | [diff] [blame] | 333 | TensorInfo(TensorShape(20U, 13U), 1, DataType::S32), // Wrong output data type |
| 334 | }), |
| 335 | framework::dataset::make("InputBInfo",{ TensorInfo(TensorShape(21U), 1, DataType::S32), |
Gian Marco | 7f0f790 | 2017-12-07 09:26:56 +0000 | [diff] [blame] | 336 | TensorInfo(TensorShape(20U), 1, DataType::S32), |
| 337 | })), |
| 338 | framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(21U, 13U), 1, DataType::QASYMM8), |
Gian Marco | 7f0f790 | 2017-12-07 09:26:56 +0000 | [diff] [blame] | 339 | TensorInfo(TensorShape(20U, 13U), 1, DataType::S32), |
| 340 | })), |
| 341 | framework::dataset::make("Min",{ 0, |
Gian Marco | 7f0f790 | 2017-12-07 09:26:56 +0000 | [diff] [blame] | 342 | 13, |
| 343 | })), |
| 344 | framework::dataset::make("Max",{ 205, |
Gian Marco | 7f0f790 | 2017-12-07 09:26:56 +0000 | [diff] [blame] | 345 | 180, |
| 346 | })), |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 347 | framework::dataset::make("Expected", { true, false })), |
Gian Marco | 7f0f790 | 2017-12-07 09:26:56 +0000 | [diff] [blame] | 348 | a_info, b_info, output_info, min, max, expected) |
| 349 | { |
| 350 | // Lock tensors |
| 351 | Status status = NEGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPoint::validate(&a_info.clone()->set_is_resizable(false), |
| 352 | &b_info.clone()->set_is_resizable(false), |
| 353 | &output_info.clone()->set_is_resizable(false), |
| 354 | min, |
| 355 | max); |
| 356 | ARM_COMPUTE_EXPECT(bool(status) == expected, framework::LogLevel::ERRORS); |
| 357 | } |
| 358 | // clang-format on |
| 359 | // *INDENT-ON* |
| 360 | |
Gian Marco | 58c5794 | 2017-11-28 09:10:03 +0000 | [diff] [blame] | 361 | FIXTURE_DATA_TEST_CASE(RunSmall, NEGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointFixture, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), |
| 362 | quantize_down_int32_to_uint8_scale_by_fixedpoint_cases)) |
| 363 | { |
| 364 | // Validate output |
| 365 | validate(Accessor(_target), _reference); |
| 366 | } |
| 367 | |
| 368 | FIXTURE_DATA_TEST_CASE(RunLarge, NEGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointFixture, framework::DatasetMode::NIGHTLY, combine(datasets::LargeShapes(), |
| 369 | quantize_down_int32_to_uint8_scale_by_fixedpoint_cases)) |
| 370 | { |
| 371 | // Validate output |
| 372 | validate(Accessor(_target), _reference); |
| 373 | } |
| 374 | |
| 375 | TEST_SUITE(BoundedReLu) |
| 376 | FIXTURE_DATA_TEST_CASE(RunSmall, NEGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointFixture, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), |
| 377 | quantize_down_int32_to_uint8_scale_by_fixedpoint_relu_cases)) |
| 378 | { |
| 379 | // Validate output |
| 380 | validate(Accessor(_target), _reference); |
| 381 | } |
| 382 | |
| 383 | FIXTURE_DATA_TEST_CASE(RunLarge, NEGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPointFixture, framework::DatasetMode::NIGHTLY, combine(datasets::LargeShapes(), |
| 384 | quantize_down_int32_to_uint8_scale_by_fixedpoint_relu_cases)) |
| 385 | { |
| 386 | // Validate output |
| 387 | validate(Accessor(_target), _reference); |
| 388 | } |
| 389 | TEST_SUITE_END() // BoundedReLu |
| 390 | |
| 391 | TEST_SUITE_END() // QuantizeDownInt32ToUint8ScaleByFixedPoint |
Gian Marco Iodice | bc415af | 2019-06-13 15:58:32 +0100 | [diff] [blame] | 392 | |
Georgios Pinitas | 448a81f | 2019-11-21 14:10:25 +0000 | [diff] [blame] | 393 | TEST_SUITE(QuantizeDownInt32ToInt8ScaleByFixedPoint) |
| 394 | |
| 395 | const auto quantize_down_int32_to_int8_scale_by_fixedpoint_cases = framework::dataset::make("result_fixedpoint_multiplier", 254601600, 254601602) * framework::dataset::make("result_shift", 1, |
| 396 | 2) |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 397 | * framework::dataset::make("result_offset_after_shift", 2, 3) * framework::dataset::make("min", -128) * framework::dataset::make("max", 128) * framework::dataset::make("addBias", { false, true }); |
Georgios Pinitas | 448a81f | 2019-11-21 14:10:25 +0000 | [diff] [blame] | 398 | |
| 399 | const auto quantize_down_int32_to_int8_scale_by_fixedpoint_relu_cases = framework::dataset::make("result_fixedpoint_multiplier", 254601600, 254601602) * framework::dataset::make("result_shift", 1, |
| 400 | 2) |
| 401 | * framework::dataset::make("result_offset_after_shift", 2, 3) * framework::dataset::make("min", -2, 0) * framework::dataset::make("max", 1, 3) * framework::dataset::make("addBias", { false, true }); |
| 402 | |
| 403 | using NEGEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPointFixture = |
| 404 | GEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPointValidationFixture<Tensor, Accessor, NEGEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPoint>; |
| 405 | |
| 406 | // *INDENT-OFF* |
| 407 | // clang-format off |
| 408 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip( |
| 409 | framework::dataset::make("InputAInfo", { TensorInfo(TensorShape(21U, 13U), 1, DataType::F32), // Invalid input data type |
Georgios Pinitas | 448a81f | 2019-11-21 14:10:25 +0000 | [diff] [blame] | 410 | TensorInfo(TensorShape(20U, 13U), 1, DataType::S32), // Wrong output data type |
| 411 | TensorInfo(TensorShape(21U, 13U), 1, DataType::S32), |
| 412 | }), |
| 413 | framework::dataset::make("InputBInfo",{ TensorInfo(TensorShape(21U), 1, DataType::S32), |
Georgios Pinitas | 448a81f | 2019-11-21 14:10:25 +0000 | [diff] [blame] | 414 | TensorInfo(TensorShape(20U), 1, DataType::S32), |
| 415 | TensorInfo(TensorShape(21U), 1, DataType::S32), |
| 416 | })), |
| 417 | framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(21U, 13U), 1, DataType::QASYMM8_SIGNED), |
Georgios Pinitas | 448a81f | 2019-11-21 14:10:25 +0000 | [diff] [blame] | 418 | TensorInfo(TensorShape(20U, 13U), 1, DataType::S32), |
| 419 | TensorInfo(TensorShape(21U, 13U), 1, DataType::QASYMM8_SIGNED), |
| 420 | })), |
| 421 | framework::dataset::make("Min",{ -110, |
Georgios Pinitas | 448a81f | 2019-11-21 14:10:25 +0000 | [diff] [blame] | 422 | -113, |
| 423 | -113, |
| 424 | })), |
| 425 | framework::dataset::make("Max",{ 87, |
Georgios Pinitas | 448a81f | 2019-11-21 14:10:25 +0000 | [diff] [blame] | 426 | 97, |
| 427 | 97, |
| 428 | })), |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 429 | framework::dataset::make("Expected", { false, false, true })), |
Georgios Pinitas | 448a81f | 2019-11-21 14:10:25 +0000 | [diff] [blame] | 430 | a_info, b_info, output_info, min, max, expected) |
| 431 | { |
| 432 | // Lock tensors |
| 433 | Status status = NEGEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPoint::validate(&a_info.clone()->set_is_resizable(false), |
| 434 | &b_info.clone()->set_is_resizable(false), |
| 435 | &output_info.clone()->set_is_resizable(false), |
| 436 | min, |
| 437 | max); |
| 438 | ARM_COMPUTE_EXPECT(bool(status) == expected, framework::LogLevel::ERRORS); |
| 439 | } |
| 440 | // clang-format on |
| 441 | // *INDENT-ON* |
| 442 | |
Georgios Pinitas | 448a81f | 2019-11-21 14:10:25 +0000 | [diff] [blame] | 443 | FIXTURE_DATA_TEST_CASE(RunSmall, NEGEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPointFixture, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), |
| 444 | quantize_down_int32_to_int8_scale_by_fixedpoint_cases)) |
| 445 | { |
| 446 | // Validate output |
| 447 | validate(Accessor(_target), _reference); |
| 448 | } |
| 449 | |
| 450 | TEST_SUITE(BoundedReLu) |
| 451 | FIXTURE_DATA_TEST_CASE(RunSmall, NEGEMMLowpQuantizeDownInt32ToInt8ScaleByFixedPointFixture, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), |
| 452 | quantize_down_int32_to_int8_scale_by_fixedpoint_relu_cases)) |
| 453 | { |
| 454 | // Validate output |
| 455 | validate(Accessor(_target), _reference); |
| 456 | } |
| 457 | TEST_SUITE_END() // BoundedReLu |
| 458 | TEST_SUITE_END() // QuantizeDownInt32ToInt8ScaleByFixedPoint |
| 459 | |
Gian Marco Iodice | bc415af | 2019-06-13 15:58:32 +0100 | [diff] [blame] | 460 | TEST_SUITE(QuantizeDownInt32ToInt16ScaleByFixedPoint) |
| 461 | |
| 462 | const auto quantize_down_int32_to_int16_scale_by_fixedpoint_cases = framework::dataset::make("result_fixedpoint_multiplier", 254601600, 254601602) * framework::dataset::make("result_shift", 1, |
| 463 | 2) |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 464 | * framework::dataset::make("min", -32768) * framework::dataset::make("max", 32767) * framework::dataset::make("addBias", { false, true }); |
Gian Marco Iodice | bc415af | 2019-06-13 15:58:32 +0100 | [diff] [blame] | 465 | |
| 466 | const auto quantize_down_int32_to_int16_scale_by_fixedpoint_relu_cases = framework::dataset::make("result_fixedpoint_multiplier", 254601600, 254601602) * framework::dataset::make("result_shift", 1, |
| 467 | 2) |
| 468 | * framework::dataset::make("min", -2, 0) * framework::dataset::make("max", 1, 3) * framework::dataset::make("addBias", { false, true }); |
Vidhya Sudhan Loganathan | 951b8a4 | 2019-11-04 14:42:08 +0000 | [diff] [blame] | 469 | const auto quantize_down_int32_to_int16_scale_by_fixedpoint_multgreat1_cases = framework::dataset::make("result_fixedpoint_multiplier", 1073741823, |
| 470 | 1073741825) |
| 471 | * framework::dataset::make("result_shift", -3, |
| 472 | -2) |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 473 | * framework::dataset::make("min", -32768) * framework::dataset::make("max", 32767) * framework::dataset::make("addBias", { false, true }); |
Manuel Bottini | 0726398 | 2019-10-17 18:37:26 +0100 | [diff] [blame] | 474 | |
Vidhya Sudhan Loganathan | 951b8a4 | 2019-11-04 14:42:08 +0000 | [diff] [blame] | 475 | const auto quantize_down_int32_to_int16_scale_by_fixedpoint_multgreat1_relu_cases = framework::dataset::make("result_fixedpoint_multiplier", 254601600, |
| 476 | 254601602) |
| 477 | * framework::dataset::make("result_shift", -3, |
| 478 | -1) |
| 479 | * framework::dataset::make("min", -2, 0) * framework::dataset::make("max", 1, 3) * framework::dataset::make("addBias", { false, true }); |
Gian Marco Iodice | bc415af | 2019-06-13 15:58:32 +0100 | [diff] [blame] | 480 | |
| 481 | using NEGEMMLowpQuantizeDownInt32ToInt16ScaleByFixedPointFixture = |
| 482 | GEMMLowpQuantizeDownInt32ToInt16ScaleByFixedPointValidationFixture<Tensor, Accessor, NEGEMMLowpQuantizeDownInt32ToInt16ScaleByFixedPoint>; |
| 483 | |
| 484 | // *INDENT-OFF* |
| 485 | // clang-format off |
| 486 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip( |
| 487 | framework::dataset::make("InputAInfo", { TensorInfo(TensorShape(21U, 13U), 1, DataType::S32), // Input not a multiple of 16 |
Gian Marco Iodice | bc415af | 2019-06-13 15:58:32 +0100 | [diff] [blame] | 488 | TensorInfo(TensorShape(20U, 13U), 1, DataType::S32), // Wrong output data type |
| 489 | }), |
| 490 | framework::dataset::make("InputBInfo",{ TensorInfo(TensorShape(21U), 1, DataType::S32), |
Gian Marco Iodice | bc415af | 2019-06-13 15:58:32 +0100 | [diff] [blame] | 491 | TensorInfo(TensorShape(20U), 1, DataType::S32), |
| 492 | })), |
| 493 | framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(21U, 13U), 1, DataType::QSYMM16), |
Gian Marco Iodice | bc415af | 2019-06-13 15:58:32 +0100 | [diff] [blame] | 494 | TensorInfo(TensorShape(20U, 13U), 1, DataType::S32), |
| 495 | })), |
| 496 | framework::dataset::make("Min",{ -205, |
Gian Marco Iodice | bc415af | 2019-06-13 15:58:32 +0100 | [diff] [blame] | 497 | -180, |
| 498 | })), |
| 499 | framework::dataset::make("Max",{ 205, |
Gian Marco Iodice | bc415af | 2019-06-13 15:58:32 +0100 | [diff] [blame] | 500 | 180, |
| 501 | })), |
Giorgio Arena | 1856ff7 | 2020-02-07 13:46:45 +0000 | [diff] [blame] | 502 | framework::dataset::make("Expected", { true, false })), |
Gian Marco Iodice | bc415af | 2019-06-13 15:58:32 +0100 | [diff] [blame] | 503 | a_info, b_info, output_info, min, max, expected) |
| 504 | { |
| 505 | // Lock tensors |
| 506 | Status status = NEGEMMLowpQuantizeDownInt32ToInt16ScaleByFixedPoint::validate(&a_info.clone()->set_is_resizable(false), |
| 507 | &b_info.clone()->set_is_resizable(false), |
| 508 | &output_info.clone()->set_is_resizable(false), |
| 509 | min, |
| 510 | max); |
| 511 | ARM_COMPUTE_EXPECT(bool(status) == expected, framework::LogLevel::ERRORS); |
| 512 | } |
| 513 | // clang-format on |
| 514 | // *INDENT-ON* |
| 515 | |
Manuel Bottini | 0726398 | 2019-10-17 18:37:26 +0100 | [diff] [blame] | 516 | TEST_SUITE(NoRelu) |
| 517 | TEST_SUITE(MultSmallerEq1) |
Gian Marco Iodice | bc415af | 2019-06-13 15:58:32 +0100 | [diff] [blame] | 518 | FIXTURE_DATA_TEST_CASE(RunSmall, NEGEMMLowpQuantizeDownInt32ToInt16ScaleByFixedPointFixture, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), |
| 519 | quantize_down_int32_to_int16_scale_by_fixedpoint_cases)) |
| 520 | { |
| 521 | // Validate output |
| 522 | validate(Accessor(_target), _reference); |
| 523 | } |
Manuel Bottini | 0726398 | 2019-10-17 18:37:26 +0100 | [diff] [blame] | 524 | TEST_SUITE_END() // MultSmallerEq1 |
| 525 | TEST_SUITE(MultGreater1) |
| 526 | FIXTURE_DATA_TEST_CASE(RunSmall, NEGEMMLowpQuantizeDownInt32ToInt16ScaleByFixedPointFixture, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), |
| 527 | quantize_down_int32_to_int16_scale_by_fixedpoint_multgreat1_cases)) |
| 528 | { |
| 529 | // Validate output |
| 530 | validate(Accessor(_target), _reference); |
| 531 | } |
| 532 | TEST_SUITE_END() // MultGreater1 |
| 533 | TEST_SUITE_END() // NoRelu |
Gian Marco Iodice | bc415af | 2019-06-13 15:58:32 +0100 | [diff] [blame] | 534 | TEST_SUITE(BoundedReLu) |
Manuel Bottini | 0726398 | 2019-10-17 18:37:26 +0100 | [diff] [blame] | 535 | TEST_SUITE(MultSmallerEq1) |
Gian Marco Iodice | bc415af | 2019-06-13 15:58:32 +0100 | [diff] [blame] | 536 | FIXTURE_DATA_TEST_CASE(RunSmall, NEGEMMLowpQuantizeDownInt32ToInt16ScaleByFixedPointFixture, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), |
| 537 | quantize_down_int32_to_int16_scale_by_fixedpoint_relu_cases)) |
| 538 | { |
| 539 | // Validate output |
| 540 | validate(Accessor(_target), _reference); |
| 541 | } |
Manuel Bottini | 0726398 | 2019-10-17 18:37:26 +0100 | [diff] [blame] | 542 | TEST_SUITE_END() // MultSmallerEq1 |
| 543 | TEST_SUITE(MultGreater1) |
| 544 | FIXTURE_DATA_TEST_CASE(RunSmall, NEGEMMLowpQuantizeDownInt32ToInt16ScaleByFixedPointFixture, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), |
| 545 | quantize_down_int32_to_int16_scale_by_fixedpoint_multgreat1_relu_cases)) |
| 546 | { |
| 547 | // Validate output |
| 548 | validate(Accessor(_target), _reference); |
| 549 | } |
| 550 | TEST_SUITE_END() // MultGreater1 |
Gian Marco Iodice | bc415af | 2019-06-13 15:58:32 +0100 | [diff] [blame] | 551 | TEST_SUITE_END() // BoundedReLu |
Gian Marco Iodice | bc415af | 2019-06-13 15:58:32 +0100 | [diff] [blame] | 552 | TEST_SUITE_END() // QuantizeDownInt32ToInt16ScaleByFixedPoint |
Gian Marco | e75a02b | 2017-11-08 12:24:09 +0000 | [diff] [blame] | 553 | TEST_SUITE_END() // OutputStage |
Gian Marco | e75a02b | 2017-11-08 12:24:09 +0000 | [diff] [blame] | 554 | TEST_SUITE_END() // GEMMLowp |
| 555 | TEST_SUITE_END() // NEON |
Pablo Tello | 299025a | 2017-09-29 11:30:12 +0100 | [diff] [blame] | 556 | } // namespace validation |
| 557 | } // namespace test |
| 558 | } // namespace arm_compute |