diff options
author | Usama Arif <usama.arif@arm.com> | 2019-05-13 16:26:29 +0100 |
---|---|---|
committer | Usama Arif <usama.arif@arm.com> | 2019-05-14 16:17:37 +0000 |
commit | c255aa7df3e61a73cc4af86d21d3b1848653b7a9 (patch) | |
tree | 98f4b899c8be56f38b13eaf11f636bc92173719d /src/core/NEON/kernels | |
parent | 4b5c588ed5bbf635bfb4d20b662db417caa4558f (diff) | |
download | ComputeLibrary-c255aa7df3e61a73cc4af86d21d3b1848653b7a9.tar.gz |
COMPMID-2263: Implement NELogLayer
Change-Id: Ie2ae8f7a0b1803dae42873201cb643c71b26129f
Signed-off-by: Usama Arif <usama.arif@arm.com>
Reviewed-on: https://review.mlplatform.org/c/1122
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/NEON/kernels')
-rw-r--r-- | src/core/NEON/kernels/NEElementwiseUnaryKernel.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/NEON/kernels/NEElementwiseUnaryKernel.cpp b/src/core/NEON/kernels/NEElementwiseUnaryKernel.cpp index d62b165727..8678bcd41b 100644 --- a/src/core/NEON/kernels/NEElementwiseUnaryKernel.cpp +++ b/src/core/NEON/kernels/NEElementwiseUnaryKernel.cpp @@ -57,6 +57,8 @@ inline ScalarType elementwise_op_scalar(const ScalarType &a) return std::exp(a); case ElementWiseUnary::NEG: return -a; + case ElementWiseUnary::LOG: + return std::log(a); default: ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); } @@ -74,13 +76,15 @@ inline VectorType elementwise_op(const VectorType &a) return wrapper::vexpq(a); case ElementWiseUnary::NEG: return wrapper::vneg(a); + case ElementWiseUnary::LOG: + return wrapper::vlog(a); default: ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); } } /* Elementwise operations that are supported for non floats */ -template <ElementWiseUnary op, bool is_float, typename VectorType, typename std::enable_if<!is_float, int>::type = 0> +template < ElementWiseUnary op, bool is_float, typename VectorType, typename std::enable_if < !is_float, int >::type = 0 > inline VectorType elementwise_op(const VectorType &a) { switch(op) @@ -190,6 +194,9 @@ void NEElementwiseUnaryKernel::configure(ElementWiseUnary op, const ITensor *inp case ElementWiseUnary::NEG: _function = configure_func<ElementWiseUnary::NEG>(input, output); break; + case ElementWiseUnary::LOG: + _function = configure_func<ElementWiseUnary::LOG>(input, output); + break; default: ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); } @@ -202,6 +209,7 @@ Status NEElementwiseUnaryKernel::validate_arguments(ElementWiseUnary op, const I { case ElementWiseUnary::EXP: case ElementWiseUnary::RSQRT: + case ElementWiseUnary::LOG: ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(&input, 1, DataType::F16, DataType::F32); break; case ElementWiseUnary::NEG: |