blob: 5825ce2e5d2be512a9fa4a3b65691ff2e9427495 [file] [log] [blame]
Sanghoon Lee72898fe2017-09-01 11:42:16 +01001/*
Georgios Pinitasda816752021-07-02 09:22:14 +01002 * 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,
Georgios Pinitascbf39c62018-09-10 15:07:45 +010021 * 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/CL/CLTensor.h"
26#include "arm_compute/runtime/CL/CLTensorAllocator.h"
giuros01164a2722018-11-20 18:34:46 +000027#include "arm_compute/runtime/CL/functions/CLElementwiseOperations.h"
Sanghoon Lee72898fe2017-09-01 11:42:16 +010028#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 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{
Ramy Elgammalec320d92022-12-14 09:20:09 +000044/** Synced with tests/validation/dynamic_fusion/gpu/cl/Sub.cpp from the dynamic fusion interface.
45 * Please check there for any differences in the coverage
46 */
Sanghoon Lee72898fe2017-09-01 11:42:16 +010047namespace
48{
49/** Input data sets **/
Giorgio Arena8b2a7d32020-02-11 17:21:31 +000050const auto EmptyActivationFunctionsDataset = framework::dataset::make("ActivationInfo",
51{ ActivationLayerInfo() });
52const auto ActivationFunctionsDataset = framework::dataset::make("ActivationInfo",
53{
54 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 0.75f, 0.25f),
55 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC, 0.75f, 0.25f)
56});
Georgios Pinitasb2842be2020-06-22 21:27:14 +010057const auto InPlaceDataSet = framework::dataset::make("InPlace", { false, true });
58const auto OutOfPlaceDataSet = framework::dataset::make("InPlace", { false });
Sanghoon Lee72898fe2017-09-01 11:42:16 +010059} // namespace
60
61TEST_SUITE(CL)
62TEST_SUITE(ArithmeticSubtraction)
63
Georgios Pinitasf9d3a0a2017-11-03 19:01:44 +000064// *INDENT-OFF*
65// clang-format off
66DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(
Georgios Pinitasda816752021-07-02 09:22:14 +010067 framework::dataset::make("Input1Info", { TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32),
giuros01164a2722018-11-20 18:34:46 +000068 TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::U8), // Invalid data type combination
69 TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), // Mismatching shapes
70 }),
Georgios Pinitasda816752021-07-02 09:22:14 +010071 framework::dataset::make("Input2Info",{ TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32),
giuros01164a2722018-11-20 18:34:46 +000072 TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::S16),
73 TensorInfo(TensorShape(48U, 11U, 2U), 1, DataType::F32),
74 })),
Georgios Pinitasda816752021-07-02 09:22:14 +010075 framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32),
giuros01164a2722018-11-20 18:34:46 +000076 TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::U8),
77 TensorInfo(TensorShape(48U, 11U, 2U), 1, DataType::F32),
78 })),
Georgios Pinitasda816752021-07-02 09:22:14 +010079 framework::dataset::make("Expected", { true, false, false})),
giuros01164a2722018-11-20 18:34:46 +000080 input1_info, input2_info, output_info, expected)
Georgios Pinitasf9d3a0a2017-11-03 19:01:44 +000081{
Giorgio Arena70623822017-11-27 15:50:10 +000082 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 Pinitasf9d3a0a2017-11-03 19:01:44 +000083}
84// clang-format on
85// *INDENT-ON*
86
Georgios Pinitasb2842be2020-06-22 21:27:14 +010087TEST_SUITE(InPlaceValidate)
88TEST_CASE(SingleTensor, framework::DatasetMode::ALL)
89{
90 const auto random_shape = TensorShape{ 9, 9 };
91 const auto single_tensor_info = TensorInfo{ random_shape, 1, DataType::F32 };
92
93 Status result = CLArithmeticSubtraction::validate(&single_tensor_info, &single_tensor_info, &single_tensor_info, ConvertPolicy::WRAP);
94 ARM_COMPUTE_EXPECT(bool(result) == true, framework::LogLevel::ERRORS);
95}
96
97TEST_CASE(ValidBroadCast, framework::DatasetMode::ALL)
98{
99 const auto larger_shape = TensorShape{ 27U, 13U, 2U };
100 const auto smaller_shape = TensorShape{ 1U, 13U, 2U };
101
102 const auto larger_tensor_info = TensorInfo{ larger_shape, 1, DataType::F32 };
103 const auto smaller_tensor_info = TensorInfo{ smaller_shape, 1, DataType::F32 };
104
105 Status result = CLArithmeticSubtraction::validate(&larger_tensor_info, &smaller_tensor_info, &larger_tensor_info, ConvertPolicy::WRAP);
106 ARM_COMPUTE_EXPECT(bool(result) == true, framework::LogLevel::ERRORS);
107}
108
109TEST_CASE(InvalidBroadcastOutput, framework::DatasetMode::ALL)
110{
111 const auto larger_shape = TensorShape{ 27U, 13U, 2U };
112 const auto smaller_shape = TensorShape{ 1U, 13U, 2U };
113
114 const auto larger_tensor_info = TensorInfo{ larger_shape, 1, DataType::F32 };
115 const auto smaller_tensor_info = TensorInfo{ smaller_shape, 1, DataType::F32 };
116
117 Status result = CLArithmeticSubtraction::validate(&larger_tensor_info, &smaller_tensor_info, &smaller_tensor_info, ConvertPolicy::WRAP);
118 ARM_COMPUTE_EXPECT(bool(result) == false, framework::LogLevel::ERRORS);
119}
120
121TEST_CASE(InvalidBroadcastBoth, framework::DatasetMode::ALL)
122{
123 const auto shape0 = TensorShape{ 9U, 9U };
124 const auto shape1 = TensorShape{ 9U, 1U, 2U };
125
126 const auto info0 = TensorInfo{ shape0, 1, DataType::F32 };
127 const auto info1 = TensorInfo{ shape1, 1, DataType::F32 };
128
129 Status result{};
130
131 result = CLArithmeticSubtraction::validate(&info0, &info1, &info0, ConvertPolicy::WRAP);
132 ARM_COMPUTE_EXPECT(bool(result) == false, framework::LogLevel::ERRORS);
133
134 result = CLArithmeticSubtraction::validate(&info0, &info1, &info1, ConvertPolicy::WRAP);
135 ARM_COMPUTE_EXPECT(bool(result) == false, framework::LogLevel::ERRORS);
136}
137TEST_SUITE_END() // InPlaceValidate
138
Georgios Pinitascbf39c62018-09-10 15:07:45 +0100139template <typename T>
140using CLArithmeticSubtractionFixture = ArithmeticSubtractionValidationFixture<CLTensor, CLAccessor, CLArithmeticSubtraction, T>;
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100141
Michele Di Giorgio6997fc92019-06-18 10:23:22 +0100142TEST_SUITE(Integer)
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100143TEST_SUITE(U8)
Georgios Pinitasda816752021-07-02 09:22:14 +0100144FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionFixture<uint8_t>, framework::DatasetMode::ALL, combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType",
145 DataType::U8)),
Michalis Spyroud175ece2020-07-30 23:39:32 +0100146 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
147 OutOfPlaceDataSet))
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100148{
149 // Validate output
150 validate(CLAccessor(_target), _reference);
151}
Michele Di Giorgio6997fc92019-06-18 10:23:22 +0100152TEST_SUITE_END() // U8
Georgios Pinitascbf39c62018-09-10 15:07:45 +0100153
154TEST_SUITE(S16)
Georgios Pinitasda816752021-07-02 09:22:14 +0100155FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType",
156 DataType::S16)),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100157 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
158 OutOfPlaceDataSet))
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100159{
160 // Validate output
161 validate(CLAccessor(_target), _reference);
162}
163
Georgios Pinitasda816752021-07-02 09:22:14 +0100164FIXTURE_DATA_TEST_CASE(RunLarge, CLArithmeticSubtractionFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeShapes(), framework::dataset::make("DataType",
165 DataType::S16)),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100166 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
167 OutOfPlaceDataSet))
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100168{
169 // Validate output
170 validate(CLAccessor(_target), _reference);
171}
Michele Di Giorgio6997fc92019-06-18 10:23:22 +0100172TEST_SUITE_END() // S16
173TEST_SUITE_END() // Integer
174
175template <typename T>
176using CLArithmeticSubtractionQuantizedFixture = ArithmeticSubtractionValidationQuantizedFixture<CLTensor, CLAccessor, CLArithmeticSubtraction, T>;
177
178TEST_SUITE(Quantized)
179TEST_SUITE(QASYMM8)
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100180FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(combine(datasets::SmallShapes(),
Georgios Pinitasda816752021-07-02 09:22:14 +0100181 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgio6997fc92019-06-18 10:23:22 +0100182 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })),
183 framework::dataset::make("Src0QInfo", { QuantizationInfo(5.f / 255.f, 20) })),
184 framework::dataset::make("Src1QInfo", { QuantizationInfo(2.f / 255.f, 10) })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100185 framework::dataset::make("OutQInfo", { QuantizationInfo(1.f / 255.f, 5) })),
Sheri Zhanga387e272021-06-29 17:34:06 +0100186 OutOfPlaceDataSet))
187{
188 // Validate output
189 validate(CLAccessor(_target), _reference);
190}
191FIXTURE_DATA_TEST_CASE(RunTinyInPlace, CLArithmeticSubtractionQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(combine(datasets::TinyShapes(),
192 framework::dataset::make("DataType", DataType::QASYMM8)),
193 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })),
194 framework::dataset::make("Src0QInfo", { QuantizationInfo(5.f / 255.f, 20) })),
195 framework::dataset::make("Src1QInfo", { QuantizationInfo(5.f / 255.f, 20) })),
196 framework::dataset::make("OutQInfo", { QuantizationInfo(5.f / 255.f, 20) })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100197 InPlaceDataSet))
Michele Di Giorgio6997fc92019-06-18 10:23:22 +0100198{
199 // Validate output
200 validate(CLAccessor(_target), _reference);
201}
202TEST_SUITE_END() // QASYMM8
Kurtis Charnockec0c4122019-12-05 14:13:46 +0000203TEST_SUITE(QASYMM8_SIGNED)
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100204FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(combine(datasets::SmallShapes(),
Georgios Pinitasda816752021-07-02 09:22:14 +0100205 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
Kurtis Charnockec0c4122019-12-05 14:13:46 +0000206 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })),
207 framework::dataset::make("Src0QInfo", { QuantizationInfo(5.f / 255.f, 10) })),
208 framework::dataset::make("Src1QInfo", { QuantizationInfo(2.f / 255.f, 10) })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100209 framework::dataset::make("OutQInfo", { QuantizationInfo(1.f / 255.f, 5) })),
Sheri Zhanga387e272021-06-29 17:34:06 +0100210 OutOfPlaceDataSet))
Kurtis Charnockec0c4122019-12-05 14:13:46 +0000211{
212 // Validate output
213 validate(CLAccessor(_target), _reference);
214}
215TEST_SUITE_END() // QASYMM8_SIGNED
Michele Di Giorgio6997fc92019-06-18 10:23:22 +0100216TEST_SUITE(QSYMM16)
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100217FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionQuantizedFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(combine(datasets::SmallShapes(),
Georgios Pinitasda816752021-07-02 09:22:14 +0100218 framework::dataset::make("DataType", DataType::QSYMM16)),
Michele Di Giorgio6997fc92019-06-18 10:23:22 +0100219 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })),
220 framework::dataset::make("Src0QInfo", { QuantizationInfo(1.f / 32768.f, 0), QuantizationInfo(5.f / 32768.f, 0) })),
221 framework::dataset::make("Src1QInfo", { QuantizationInfo(2.f / 32768.f, 0), QuantizationInfo(5.f / 32768.f, 0) })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100222 framework::dataset::make("OutQInfo", { QuantizationInfo(5.f / 32768.f, 0) })),
223 OutOfPlaceDataSet))
Michele Di Giorgio6997fc92019-06-18 10:23:22 +0100224{
225 // Validate output
226 validate(CLAccessor(_target), _reference);
227}
228TEST_SUITE_END() // QSYMM16
229TEST_SUITE_END() // Quantized
Isabella Gottardib5908c22017-10-30 15:28:13 +0000230
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000231template <typename T>
232using CLArithmeticSubtractionFloatFixture = ArithmeticSubtractionValidationFloatFixture<CLTensor, CLAccessor, CLArithmeticSubtraction, T>;
233
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100234TEST_SUITE(Float)
235TEST_SUITE(FP16)
Georgios Pinitasda816752021-07-02 09:22:14 +0100236FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionFloatFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType",
237 DataType::F16)),
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000238 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100239 EmptyActivationFunctionsDataset),
240 OutOfPlaceDataSet))
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000241{
242 // Validate output
243 validate(CLAccessor(_target), _reference);
244}
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100245FIXTURE_DATA_TEST_CASE(RunWithActivation, CLArithmeticSubtractionFloatFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::TinyShapes(),
Georgios Pinitasda816752021-07-02 09:22:14 +0100246 framework::dataset::make("DataType", DataType::F16)),
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000247 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100248 ActivationFunctionsDataset),
249 InPlaceDataSet))
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100250{
251 // Validate output
252 validate(CLAccessor(_target), _reference);
253}
Michele Di Giorgio6997fc92019-06-18 10:23:22 +0100254TEST_SUITE_END() // FP16
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100255
256TEST_SUITE(FP32)
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100257FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionFloatFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallShapes(),
Georgios Pinitasda816752021-07-02 09:22:14 +0100258 framework::dataset::make("DataType", DataType::F32)),
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000259 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100260 EmptyActivationFunctionsDataset),
261 OutOfPlaceDataSet))
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000262{
263 // Validate output
264 validate(CLAccessor(_target), _reference);
265}
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100266FIXTURE_DATA_TEST_CASE(RunWithActivation, CLArithmeticSubtractionFloatFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::TinyShapes(),
Georgios Pinitasda816752021-07-02 09:22:14 +0100267 framework::dataset::make("DataType", DataType::F32)),
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000268 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100269 ActivationFunctionsDataset),
270 InPlaceDataSet))
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100271{
272 // Validate output
273 validate(CLAccessor(_target), _reference);
274}
275
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100276FIXTURE_DATA_TEST_CASE(RunLarge, CLArithmeticSubtractionFloatFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeShapes(),
Georgios Pinitasda816752021-07-02 09:22:14 +0100277 framework::dataset::make("DataType", DataType::F32)),
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000278 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100279 EmptyActivationFunctionsDataset),
280 OutOfPlaceDataSet))
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100281{
282 // Validate output
283 validate(CLAccessor(_target), _reference);
284}
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100285
Georgios Pinitascbf39c62018-09-10 15:07:45 +0100286template <typename T>
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000287using CLArithmeticSubtractionBroadcastFloatFixture = ArithmeticSubtractionBroadcastValidationFloatFixture<CLTensor, CLAccessor, CLArithmeticSubtraction, T>;
Georgios Pinitascbf39c62018-09-10 15:07:45 +0100288
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100289FIXTURE_DATA_TEST_CASE(RunSmallBroadcast, CLArithmeticSubtractionBroadcastFloatFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallShapesBroadcast(),
Georgios Pinitasda816752021-07-02 09:22:14 +0100290 framework::dataset::make("DataType", DataType::F32)),
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000291 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100292 EmptyActivationFunctionsDataset),
293 OutOfPlaceDataSet))
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000294{
295 // Validate output
296 validate(CLAccessor(_target), _reference);
297}
Sheri Zhanga387e272021-06-29 17:34:06 +0100298FIXTURE_DATA_TEST_CASE(RunTinyBroadcastInplace, CLArithmeticSubtractionBroadcastFloatFixture<float>, framework::DatasetMode::PRECOMMIT,
299 combine(combine(combine(combine(datasets::TinyShapesBroadcastInplace(),
300 framework::dataset::make("DataType", DataType::F32)),
301 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
302 EmptyActivationFunctionsDataset),
303 InPlaceDataSet))
304{
305 // Validate output
306 validate(CLAccessor(_target), _reference);
307}
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100308FIXTURE_DATA_TEST_CASE(RunWithActivationBroadcast, CLArithmeticSubtractionBroadcastFloatFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::TinyShapesBroadcast(),
Georgios Pinitasda816752021-07-02 09:22:14 +0100309 framework::dataset::make("DataType", DataType::F32)),
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000310 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100311 ActivationFunctionsDataset),
312 OutOfPlaceDataSet))
Georgios Pinitascbf39c62018-09-10 15:07:45 +0100313{
314 // Validate output
315 validate(CLAccessor(_target), _reference);
316}
317
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100318FIXTURE_DATA_TEST_CASE(RunLargeBroadcast, CLArithmeticSubtractionBroadcastFloatFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeShapesBroadcast(),
Georgios Pinitasda816752021-07-02 09:22:14 +0100319 framework::dataset::make("DataType", DataType::F32)),
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000320 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100321 EmptyActivationFunctionsDataset),
322 OutOfPlaceDataSet))
Georgios Pinitascbf39c62018-09-10 15:07:45 +0100323{
324 // Validate output
325 validate(CLAccessor(_target), _reference);
326}
Michele Di Giorgio6997fc92019-06-18 10:23:22 +0100327TEST_SUITE_END() // FP32
328TEST_SUITE_END() // Float
Georgios Pinitascbf39c62018-09-10 15:07:45 +0100329
Michele Di Giorgio6997fc92019-06-18 10:23:22 +0100330TEST_SUITE_END() // ArithmeticSubtraction
331TEST_SUITE_END() // CL
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100332} // namespace validation
333} // namespace test
giuros01164a2722018-11-20 18:34:46 +0000334} // namespace arm_compute