diff options
author | Usama Arif <usama.arif@arm.com> | 2019-05-13 13:33:14 +0100 |
---|---|---|
committer | Usama Arif <usama.arif@arm.com> | 2019-05-15 10:25:17 +0000 |
commit | 81e671ef4f2a8fb3128fba402610b9de28b57891 (patch) | |
tree | 37ae4534cc3e34d8aba615c869a318d8f8038d33 /tests/validation/fixtures/ElementwiseOperationsFixture.h | |
parent | c255aa7df3e61a73cc4af86d21d3b1848653b7a9 (diff) | |
download | ComputeLibrary-81e671ef4f2a8fb3128fba402610b9de28b57891.tar.gz |
COMPMID-2269: Implement POW operator for NEON
Change-Id: I7135f665d89da3c24c9bbe00e991a64713a41d0e
Signed-off-by: Usama Arif <usama.arif@arm.com>
Reviewed-on: https://review.mlplatform.org/c/1128
Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests/validation/fixtures/ElementwiseOperationsFixture.h')
-rw-r--r-- | tests/validation/fixtures/ElementwiseOperationsFixture.h | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/tests/validation/fixtures/ElementwiseOperationsFixture.h b/tests/validation/fixtures/ElementwiseOperationsFixture.h index 53030842e7..e86e7a0f20 100644 --- a/tests/validation/fixtures/ElementwiseOperationsFixture.h +++ b/tests/validation/fixtures/ElementwiseOperationsFixture.h @@ -58,7 +58,17 @@ protected: template <typename U> void fill(U &&tensor, int i) { - (_op == ArithmeticOperation::DIV) ? library->fill_tensor_uniform_ranged(tensor, i, { std::pair<float, float>(-0.001f, 0.001f) }) : library->fill_tensor_uniform(tensor, i); + switch(_op) + { + case ArithmeticOperation::DIV: + library->fill_tensor_uniform_ranged(tensor, i, { std::pair<float, float>(-0.001f, 0.001f) }); + break; + case ArithmeticOperation::POWER: + library->fill_tensor_uniform(tensor, i, 0.0f, 5.0f); + break; + default: + library->fill_tensor_uniform(tensor, i); + } } TensorType compute_target(const TensorShape &shape0, const TensorShape &shape1, DataType data_type0, DataType data_type1, DataType output_data_type, @@ -382,6 +392,32 @@ public: } }; +template <typename TensorType, typename AccessorType, typename FunctionType, typename T> +class ElementwisePowerBroadcastValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T> +{ +public: + template <typename...> + void setup(const TensorShape &shape0, const TensorShape &shape1, DataType data_type0, DataType data_type1, DataType output_data_type) + { + ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::POWER, shape0, shape1, + data_type0, data_type1, output_data_type, + QuantizationInfo(), QuantizationInfo(), QuantizationInfo()); + } +}; + +template <typename TensorType, typename AccessorType, typename FunctionType, typename T> +class ElementwisePowerValidationFixture : public ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T> +{ +public: + template <typename...> + void setup(const TensorShape &shape, DataType data_type0, DataType data_type1, DataType output_data_type) + { + ArithmeticOperationsGenericFixture<TensorType, AccessorType, FunctionType, T>::setup(ArithmeticOperation::POWER, shape, shape, + data_type0, data_type1, output_data_type, + QuantizationInfo(), QuantizationInfo(), QuantizationInfo()); + } +}; + } // namespace validation } // namespace test } // namespace arm_compute |