From 6b0bf9972975aff01e42e5790f7b7c98cd835afb Mon Sep 17 00:00:00 2001 From: Sang-Hoon Park Date: Wed, 17 Feb 2021 13:12:53 +0000 Subject: Add CpuPRelu operators Implements: COMPMID-4184 Change-Id: I252168b460a18f837a26df5641664e95ddbd9c7e Signed-off-by: Sang-Hoon Park Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5237 Tested-by: Arm Jenkins Reviewed-by: Manuel Bottini Reviewed-by: Georgios Pinitas Comments-Addressed: Arm Jenkins --- src/runtime/NEON/functions/NEPReluLayer.cpp | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) (limited to 'src/runtime/NEON/functions/NEPReluLayer.cpp') diff --git a/src/runtime/NEON/functions/NEPReluLayer.cpp b/src/runtime/NEON/functions/NEPReluLayer.cpp index d79235747b..a05b545e9a 100644 --- a/src/runtime/NEON/functions/NEPReluLayer.cpp +++ b/src/runtime/NEON/functions/NEPReluLayer.cpp @@ -24,31 +24,18 @@ #include "arm_compute/runtime/NEON/functions/NEPReluLayer.h" #include "arm_compute/core/ITensor.h" -#include "src/core/cpu/kernels/CpuElementwiseKernel.h" +#include "src/runtime/cpu/operators/CpuPRelu.h" namespace arm_compute { -namespace experimental -{ -void NEPRelu::configure(const ITensorInfo *input, const ITensorInfo *alpha, ITensorInfo *output) -{ - auto k = std::make_unique(); - k->configure(ArithmeticOperation::PRELU, input, alpha, output); - _kernel = std::move(k); -} - -Status NEPRelu::validate(const ITensorInfo *input, const ITensorInfo *alpha, const ITensorInfo *output) -{ - return cpu::kernels::CpuArithmeticKernel::validate(ArithmeticOperation::PRELU, input, alpha, output); -} -} // nsamespace experimental +using OperatorType = cpu::CpuPRelu; struct NEPReluLayer::Impl { - const ITensor *src_0{ nullptr }; - const ITensor *src_1{ nullptr }; - ITensor *dst{ nullptr }; - std::unique_ptr op{ nullptr }; + const ITensor *src_0{ nullptr }; + const ITensor *src_1{ nullptr }; + ITensor *dst{ nullptr }; + std::unique_ptr op{ nullptr }; }; NEPReluLayer::NEPReluLayer() @@ -64,7 +51,7 @@ void NEPReluLayer::configure(const ITensor *input, const ITensor *alpha, ITensor _impl->src_0 = input; _impl->src_1 = alpha; _impl->dst = output; - _impl->op = std::make_unique(); + _impl->op = std::make_unique(); _impl->op->configure(input->info(), alpha->info(), output->info()); } @@ -79,6 +66,6 @@ void NEPReluLayer::run() Status NEPReluLayer::validate(const ITensorInfo *input, const ITensorInfo *alpha, const ITensorInfo *output) { - return experimental::NEPRelu::validate(input, alpha, output); + return OperatorType::validate(input, alpha, output); } } // namespace arm_compute -- cgit v1.2.1