blob: 68213fb51fab15619a62a4b8ff63cd2f62ef7aab [file] [log] [blame]
Sanghoon Lee72898fe2017-09-01 11:42:16 +01001/*
Sheri Zhangac6499a2021-02-10 15:32:38 +00002 * Copyright (c) 2017-2021 Arm Limited.
Sanghoon Lee72898fe2017-09-01 11:42:16 +01003 *
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,
Michalis Spyrou5c9f0c42019-01-16 14:48:48 +000021 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
Sanghoon Lee72898fe2017-09-01 11:42:16 +010022 * SOFTWARE.
23 */
24#include "arm_compute/core/Types.h"
25#include "arm_compute/runtime/NEON/functions/NEArithmeticSubtraction.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/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 Pinitascbf39c62018-09-10 15:07:45 +010036#include "tests/validation/fixtures/ArithmeticOperationsFixture.h"
Sanghoon Lee72898fe2017-09-01 11:42:16 +010037
38namespace arm_compute
39{
40namespace test
41{
42namespace validation
43{
44namespace
45{
Manuel Bottini8d04fa02019-03-08 14:00:40 +000046#ifdef __aarch64__
Michele Di Giorgio9f2403f2020-03-27 10:23:44 +000047constexpr AbsoluteTolerance<float> tolerance_qasymm8(0); /**< Tolerance value for comparing reference's output against implementation's output for quantized data types */
48#else //__aarch64__
Manuel Bottini8d04fa02019-03-08 14:00:40 +000049constexpr AbsoluteTolerance<float> tolerance_qasymm8(1); /**< Tolerance value for comparing reference's output against implementation's output for quantized data types */
Michele Di Giorgio9f2403f2020-03-27 10:23:44 +000050#endif //__aarch64__
51constexpr AbsoluteTolerance<int16_t> tolerance_qsymm16(1); /**< Tolerance value for comparing reference's output against implementation's output for quantized data types */
Manuel Bottini8d04fa02019-03-08 14:00:40 +000052
Georgios Pinitasda816752021-07-02 09:22:14 +010053// Quantization Infomation DataSet
Manuel Bottini6a2b6e82019-02-25 13:50:11 +000054const auto ArithmeticSubtractionQuantizationInfoDataset = combine(combine(framework::dataset::make("QuantizationInfoIn1", { QuantizationInfo(10, 120) }),
55 framework::dataset::make("QuantizationInfoIn2", { QuantizationInfo(20, 110) })),
56 framework::dataset::make("QuantizationInfoOut", { QuantizationInfo(15, 125) }));
Michalis Spyrou6f58b372019-12-04 12:00:36 +000057const auto ArithmeticSubtractionQuantizationInfoSignedDataset = combine(combine(framework::dataset::make("QuantizationInfoIn1", { QuantizationInfo(0.5f, 10) }),
58 framework::dataset::make("QuantizationInfoIn2", { QuantizationInfo(0.5f, 20) })),
59 framework::dataset::make("QuantizationInfoOut", { QuantizationInfo(0.5f, 50) }));
Michele Di Giorgio9f2403f2020-03-27 10:23:44 +000060const auto ArithmeticSubtractionQuantizationInfoSymmetric = combine(combine(framework::dataset::make("QuantizationInfoIn1", { QuantizationInfo(0.3f, 0) }),
61 framework::dataset::make("QuantizationInfoIn2", { QuantizationInfo(0.7f, 0) })),
62 framework::dataset::make("QuantizationInfoOut", { QuantizationInfo(0.2f, 0) }));
Georgios Pinitasb2842be2020-06-22 21:27:14 +010063const auto InPlaceDataSet = framework::dataset::make("InPlace", { false, true });
64const auto OutOfPlaceDataSet = framework::dataset::make("InPlace", { false });
Sanghoon Lee72898fe2017-09-01 11:42:16 +010065} // namespace
66
67TEST_SUITE(NEON)
68TEST_SUITE(ArithmeticSubtraction)
69
Georgios Pinitascbf39c62018-09-10 15:07:45 +010070template <typename T>
71using NEArithmeticSubtractionFixture = ArithmeticSubtractionValidationFixture<Tensor, Accessor, NEArithmeticSubtraction, T>;
72
Ioan-Cristian Szabo397d58a2017-11-30 15:19:11 +000073// *INDENT-OFF*
74// clang-format off
Manuel Bottini6a2b6e82019-02-25 13:50:11 +000075DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(
Georgios Pinitasda816752021-07-02 09:22:14 +010076 framework::dataset::make("Input1Info", { TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32),
Georgios Pinitascbf39c62018-09-10 15:07:45 +010077 TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::U8), // Invalid data type combination
78 TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), // Mismatching shapes
Manuel Bottini6a2b6e82019-02-25 13:50:11 +000079 TensorInfo(TensorShape(48U, 11U, 2U), 1, DataType::QASYMM8), // Mismatching types
80 TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QASYMM8), // Invalid convert policy
Georgios Pinitascbf39c62018-09-10 15:07:45 +010081 }),
Georgios Pinitasda816752021-07-02 09:22:14 +010082 framework::dataset::make("Input2Info",{ TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32),
Georgios Pinitascbf39c62018-09-10 15:07:45 +010083 TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::S16),
84 TensorInfo(TensorShape(48U, 11U, 2U), 1, DataType::F32),
Manuel Bottini6a2b6e82019-02-25 13:50:11 +000085 TensorInfo(TensorShape(48U, 11U, 2U), 1, DataType::F32),
86 TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QASYMM8),
Georgios Pinitascbf39c62018-09-10 15:07:45 +010087 })),
Georgios Pinitasda816752021-07-02 09:22:14 +010088 framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32),
Georgios Pinitascbf39c62018-09-10 15:07:45 +010089 TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::U8),
90 TensorInfo(TensorShape(48U, 11U, 2U), 1, DataType::F32),
Manuel Bottini6a2b6e82019-02-25 13:50:11 +000091 TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QASYMM8),
SiCong Li903f8cc2020-08-27 10:17:10 +010092 TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::QASYMM8),
Georgios Pinitascbf39c62018-09-10 15:07:45 +010093 })),
Georgios Pinitasda816752021-07-02 09:22:14 +010094 framework::dataset::make("ConvertPolicy",{ ConvertPolicy::SATURATE,
95 ConvertPolicy::SATURATE,
96 ConvertPolicy::WRAP,
97 ConvertPolicy::WRAP,
98 ConvertPolicy::WRAP,
Manuel Bottini6a2b6e82019-02-25 13:50:11 +000099 })),
Georgios Pinitasda816752021-07-02 09:22:14 +0100100 framework::dataset::make("Expected", { true, false, false, false, false})),
Manuel Bottini6a2b6e82019-02-25 13:50:11 +0000101 input1_info, input2_info, output_info, policy, expected)
Ioan-Cristian Szabo397d58a2017-11-30 15:19:11 +0000102{
Manuel Bottini6a2b6e82019-02-25 13:50:11 +0000103 ARM_COMPUTE_EXPECT(bool(NEArithmeticSubtraction::validate(&input1_info.clone()->set_is_resizable(false), &input2_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), policy)) == expected, framework::LogLevel::ERRORS);
Ioan-Cristian Szabo397d58a2017-11-30 15:19:11 +0000104}
105// clang-format on
106// *INDENT-ON*
107
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100108TEST_SUITE(InPlaceValidate)
109TEST_CASE(SingleTensor, framework::DatasetMode::ALL)
110{
111 const auto random_shape = TensorShape{ 9, 9 };
112 const auto single_tensor_info = TensorInfo{ random_shape, 1, DataType::F32 };
113
114 Status result = NEArithmeticSubtraction::validate(&single_tensor_info, &single_tensor_info, &single_tensor_info, ConvertPolicy::WRAP);
115 ARM_COMPUTE_EXPECT(bool(result) == true, framework::LogLevel::ERRORS);
116}
117
118TEST_CASE(ValidBroadCast, framework::DatasetMode::ALL)
119{
120 const auto larger_shape = TensorShape{ 27U, 13U, 2U };
121 const auto smaller_shape = TensorShape{ 1U, 13U, 2U };
122
123 const auto larger_tensor_info = TensorInfo{ larger_shape, 1, DataType::F32 };
124 const auto smaller_tensor_info = TensorInfo{ smaller_shape, 1, DataType::F32 };
125
126 Status result = NEArithmeticSubtraction::validate(&larger_tensor_info, &smaller_tensor_info, &larger_tensor_info, ConvertPolicy::WRAP);
127 ARM_COMPUTE_EXPECT(bool(result) == true, framework::LogLevel::ERRORS);
128}
129
130TEST_CASE(InvalidBroadcastOutput, framework::DatasetMode::ALL)
131{
132 const auto larger_shape = TensorShape{ 27U, 13U, 2U };
133 const auto smaller_shape = TensorShape{ 1U, 13U, 2U };
134
135 const auto larger_tensor_info = TensorInfo{ larger_shape, 1, DataType::F32 };
136 const auto smaller_tensor_info = TensorInfo{ smaller_shape, 1, DataType::F32 };
137
138 Status result = NEArithmeticSubtraction::validate(&larger_tensor_info, &smaller_tensor_info, &smaller_tensor_info, ConvertPolicy::WRAP);
139 ARM_COMPUTE_EXPECT(bool(result) == false, framework::LogLevel::ERRORS);
140}
141
142TEST_CASE(InvalidBroadcastBoth, framework::DatasetMode::ALL)
143{
144 const auto shape0 = TensorShape{ 9U, 9U };
145 const auto shape1 = TensorShape{ 9U, 1U, 2U };
146
147 const auto info0 = TensorInfo{ shape0, 1, DataType::F32 };
148 const auto info1 = TensorInfo{ shape1, 1, DataType::F32 };
149
150 Status result{};
151
152 result = NEArithmeticSubtraction::validate(&info0, &info1, &info0, ConvertPolicy::WRAP);
153 ARM_COMPUTE_EXPECT(bool(result) == false, framework::LogLevel::ERRORS);
154
155 result = NEArithmeticSubtraction::validate(&info0, &info1, &info1, ConvertPolicy::WRAP);
156 ARM_COMPUTE_EXPECT(bool(result) == false, framework::LogLevel::ERRORS);
157}
158TEST_SUITE_END() // InPlaceValidate
159
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100160TEST_SUITE(U8)
Georgios Pinitasda816752021-07-02 09:22:14 +0100161FIXTURE_DATA_TEST_CASE(RunSmall, NEArithmeticSubtractionFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType",
162 DataType::U8)),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100163 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
164 OutOfPlaceDataSet))
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100165{
166 // Validate output
167 validate(Accessor(_target), _reference);
168}
Georgios Pinitascbf39c62018-09-10 15:07:45 +0100169TEST_SUITE_END() // U8
Isabella Gottardib5908c22017-10-30 15:28:13 +0000170
Michalis Spyroueae65842020-06-15 20:23:59 +0100171using NEArithmeticSubtractionQASYMM8Fixture = ArithmeticSubtractionValidationQuantizedFixture<Tensor, Accessor, NEArithmeticSubtraction, uint8_t>;
172using NEArithmeticSubtractionQASYMM8SignedFixture = ArithmeticSubtractionValidationQuantizedFixture<Tensor, Accessor, NEArithmeticSubtraction, int8_t>;
173using NEArithmeticSubtractionQASYMM8SignedBroadcastFixture = ArithmeticSubtractionValidationQuantizedBroadcastFixture<Tensor, Accessor, NEArithmeticSubtraction, int8_t>;
174using NEArithmeticSubtractionQSYMM16Fixture = ArithmeticSubtractionValidationQuantizedFixture<Tensor, Accessor, NEArithmeticSubtraction, int16_t>;
Manuel Bottini6a2b6e82019-02-25 13:50:11 +0000175
176TEST_SUITE(Quantized)
177TEST_SUITE(QASYMM8)
Georgios Pinitasda816752021-07-02 09:22:14 +0100178FIXTURE_DATA_TEST_CASE(RunSmall, NEArithmeticSubtractionQASYMM8Fixture, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType",
179 DataType::QASYMM8)),
Michele Di Giorgio9f2403f2020-03-27 10:23:44 +0000180 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100181 ArithmeticSubtractionQuantizationInfoDataset),
182 InPlaceDataSet))
Manuel Bottini6a2b6e82019-02-25 13:50:11 +0000183{
184 // Validate output
Manuel Bottini8d04fa02019-03-08 14:00:40 +0000185 validate(Accessor(_target), _reference, tolerance_qasymm8);
Manuel Bottini6a2b6e82019-02-25 13:50:11 +0000186}
187TEST_SUITE_END() // QASYMM8
Michalis Spyrou6f58b372019-12-04 12:00:36 +0000188
189TEST_SUITE(QASYMM8_SIGNED)
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100190FIXTURE_DATA_TEST_CASE(RunSmall, NEArithmeticSubtractionQASYMM8SignedFixture, framework::DatasetMode::ALL, combine(combine(combine(combine(
Georgios Pinitasda816752021-07-02 09:22:14 +0100191 datasets::SmallShapes(), framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
Michele Di Giorgio9f2403f2020-03-27 10:23:44 +0000192 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100193 ArithmeticSubtractionQuantizationInfoSignedDataset),
194 InPlaceDataSet))
Michalis Spyrou6f58b372019-12-04 12:00:36 +0000195{
196 // Validate output
197 validate(Accessor(_target), _reference, tolerance_qasymm8);
198}
Michalis Spyroueae65842020-06-15 20:23:59 +0100199
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100200FIXTURE_DATA_TEST_CASE(RunSmallBroadcast, NEArithmeticSubtractionQASYMM8SignedBroadcastFixture, framework::DatasetMode::ALL, combine(combine(combine(combine(
Michalis Spyroueae65842020-06-15 20:23:59 +0100201 datasets::SmallShapesBroadcast(),
Georgios Pinitasda816752021-07-02 09:22:14 +0100202 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
Michalis Spyroueae65842020-06-15 20:23:59 +0100203 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100204 ArithmeticSubtractionQuantizationInfoSignedDataset),
205 OutOfPlaceDataSet))
Michalis Spyroueae65842020-06-15 20:23:59 +0100206{
207 // Validate output
208 validate(Accessor(_target), _reference, tolerance_qasymm8);
209}
Michalis Spyrou6f58b372019-12-04 12:00:36 +0000210TEST_SUITE_END() // QASYMM8_SIGNED
Michele Di Giorgio9f2403f2020-03-27 10:23:44 +0000211
212TEST_SUITE(QSYMM16)
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100213FIXTURE_DATA_TEST_CASE(RunSmall, NEArithmeticSubtractionQSYMM16Fixture, framework::DatasetMode::ALL, combine(combine(combine(combine(
Michele Di Giorgio9f2403f2020-03-27 10:23:44 +0000214 datasets::SmallShapes(),
Georgios Pinitasda816752021-07-02 09:22:14 +0100215 framework::dataset::make("DataType", DataType::QSYMM16)),
Michele Di Giorgio9f2403f2020-03-27 10:23:44 +0000216 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100217 ArithmeticSubtractionQuantizationInfoSymmetric),
218 OutOfPlaceDataSet))
Michele Di Giorgio9f2403f2020-03-27 10:23:44 +0000219{
220 // Validate output
221 validate(Accessor(_target), _reference, tolerance_qsymm16);
222}
223TEST_SUITE_END() // QSYMM16
Manuel Bottini6a2b6e82019-02-25 13:50:11 +0000224TEST_SUITE_END() // Quantized
225
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100226TEST_SUITE(S16)
Georgios Pinitasda816752021-07-02 09:22:14 +0100227FIXTURE_DATA_TEST_CASE(RunSmall, NEArithmeticSubtractionFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType",
228 DataType::S16)),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100229 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
230 OutOfPlaceDataSet))
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100231{
232 // Validate output
233 validate(Accessor(_target), _reference);
234}
235
Georgios Pinitasda816752021-07-02 09:22:14 +0100236FIXTURE_DATA_TEST_CASE(RunLarge, NEArithmeticSubtractionFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeShapes(), framework::dataset::make("DataType",
237 DataType::S16)),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100238 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
239 OutOfPlaceDataSet))
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100240{
241 // Validate output
242 validate(Accessor(_target), _reference);
243}
Georgios Pinitascbf39c62018-09-10 15:07:45 +0100244TEST_SUITE_END() // S16
Isabella Gottardib5908c22017-10-30 15:28:13 +0000245
SiCong Li903f8cc2020-08-27 10:17:10 +0100246TEST_SUITE(S32)
Georgios Pinitasda816752021-07-02 09:22:14 +0100247FIXTURE_DATA_TEST_CASE(RunSmall, NEArithmeticSubtractionFixture<int32_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType",
248 DataType::S32)),
SiCong Li903f8cc2020-08-27 10:17:10 +0100249 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
250 OutOfPlaceDataSet))
251{
252 // Validate output
253 validate(Accessor(_target), _reference);
254}
255
Georgios Pinitasda816752021-07-02 09:22:14 +0100256FIXTURE_DATA_TEST_CASE(RunLarge, NEArithmeticSubtractionFixture<int32_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeShapes(), framework::dataset::make("DataType",
257 DataType::S32)),
SiCong Li903f8cc2020-08-27 10:17:10 +0100258 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
259 OutOfPlaceDataSet))
260{
261 // Validate output
262 validate(Accessor(_target), _reference);
263}
264TEST_SUITE_END() // S32
265
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100266TEST_SUITE(Float)
Ioan-Cristian Szabo5edbd1c2017-11-13 13:34:08 +0000267#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
Georgios Pinitascbf39c62018-09-10 15:07:45 +0100268TEST_SUITE(F16)
Georgios Pinitasda816752021-07-02 09:22:14 +0100269FIXTURE_DATA_TEST_CASE(RunSmall, NEArithmeticSubtractionFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType",
270 DataType::F16)),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100271 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
272 OutOfPlaceDataSet))
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100273{
274 // Validate output
275 validate(Accessor(_target), _reference);
276}
Georgios Pinitascbf39c62018-09-10 15:07:45 +0100277TEST_SUITE_END() // F16
278#endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100279
Georgios Pinitascbf39c62018-09-10 15:07:45 +0100280TEST_SUITE(F32)
Georgios Pinitasda816752021-07-02 09:22:14 +0100281FIXTURE_DATA_TEST_CASE(RunSmall, NEArithmeticSubtractionFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType",
282 DataType::F32)),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100283 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
284 InPlaceDataSet))
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100285{
286 // Validate output
287 validate(Accessor(_target), _reference);
288}
289
Georgios Pinitasda816752021-07-02 09:22:14 +0100290FIXTURE_DATA_TEST_CASE(RunLarge, NEArithmeticSubtractionFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeShapes(), framework::dataset::make("DataType",
291 DataType::F32)),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100292 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
293 OutOfPlaceDataSet))
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100294{
295 // Validate output
296 validate(Accessor(_target), _reference);
297}
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100298
Georgios Pinitascbf39c62018-09-10 15:07:45 +0100299template <typename T>
300using NEArithmeticSubtractionBroadcastFixture = ArithmeticSubtractionBroadcastValidationFixture<Tensor, Accessor, NEArithmeticSubtraction, T>;
301
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100302FIXTURE_DATA_TEST_CASE(RunSmallBroadcast, NEArithmeticSubtractionBroadcastFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapesBroadcast(),
Georgios Pinitasda816752021-07-02 09:22:14 +0100303 framework::dataset::make("DataType", DataType::F32)),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100304 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
305 OutOfPlaceDataSet))
Georgios Pinitascbf39c62018-09-10 15:07:45 +0100306{
307 // Validate output
308 validate(Accessor(_target), _reference);
309}
310
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100311FIXTURE_DATA_TEST_CASE(RunLargeBroadcast, NEArithmeticSubtractionBroadcastFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeShapesBroadcast(),
Georgios Pinitasda816752021-07-02 09:22:14 +0100312 framework::dataset::make("DataType", DataType::F32)),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100313 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
314 OutOfPlaceDataSet))
Georgios Pinitascbf39c62018-09-10 15:07:45 +0100315{
316 // Validate output
317 validate(Accessor(_target), _reference);
318}
319TEST_SUITE_END() // F32
320TEST_SUITE_END() // Float
321
322TEST_SUITE_END() // ArithmeticSubtraction
Sheri Zhangac6499a2021-02-10 15:32:38 +0000323TEST_SUITE_END() // Neon
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100324} // namespace validation
325} // namespace test
326} // namespace arm_compute