From 668ccdcfb81bfab3a2d44cd1ddd956e83a2dfb09 Mon Sep 17 00:00:00 2001 From: Sang-Hoon Park Date: Wed, 3 Feb 2021 10:32:59 +0000 Subject: Add dynamic tensor support to CpuElementwise The kernels and operators for binary and unary operations are now capable of being configured with dynamic shapes and computing windows at run-time. Additionally, changing arguments' names is done for consistency. Partially Implements: COMPMID-4127 Change-Id: I48e5038692db667dec7cb2b2906fe5683214fe19 Signed-off-by: Sang-Hoon Park Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4973 Tested-by: Arm Jenkins Reviewed-by: Pablo Marquez Tello Comments-Addressed: Arm Jenkins --- src/runtime/cpu/operators/CpuElementwiseUnary.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/runtime/cpu/operators/CpuElementwiseUnary.cpp') diff --git a/src/runtime/cpu/operators/CpuElementwiseUnary.cpp b/src/runtime/cpu/operators/CpuElementwiseUnary.cpp index d1b1700927..2140c5cf78 100644 --- a/src/runtime/cpu/operators/CpuElementwiseUnary.cpp +++ b/src/runtime/cpu/operators/CpuElementwiseUnary.cpp @@ -23,6 +23,7 @@ */ #include "src/runtime/cpu/operators/CpuElementwiseUnary.h" #include "src/core/cpu/kernels/CpuElementwiseUnaryKernel.h" +#include "src/core/helpers/WindowHelpers.h" namespace arm_compute { @@ -41,5 +42,17 @@ Status CpuElementwiseUnary::validate(ElementWiseUnary op, const ITensorInfo &src { return KernelType::validate(op, src, dst); } + +void CpuElementwiseUnary::run(ITensorPack &tensors) +{ + if(_kernel->is_window_configured()) + { + ICpuOperator::run(tensors); + return; + } + + auto src_info = tensors.get_const_tensor(TensorType::ACL_SRC)->info(); + ICpuOperator::run(tensors, compute_output_shape_and_window(*src_info).second); +} } // namespace cpu } // namespace arm_compute \ No newline at end of file -- cgit v1.2.1