blob: 6f31a730ae288a7534e6a9099902f6f90697c2e5 [file] [log] [blame]
giuros01164a2722018-11-20 18:34:46 +00001/*
Sang-Hoon Park668ccdc2021-02-03 10:32:59 +00002 * Copyright (c) 2018-2021 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 */
24#ifndef ARM_COMPUTE_TEST_ELEMENTWISE_OPERATIONS_FIXTURE
25#define ARM_COMPUTE_TEST_ELEMENTWISE_OPERATIONS_FIXTURE
26
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:
49 template <typename...>
50 void setup(ArithmeticOperation op, const TensorShape &shape0, const TensorShape &shape1,
51 DataType data_type0, DataType data_type1, DataType output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +010052 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out, bool is_inplace = false, bool use_dynamic_shape = false)
giuros01164a2722018-11-20 18:34:46 +000053 {
Sang-Hoon Park668ccdc2021-02-03 10:32:59 +000054 _op = op;
Sheri Zhang1d359272021-06-10 13:56:11 +010055 _use_dynamic_shape = use_dynamic_shape;
Sheri Zhanga387e272021-06-29 17:34:06 +010056 _is_inplace = is_inplace;
Sang-Hoon Park668ccdc2021-02-03 10:32:59 +000057
Sheri Zhanga387e272021-06-29 17:34:06 +010058 _target = compute_target(shape0, shape1, data_type0, data_type1, output_data_type, qinfo0, qinfo1, qinfo_out);
giuros01164a2722018-11-20 18:34:46 +000059 _reference = compute_reference(shape0, shape1, data_type0, data_type1, output_data_type, qinfo0, qinfo1, qinfo_out);
60 }
61
62protected:
63 template <typename U>
64 void fill(U &&tensor, int i)
65 {
Georgios Pinitas18134222020-09-03 21:00:23 +010066 if(is_data_type_float(tensor.data_type()))
Usama Arif81e671e2019-05-13 13:33:14 +010067 {
Georgios Pinitas18134222020-09-03 21:00:23 +010068 switch(_op)
69 {
70 case ArithmeticOperation::DIV:
71 library->fill_tensor_uniform_ranged(tensor, i, { std::pair<float, float>(-0.001f, 0.001f) });
72 break;
73 case ArithmeticOperation::POWER:
74 library->fill_tensor_uniform(tensor, i, 0.0f, 5.0f);
75 break;
76 default:
77 library->fill_tensor_uniform(tensor, i);
78 }
79 }
80 else
81 {
82 library->fill_tensor_uniform(tensor, i);
Usama Arif81e671e2019-05-13 13:33:14 +010083 }
giuros01164a2722018-11-20 18:34:46 +000084 }
85
86 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 +010087 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out)
giuros01164a2722018-11-20 18:34:46 +000088 {
89 // Create tensors
Sheri Zhang1d359272021-06-10 13:56:11 +010090 const TensorShape out_shape = TensorShape::broadcast_shape(shape0, shape1);
91 TensorType ref_src1 = create_tensor<TensorType>(shape0, data_type0, 1, qinfo0);
92 TensorType ref_src2 = create_tensor<TensorType>(shape1, data_type1, 1, qinfo1);
93 TensorType dst = create_tensor<TensorType>(out_shape, output_data_type, 1, qinfo_out);
94
95 // Check whether do in-place computation and whether inputs are broadcast compatible
Sheri Zhanga387e272021-06-29 17:34:06 +010096 TensorType *actual_dst = &dst;
97 if(_is_inplace)
Sheri Zhang1d359272021-06-10 13:56:11 +010098 {
Sheri Zhanga387e272021-06-29 17:34:06 +010099 bool src1_is_inplace = !arm_compute::detail::have_different_dimensions(out_shape, shape0, 0) && (qinfo0 == qinfo_out) && (data_type0 == output_data_type);
100 bool src2_is_inplace = !arm_compute::detail::have_different_dimensions(out_shape, shape1, 0) && (qinfo1 == qinfo_out) && (data_type1 == output_data_type);
101 bool do_in_place = out_shape.total_size() != 0 && (src1_is_inplace || src2_is_inplace);
102 ARM_COMPUTE_ASSERT(do_in_place);
103
104 if(src1_is_inplace)
Sheri Zhang1d359272021-06-10 13:56:11 +0100105 {
106 actual_dst = &ref_src1;
107 }
Sheri Zhanga387e272021-06-29 17:34:06 +0100108 else
Sheri Zhang1d359272021-06-10 13:56:11 +0100109 {
110 actual_dst = &ref_src2;
111 }
112 }
giuros01164a2722018-11-20 18:34:46 +0000113
Sang-Hoon Park668ccdc2021-02-03 10:32:59 +0000114 // if _use_dynamic_shape is true, this fixture will test scenario for dynamic shapes.
115 // - At configure time, all input tensors are marked as dynamic using set_tensor_dynamic()
116 // - After configure, tensors are marked as static for run using set_tensor_static()
117 // - The tensors with static shape are given to run()
118 if(_use_dynamic_shape)
119 {
120 set_tensor_dynamic(ref_src1);
121 set_tensor_dynamic(ref_src2);
122 }
123
giuros01164a2722018-11-20 18:34:46 +0000124 // Create and configure function
125 FunctionType elem_op;
Sheri Zhang1d359272021-06-10 13:56:11 +0100126 elem_op.configure(&ref_src1, &ref_src2, actual_dst);
giuros01164a2722018-11-20 18:34:46 +0000127
Sang-Hoon Park668ccdc2021-02-03 10:32:59 +0000128 if(_use_dynamic_shape)
129 {
130 set_tensor_static(ref_src1);
131 set_tensor_static(ref_src2);
132 }
133
Michele Di Giorgio4fc10b32021-04-30 18:30:41 +0100134 ARM_COMPUTE_ASSERT(ref_src1.info()->is_resizable());
135 ARM_COMPUTE_ASSERT(ref_src2.info()->is_resizable());
giuros01164a2722018-11-20 18:34:46 +0000136
137 // Allocate tensors
138 ref_src1.allocator()->allocate();
139 ref_src2.allocator()->allocate();
Sheri Zhang1d359272021-06-10 13:56:11 +0100140
Sheri Zhanga387e272021-06-29 17:34:06 +0100141 // If don't do in-place computation, still need to allocate original dst
142 if(!_is_inplace)
Sheri Zhang1d359272021-06-10 13:56:11 +0100143 {
144 ARM_COMPUTE_ASSERT(dst.info()->is_resizable());
145 dst.allocator()->allocate();
146 ARM_COMPUTE_ASSERT(!dst.info()->is_resizable());
147 }
giuros01164a2722018-11-20 18:34:46 +0000148
Michele Di Giorgio4fc10b32021-04-30 18:30:41 +0100149 ARM_COMPUTE_ASSERT(!ref_src1.info()->is_resizable());
150 ARM_COMPUTE_ASSERT(!ref_src2.info()->is_resizable());
giuros01164a2722018-11-20 18:34:46 +0000151
152 // Fill tensors
153 fill(AccessorType(ref_src1), 0);
154 fill(AccessorType(ref_src2), 1);
155
156 // Compute function
157 elem_op.run();
158
Sheri Zhang1d359272021-06-10 13:56:11 +0100159 return std::move(*actual_dst);
giuros01164a2722018-11-20 18:34:46 +0000160 }
161
162 SimpleTensor<T> compute_reference(const TensorShape &shape0, const TensorShape &shape1,
163 DataType data_type0, DataType data_type1, DataType output_data_type,
164 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out)
165 {
166 // Create reference
167 SimpleTensor<T> ref_src1{ shape0, data_type0, 1, qinfo0 };
168 SimpleTensor<T> ref_src2{ shape1, data_type1, 1, qinfo1 };
169 SimpleTensor<T> ref_dst{ TensorShape::broadcast_shape(shape0, shape1), output_data_type, 1, qinfo_out };
170
171 // Fill reference
172 fill(ref_src1, 0);
173 fill(ref_src2, 1);
174
175 return reference::arithmetic_operation<T>(_op, ref_src1, ref_src2, ref_dst);
176 }
177
178 TensorType _target{};
179 SimpleTensor<T> _reference{};
180 ArithmeticOperation _op{ ArithmeticOperation::ADD };
Sang-Hoon Park668ccdc2021-02-03 10:32:59 +0000181 bool _use_dynamic_shape{ false };
Sheri Zhanga387e272021-06-29 17:34:06 +0100182 bool _is_inplace{ false };
giuros01164a2722018-11-20 18:34:46 +0000183};
184
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000185// Arithmetic operation fused with activation function
186template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
187class ArithmeticOperationsFuseActivationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
188{
189public:
190 template <typename...>
191 void setup(ArithmeticOperation op, const TensorShape &shape0, const TensorShape &shape1,
192 DataType data_type0, DataType data_type1, DataType output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100193 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out, ActivationLayerInfo act_info, bool is_inplace = true)
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000194 {
195 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(op, shape0, shape1,
196 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100197 qinfo0, qinfo1, qinfo_out, is_inplace);
198 _act_info = act_info;
199 _is_inplace = is_inplace;
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000200 }
201
202protected:
203 TensorType compute_target(const TensorShape &shape0, const TensorShape &shape1, DataType data_type0, DataType data_type1, DataType output_data_type,
204 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out)
205 {
206 // Create tensors
Sheri Zhanga387e272021-06-29 17:34:06 +0100207 const TensorShape out_shape = TensorShape::broadcast_shape(shape0, shape1);
208 TensorType ref_src1 = create_tensor<TensorType>(shape0, data_type0, 1, qinfo0);
209 TensorType ref_src2 = create_tensor<TensorType>(shape1, data_type1, 1, qinfo1);
210 TensorType dst = create_tensor<TensorType>(out_shape, output_data_type, 1, qinfo_out);
211
212 // Check whether do in-place computation and whether inputs are broadcast compatible
213 TensorType *actual_dst = &dst;
214 if(_is_inplace)
215 {
216 bool src1_is_inplace = !arm_compute::detail::have_different_dimensions(out_shape, shape0, 0) && (qinfo0 == qinfo_out) && (data_type0 == output_data_type);
217 bool src2_is_inplace = !arm_compute::detail::have_different_dimensions(out_shape, shape1, 0) && (qinfo1 == qinfo_out) && (data_type1 == output_data_type);
218 bool do_in_place = out_shape.total_size() != 0 && (src1_is_inplace || src2_is_inplace);
219 ARM_COMPUTE_ASSERT(do_in_place);
220
221 if(src1_is_inplace)
222 {
223 actual_dst = &ref_src1;
224 }
225 else
226 {
227 actual_dst = &ref_src2;
228 }
229 }
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000230
231 // Create and configure function
232 FunctionType elem_op;
Sheri Zhanga387e272021-06-29 17:34:06 +0100233 elem_op.configure(&ref_src1, &ref_src2, actual_dst, _act_info);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000234
Michele Di Giorgio4fc10b32021-04-30 18:30:41 +0100235 ARM_COMPUTE_ASSERT(ref_src1.info()->is_resizable());
236 ARM_COMPUTE_ASSERT(ref_src2.info()->is_resizable());
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000237
238 // Allocate tensors
239 ref_src1.allocator()->allocate();
240 ref_src2.allocator()->allocate();
Sheri Zhanga387e272021-06-29 17:34:06 +0100241
242 // If don't do in-place computation, still need to allocate original dst
243 if(!_is_inplace)
244 {
245 ARM_COMPUTE_ASSERT(dst.info()->is_resizable());
246 dst.allocator()->allocate();
247 ARM_COMPUTE_ASSERT(!dst.info()->is_resizable());
248 }
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000249
Michele Di Giorgio4fc10b32021-04-30 18:30:41 +0100250 ARM_COMPUTE_ASSERT(!ref_src1.info()->is_resizable());
251 ARM_COMPUTE_ASSERT(!ref_src2.info()->is_resizable());
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000252
253 // Fill tensors
254 fill(AccessorType(ref_src1), 0);
255 fill(AccessorType(ref_src2), 1);
256
257 // Compute function
258 elem_op.run();
259
Sheri Zhanga387e272021-06-29 17:34:06 +0100260 return std::move(*actual_dst);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000261 }
262
263 SimpleTensor<T> compute_reference(const TensorShape &shape0, const TensorShape &shape1,
264 DataType data_type0, DataType data_type1, DataType output_data_type,
265 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out)
266 {
267 auto result = ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::compute_reference(shape0, shape1, data_type0,
268 data_type1, output_data_type, qinfo0, qinfo1, qinfo_out);
269 return _act_info.enabled() ? reference::activation_layer(result, _act_info, qinfo_out) : result;
270 }
271
272 ActivationLayerInfo _act_info{};
Sheri Zhanga387e272021-06-29 17:34:06 +0100273 bool _is_inplace{ false };
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000274};
275
giuros01164a2722018-11-20 18:34:46 +0000276template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
277class ArithmeticDivisionBroadcastValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
278{
279public:
280 template <typename...>
Sheri Zhanga387e272021-06-29 17:34:06 +0100281 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 +0000282 {
283 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::DIV, shape0, shape1,
284 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100285 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000286 }
287};
288
289template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
290class ArithmeticDivisionValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
291{
292public:
293 template <typename...>
Sheri Zhanga387e272021-06-29 17:34:06 +0100294 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type, bool is_inplace)
giuros01164a2722018-11-20 18:34:46 +0000295 {
296 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::DIV, shape, shape,
297 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100298 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000299 }
300};
301
302template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
Sang-Hoon Park668ccdc2021-02-03 10:32:59 +0000303class ArithmeticDivisionBroadcastDynamicShapeValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
304{
305public:
306 template <typename...>
Sheri Zhanga387e272021-06-29 17:34:06 +0100307 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 +0000308 {
309 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::DIV, shape0, shape1,
310 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100311 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), is_inplace, true);
Sang-Hoon Park668ccdc2021-02-03 10:32:59 +0000312 }
313};
314
315template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
316class ArithmeticDivisionDynamicShapeValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
317{
318public:
319 template <typename...>
Sheri Zhanga387e272021-06-29 17:34:06 +0100320 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 +0000321 {
322 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::DIV, shape, shape,
323 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100324 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), is_inplace);
Sang-Hoon Park668ccdc2021-02-03 10:32:59 +0000325 }
326};
327
328template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000329class ArithmeticDivisionBroadcastValidationFloatFixture : public ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>
330{
331public:
332 template <typename...>
Sheri Zhanga387e272021-06-29 17:34:06 +0100333 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 +0000334 {
335 ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::DIV, shape0, shape1,
336 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100337 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), act_info, is_inplace);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000338 }
339};
340
341template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
342class ArithmeticDivisionValidationFloatFixture : public ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>
343{
344public:
345 template <typename...>
Sheri Zhanga387e272021-06-29 17:34:06 +0100346 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 +0000347 {
348 ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::DIV, shape, shape,
349 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100350 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), act_info, is_inplace);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000351 }
352};
353
354template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
Suhail Munshiae1c9fe2021-04-14 12:16:49 +0100355class ArithmeticDivisionValidationIntegerFixture : public ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>
356{
357public:
358 template <typename...>
Sheri Zhanga387e272021-06-29 17:34:06 +0100359 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 +0100360 {
361 ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::DIV, shape, shape,
362 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100363 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), act_info, is_inplace);
Suhail Munshiae1c9fe2021-04-14 12:16:49 +0100364 }
365};
366
367template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
giuros01164a2722018-11-20 18:34:46 +0000368class ArithmeticDivisionValidationQuantizedFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
369{
370public:
371 template <typename...>
372 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100373 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out, bool is_inplace)
giuros01164a2722018-11-20 18:34:46 +0000374
375 {
376 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::DIV, shape, shape,
377 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100378 qinfo0, qinfo1, qinfo_out, is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000379 }
380};
381
382template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
383class ElementwiseMaxBroadcastValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
384{
385public:
386 template <typename...>
Sheri Zhanga387e272021-06-29 17:34:06 +0100387 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 +0000388 {
389 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::MAX, shape0, shape1,
390 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100391 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000392 }
393};
394
395template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
396class ElementwiseMaxValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
397{
398public:
399 template <typename...>
Sheri Zhanga387e272021-06-29 17:34:06 +0100400 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type, bool is_inplace)
giuros01164a2722018-11-20 18:34:46 +0000401 {
402 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::MAX, shape, shape,
403 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100404 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000405 }
406};
407
408template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000409class ElementwiseMaxBroadcastValidationFloatFixture : public ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>
410{
411public:
412 template <typename...>
Sheri Zhanga387e272021-06-29 17:34:06 +0100413 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 +0000414 {
415 ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::MAX, shape0, shape1,
416 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100417 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), act_info, is_inplace);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000418 }
419};
420
421template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
422class ElementwiseMaxValidationFloatFixture : public ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>
423{
424public:
425 template <typename...>
Sheri Zhanga387e272021-06-29 17:34:06 +0100426 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 +0000427 {
428 ArithmeticOperationsFuseActivationFixture<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 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), act_info, is_inplace);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000431 }
432};
433
434template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
giuros01164a2722018-11-20 18:34:46 +0000435class ElementwiseMaxValidationQuantizedFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
436{
437public:
438 template <typename...>
439 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100440 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out, bool is_inplace)
giuros01164a2722018-11-20 18:34:46 +0000441
442 {
443 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::MAX, shape, shape,
444 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100445 qinfo0, qinfo1, qinfo_out, is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000446 }
447};
448
449template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
giuros0192fd9432018-12-03 17:30:00 +0000450class ElementwiseMaxQuantizedBroadcastValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
451{
452public:
453 template <typename...>
454 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 +0100455 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out, bool is_inplace)
giuros0192fd9432018-12-03 17:30:00 +0000456
457 {
458 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::MAX, shape0, shape1,
459 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100460 qinfo0, qinfo1, qinfo_out, is_inplace);
giuros0192fd9432018-12-03 17:30:00 +0000461 }
462};
463
464template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
giuros01164a2722018-11-20 18:34:46 +0000465class ElementwiseMinBroadcastValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
466{
467public:
468 template <typename...>
Sheri Zhanga387e272021-06-29 17:34:06 +0100469 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 +0000470 {
471 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::MIN, shape0, shape1,
472 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100473 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000474 }
475};
476
477template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
478class ElementwiseMinValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
479{
480public:
481 template <typename...>
Sheri Zhanga387e272021-06-29 17:34:06 +0100482 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type, bool is_inplace)
giuros01164a2722018-11-20 18:34:46 +0000483 {
484 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::MIN, shape, shape,
485 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100486 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000487 }
488};
489
490template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000491class ElementwiseMinBroadcastValidationFloatFixture : public ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>
492{
493public:
494 template <typename...>
Sheri Zhanga387e272021-06-29 17:34:06 +0100495 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 +0000496 {
497 ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::MIN, shape0, shape1,
498 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100499 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), act_info, is_inplace);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000500 }
501};
502
503template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
504class ElementwiseMinValidationFloatFixture : public ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>
505{
506public:
507 template <typename...>
Sheri Zhanga387e272021-06-29 17:34:06 +0100508 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 +0000509 {
510 ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::MIN, shape, shape,
511 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100512 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), act_info, is_inplace);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000513 }
514};
515
516template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
giuros01164a2722018-11-20 18:34:46 +0000517class ElementwiseMinValidationQuantizedFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
518{
519public:
520 template <typename...>
521 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100522 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out, bool is_inplace)
giuros01164a2722018-11-20 18:34:46 +0000523
524 {
525 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::MIN, shape, shape,
526 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100527 qinfo0, qinfo1, qinfo_out, is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000528 }
529};
530
531template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
giuros0192fd9432018-12-03 17:30:00 +0000532class ElementwiseMinQuantizedBroadcastValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
533{
534public:
535 template <typename...>
536 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 +0100537 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out, bool is_inplace)
giuros0192fd9432018-12-03 17:30:00 +0000538
539 {
540 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::MIN, shape0, shape1,
541 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100542 qinfo0, qinfo1, qinfo_out, is_inplace);
giuros0192fd9432018-12-03 17:30:00 +0000543 }
544};
545
546template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
giuros01164a2722018-11-20 18:34:46 +0000547class ElementwiseSquaredDiffBroadcastValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
548{
549public:
550 template <typename...>
Sheri Zhanga387e272021-06-29 17:34:06 +0100551 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 +0000552 {
553 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::SQUARED_DIFF, shape0, shape1,
554 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100555 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000556 }
557};
558
559template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
560class ElementwiseSquaredDiffValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
561{
562public:
563 template <typename...>
Sheri Zhanga387e272021-06-29 17:34:06 +0100564 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type, bool is_inplace)
giuros01164a2722018-11-20 18:34:46 +0000565 {
566 ArithmeticOperationsGenericFixture<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(), is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000569 }
570};
571
572template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000573class ElementwiseSquaredDiffBroadcastValidationFloatFixture : public ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>
574{
575public:
576 template <typename...>
Sheri Zhanga387e272021-06-29 17:34:06 +0100577 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 +0000578 {
579 ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::SQUARED_DIFF, shape0, shape1,
580 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100581 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), act_info, is_inplace);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000582 }
583};
584
585template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
586class ElementwiseSquaredDiffValidationFloatFixture : public ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>
587{
588public:
589 template <typename...>
Sheri Zhanga387e272021-06-29 17:34:06 +0100590 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 +0000591 {
592 ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::SQUARED_DIFF, shape, shape,
593 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100594 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), act_info, is_inplace);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000595 }
596};
597
598template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
giuros01164a2722018-11-20 18:34:46 +0000599class ElementwiseSquaredDiffValidationQuantizedFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
600{
601public:
602 template <typename...>
603 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100604 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out, bool is_inplace)
giuros01164a2722018-11-20 18:34:46 +0000605
606 {
607 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::SQUARED_DIFF, shape, shape,
608 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100609 qinfo0, qinfo1, qinfo_out, is_inplace);
giuros01164a2722018-11-20 18:34:46 +0000610 }
611};
giuros0192fd9432018-12-03 17:30:00 +0000612
613template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
614class ElementwiseSquaredDiffQuantizedBroadcastValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
615{
616public:
617 template <typename...>
618 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 +0100619 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out, bool is_inplace)
giuros0192fd9432018-12-03 17:30:00 +0000620
621 {
622 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::SQUARED_DIFF, shape0, shape1,
623 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100624 qinfo0, qinfo1, qinfo_out, is_inplace);
giuros0192fd9432018-12-03 17:30:00 +0000625 }
626};
George Worta1e7e282019-01-15 11:00:29 +0000627
628template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
giuros011e6e1b82019-05-14 16:12:53 +0100629class PReluLayerBroadcastValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
630{
631public:
632 template <typename...>
633 void setup(const TensorShape &shape0, const TensorShape &shape1, DataType data_type0, DataType data_type1, DataType output_data_type)
634 {
635 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::PRELU, shape0, shape1,
636 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100637 QuantizationInfo(), QuantizationInfo(), QuantizationInfo());
giuros011e6e1b82019-05-14 16:12:53 +0100638 }
639};
640
641template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
642class PReluLayerValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
643{
644public:
645 template <typename...>
646 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type)
647 {
648 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::PRELU, shape, shape,
649 data_type0, data_type1, output_data_type,
650 QuantizationInfo(), QuantizationInfo(), QuantizationInfo());
651 }
652};
653
654template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
655class PReluLayerValidationQuantizedFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
656{
657public:
658 template <typename...>
659 void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type,
660 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out)
661
662 {
663 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::PRELU, shape, shape,
664 data_type0, data_type1, output_data_type,
665 qinfo0, qinfo1, qinfo_out);
666 }
667};
668
669template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
670class PReluLayerQuantizedBroadcastValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
671{
672public:
673 template <typename...>
674 void setup(const TensorShape &shape0, const TensorShape &shape1, DataType data_type0, DataType data_type1, DataType output_data_type,
675 QuantizationInfo qinfo0, QuantizationInfo qinfo1, QuantizationInfo qinfo_out)
676
677 {
678 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::PRELU, shape0, shape1,
679 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100680 qinfo0, qinfo1, qinfo_out);
giuros011e6e1b82019-05-14 16:12:53 +0100681 }
682};
683
684template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
Usama Arif81e671e2019-05-13 13:33:14 +0100685class ElementwisePowerBroadcastValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
686{
687public:
688 template <typename...>
Sheri Zhanga387e272021-06-29 17:34:06 +0100689 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 +0100690 {
691 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::POWER, shape0, shape1,
692 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100693 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), is_inplace);
Usama Arif81e671e2019-05-13 13:33:14 +0100694 }
695};
696
697template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
698class ElementwisePowerValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>
699{
700public:
701 template <typename...>
Sheri Zhanga387e272021-06-29 17:34:06 +0100702 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 +0100703 {
704 ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::POWER, shape, shape,
705 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100706 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), is_inplace);
Usama Arif81e671e2019-05-13 13:33:14 +0100707 }
708};
709
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000710template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
711class ElementwisePowerBroadcastValidationFloatFixture : public ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>
712{
713public:
714 template <typename...>
Sheri Zhanga387e272021-06-29 17:34:06 +0100715 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 +0000716 {
717 ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::POWER, shape0, shape1,
718 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100719 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), act_info, is_inplace);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000720 }
721};
722
723template <typename TensorType, typename AccessorType, typename FunctionType, typename T>
724class ElementwisePowerValidationFloatFixture : public ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>
725{
726public:
727 template <typename...>
Sheri Zhanga387e272021-06-29 17:34:06 +0100728 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 +0000729 {
730 ArithmeticOperationsFuseActivationFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::POWER, shape, shape,
731 data_type0, data_type1, output_data_type,
Sheri Zhanga387e272021-06-29 17:34:06 +0100732 QuantizationInfo(), QuantizationInfo(), QuantizationInfo(), act_info, is_inplace);
Giorgio Arena8b2a7d32020-02-11 17:21:31 +0000733 }
734};
735
giuros01164a2722018-11-20 18:34:46 +0000736} // namespace validation
737} // namespace test
738} // namespace arm_compute
739#endif /* ARM_COMPUTE_TEST_ARITHMETIC_OPERATIONS_FIXTURE */