Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 1 | /* |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 2 | * Copyright (c) 2017-2019 ARM Limited. |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +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, |
Georgios Pinitas | cbf39c6 | 2018-09-10 15:07:45 +0100 | [diff] [blame] | 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 22 | * SOFTWARE. |
| 23 | */ |
| 24 | #include "arm_compute/core/Types.h" |
| 25 | #include "arm_compute/runtime/CL/CLTensor.h" |
| 26 | #include "arm_compute/runtime/CL/CLTensorAllocator.h" |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 27 | #include "arm_compute/runtime/CL/functions/CLElementwiseOperations.h" |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 28 | #include "tests/CL/CLAccessor.h" |
| 29 | #include "tests/PaddingCalculator.h" |
| 30 | #include "tests/datasets/ConvertPolicyDataset.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" |
Georgios Pinitas | cbf39c6 | 2018-09-10 15:07:45 +0100 | [diff] [blame] | 36 | #include "tests/validation/fixtures/ArithmeticOperationsFixture.h" |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 37 | |
| 38 | namespace arm_compute |
| 39 | { |
| 40 | namespace test |
| 41 | { |
| 42 | namespace validation |
| 43 | { |
| 44 | namespace |
| 45 | { |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 46 | constexpr unsigned int num_elems_processed_per_iteration = 16; |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 47 | /** Input data sets **/ |
| 48 | const auto ArithmeticSubtractionU8Dataset = combine(combine(framework::dataset::make("DataType", DataType::U8), framework::dataset::make("DataType", DataType::U8)), |
| 49 | framework::dataset::make("DataType", |
| 50 | DataType::U8)); |
Georgios Pinitas | cbf39c6 | 2018-09-10 15:07:45 +0100 | [diff] [blame] | 51 | const auto ArithmeticSubtractionQASYMM8Dataset = combine(combine(framework::dataset::make("DataType", DataType::QASYMM8), framework::dataset::make("DataType", DataType::QASYMM8)), |
| 52 | framework::dataset::make("DataType", |
| 53 | DataType::QASYMM8)); |
| 54 | const auto ArithmeticSubtractionS16Dataset = combine(combine(framework::dataset::make("DataType", { DataType::U8, DataType::S16 }), framework::dataset::make("DataType", DataType::S16)), |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 55 | framework::dataset::make("DataType", DataType::S16)); |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 56 | const auto ArithmeticSubtractionFP16Dataset = combine(combine(framework::dataset::make("DataType", DataType::F16), framework::dataset::make("DataType", DataType::F16)), |
| 57 | framework::dataset::make("DataType", DataType::F16)); |
| 58 | const auto ArithmeticSubtractionFP32Dataset = combine(combine(framework::dataset::make("DataType", DataType::F32), framework::dataset::make("DataType", DataType::F32)), |
| 59 | framework::dataset::make("DataType", DataType::F32)); |
| 60 | } // namespace |
| 61 | |
| 62 | TEST_SUITE(CL) |
| 63 | TEST_SUITE(ArithmeticSubtraction) |
| 64 | |
Georgios Pinitas | f9d3a0a | 2017-11-03 19:01:44 +0000 | [diff] [blame] | 65 | // *INDENT-OFF* |
| 66 | // clang-format off |
| 67 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 68 | framework::dataset::make("Input1Info", { TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::U8), |
| 69 | TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::U8), |
| 70 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::U8), // Window shrink |
| 71 | TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::U8), // Invalid data type combination |
| 72 | TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), // Mismatching shapes |
| 73 | }), |
| 74 | framework::dataset::make("Input2Info",{ TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::U8), |
| 75 | TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::U8), |
| 76 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::U8), |
| 77 | TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::S16), |
| 78 | TensorInfo(TensorShape(48U, 11U, 2U), 1, DataType::F32), |
| 79 | })), |
| 80 | framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::S16), |
| 81 | TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::U8), |
| 82 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::U8), |
| 83 | TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::U8), |
| 84 | TensorInfo(TensorShape(48U, 11U, 2U), 1, DataType::F32), |
| 85 | })), |
| 86 | framework::dataset::make("Expected", { true, true, false, false, false})), |
| 87 | input1_info, input2_info, output_info, expected) |
Georgios Pinitas | f9d3a0a | 2017-11-03 19:01:44 +0000 | [diff] [blame] | 88 | { |
Giorgio Arena | 7062382 | 2017-11-27 15:50:10 +0000 | [diff] [blame] | 89 | ARM_COMPUTE_EXPECT(bool(CLArithmeticSubtraction::validate(&input1_info.clone()->set_is_resizable(false), &input2_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), ConvertPolicy::WRAP)) == expected, framework::LogLevel::ERRORS); |
Georgios Pinitas | f9d3a0a | 2017-11-03 19:01:44 +0000 | [diff] [blame] | 90 | } |
| 91 | // clang-format on |
| 92 | // *INDENT-ON* |
| 93 | |
Georgios Pinitas | cbf39c6 | 2018-09-10 15:07:45 +0100 | [diff] [blame] | 94 | template <typename T> |
| 95 | using CLArithmeticSubtractionFixture = ArithmeticSubtractionValidationFixture<CLTensor, CLAccessor, CLArithmeticSubtraction, T>; |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 96 | |
| 97 | TEST_SUITE(U8) |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 98 | DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 99 | shape, policy) |
| 100 | { |
| 101 | // Create tensors |
| 102 | CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::U8); |
| 103 | CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::U8); |
| 104 | CLTensor dst = create_tensor<CLTensor>(shape, DataType::U8); |
| 105 | |
| 106 | // Create and Configure function |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 107 | CLArithmeticSubtraction add; |
| 108 | add.configure(&ref_src1, &ref_src2, &dst, policy); |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 109 | |
| 110 | // Validate valid region |
| 111 | const ValidRegion valid_region = shape_to_valid_region(shape); |
| 112 | validate(dst.info()->valid_region(), valid_region); |
| 113 | |
| 114 | // Validate padding |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 115 | const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 116 | validate(ref_src1.info()->padding(), padding); |
| 117 | validate(ref_src2.info()->padding(), padding); |
| 118 | validate(dst.info()->padding(), padding); |
| 119 | } |
| 120 | |
Georgios Pinitas | cbf39c6 | 2018-09-10 15:07:45 +0100 | [diff] [blame] | 121 | FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallShapes(), ArithmeticSubtractionU8Dataset), |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 122 | framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP }))) |
| 123 | { |
| 124 | // Validate output |
| 125 | validate(CLAccessor(_target), _reference); |
| 126 | } |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 127 | TEST_SUITE_END() |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 128 | |
Georgios Pinitas | cbf39c6 | 2018-09-10 15:07:45 +0100 | [diff] [blame] | 129 | template <typename T> |
| 130 | using CLArithmeticSubtractionQuantizedFixture = ArithmeticSubtractionValidationQuantizedFixture<CLTensor, CLAccessor, CLArithmeticSubtraction, T>; |
Isabella Gottardi | b5908c2 | 2017-10-30 15:28:13 +0000 | [diff] [blame] | 131 | |
Georgios Pinitas | cbf39c6 | 2018-09-10 15:07:45 +0100 | [diff] [blame] | 132 | TEST_SUITE(Quantized) |
| 133 | TEST_SUITE(QASYMM8) |
Manuel Bottini | 6a2b6e8 | 2019-02-25 13:50:11 +0000 | [diff] [blame] | 134 | DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })), |
Georgios Pinitas | cbf39c6 | 2018-09-10 15:07:45 +0100 | [diff] [blame] | 135 | shape, policy) |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 136 | { |
| 137 | // Create tensors |
Georgios Pinitas | cbf39c6 | 2018-09-10 15:07:45 +0100 | [diff] [blame] | 138 | CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::QASYMM8); |
| 139 | CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::QASYMM8); |
| 140 | CLTensor dst = create_tensor<CLTensor>(shape, DataType::QASYMM8); |
| 141 | |
| 142 | // Create and Configure function |
| 143 | CLArithmeticSubtraction add; |
| 144 | add.configure(&ref_src1, &ref_src2, &dst, policy); |
| 145 | |
| 146 | // Validate valid region |
| 147 | const ValidRegion valid_region = shape_to_valid_region(shape); |
| 148 | validate(dst.info()->valid_region(), valid_region); |
| 149 | |
| 150 | // Validate padding |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 151 | const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); |
Georgios Pinitas | cbf39c6 | 2018-09-10 15:07:45 +0100 | [diff] [blame] | 152 | validate(ref_src1.info()->padding(), padding); |
| 153 | validate(ref_src2.info()->padding(), padding); |
| 154 | validate(dst.info()->padding(), padding); |
| 155 | } |
| 156 | |
| 157 | FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(datasets::SmallShapes(), |
| 158 | ArithmeticSubtractionQASYMM8Dataset), |
Manuel Bottini | 6a2b6e8 | 2019-02-25 13:50:11 +0000 | [diff] [blame] | 159 | framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })), |
Georgios Pinitas | cbf39c6 | 2018-09-10 15:07:45 +0100 | [diff] [blame] | 160 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(5.f / 255.f, 20) })), |
| 161 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(2.f / 255.f, 10) })), |
| 162 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(1.f / 255.f, 5) })) |
| 163 | |
| 164 | ) |
| 165 | { |
| 166 | // Validate output |
| 167 | validate(CLAccessor(_target), _reference); |
| 168 | } |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 169 | TEST_SUITE_END() |
| 170 | TEST_SUITE_END() |
Georgios Pinitas | cbf39c6 | 2018-09-10 15:07:45 +0100 | [diff] [blame] | 171 | |
| 172 | TEST_SUITE(S16) |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 173 | DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType", { DataType::U8, DataType::S16 })), |
Georgios Pinitas | cbf39c6 | 2018-09-10 15:07:45 +0100 | [diff] [blame] | 174 | framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), |
| 175 | shape, data_type, policy) |
| 176 | { |
| 177 | // Create tensors |
| 178 | CLTensor ref_src1 = create_tensor<CLTensor>(shape, data_type); |
| 179 | CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::S16); |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 180 | CLTensor dst = create_tensor<CLTensor>(shape, DataType::S16); |
| 181 | |
| 182 | // Create and Configure function |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 183 | CLArithmeticSubtraction add; |
| 184 | add.configure(&ref_src1, &ref_src2, &dst, policy); |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 185 | |
| 186 | // Validate valid region |
| 187 | const ValidRegion valid_region = shape_to_valid_region(shape); |
| 188 | validate(dst.info()->valid_region(), valid_region); |
| 189 | |
| 190 | // Validate padding |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 191 | const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 192 | validate(ref_src1.info()->padding(), padding); |
| 193 | validate(ref_src2.info()->padding(), padding); |
| 194 | validate(dst.info()->padding(), padding); |
| 195 | } |
Georgios Pinitas | cbf39c6 | 2018-09-10 15:07:45 +0100 | [diff] [blame] | 196 | |
| 197 | FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallShapes(), ArithmeticSubtractionS16Dataset), |
| 198 | framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP }))) |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 199 | { |
| 200 | // Validate output |
| 201 | validate(CLAccessor(_target), _reference); |
| 202 | } |
| 203 | |
Georgios Pinitas | cbf39c6 | 2018-09-10 15:07:45 +0100 | [diff] [blame] | 204 | FIXTURE_DATA_TEST_CASE(RunLarge, CLArithmeticSubtractionFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeShapes(), ArithmeticSubtractionS16Dataset), |
| 205 | framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP }))) |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 206 | { |
| 207 | // Validate output |
| 208 | validate(CLAccessor(_target), _reference); |
| 209 | } |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 210 | TEST_SUITE_END() |
Isabella Gottardi | b5908c2 | 2017-10-30 15:28:13 +0000 | [diff] [blame] | 211 | |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 212 | TEST_SUITE(Float) |
| 213 | TEST_SUITE(FP16) |
Georgios Pinitas | 583137c | 2017-08-31 18:12:42 +0100 | [diff] [blame] | 214 | FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionFixture<half>, framework::DatasetMode::ALL, combine(combine(datasets::SmallShapes(), ArithmeticSubtractionFP16Dataset), |
| 215 | framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP }))) |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 216 | { |
| 217 | // Validate output |
| 218 | validate(CLAccessor(_target), _reference); |
| 219 | } |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 220 | TEST_SUITE_END() |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 221 | |
| 222 | TEST_SUITE(FP32) |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 223 | DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })), |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 224 | shape, policy) |
| 225 | { |
| 226 | // Create tensors |
| 227 | CLTensor ref_src1 = create_tensor<CLTensor>(shape, DataType::F32); |
| 228 | CLTensor ref_src2 = create_tensor<CLTensor>(shape, DataType::F32); |
| 229 | CLTensor dst = create_tensor<CLTensor>(shape, DataType::F32); |
| 230 | |
| 231 | // Create and Configure function |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 232 | CLArithmeticSubtraction add; |
| 233 | add.configure(&ref_src1, &ref_src2, &dst, policy); |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 234 | |
| 235 | // Validate valid region |
| 236 | const ValidRegion valid_region = shape_to_valid_region(shape); |
| 237 | validate(dst.info()->valid_region(), valid_region); |
| 238 | |
| 239 | // Validate padding |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 240 | const PaddingSize padding = PaddingCalculator(shape.x(), num_elems_processed_per_iteration).required_padding(); |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 241 | validate(ref_src1.info()->padding(), padding); |
| 242 | validate(ref_src2.info()->padding(), padding); |
| 243 | validate(dst.info()->padding(), padding); |
| 244 | } |
| 245 | |
| 246 | FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallShapes(), ArithmeticSubtractionFP32Dataset), |
| 247 | framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP }))) |
| 248 | { |
| 249 | // Validate output |
| 250 | validate(CLAccessor(_target), _reference); |
| 251 | } |
| 252 | |
| 253 | FIXTURE_DATA_TEST_CASE(RunLarge, CLArithmeticSubtractionFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeShapes(), ArithmeticSubtractionFP32Dataset), |
| 254 | framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP }))) |
| 255 | { |
| 256 | // Validate output |
| 257 | validate(CLAccessor(_target), _reference); |
| 258 | } |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 259 | |
Georgios Pinitas | cbf39c6 | 2018-09-10 15:07:45 +0100 | [diff] [blame] | 260 | template <typename T> |
| 261 | using CLArithmeticSubtractionBroadcastFixture = ArithmeticSubtractionBroadcastValidationFixture<CLTensor, CLAccessor, CLArithmeticSubtraction, T>; |
| 262 | |
| 263 | FIXTURE_DATA_TEST_CASE(RunSmallBroadcast, CLArithmeticSubtractionBroadcastFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallShapesBroadcast(), |
| 264 | ArithmeticSubtractionFP32Dataset), |
| 265 | framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP }))) |
| 266 | { |
| 267 | // Validate output |
| 268 | validate(CLAccessor(_target), _reference); |
| 269 | } |
| 270 | |
| 271 | FIXTURE_DATA_TEST_CASE(RunLargeBroadcast, CLArithmeticSubtractionBroadcastFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeShapesBroadcast(), |
| 272 | ArithmeticSubtractionFP32Dataset), |
| 273 | framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP }))) |
| 274 | { |
| 275 | // Validate output |
| 276 | validate(CLAccessor(_target), _reference); |
| 277 | } |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 278 | TEST_SUITE_END() |
| 279 | TEST_SUITE_END() |
Georgios Pinitas | cbf39c6 | 2018-09-10 15:07:45 +0100 | [diff] [blame] | 280 | |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 281 | TEST_SUITE_END() |
| 282 | TEST_SUITE_END() |
Sanghoon Lee | 72898fe | 2017-09-01 11:42:16 +0100 | [diff] [blame] | 283 | } // namespace validation |
| 284 | } // namespace test |
giuros01 | 164a272 | 2018-11-20 18:34:46 +0000 | [diff] [blame] | 285 | } // namespace arm_compute |