blob: 6a82471dfa822b33df3927f1a55a53fa27b89cf1 [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{
44namespace
45{
46/** Input data sets **/
Giorgio Arena8b2a7d32020-02-11 17:21:31 +000047const auto EmptyActivationFunctionsDataset = framework::dataset::make("ActivationInfo",
48{ ActivationLayerInfo() });
49const auto ActivationFunctionsDataset = framework::dataset::make("ActivationInfo",
50{
51 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 0.75f, 0.25f),
52 ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC, 0.75f, 0.25f)
53});
Georgios Pinitasb2842be2020-06-22 21:27:14 +010054const auto InPlaceDataSet = framework::dataset::make("InPlace", { false, true });
55const auto OutOfPlaceDataSet = framework::dataset::make("InPlace", { false });
Sanghoon Lee72898fe2017-09-01 11:42:16 +010056} // namespace
57
58TEST_SUITE(CL)
59TEST_SUITE(ArithmeticSubtraction)
60
Georgios Pinitasf9d3a0a2017-11-03 19:01:44 +000061// *INDENT-OFF*
62// clang-format off
63DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(
Georgios Pinitasda816752021-07-02 09:22:14 +010064 framework::dataset::make("Input1Info", { TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32),
giuros01164a2722018-11-20 18:34:46 +000065 TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::U8), // Invalid data type combination
66 TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32), // Mismatching shapes
67 }),
Georgios Pinitasda816752021-07-02 09:22:14 +010068 framework::dataset::make("Input2Info",{ TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32),
giuros01164a2722018-11-20 18:34:46 +000069 TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::S16),
70 TensorInfo(TensorShape(48U, 11U, 2U), 1, DataType::F32),
71 })),
Georgios Pinitasda816752021-07-02 09:22:14 +010072 framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::F32),
giuros01164a2722018-11-20 18:34:46 +000073 TensorInfo(TensorShape(32U, 13U, 2U), 1, DataType::U8),
74 TensorInfo(TensorShape(48U, 11U, 2U), 1, DataType::F32),
75 })),
Georgios Pinitasda816752021-07-02 09:22:14 +010076 framework::dataset::make("Expected", { true, false, false})),
giuros01164a2722018-11-20 18:34:46 +000077 input1_info, input2_info, output_info, expected)
Georgios Pinitasf9d3a0a2017-11-03 19:01:44 +000078{
Giorgio Arena70623822017-11-27 15:50:10 +000079 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 +000080}
81// clang-format on
82// *INDENT-ON*
83
Georgios Pinitasb2842be2020-06-22 21:27:14 +010084TEST_SUITE(InPlaceValidate)
85TEST_CASE(SingleTensor, framework::DatasetMode::ALL)
86{
87 const auto random_shape = TensorShape{ 9, 9 };
88 const auto single_tensor_info = TensorInfo{ random_shape, 1, DataType::F32 };
89
90 Status result = CLArithmeticSubtraction::validate(&single_tensor_info, &single_tensor_info, &single_tensor_info, ConvertPolicy::WRAP);
91 ARM_COMPUTE_EXPECT(bool(result) == true, framework::LogLevel::ERRORS);
92}
93
94TEST_CASE(ValidBroadCast, framework::DatasetMode::ALL)
95{
96 const auto larger_shape = TensorShape{ 27U, 13U, 2U };
97 const auto smaller_shape = TensorShape{ 1U, 13U, 2U };
98
99 const auto larger_tensor_info = TensorInfo{ larger_shape, 1, DataType::F32 };
100 const auto smaller_tensor_info = TensorInfo{ smaller_shape, 1, DataType::F32 };
101
102 Status result = CLArithmeticSubtraction::validate(&larger_tensor_info, &smaller_tensor_info, &larger_tensor_info, ConvertPolicy::WRAP);
103 ARM_COMPUTE_EXPECT(bool(result) == true, framework::LogLevel::ERRORS);
104}
105
106TEST_CASE(InvalidBroadcastOutput, framework::DatasetMode::ALL)
107{
108 const auto larger_shape = TensorShape{ 27U, 13U, 2U };
109 const auto smaller_shape = TensorShape{ 1U, 13U, 2U };
110
111 const auto larger_tensor_info = TensorInfo{ larger_shape, 1, DataType::F32 };
112 const auto smaller_tensor_info = TensorInfo{ smaller_shape, 1, DataType::F32 };
113
114 Status result = CLArithmeticSubtraction::validate(&larger_tensor_info, &smaller_tensor_info, &smaller_tensor_info, ConvertPolicy::WRAP);
115 ARM_COMPUTE_EXPECT(bool(result) == false, framework::LogLevel::ERRORS);
116}
117
118TEST_CASE(InvalidBroadcastBoth, framework::DatasetMode::ALL)
119{
120 const auto shape0 = TensorShape{ 9U, 9U };
121 const auto shape1 = TensorShape{ 9U, 1U, 2U };
122
123 const auto info0 = TensorInfo{ shape0, 1, DataType::F32 };
124 const auto info1 = TensorInfo{ shape1, 1, DataType::F32 };
125
126 Status result{};
127
128 result = CLArithmeticSubtraction::validate(&info0, &info1, &info0, ConvertPolicy::WRAP);
129 ARM_COMPUTE_EXPECT(bool(result) == false, framework::LogLevel::ERRORS);
130
131 result = CLArithmeticSubtraction::validate(&info0, &info1, &info1, ConvertPolicy::WRAP);
132 ARM_COMPUTE_EXPECT(bool(result) == false, framework::LogLevel::ERRORS);
133}
134TEST_SUITE_END() // InPlaceValidate
135
Georgios Pinitascbf39c62018-09-10 15:07:45 +0100136template <typename T>
137using CLArithmeticSubtractionFixture = ArithmeticSubtractionValidationFixture<CLTensor, CLAccessor, CLArithmeticSubtraction, T>;
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100138
Michele Di Giorgio6997fc92019-06-18 10:23:22 +0100139TEST_SUITE(Integer)
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100140TEST_SUITE(U8)
Georgios Pinitasda816752021-07-02 09:22:14 +0100141FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionFixture<uint8_t>, framework::DatasetMode::ALL, combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType",
142 DataType::U8)),
Michalis Spyroud175ece2020-07-30 23:39:32 +0100143 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
144 OutOfPlaceDataSet))
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100145{
146 // Validate output
147 validate(CLAccessor(_target), _reference);
148}
Michele Di Giorgio6997fc92019-06-18 10:23:22 +0100149TEST_SUITE_END() // U8
Georgios Pinitascbf39c62018-09-10 15:07:45 +0100150
151TEST_SUITE(S16)
Georgios Pinitasda816752021-07-02 09:22:14 +0100152FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionFixture<int16_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType",
153 DataType::S16)),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100154 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
155 OutOfPlaceDataSet))
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100156{
157 // Validate output
158 validate(CLAccessor(_target), _reference);
159}
160
Georgios Pinitasda816752021-07-02 09:22:14 +0100161FIXTURE_DATA_TEST_CASE(RunLarge, CLArithmeticSubtractionFixture<int16_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeShapes(), framework::dataset::make("DataType",
162 DataType::S16)),
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(CLAccessor(_target), _reference);
168}
Michele Di Giorgio6997fc92019-06-18 10:23:22 +0100169TEST_SUITE_END() // S16
170TEST_SUITE_END() // Integer
171
172template <typename T>
173using CLArithmeticSubtractionQuantizedFixture = ArithmeticSubtractionValidationQuantizedFixture<CLTensor, CLAccessor, CLArithmeticSubtraction, T>;
174
175TEST_SUITE(Quantized)
176TEST_SUITE(QASYMM8)
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100177FIXTURE_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 +0100178 framework::dataset::make("DataType", DataType::QASYMM8)),
Michele Di Giorgio6997fc92019-06-18 10:23:22 +0100179 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })),
180 framework::dataset::make("Src0QInfo", { QuantizationInfo(5.f / 255.f, 20) })),
181 framework::dataset::make("Src1QInfo", { QuantizationInfo(2.f / 255.f, 10) })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100182 framework::dataset::make("OutQInfo", { QuantizationInfo(1.f / 255.f, 5) })),
Sheri Zhanga387e272021-06-29 17:34:06 +0100183 OutOfPlaceDataSet))
184{
185 // Validate output
186 validate(CLAccessor(_target), _reference);
187}
188FIXTURE_DATA_TEST_CASE(RunTinyInPlace, CLArithmeticSubtractionQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(combine(datasets::TinyShapes(),
189 framework::dataset::make("DataType", DataType::QASYMM8)),
190 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })),
191 framework::dataset::make("Src0QInfo", { QuantizationInfo(5.f / 255.f, 20) })),
192 framework::dataset::make("Src1QInfo", { QuantizationInfo(5.f / 255.f, 20) })),
193 framework::dataset::make("OutQInfo", { QuantizationInfo(5.f / 255.f, 20) })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100194 InPlaceDataSet))
Michele Di Giorgio6997fc92019-06-18 10:23:22 +0100195{
196 // Validate output
197 validate(CLAccessor(_target), _reference);
198}
199TEST_SUITE_END() // QASYMM8
Kurtis Charnockec0c4122019-12-05 14:13:46 +0000200TEST_SUITE(QASYMM8_SIGNED)
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100201FIXTURE_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 +0100202 framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)),
Kurtis Charnockec0c4122019-12-05 14:13:46 +0000203 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })),
204 framework::dataset::make("Src0QInfo", { QuantizationInfo(5.f / 255.f, 10) })),
205 framework::dataset::make("Src1QInfo", { QuantizationInfo(2.f / 255.f, 10) })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100206 framework::dataset::make("OutQInfo", { QuantizationInfo(1.f / 255.f, 5) })),
Sheri Zhanga387e272021-06-29 17:34:06 +0100207 OutOfPlaceDataSet))
Kurtis Charnockec0c4122019-12-05 14:13:46 +0000208{
209 // Validate output
210 validate(CLAccessor(_target), _reference);
211}
212TEST_SUITE_END() // QASYMM8_SIGNED
Michele Di Giorgio6997fc92019-06-18 10:23:22 +0100213TEST_SUITE(QSYMM16)
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100214FIXTURE_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 +0100215 framework::dataset::make("DataType", DataType::QSYMM16)),
Michele Di Giorgio6997fc92019-06-18 10:23:22 +0100216 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE })),
217 framework::dataset::make("Src0QInfo", { QuantizationInfo(1.f / 32768.f, 0), QuantizationInfo(5.f / 32768.f, 0) })),
218 framework::dataset::make("Src1QInfo", { QuantizationInfo(2.f / 32768.f, 0), QuantizationInfo(5.f / 32768.f, 0) })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100219 framework::dataset::make("OutQInfo", { QuantizationInfo(5.f / 32768.f, 0) })),
220 OutOfPlaceDataSet))
Michele Di Giorgio6997fc92019-06-18 10:23:22 +0100221{
222 // Validate output
223 validate(CLAccessor(_target), _reference);
224}
225TEST_SUITE_END() // QSYMM16
226TEST_SUITE_END() // Quantized
Isabella Gottardib5908c22017-10-30 15:28:13 +0000227
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000228template <typename T>
229using CLArithmeticSubtractionFloatFixture = ArithmeticSubtractionValidationFloatFixture<CLTensor, CLAccessor, CLArithmeticSubtraction, T>;
230
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100231TEST_SUITE(Float)
232TEST_SUITE(FP16)
Georgios Pinitasda816752021-07-02 09:22:14 +0100233FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionFloatFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallShapes(), framework::dataset::make("DataType",
234 DataType::F16)),
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000235 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100236 EmptyActivationFunctionsDataset),
237 OutOfPlaceDataSet))
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000238{
239 // Validate output
240 validate(CLAccessor(_target), _reference);
241}
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100242FIXTURE_DATA_TEST_CASE(RunWithActivation, CLArithmeticSubtractionFloatFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::TinyShapes(),
Georgios Pinitasda816752021-07-02 09:22:14 +0100243 framework::dataset::make("DataType", DataType::F16)),
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000244 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100245 ActivationFunctionsDataset),
246 InPlaceDataSet))
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100247{
248 // Validate output
249 validate(CLAccessor(_target), _reference);
250}
Michele Di Giorgio6997fc92019-06-18 10:23:22 +0100251TEST_SUITE_END() // FP16
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100252
253TEST_SUITE(FP32)
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100254FIXTURE_DATA_TEST_CASE(RunSmall, CLArithmeticSubtractionFloatFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallShapes(),
Georgios Pinitasda816752021-07-02 09:22:14 +0100255 framework::dataset::make("DataType", DataType::F32)),
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000256 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100257 EmptyActivationFunctionsDataset),
258 OutOfPlaceDataSet))
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000259{
260 // Validate output
261 validate(CLAccessor(_target), _reference);
262}
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100263FIXTURE_DATA_TEST_CASE(RunWithActivation, CLArithmeticSubtractionFloatFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::TinyShapes(),
Georgios Pinitasda816752021-07-02 09:22:14 +0100264 framework::dataset::make("DataType", DataType::F32)),
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000265 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100266 ActivationFunctionsDataset),
267 InPlaceDataSet))
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100268{
269 // Validate output
270 validate(CLAccessor(_target), _reference);
271}
272
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100273FIXTURE_DATA_TEST_CASE(RunLarge, CLArithmeticSubtractionFloatFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeShapes(),
Georgios Pinitasda816752021-07-02 09:22:14 +0100274 framework::dataset::make("DataType", DataType::F32)),
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000275 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100276 EmptyActivationFunctionsDataset),
277 OutOfPlaceDataSet))
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100278{
279 // Validate output
280 validate(CLAccessor(_target), _reference);
281}
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100282
Georgios Pinitascbf39c62018-09-10 15:07:45 +0100283template <typename T>
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000284using CLArithmeticSubtractionBroadcastFloatFixture = ArithmeticSubtractionBroadcastValidationFloatFixture<CLTensor, CLAccessor, CLArithmeticSubtraction, T>;
Georgios Pinitascbf39c62018-09-10 15:07:45 +0100285
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100286FIXTURE_DATA_TEST_CASE(RunSmallBroadcast, CLArithmeticSubtractionBroadcastFloatFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallShapesBroadcast(),
Georgios Pinitasda816752021-07-02 09:22:14 +0100287 framework::dataset::make("DataType", DataType::F32)),
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000288 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100289 EmptyActivationFunctionsDataset),
290 OutOfPlaceDataSet))
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000291{
292 // Validate output
293 validate(CLAccessor(_target), _reference);
294}
Sheri Zhanga387e272021-06-29 17:34:06 +0100295FIXTURE_DATA_TEST_CASE(RunTinyBroadcastInplace, CLArithmeticSubtractionBroadcastFloatFixture<float>, framework::DatasetMode::PRECOMMIT,
296 combine(combine(combine(combine(datasets::TinyShapesBroadcastInplace(),
297 framework::dataset::make("DataType", DataType::F32)),
298 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
299 EmptyActivationFunctionsDataset),
300 InPlaceDataSet))
301{
302 // Validate output
303 validate(CLAccessor(_target), _reference);
304}
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100305FIXTURE_DATA_TEST_CASE(RunWithActivationBroadcast, CLArithmeticSubtractionBroadcastFloatFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::TinyShapesBroadcast(),
Georgios Pinitasda816752021-07-02 09:22:14 +0100306 framework::dataset::make("DataType", DataType::F32)),
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000307 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100308 ActivationFunctionsDataset),
309 OutOfPlaceDataSet))
Georgios Pinitascbf39c62018-09-10 15:07:45 +0100310{
311 // Validate output
312 validate(CLAccessor(_target), _reference);
313}
314
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100315FIXTURE_DATA_TEST_CASE(RunLargeBroadcast, CLArithmeticSubtractionBroadcastFloatFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeShapesBroadcast(),
Georgios Pinitasda816752021-07-02 09:22:14 +0100316 framework::dataset::make("DataType", DataType::F32)),
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000317 framework::dataset::make("ConvertPolicy", { ConvertPolicy::SATURATE, ConvertPolicy::WRAP })),
Georgios Pinitasb2842be2020-06-22 21:27:14 +0100318 EmptyActivationFunctionsDataset),
319 OutOfPlaceDataSet))
Georgios Pinitascbf39c62018-09-10 15:07:45 +0100320{
321 // Validate output
322 validate(CLAccessor(_target), _reference);
323}
Michele Di Giorgio6997fc92019-06-18 10:23:22 +0100324TEST_SUITE_END() // FP32
325TEST_SUITE_END() // Float
Georgios Pinitascbf39c62018-09-10 15:07:45 +0100326
Michele Di Giorgio6997fc92019-06-18 10:23:22 +0100327TEST_SUITE_END() // ArithmeticSubtraction
328TEST_SUITE_END() // CL
Sanghoon Lee72898fe2017-09-01 11:42:16 +0100329} // namespace validation
330} // namespace test
giuros01164a2722018-11-20 18:34:46 +0000331} // namespace arm_compute