Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 1 | /* |
Ramy Elgammal | 14d7b53 | 2023-01-30 04:56:47 +0000 | [diff] [blame^] | 2 | * Copyright (c) 2018-2021, 2023 Arm Limited. |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 3 | * |
| 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_UNARY_FIXTURE |
| 25 | #define ARM_COMPUTE_TEST_ELEMENTWISE_UNARY_FIXTURE |
| 26 | |
| 27 | #include "arm_compute/core/TensorShape.h" |
| 28 | #include "arm_compute/core/Types.h" |
| 29 | #include "tests/AssetsLibrary.h" |
| 30 | #include "tests/Globals.h" |
| 31 | #include "tests/IAccessor.h" |
| 32 | #include "tests/framework/Asserts.h" |
| 33 | #include "tests/framework/Fixture.h" |
Jakub Sujak | ee301b3 | 2021-06-04 09:46:08 +0100 | [diff] [blame] | 34 | #include "tests/validation/reference/ElementwiseUnary.h" |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 35 | |
| 36 | namespace arm_compute |
| 37 | { |
| 38 | namespace test |
| 39 | { |
| 40 | namespace validation |
| 41 | { |
| 42 | template <typename TensorType, typename AccessorType, typename FunctionType, typename T> |
| 43 | class ElementWiseUnaryValidationFixture : public framework::Fixture |
| 44 | { |
| 45 | public: |
| 46 | template <typename...> |
Ramy Elgammal | 14d7b53 | 2023-01-30 04:56:47 +0000 | [diff] [blame^] | 47 | void setup(TensorShape input_shape, DataType input_data_type, bool in_place, ElementWiseUnary op, |
| 48 | bool use_dynamic_shape = false, QuantizationInfo qinfo = QuantizationInfo(), QuantizationInfo qinfo_out = QuantizationInfo()) |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 49 | { |
Sang-Hoon Park | 668ccdc | 2021-02-03 10:32:59 +0000 | [diff] [blame] | 50 | _op = op; |
Ramy Elgammal | 14d7b53 | 2023-01-30 04:56:47 +0000 | [diff] [blame^] | 51 | _target = compute_target(input_shape, input_data_type, in_place, qinfo, qinfo_out); |
| 52 | _reference = compute_reference(input_shape, input_data_type, qinfo, qinfo_out); |
Sang-Hoon Park | 668ccdc | 2021-02-03 10:32:59 +0000 | [diff] [blame] | 53 | _use_dynamic_shape = use_dynamic_shape; |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 54 | } |
| 55 | |
| 56 | protected: |
| 57 | template <typename U> |
Usama Arif | f6e475c | 2019-05-10 12:06:28 +0100 | [diff] [blame] | 58 | void fill(U &&tensor, int i, DataType data_type) |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 59 | { |
Giorgio Arena | 4bdd177 | 2020-12-17 16:47:07 +0000 | [diff] [blame] | 60 | using FloatType = typename std::conditional < std::is_same<T, half>::value || std::is_floating_point<T>::value, T, float >::type; |
Giorgio Arena | 33b103b | 2021-01-08 10:37:15 +0000 | [diff] [blame] | 61 | using FloatDistributionType = typename std::conditional<std::is_same<T, half>::value, arm_compute::utils::uniform_real_distribution_16bit<T>, std::uniform_real_distribution<FloatType>>::type; |
Giorgio Arena | 4bdd177 | 2020-12-17 16:47:07 +0000 | [diff] [blame] | 62 | |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 63 | switch(_op) |
| 64 | { |
| 65 | case ElementWiseUnary::EXP: |
| 66 | { |
Giorgio Arena | 4bdd177 | 2020-12-17 16:47:07 +0000 | [diff] [blame] | 67 | FloatDistributionType distribution{ FloatType(-1.0f), FloatType(1.0f) }; |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 68 | library->fill(tensor, distribution, i); |
| 69 | break; |
| 70 | } |
| 71 | case ElementWiseUnary::RSQRT: |
| 72 | { |
Ramy Elgammal | 14d7b53 | 2023-01-30 04:56:47 +0000 | [diff] [blame^] | 73 | if(data_type == DataType::F32 || data_type == DataType::F16) |
| 74 | { |
| 75 | FloatDistributionType distribution{ FloatType(1.0f), FloatType(2.0f) }; |
| 76 | library->fill(tensor, distribution, i); |
| 77 | } |
| 78 | else |
| 79 | { |
| 80 | library->fill_tensor_uniform(tensor, i); |
| 81 | } |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 82 | break; |
| 83 | } |
Manuel Bottini | 6ac5992 | 2019-05-15 14:06:02 +0100 | [diff] [blame] | 84 | case ElementWiseUnary::ABS: |
Usama Arif | f6e475c | 2019-05-10 12:06:28 +0100 | [diff] [blame] | 85 | case ElementWiseUnary::NEG: |
| 86 | { |
| 87 | switch(data_type) |
| 88 | { |
Usama Arif | f6e475c | 2019-05-10 12:06:28 +0100 | [diff] [blame] | 89 | case DataType::F16: |
| 90 | { |
Giorgio Arena | a8e2aeb | 2021-01-06 11:34:57 +0000 | [diff] [blame] | 91 | arm_compute::utils::uniform_real_distribution_16bit<half> distribution{ -2.0f, 2.0f }; |
Giorgio Arena | 6aeb217 | 2020-12-15 15:45:43 +0000 | [diff] [blame] | 92 | library->fill(tensor, distribution, i); |
| 93 | break; |
| 94 | } |
| 95 | case DataType::F32: |
| 96 | { |
Giorgio Arena | 4bdd177 | 2020-12-17 16:47:07 +0000 | [diff] [blame] | 97 | FloatDistributionType distribution{ FloatType(-2.0f), FloatType(2.0f) }; |
Usama Arif | f6e475c | 2019-05-10 12:06:28 +0100 | [diff] [blame] | 98 | library->fill(tensor, distribution, i); |
| 99 | break; |
| 100 | } |
| 101 | case DataType::S32: |
| 102 | { |
| 103 | std::uniform_int_distribution<int32_t> distribution(-100, 100); |
| 104 | library->fill(tensor, distribution, i); |
| 105 | break; |
| 106 | } |
| 107 | default: |
| 108 | ARM_COMPUTE_ERROR("DataType for Elementwise Negation Not implemented"); |
| 109 | } |
| 110 | break; |
| 111 | } |
Usama Arif | c255aa7 | 2019-05-13 16:26:29 +0100 | [diff] [blame] | 112 | case ElementWiseUnary::LOG: |
| 113 | { |
Giorgio Arena | 4bdd177 | 2020-12-17 16:47:07 +0000 | [diff] [blame] | 114 | FloatDistributionType distribution{ FloatType(0.0000001f), FloatType(100.0f) }; |
Usama Arif | c255aa7 | 2019-05-13 16:26:29 +0100 | [diff] [blame] | 115 | library->fill(tensor, distribution, i); |
| 116 | break; |
| 117 | } |
Michalis Spyrou | 0af4418 | 2019-05-17 14:04:47 +0100 | [diff] [blame] | 118 | case ElementWiseUnary::SIN: |
| 119 | { |
Giorgio Arena | 4bdd177 | 2020-12-17 16:47:07 +0000 | [diff] [blame] | 120 | FloatDistributionType distribution{ FloatType(-100.00f), FloatType(100.00f) }; |
Michalis Spyrou | 0af4418 | 2019-05-17 14:04:47 +0100 | [diff] [blame] | 121 | library->fill(tensor, distribution, i); |
| 122 | break; |
| 123 | } |
Usama Arif | 0a5a57a | 2019-05-23 14:20:33 +0100 | [diff] [blame] | 124 | case ElementWiseUnary::ROUND: |
| 125 | { |
Giorgio Arena | 4bdd177 | 2020-12-17 16:47:07 +0000 | [diff] [blame] | 126 | FloatDistributionType distribution{ FloatType(100.0f), FloatType(-100.0f) }; |
Usama Arif | 0a5a57a | 2019-05-23 14:20:33 +0100 | [diff] [blame] | 127 | library->fill(tensor, distribution, i); |
| 128 | break; |
| 129 | } |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 130 | default: |
| 131 | ARM_COMPUTE_ERROR("Not implemented"); |
| 132 | } |
| 133 | } |
| 134 | |
Ramy Elgammal | 14d7b53 | 2023-01-30 04:56:47 +0000 | [diff] [blame^] | 135 | TensorType compute_target(const TensorShape &shape, DataType data_type, bool in_place, QuantizationInfo qinfo, QuantizationInfo qinfo_out) |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 136 | { |
| 137 | // Create tensors |
Ramy Elgammal | 14d7b53 | 2023-01-30 04:56:47 +0000 | [diff] [blame^] | 138 | TensorType src = create_tensor<TensorType>(shape, data_type, 1, qinfo); |
| 139 | TensorType dst = create_tensor<TensorType>(shape, data_type, 1, qinfo_out); |
Manuel Bottini | 80feed5 | 2020-06-03 13:20:41 +0100 | [diff] [blame] | 140 | TensorType *actual_dst = in_place ? &src : &dst; |
| 141 | |
Sang-Hoon Park | 668ccdc | 2021-02-03 10:32:59 +0000 | [diff] [blame] | 142 | // if _use_dynamic_shape is true, this fixture will test scenario for dynamic shapes. |
| 143 | // - At configure time, all input tensors are marked as dynamic using set_tensor_dynamic() |
| 144 | // - After configure, tensors are marked as static for run using set_tensor_static() |
| 145 | // - The tensors with static shape are given to run() |
| 146 | if(_use_dynamic_shape) |
| 147 | { |
| 148 | set_tensor_dynamic(src); |
| 149 | } |
| 150 | |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 151 | // Create and configure function |
| 152 | FunctionType elwiseunary_layer; |
Manuel Bottini | 80feed5 | 2020-06-03 13:20:41 +0100 | [diff] [blame] | 153 | elwiseunary_layer.configure(&src, actual_dst); |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 154 | |
Sang-Hoon Park | 668ccdc | 2021-02-03 10:32:59 +0000 | [diff] [blame] | 155 | if(_use_dynamic_shape) |
| 156 | { |
| 157 | set_tensor_static(src); |
| 158 | } |
| 159 | |
Michele Di Giorgio | 4fc10b3 | 2021-04-30 18:30:41 +0100 | [diff] [blame] | 160 | ARM_COMPUTE_ASSERT(src.info()->is_resizable()); |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 161 | src.allocator()->allocate(); |
Michele Di Giorgio | 4fc10b3 | 2021-04-30 18:30:41 +0100 | [diff] [blame] | 162 | ARM_COMPUTE_ASSERT(!src.info()->is_resizable()); |
Manuel Bottini | 80feed5 | 2020-06-03 13:20:41 +0100 | [diff] [blame] | 163 | if(!in_place) |
| 164 | { |
Michele Di Giorgio | 4fc10b3 | 2021-04-30 18:30:41 +0100 | [diff] [blame] | 165 | ARM_COMPUTE_ASSERT(dst.info()->is_resizable()); |
Manuel Bottini | 80feed5 | 2020-06-03 13:20:41 +0100 | [diff] [blame] | 166 | dst.allocator()->allocate(); |
Michele Di Giorgio | 4fc10b3 | 2021-04-30 18:30:41 +0100 | [diff] [blame] | 167 | ARM_COMPUTE_ASSERT(!dst.info()->is_resizable()); |
Manuel Bottini | 80feed5 | 2020-06-03 13:20:41 +0100 | [diff] [blame] | 168 | } |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 169 | |
| 170 | // Fill tensors |
Usama Arif | f6e475c | 2019-05-10 12:06:28 +0100 | [diff] [blame] | 171 | fill(AccessorType(src), 0, data_type); |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 172 | |
| 173 | // Compute function |
| 174 | elwiseunary_layer.run(); |
| 175 | |
Manuel Bottini | 80feed5 | 2020-06-03 13:20:41 +0100 | [diff] [blame] | 176 | if(in_place) |
| 177 | { |
| 178 | return src; |
| 179 | } |
| 180 | else |
| 181 | { |
| 182 | return dst; |
| 183 | } |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 184 | } |
| 185 | |
Ramy Elgammal | 14d7b53 | 2023-01-30 04:56:47 +0000 | [diff] [blame^] | 186 | SimpleTensor<T> compute_reference(const TensorShape &shape, DataType data_type, QuantizationInfo qinfo, QuantizationInfo qinfo_out) |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 187 | { |
| 188 | // Create reference |
Ramy Elgammal | 14d7b53 | 2023-01-30 04:56:47 +0000 | [diff] [blame^] | 189 | SimpleTensor<T> src{ shape, data_type, 1, qinfo }; |
| 190 | SimpleTensor<T> dst{ shape, data_type, 1, qinfo_out }; |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 191 | |
| 192 | // Fill reference |
Usama Arif | f6e475c | 2019-05-10 12:06:28 +0100 | [diff] [blame] | 193 | fill(src, 0, data_type); |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 194 | |
Ramy Elgammal | 14d7b53 | 2023-01-30 04:56:47 +0000 | [diff] [blame^] | 195 | return reference::elementwise_unary<T>(src, dst, _op); |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 196 | } |
| 197 | |
| 198 | TensorType _target{}; |
| 199 | SimpleTensor<T> _reference{}; |
| 200 | ElementWiseUnary _op{}; |
Sang-Hoon Park | 668ccdc | 2021-02-03 10:32:59 +0000 | [diff] [blame] | 201 | bool _use_dynamic_shape{ false }; |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 202 | }; |
Ramy Elgammal | 14d7b53 | 2023-01-30 04:56:47 +0000 | [diff] [blame^] | 203 | template <typename TensorType, typename AccessorType, typename FunctionType, typename T> |
| 204 | class RsqrtQuantizedValidationFixture : public ElementWiseUnaryValidationFixture<TensorType, AccessorType, FunctionType, T> |
| 205 | { |
| 206 | public: |
| 207 | template <typename...> |
| 208 | void setup(const TensorShape &shape, DataType data_type, QuantizationInfo qinfo, QuantizationInfo qinfo_out) |
| 209 | { |
| 210 | ElementWiseUnaryValidationFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, data_type, false, ElementWiseUnary::RSQRT, false, qinfo, qinfo_out); |
| 211 | } |
| 212 | }; |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 213 | |
| 214 | template <typename TensorType, typename AccessorType, typename FunctionType, typename T> |
| 215 | class RsqrtValidationFixture : public ElementWiseUnaryValidationFixture<TensorType, AccessorType, FunctionType, T> |
| 216 | { |
| 217 | public: |
| 218 | template <typename...> |
| 219 | void setup(const TensorShape &shape, DataType data_type) |
| 220 | { |
Manuel Bottini | 80feed5 | 2020-06-03 13:20:41 +0100 | [diff] [blame] | 221 | ElementWiseUnaryValidationFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, data_type, false, ElementWiseUnary::RSQRT); |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 222 | } |
| 223 | }; |
| 224 | |
| 225 | template <typename TensorType, typename AccessorType, typename FunctionType, typename T> |
Sang-Hoon Park | 668ccdc | 2021-02-03 10:32:59 +0000 | [diff] [blame] | 226 | class RsqrtDynamicShapeValidationFixture : public ElementWiseUnaryValidationFixture<TensorType, AccessorType, FunctionType, T> |
| 227 | { |
| 228 | public: |
| 229 | template <typename...> |
| 230 | void setup(const TensorShape &shape, DataType data_type) |
| 231 | { |
| 232 | ElementWiseUnaryValidationFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, data_type, false, ElementWiseUnary::RSQRT, true); |
| 233 | } |
| 234 | }; |
| 235 | |
| 236 | template <typename TensorType, typename AccessorType, typename FunctionType, typename T> |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 237 | class ExpValidationFixture : public ElementWiseUnaryValidationFixture<TensorType, AccessorType, FunctionType, T> |
| 238 | { |
| 239 | public: |
| 240 | template <typename...> |
| 241 | void setup(const TensorShape &shape, DataType data_type) |
| 242 | { |
Manuel Bottini | 80feed5 | 2020-06-03 13:20:41 +0100 | [diff] [blame] | 243 | ElementWiseUnaryValidationFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, data_type, false, ElementWiseUnary::EXP); |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 244 | } |
| 245 | }; |
Usama Arif | f6e475c | 2019-05-10 12:06:28 +0100 | [diff] [blame] | 246 | |
| 247 | template <typename TensorType, typename AccessorType, typename FunctionType, typename T> |
| 248 | class NegValidationFixture : public ElementWiseUnaryValidationFixture<TensorType, AccessorType, FunctionType, T> |
| 249 | { |
| 250 | public: |
| 251 | template <typename...> |
| 252 | void setup(const TensorShape &shape, DataType data_type) |
| 253 | { |
Manuel Bottini | 80feed5 | 2020-06-03 13:20:41 +0100 | [diff] [blame] | 254 | ElementWiseUnaryValidationFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, data_type, false, ElementWiseUnary::NEG); |
| 255 | } |
| 256 | }; |
| 257 | |
| 258 | template <typename TensorType, typename AccessorType, typename FunctionType, typename T> |
| 259 | class NegValidationInPlaceFixture : public ElementWiseUnaryValidationFixture<TensorType, AccessorType, FunctionType, T> |
| 260 | { |
| 261 | public: |
| 262 | template <typename...> |
| 263 | void setup(const TensorShape &shape, DataType data_type, bool in_place) |
| 264 | { |
| 265 | ElementWiseUnaryValidationFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, data_type, in_place, ElementWiseUnary::NEG); |
Usama Arif | f6e475c | 2019-05-10 12:06:28 +0100 | [diff] [blame] | 266 | } |
| 267 | }; |
Usama Arif | c255aa7 | 2019-05-13 16:26:29 +0100 | [diff] [blame] | 268 | |
| 269 | template <typename TensorType, typename AccessorType, typename FunctionType, typename T> |
| 270 | class LogValidationFixture : public ElementWiseUnaryValidationFixture<TensorType, AccessorType, FunctionType, T> |
| 271 | { |
| 272 | public: |
| 273 | template <typename...> |
| 274 | void setup(const TensorShape &shape, DataType data_type) |
| 275 | { |
Manuel Bottini | 80feed5 | 2020-06-03 13:20:41 +0100 | [diff] [blame] | 276 | ElementWiseUnaryValidationFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, data_type, false, ElementWiseUnary::LOG); |
Usama Arif | c255aa7 | 2019-05-13 16:26:29 +0100 | [diff] [blame] | 277 | } |
| 278 | }; |
Manuel Bottini | 6ac5992 | 2019-05-15 14:06:02 +0100 | [diff] [blame] | 279 | |
| 280 | template <typename TensorType, typename AccessorType, typename FunctionType, typename T> |
| 281 | class AbsValidationFixture : public ElementWiseUnaryValidationFixture<TensorType, AccessorType, FunctionType, T> |
| 282 | { |
| 283 | public: |
| 284 | template <typename...> |
| 285 | void setup(const TensorShape &shape, DataType data_type) |
| 286 | { |
Manuel Bottini | 80feed5 | 2020-06-03 13:20:41 +0100 | [diff] [blame] | 287 | ElementWiseUnaryValidationFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, data_type, false, ElementWiseUnary::ABS); |
Manuel Bottini | 6ac5992 | 2019-05-15 14:06:02 +0100 | [diff] [blame] | 288 | } |
| 289 | }; |
Michalis Spyrou | 0af4418 | 2019-05-17 14:04:47 +0100 | [diff] [blame] | 290 | |
| 291 | template <typename TensorType, typename AccessorType, typename FunctionType, typename T> |
| 292 | class SinValidationFixture : public ElementWiseUnaryValidationFixture<TensorType, AccessorType, FunctionType, T> |
| 293 | { |
| 294 | public: |
| 295 | template <typename...> |
| 296 | void setup(const TensorShape &shape, DataType data_type) |
| 297 | { |
Manuel Bottini | 80feed5 | 2020-06-03 13:20:41 +0100 | [diff] [blame] | 298 | ElementWiseUnaryValidationFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, data_type, false, ElementWiseUnary::SIN); |
Michalis Spyrou | 0af4418 | 2019-05-17 14:04:47 +0100 | [diff] [blame] | 299 | } |
| 300 | }; |
Usama Arif | 0a5a57a | 2019-05-23 14:20:33 +0100 | [diff] [blame] | 301 | |
| 302 | template <typename TensorType, typename AccessorType, typename FunctionType, typename T> |
| 303 | class RoundValidationFixture : public ElementWiseUnaryValidationFixture<TensorType, AccessorType, FunctionType, T> |
| 304 | { |
| 305 | public: |
| 306 | template <typename...> |
| 307 | void setup(const TensorShape &shape, DataType data_type) |
| 308 | { |
Manuel Bottini | 80feed5 | 2020-06-03 13:20:41 +0100 | [diff] [blame] | 309 | ElementWiseUnaryValidationFixture<TensorType, AccessorType, FunctionType, T>::setup(shape, data_type, false, ElementWiseUnary::ROUND); |
Usama Arif | 0a5a57a | 2019-05-23 14:20:33 +0100 | [diff] [blame] | 310 | } |
| 311 | }; |
Michalis Spyrou | e936262 | 2018-11-23 17:41:37 +0000 | [diff] [blame] | 312 | } // namespace validation |
| 313 | } // namespace test |
| 314 | } // namespace arm_compute |
| 315 | #endif /* ARM_COMPUTE_TEST_ELEMENTWISE_UNARY_FIXTURE */ |