From 4cfab1886549d7582e3867c51278132e5d37681b Mon Sep 17 00:00:00 2001 From: Michele Di Giorgio Date: Mon, 25 Jan 2021 11:49:03 +0000 Subject: Make CLArithmeticSubtraction kernel and function state-less Resolves COMPMID-4008 Change-Id: Ic5f40610e771f31e6d301dfae976c81e9c79fa8b Signed-off-by: Michele Di Giorgio Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4917 Reviewed-by: Michalis Spyrou Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins --- .../CL/functions/CLElementwiseOperations.cpp | 35 +++++----------------- 1 file changed, 7 insertions(+), 28 deletions(-) (limited to 'src/runtime/CL/functions/CLElementwiseOperations.cpp') diff --git a/src/runtime/CL/functions/CLElementwiseOperations.cpp b/src/runtime/CL/functions/CLElementwiseOperations.cpp index 638990e472..9b809eebc7 100644 --- a/src/runtime/CL/functions/CLElementwiseOperations.cpp +++ b/src/runtime/CL/functions/CLElementwiseOperations.cpp @@ -28,6 +28,7 @@ #include "src/core/gpu/cl/kernels/ClElementwiseKernel.h" #include "src/runtime/gpu/cl/operators/ClAdd.h" +#include "src/runtime/gpu/cl/operators/ClSub.h" #include @@ -35,28 +36,6 @@ namespace arm_compute { namespace experimental { -CLArithmeticSubtraction::CLArithmeticSubtraction() -{ -} -void CLArithmeticSubtraction::configure(const CLCompileContext &compile_context, ITensorInfo *input1, ITensorInfo *input2, ITensorInfo *output, ConvertPolicy policy, - const ActivationLayerInfo &act_info) -{ - auto k = std::make_unique(); - k->configure(compile_context, ArithmeticOperation::SUB, input1, input2, output, policy, act_info); - _kernel = std::move(k); -} - -Status CLArithmeticSubtraction::validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, ConvertPolicy policy, const ActivationLayerInfo &act_info) -{ - ARM_COMPUTE_UNUSED(policy); - return arm_compute::opencl::kernels::ClSaturatedArithmeticKernel::validate(ArithmeticOperation::SUB, input1, input2, output, policy, act_info); -} - -void CLArithmeticSubtraction::run(ITensorPack &tensors) -{ - ICLOperator::run(tensors); -} - CLArithmeticDivision::CLArithmeticDivision() { } @@ -210,10 +189,10 @@ void CLArithmeticAddition::run() struct CLArithmeticSubtraction::Impl { - const ICLTensor *src_0{ nullptr }; - const ICLTensor *src_1{ nullptr }; - ICLTensor *dst{ nullptr }; - std::unique_ptr op{ nullptr }; + const ICLTensor *src_0{ nullptr }; + const ICLTensor *src_1{ nullptr }; + ICLTensor *dst{ nullptr }; + std::unique_ptr op{ nullptr }; }; CLArithmeticSubtraction::CLArithmeticSubtraction() @@ -235,13 +214,13 @@ void CLArithmeticSubtraction::configure(const CLCompileContext &compile_context, _impl->src_0 = input1; _impl->src_1 = input2; _impl->dst = output; - _impl->op = std::make_unique(); + _impl->op = std::make_unique(); _impl->op->configure(compile_context, input1->info(), input2->info(), output->info(), policy, act_info); } Status CLArithmeticSubtraction::validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, ConvertPolicy policy, const ActivationLayerInfo &act_info) { - return experimental::CLArithmeticSubtraction::validate(input1, input2, output, policy, act_info); + return opencl::ClSub::validate(input1, input2, output, policy, act_info); } void CLArithmeticSubtraction::run() -- cgit v1.2.1