blob: f36a1f75b7bfe2839af4534252c660f06e79ad57 [file] [log] [blame]
giuros01164a2722018-11-20 18:34:46 +00001/*
Matthew Bentham945b8da2023-07-12 11:54:59 +00002 * Copyright (c) 2018-2021, 2023 Arm Limited.
giuros01164a2722018-11-20 18:34:46 +00003 *
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 */
Anitha Raj449af402023-11-01 13:22:50 +000024#ifndef ACL_TESTS_VALIDATION_FIXTURES_ELEMENTWISEOPERATIONSFIXTURE_H
25#define ACL_TESTS_VALIDATION_FIXTURES_ELEMENTWISEOPERATIONSFIXTURE_H
giuros01164a2722018-11-20 18:34:46 +000026
27#include "arm_compute/core/TensorShape.h"
28#include "arm_compute/core/Types.h"
Sheri Zhang1d359272021-06-10 13:56:11 +010029#include "arm_compute/core/Validate.h"
giuros01164a2722018-11-20 18:34:46 +000030#include "tests/AssetsLibrary.h"
31#include "tests/Globals.h"
32#include "tests/IAccessor.h"
33#include "tests/framework/Asserts.h"
34#include "tests/framework/Fixture.h"
35#include "tests/validation/Helpers.h"
Giorgio Arena8b2a7d32020-02-11 17:21:31 +000036#include "tests/validation/reference/ActivationLayer.h"
giuros01164a2722018-11-20 18:34:46 +000037#include "tests/validation/reference/ElementwiseOperations.h"
38
39namespace arm_compute
40{
41namespace test
42{
43namespace validation
44{
45template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
46class ArithmeticOperationsGenericFixture : public framework::Fixture
47{
48public:
giuros01164a2722018-11-20 18:34:46 +000049 void setup(ArithmeticOperation op, const TensorShape &shape0, const TensorShape &shape1,
50 DataType data_type0, DataType data_type1, DataType output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +010051 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out, bool is_inplace = false, bool use_dynamic_shape = false)
giuros01164a2722018-11-20 18:34:46 +000052 {
Sang-Hoon Park668ccdc2021-02-03 10:32:59 +000053 _op = op;
Sheri Zhang1d359272021-06-10 13:56:11 +010054 _use_dynamic_shape = use_dynamic_shape;
Sheri Zhanga387e272021-06-29 17:34:06 +010055 _is_inplace = is_inplace;
Sang-Hoon Park668ccdc2021-02-03 10:32:59 +000056
Sheri Zhanga387e272021-06-29 17:34:06 +010057 _target = compute_target(shape0, shape1, data_type0, data_type1, output_data_type, qinfo0, qinfo1, qinfo_out);
giuros01164a2722018-11-20 18:34:46 +000058 _reference = compute_reference(shape0, shape1, data_type0, data_type1, output_data_type, qinfo0, qinfo1, qinfo_out);
59 }
60
61protected:
62 template <typename U>
63 void fill(U &&tensor, int i)
64 {
Georgios Pinitas18134222020-09-03 21:00:23 +010065 if(is_data_type_float(tensor.data_type()))
Usama Arif81e671e2019-05-13 13:33:14 +010066 {
Georgios Pinitas18134222020-09-03 21:00:23 +010067 switch(_op)
68 {
69 case ArithmeticOperation::DIV:
70 library->fill_tensor_uniform_ranged(tensor, i, { std::pair<float, float>(-0.001f, 0.001f) });
71 break;
72 case ArithmeticOperation::POWER:
73 library->fill_tensor_uniform(tensor, i, 0.0f, 5.0f);
74 break;
75 default:
76 library->fill_tensor_uniform(tensor, i);
77 }
78 }
79 else
80 {
81 library->fill_tensor_uniform(tensor, i);
Usama Arif81e671e2019-05-13 13:33:14 +010082 }
giuros01164a2722018-11-20 18:34:46 +000083 }
84
85 TensorType compute_target(const TensorShape &shape0, const TensorShape &shape1, DataType data_type0, DataType data_type1, DataType output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +010086 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out)
giuros01164a2722018-11-20 18:34:46 +000087 {
88 // Create tensors
Sheri Zhang1d359272021-06-10 13:56:11 +010089 const TensorShape out_shape = TensorShape::broadcast_shape(shape0, shape1);
90 TensorType ref_src1 = create_tensor<TensorType>(shape0, data_type0, 1, qinfo0);
91 TensorType ref_src2 = create_tensor<TensorType>(shape1, data_type1, 1, qinfo1);
92 TensorType dst = create_tensor<TensorType>(out_shape, output_data_type, 1, qinfo_out);
93
94 // Check whether do in-place computation and whether inputs are broadcast compatible
Sheri Zhanga387e272021-06-29 17:34:06 +010095 TensorType *actual_dst = &dst;
96 if(_is_inplace)
Sheri Zhang1d359272021-06-10 13:56:11 +010097 {
Sheri Zhanga387e272021-06-29 17:34:06 +010098 bool src1_is_inplace = !arm_compute::detail::have_different_dimensions(out_shape, shape0, 0) && (qinfo0 == qinfo_out) && (data_type0 == output_data_type);
99 bool src2_is_inplace = !arm_compute::detail::have_different_dimensions(out_shape, shape1, 0) && (qinfo1 == qinfo_out) && (data_type1 == output_data_type);
100 bool do_in_place = out_shape.total_size() != 0 && (src1_is_inplace || src2_is_inplace);
101 ARM_COMPUTE_ASSERT(do_in_place);
102
103 if(src1_is_inplace)
Sheri Zhang1d359272021-06-10 13:56:11 +0100104 {
105 actual_dst = &ref_src1;
106 }
Sheri Zhanga387e272021-06-29 17:34:06 +0100107 else
Sheri Zhang1d359272021-06-10 13:56:11 +0100108 {
109 actual_dst = &ref_src2;
110 }
111 }
giuros01164a2722018-11-20 18:34:46 +0000112
Sang-Hoon Park668ccdc2021-02-03 10:32:59 +0000113 // if _use_dynamic_shape is true, this fixture will test scenario for dynamic shapes.
114 // - At configure time, all input tensors are marked as dynamic using set_tensor_dynamic()
115 // - After configure, tensors are marked as static for run using set_tensor_static()
116 // - The tensors with static shape are given to run()
117 if(_use_dynamic_shape)
118 {
119 set_tensor_dynamic(ref_src1);
120 set_tensor_dynamic(ref_src2);
121 }
122
giuros01164a2722018-11-20 18:34:46 +0000123 // Create and configure function
124 FunctionType elem_op;
Sheri Zhang1d359272021-06-10 13:56:11 +0100125 elem_op.configure(&ref_src1, &ref_src2, actual_dst);
giuros01164a2722018-11-20 18:34:46 +0000126
Sang-Hoon Park668ccdc2021-02-03 10:32:59 +0000127 if(_use_dynamic_shape)
128 {
129 set_tensor_static(ref_src1);
130 set_tensor_static(ref_src2);
131 }
132
Michele Di Giorgio4fc10b32021-04-30 18:30:41 +0100133 ARM_COMPUTE_ASSERT(ref_src1.info()->is_resizable());
134 ARM_COMPUTE_ASSERT(ref_src2.info()->is_resizable());
giuros01164a2722018-11-20 18:34:46 +0000135
136 // Allocate tensors
137 ref_src1.allocator()->allocate();
138 ref_src2.allocator()->allocate();
Sheri Zhang1d359272021-06-10 13:56:11 +0100139
Sheri Zhanga387e272021-06-29 17:34:06 +0100140 // If don't do in-place computation, still need to allocate original dst
141 if(!_is_inplace)
Sheri Zhang1d359272021-06-10 13:56:11 +0100142 {
143 ARM_COMPUTE_ASSERT(dst.info()->is_resizable());
144 dst.allocator()->allocate();
145 ARM_COMPUTE_ASSERT(!dst.info()->is_resizable());
146 }
giuros01164a2722018-11-20 18:34:46 +0000147
Michele Di Giorgio4fc10b32021-04-30 18:30:41 +0100148 ARM_COMPUTE_ASSERT(!ref_src1.info()->is_resizable());
149 ARM_COMPUTE_ASSERT(!ref_src2.info()->is_resizable());
giuros01164a2722018-11-20 18:34:46 +0000150
151 // Fill tensors
152 fill(AccessorType(ref_src1), 0);
153 fill(AccessorType(ref_src2), 1);
154
155 // Compute function
156 elem_op.run();
157
Sheri Zhang1d359272021-06-10 13:56:11 +0100158 return std::move(*actual_dst);
giuros01164a2722018-11-20 18:34:46 +0000159 }
160
161 SimpleTensor<T> compute_reference(const TensorShape &shape0, const TensorShape &shape1,
162 DataType data_type0, DataType data_type1, DataType output_data_type,
163 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out)
164 {
165 // Create reference
166 SimpleTensor<T> ref_src1{ shape0, data_type0, 1, qinfo0 };
167 SimpleTensor<T> ref_src2{ shape1, data_type1, 1, qinfo1 };
168 SimpleTensor<T> ref_dst{ TensorShape::broadcast_shape(shape0, shape1), output_data_type, 1, qinfo_out };
169
170 // Fill reference
171 fill(ref_src1, 0);
172 fill(ref_src2, 1);
173
174 return reference::arithmetic_operation<T>(_op, ref_src1, ref_src2, ref_dst);
175 }
176
177 TensorType _target{};
178 SimpleTensor<T> _reference{};
179 ArithmeticOperation _op{ ArithmeticOperation::ADD };
Sang-Hoon Park668ccdc2021-02-03 10:32:59 +0000180 bool _use_dynamic_shape{ false };
Sheri Zhanga387e272021-06-29 17:34:06 +0100181 bool _is_inplace{ false };
giuros01164a2722018-11-20 18:34:46 +0000182};
183
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000184// Arithmetic operation fused with activation function
185template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
186class ArithmeticOperationsFuseActivationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
187{
188public:
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000189 void setup(ArithmeticOperation op, const TensorShape &shape0, const TensorShape &shape1,
190 DataType data_type0, DataType data_type1, DataType output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100191 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out, ActivationLayerInfo act_info, bool is_inplace = true)
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000192 {
193 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(op, shape0, shape1,
194 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100195 qinfo0, qinfo1, qinfo_out, is_inplace);
196 _act_info = act_info;
197 _is_inplace = is_inplace;
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000198 }
199
200protected:
201 TensorType compute_target(const TensorShape &shape0, const TensorShape &shape1, DataType data_type0, DataType data_type1, DataType output_data_type,
202 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out)
203 {
204 // Create tensors
Sheri Zhanga387e272021-06-29 17:34:06 +0100205 const TensorShape out_shape = TensorShape::broadcast_shape(shape0, shape1);
206 TensorType ref_src1 = create_tensor<TensorType>(shape0, data_type0, 1, qinfo0);
207 TensorType ref_src2 = create_tensor<TensorType>(shape1, data_type1, 1, qinfo1);
208 TensorType dst = create_tensor<TensorType>(out_shape, output_data_type, 1, qinfo_out);
209
210 // Check whether do in-place computation and whether inputs are broadcast compatible
211 TensorType *actual_dst = &dst;
212 if(_is_inplace)
213 {
214 bool src1_is_inplace = !arm_compute::detail::have_different_dimensions(out_shape, shape0, 0) && (qinfo0 == qinfo_out) && (data_type0 == output_data_type);
215 bool src2_is_inplace = !arm_compute::detail::have_different_dimensions(out_shape, shape1, 0) && (qinfo1 == qinfo_out) && (data_type1 == output_data_type);
216 bool do_in_place = out_shape.total_size() != 0 && (src1_is_inplace || src2_is_inplace);
217 ARM_COMPUTE_ASSERT(do_in_place);
218
219 if(src1_is_inplace)
220 {
221 actual_dst = &ref_src1;
222 }
223 else
224 {
225 actual_dst = &ref_src2;
226 }
227 }
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000228
229 // Create and configure function
230 FunctionType elem_op;
Sheri Zhanga387e272021-06-29 17:34:06 +0100231 elem_op.configure(&ref_src1, &ref_src2, actual_dst, _act_info);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000232
Michele Di Giorgio4fc10b32021-04-30 18:30:41 +0100233 ARM_COMPUTE_ASSERT(ref_src1.info()->is_resizable());
234 ARM_COMPUTE_ASSERT(ref_src2.info()->is_resizable());
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000235
236 // Allocate tensors
237 ref_src1.allocator()->allocate();
238 ref_src2.allocator()->allocate();
Sheri Zhanga387e272021-06-29 17:34:06 +0100239
240 // If don't do in-place computation, still need to allocate original dst
241 if(!_is_inplace)
242 {
243 ARM_COMPUTE_ASSERT(dst.info()->is_resizable());
244 dst.allocator()->allocate();
245 ARM_COMPUTE_ASSERT(!dst.info()->is_resizable());
246 }
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000247
Michele Di Giorgio4fc10b32021-04-30 18:30:41 +0100248 ARM_COMPUTE_ASSERT(!ref_src1.info()->is_resizable());
249 ARM_COMPUTE_ASSERT(!ref_src2.info()->is_resizable());
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000250
251 // Fill tensors
252 fill(AccessorType(ref_src1), 0);
253 fill(AccessorType(ref_src2), 1);
254
255 // Compute function
256 elem_op.run();
257
Sheri Zhanga387e272021-06-29 17:34:06 +0100258 return std::move(*actual_dst);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000259 }
260
261 SimpleTensor<T> compute_reference(const TensorShape &shape0, const TensorShape &shape1,
262 DataType data_type0, DataType data_type1, DataType output_data_type,
263 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out)
264 {
265 auto result = ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::compute_reference(shape0, shape1, data_type0,
266 data_type1, output_data_type, qinfo0, qinfo1, qinfo_out);
267 return _act_info.enabled() ? reference::activation_layer(result, _act_info, qinfo_out) : result;
268 }
269
270 ActivationLayerInfo _act_info{};
Sheri Zhanga387e272021-06-29 17:34:06 +0100271 bool _is_inplace{ false };
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000272};
273
giuros01164a2722018-11-20 18:34:46 +0000274template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
275class ArithmeticDivisionBroadcastValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
276{
277public:
Sheri Zhanga387e272021-06-29 17:34:06 +0100278 void setup(const TensorShape &shape0, const TensorShape &shape1, DataType data_type0, DataType data_type1, DataType output_data_type, bool is_inplace)
giuros01164a2722018-11-20 18:34:46 +0000279 {
280 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::DIV, shape0, shape1,
281 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100282 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000283 }
284};
285
286template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
287class ArithmeticDivisionValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
288{
289public:
Sheri Zhanga387e272021-06-29 17:34:06 +0100290 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type, bool is_inplace)
giuros01164a2722018-11-20 18:34:46 +0000291 {
292 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::DIV, shape, shape,
293 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100294 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000295 }
296};
297
298template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
Sang-Hoon Park668ccdc2021-02-03 10:32:59 +0000299class ArithmeticDivisionBroadcastDynamicShapeValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
300{
301public:
Sheri Zhanga387e272021-06-29 17:34:06 +0100302 void setup(const TensorShape &shape0, const TensorShape &shape1, DataType data_type0, DataType data_type1, DataType output_data_type, bool is_inplace)
Sang-Hoon Park668ccdc2021-02-03 10:32:59 +0000303 {
304 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::DIV, shape0, shape1,
305 data_type0, data_type1, output_data_type,
Anitha Raj449af402023-11-01 13:22:50 +0000306 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), is_inplace, true /* use_dynamic_shape */);
Sang-Hoon Park668ccdc2021-02-03 10:32:59 +0000307 }
308};
309
310template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
311class ArithmeticDivisionDynamicShapeValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
312{
313public:
Sheri Zhanga387e272021-06-29 17:34:06 +0100314 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type, bool is_inplace)
Sang-Hoon Park668ccdc2021-02-03 10:32:59 +0000315 {
316 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::DIV, shape, shape,
317 data_type0, data_type1, output_data_type,
Anitha Raj449af402023-11-01 13:22:50 +0000318 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), is_inplace, true /* use_dynamic_shape */);
Sang-Hoon Park668ccdc2021-02-03 10:32:59 +0000319 }
320};
321
322template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000323class ArithmeticDivisionBroadcastValidationFloatFixture : public ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>
324{
325public:
Sheri Zhanga387e272021-06-29 17:34:06 +0100326 void setup(const TensorShape &shape0, const TensorShape &shape1, DataType data_type0, DataType data_type1, DataType output_data_type, ActivationLayerInfo act_info, bool is_inplace)
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000327 {
328 ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::DIV, shape0, shape1,
329 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100330 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), act_info, is_inplace);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000331 }
332};
333
334template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
335class ArithmeticDivisionValidationFloatFixture : public ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>
336{
337public:
Sheri Zhanga387e272021-06-29 17:34:06 +0100338 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type, ActivationLayerInfo act_info, bool is_inplace)
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000339 {
340 ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::DIV, shape, shape,
341 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100342 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), act_info, is_inplace);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000343 }
344};
345
346template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
Suhail Munshiae1c9fe2021-04-14 12:16:49 +0100347class ArithmeticDivisionValidationIntegerFixture : public ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>
348{
349public:
Sheri Zhanga387e272021-06-29 17:34:06 +0100350 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type, ActivationLayerInfo act_info, bool is_inplace)
Suhail Munshiae1c9fe2021-04-14 12:16:49 +0100351 {
352 ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::DIV, shape, shape,
353 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100354 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), act_info, is_inplace);
Suhail Munshiae1c9fe2021-04-14 12:16:49 +0100355 }
356};
357
358template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
giuros01164a2722018-11-20 18:34:46 +0000359class ArithmeticDivisionValidationQuantizedFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
360{
361public:
giuros01164a2722018-11-20 18:34:46 +0000362 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100363 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out, bool is_inplace)
giuros01164a2722018-11-20 18:34:46 +0000364
365 {
366 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::DIV, shape, shape,
367 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100368 qinfo0, qinfo1, qinfo_out, is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000369 }
370};
371
372template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
373class ElementwiseMaxBroadcastValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
374{
375public:
Sheri Zhanga387e272021-06-29 17:34:06 +0100376 void setup(const TensorShape &shape0, const TensorShape &shape1, DataType data_type0, DataType data_type1, DataType output_data_type, bool is_inplace)
giuros01164a2722018-11-20 18:34:46 +0000377 {
378 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::MAX, shape0, shape1,
379 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100380 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000381 }
382};
383
384template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
385class ElementwiseMaxValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
386{
387public:
Sheri Zhanga387e272021-06-29 17:34:06 +0100388 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type, bool is_inplace)
giuros01164a2722018-11-20 18:34:46 +0000389 {
390 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::MAX, shape, shape,
391 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100392 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000393 }
394};
395
396template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000397class ElementwiseMaxBroadcastValidationFloatFixture : public ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>
398{
399public:
Sheri Zhanga387e272021-06-29 17:34:06 +0100400 void setup(const TensorShape &shape0, const TensorShape &shape1, DataType data_type0, DataType data_type1, DataType output_data_type, ActivationLayerInfo act_info, bool is_inplace)
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000401 {
402 ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::MAX, shape0, shape1,
403 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100404 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), act_info, is_inplace);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000405 }
406};
407
408template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
409class ElementwiseMaxValidationFloatFixture : public ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>
410{
411public:
Sheri Zhanga387e272021-06-29 17:34:06 +0100412 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type, ActivationLayerInfo act_info, bool is_inplace)
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000413 {
414 ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::MAX, shape, shape,
415 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100416 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), act_info, is_inplace);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000417 }
418};
419
420template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
giuros01164a2722018-11-20 18:34:46 +0000421class ElementwiseMaxValidationQuantizedFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
422{
423public:
giuros01164a2722018-11-20 18:34:46 +0000424 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100425 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out, bool is_inplace)
giuros01164a2722018-11-20 18:34:46 +0000426
427 {
428 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::MAX, shape, shape,
429 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100430 qinfo0, qinfo1, qinfo_out, is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000431 }
432};
433
434template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
giuros0192fd9432018-12-03 17:30:00 +0000435class ElementwiseMaxQuantizedBroadcastValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
436{
437public:
giuros0192fd9432018-12-03 17:30:00 +0000438 void setup(const TensorShape &shape0, const TensorShape &shape1, DataType data_type0, DataType data_type1, DataType output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100439 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out, bool is_inplace)
giuros0192fd9432018-12-03 17:30:00 +0000440
441 {
442 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::MAX, shape0, shape1,
443 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100444 qinfo0, qinfo1, qinfo_out, is_inplace);
giuros0192fd9432018-12-03 17:30:00 +0000445 }
446};
447
448template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
giuros01164a2722018-11-20 18:34:46 +0000449class ElementwiseMinBroadcastValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
450{
451public:
Sheri Zhanga387e272021-06-29 17:34:06 +0100452 void setup(const TensorShape &shape0, const TensorShape &shape1, DataType data_type0, DataType data_type1, DataType output_data_type, bool is_inplace)
giuros01164a2722018-11-20 18:34:46 +0000453 {
454 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::MIN, shape0, shape1,
455 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100456 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000457 }
458};
459
460template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
461class ElementwiseMinValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
462{
463public:
Sheri Zhanga387e272021-06-29 17:34:06 +0100464 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type, bool is_inplace)
giuros01164a2722018-11-20 18:34:46 +0000465 {
466 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::MIN, shape, shape,
467 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100468 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000469 }
470};
471
472template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000473class ElementwiseMinBroadcastValidationFloatFixture : public ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>
474{
475public:
Sheri Zhanga387e272021-06-29 17:34:06 +0100476 void setup(const TensorShape &shape0, const TensorShape &shape1, DataType data_type0, DataType data_type1, DataType output_data_type, ActivationLayerInfo act_info, bool is_inplace)
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000477 {
478 ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::MIN, shape0, shape1,
479 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100480 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), act_info, is_inplace);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000481 }
482};
483
484template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
485class ElementwiseMinValidationFloatFixture : public ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>
486{
487public:
Sheri Zhanga387e272021-06-29 17:34:06 +0100488 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type, ActivationLayerInfo act_info, bool is_inplace)
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000489 {
490 ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::MIN, shape, shape,
491 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100492 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), act_info, is_inplace);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000493 }
494};
495
496template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
giuros01164a2722018-11-20 18:34:46 +0000497class ElementwiseMinValidationQuantizedFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
498{
499public:
giuros01164a2722018-11-20 18:34:46 +0000500 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100501 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out, bool is_inplace)
giuros01164a2722018-11-20 18:34:46 +0000502
503 {
504 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::MIN, shape, shape,
505 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100506 qinfo0, qinfo1, qinfo_out, is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000507 }
508};
509
510template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
giuros0192fd9432018-12-03 17:30:00 +0000511class ElementwiseMinQuantizedBroadcastValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
512{
513public:
giuros0192fd9432018-12-03 17:30:00 +0000514 void setup(const TensorShape &shape0, const TensorShape &shape1, DataType data_type0, DataType data_type1, DataType output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100515 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out, bool is_inplace)
giuros0192fd9432018-12-03 17:30:00 +0000516
517 {
518 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::MIN, shape0, shape1,
519 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100520 qinfo0, qinfo1, qinfo_out, is_inplace);
giuros0192fd9432018-12-03 17:30:00 +0000521 }
522};
523
524template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
giuros01164a2722018-11-20 18:34:46 +0000525class ElementwiseSquaredDiffBroadcastValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
526{
527public:
Sheri Zhanga387e272021-06-29 17:34:06 +0100528 void setup(const TensorShape &shape0, const TensorShape &shape1, DataType data_type0, DataType data_type1, DataType output_data_type, bool is_inplace)
giuros01164a2722018-11-20 18:34:46 +0000529 {
530 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::SQUARED_DIFF, shape0, shape1,
531 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100532 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000533 }
534};
535
536template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
537class ElementwiseSquaredDiffValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
538{
539public:
Sheri Zhanga387e272021-06-29 17:34:06 +0100540 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type, bool is_inplace)
giuros01164a2722018-11-20 18:34:46 +0000541 {
542 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::SQUARED_DIFF, shape, shape,
543 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100544 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000545 }
546};
547
548template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000549class ElementwiseSquaredDiffBroadcastValidationFloatFixture : public ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>
550{
551public:
Sheri Zhanga387e272021-06-29 17:34:06 +0100552 void setup(const TensorShape &shape0, const TensorShape &shape1, DataType data_type0, DataType data_type1, DataType output_data_type, ActivationLayerInfo act_info, bool is_inplace)
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000553 {
554 ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::SQUARED_DIFF, shape0, shape1,
555 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100556 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), act_info, is_inplace);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000557 }
558};
559
560template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
561class ElementwiseSquaredDiffValidationFloatFixture : public ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>
562{
563public:
Sheri Zhanga387e272021-06-29 17:34:06 +0100564 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type, ActivationLayerInfo act_info, bool is_inplace)
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000565 {
566 ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::SQUARED_DIFF, shape, shape,
567 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100568 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), act_info, is_inplace);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000569 }
570};
571
572template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
giuros01164a2722018-11-20 18:34:46 +0000573class ElementwiseSquaredDiffValidationQuantizedFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
574{
575public:
giuros01164a2722018-11-20 18:34:46 +0000576 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100577 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out, bool is_inplace)
giuros01164a2722018-11-20 18:34:46 +0000578
579 {
580 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::SQUARED_DIFF, shape, shape,
581 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100582 qinfo0, qinfo1, qinfo_out, is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000583 }
584};
giuros0192fd9432018-12-03 17:30:00 +0000585
586template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
587class ElementwiseSquaredDiffQuantizedBroadcastValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
588{
589public:
giuros0192fd9432018-12-03 17:30:00 +0000590 void setup(const TensorShape &shape0, const TensorShape &shape1, DataType data_type0, DataType data_type1, DataType output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100591 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out, bool is_inplace)
giuros0192fd9432018-12-03 17:30:00 +0000592
593 {
594 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::SQUARED_DIFF, shape0, shape1,
595 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100596 qinfo0, qinfo1, qinfo_out, is_inplace);
giuros0192fd9432018-12-03 17:30:00 +0000597 }
598};
George Worta1e7e282019-01-15 11:00:29 +0000599
600template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
giuros011e6e1b82019-05-14 16:12:53 +0100601class PReluLayerBroadcastValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
602{
603public:
giuros011e6e1b82019-05-14 16:12:53 +0100604 void setup(const TensorShape &shape0, const TensorShape &shape1, DataType data_type0, DataType data_type1, DataType output_data_type)
605 {
606 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::PRELU, shape0, shape1,
607 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100608 QuantizationInfo(), QuantizationInfo(), QuantizationInfo());
giuros011e6e1b82019-05-14 16:12:53 +0100609 }
610};
611
612template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
613class PReluLayerValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
614{
615public:
giuros011e6e1b82019-05-14 16:12:53 +0100616 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type)
617 {
618 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::PRELU, shape, shape,
619 data_type0, data_type1, output_data_type,
620 QuantizationInfo(), QuantizationInfo(), QuantizationInfo());
621 }
622};
623
624template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
625class PReluLayerValidationQuantizedFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
626{
627public:
giuros011e6e1b82019-05-14 16:12:53 +0100628 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type,
629 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out)
630
631 {
632 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::PRELU, shape, shape,
633 data_type0, data_type1, output_data_type,
634 qinfo0, qinfo1, qinfo_out);
635 }
636};
637
638template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
639class PReluLayerQuantizedBroadcastValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
640{
641public:
giuros011e6e1b82019-05-14 16:12:53 +0100642 void setup(const TensorShape &shape0, const TensorShape &shape1, DataType data_type0, DataType data_type1, DataType output_data_type,
643 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out)
644
645 {
646 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::PRELU, shape0, shape1,
647 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100648 qinfo0, qinfo1, qinfo_out);
giuros011e6e1b82019-05-14 16:12:53 +0100649 }
650};
651
652template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
Usama Arif81e671e2019-05-13 13:33:14 +0100653class ElementwisePowerBroadcastValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
654{
655public:
Sheri Zhanga387e272021-06-29 17:34:06 +0100656 void setup(const TensorShape &shape0, const TensorShape &shape1, DataType data_type0, DataType data_type1, DataType output_data_type, bool is_inplace)
Usama Arif81e671e2019-05-13 13:33:14 +0100657 {
658 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::POWER, shape0, shape1,
659 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100660 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), is_inplace);
Usama Arif81e671e2019-05-13 13:33:14 +0100661 }
662};
663
664template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
665class ElementwisePowerValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
666{
667public:
Sheri Zhanga387e272021-06-29 17:34:06 +0100668 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type, bool is_inplace)
Usama Arif81e671e2019-05-13 13:33:14 +0100669 {
670 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::POWER, shape, shape,
671 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100672 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), is_inplace);
Usama Arif81e671e2019-05-13 13:33:14 +0100673 }
674};
675
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000676template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
677class ElementwisePowerBroadcastValidationFloatFixture : public ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>
678{
679public:
Sheri Zhanga387e272021-06-29 17:34:06 +0100680 void setup(const TensorShape &shape0, const TensorShape &shape1, DataType data_type0, DataType data_type1, DataType output_data_type, ActivationLayerInfo act_info, bool is_inplace)
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000681 {
682 ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::POWER, shape0, shape1,
683 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100684 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), act_info, is_inplace);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000685 }
686};
687
688template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
689class ElementwisePowerValidationFloatFixture : public ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>
690{
691public:
Sheri Zhanga387e272021-06-29 17:34:06 +0100692 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type, ActivationLayerInfo act_info, bool is_inplace)
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000693 {
694 ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::POWER, shape, shape,
695 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100696 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), act_info, is_inplace);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000697 }
698};
699
giuros01164a2722018-11-20 18:34:46 +0000700} // namespace validation
701} // namespace test
702} // namespace arm_compute
Anitha Raj449af402023-11-01 13:22:50 +0000703#endif // ACL_TESTS_VALIDATION_FIXTURES_ELEMENTWISEOPERATIONSFIXTURE_H