From 70eb53b09adf57cc6ff7435c795e65a4f4697f67 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Wed, 6 Jan 2021 19:42:21 +0000 Subject: Make CpuFloorKernel kernel stateless - Rename NEFloorKernel to CpuFloorKernel to accomodate new ISA implementations - Remove state and instead pass tensors to operate during run - Add member function to generate an execution window given an input and output tensor description Signed-off-by: Georgios Pinitas Change-Id: I9240b8ec534589c0f15c354f771f1ac5d7010c3b Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4773 Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Michalis Spyrou --- src/runtime/NEON/functions/NEFloor.cpp | 37 ++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) (limited to 'src/runtime/NEON') diff --git a/src/runtime/NEON/functions/NEFloor.cpp b/src/runtime/NEON/functions/NEFloor.cpp index 74149e6f24..b4ecb1ef38 100644 --- a/src/runtime/NEON/functions/NEFloor.cpp +++ b/src/runtime/NEON/functions/NEFloor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -23,19 +23,44 @@ */ #include "arm_compute/runtime/NEON/functions/NEFloor.h" -#include "src/core/NEON/kernels/NEFloorKernel.h" +#include "src/runtime/cpu/operators/CpuFloor.h" namespace arm_compute { +NEFloor::NEFloor() + : _impl(std::make_unique()) +{ +} +NEFloor::NEFloor(NEFloor &&) = default; +NEFloor &NEFloor::operator=(NEFloor &&) = default; +NEFloor::~NEFloor() = default; + +struct NEFloor::Impl +{ + const ITensor *src{ nullptr }; + ITensor *dst{ nullptr }; + std::unique_ptr op{ nullptr }; +}; + void NEFloor::configure(const ITensor *input, ITensor *output) { - auto k = std::make_unique(); - k->configure(input, output); - _kernel = std::move(k); + _impl->src = input; + _impl->dst = output; + + _impl->op = std::make_unique(); + _impl->op->configure(_impl->src->info(), _impl->dst->info()); } Status NEFloor::validate(const ITensorInfo *input, const ITensorInfo *output) { - return NEFloorKernel::validate(input, output); + return cpu::CpuFloor::validate(input, output); +} + +void NEFloor::run() +{ + ITensorPack pack; + pack.add_tensor(TensorType::ACL_SRC, _impl->src); + pack.add_tensor(TensorType::ACL_DST, _impl->dst); + _impl->op->run(pack); } } // namespace arm_compute -- cgit v1.2.1