aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/CL/cl_kernels/elementwise_unary.cl2
-rw-r--r--src/core/CL/kernels/CLElementWiseUnaryLayerKernel.cpp3
-rw-r--r--src/runtime/CL/functions/CLElementWiseUnaryLayer.cpp10
3 files changed, 15 insertions, 0 deletions
diff --git a/src/core/CL/cl_kernels/elementwise_unary.cl b/src/core/CL/cl_kernels/elementwise_unary.cl
index 89bffed16d..866b7ee2b0 100644
--- a/src/core/CL/cl_kernels/elementwise_unary.cl
+++ b/src/core/CL/cl_kernels/elementwise_unary.cl
@@ -36,6 +36,8 @@
#define sin_op(input) sin(input)
// Calculate abs for floating point values
#define fabs_op(input) fabs(input)
+// Calculate natural_log
+#define natural_log_op(input) log(input)
/** Applies element wise unary operator in a tensor.
*
diff --git a/src/core/CL/kernels/CLElementWiseUnaryLayerKernel.cpp b/src/core/CL/kernels/CLElementWiseUnaryLayerKernel.cpp
index 15823b06ce..8b8d2965df 100644
--- a/src/core/CL/kernels/CLElementWiseUnaryLayerKernel.cpp
+++ b/src/core/CL/kernels/CLElementWiseUnaryLayerKernel.cpp
@@ -93,6 +93,9 @@ void CLElementWiseUnaryLayerKernel::configure(const ICLTensor *input, ICLTensor
case ElementWiseUnary::ABS:
build_opts.add_option("-DOPERATION=fabs_op");
break;
+ case ElementWiseUnary::LOG:
+ build_opts.add_option("-DOPERATION=natural_log_op");
+ break;
default:
ARM_COMPUTE_ERROR("Not implemented");
}
diff --git a/src/runtime/CL/functions/CLElementWiseUnaryLayer.cpp b/src/runtime/CL/functions/CLElementWiseUnaryLayer.cpp
index 14e77eadce..b1e18ecd7e 100644
--- a/src/runtime/CL/functions/CLElementWiseUnaryLayer.cpp
+++ b/src/runtime/CL/functions/CLElementWiseUnaryLayer.cpp
@@ -84,5 +84,15 @@ Status CLAbsLayer::validate(const ITensorInfo *input, const ITensorInfo *output)
{
return CLElementWiseUnaryLayerKernel::validate(input, output, ElementWiseUnary::ABS);
}
+void CLLogLayer::configure(const ICLTensor *input, ICLTensor *output)
+{
+ auto k = arm_compute::support::cpp14::make_unique<CLElementWiseUnaryLayerKernel>();
+ k->configure(input, output, ElementWiseUnary::LOG);
+ _kernel = std::move(k);
+}
+Status CLLogLayer::validate(const ITensorInfo *input, const ITensorInfo *output)
+{
+ return CLElementWiseUnaryLayerKernel::validate(input, output, ElementWiseUnary::LOG);
+}
} // namespace arm_compute