From 0c19cbd5800e830fa67cdd3b725efe796b211899 Mon Sep 17 00:00:00 2001 From: Michele Di Giorgio Date: Tue, 11 May 2021 17:41:32 +0100 Subject: Move memory management out of CpuPooling Change-Id: Idae4fc687942f61a1f63f23c9e5538df28888d93 Signed-off-by: Michele Di Giorgio Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5632 Tested-by: Arm Jenkins Reviewed-by: Georgios Pinitas Comments-Addressed: Arm Jenkins --- src/runtime/cpu/operators/CpuPooling.h | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'src/runtime/cpu/operators/CpuPooling.h') diff --git a/src/runtime/cpu/operators/CpuPooling.h b/src/runtime/cpu/operators/CpuPooling.h index b1647ea689..bc30adf762 100644 --- a/src/runtime/cpu/operators/CpuPooling.h +++ b/src/runtime/cpu/operators/CpuPooling.h @@ -26,8 +26,7 @@ #include "src/runtime/cpu/ICpuOperator.h" -#include "arm_compute/runtime/IMemoryManager.h" -#include "src/runtime/cpu/operators/CpuPoolingAssemblyDispatch.h" +#include "arm_compute/core/experimental/Types.h" #include @@ -38,19 +37,17 @@ struct PoolingLayerInfo; namespace cpu { -// Forward Declarations -class CpuPoolingAssemblyDispatch; /** Basic function to simulate a pooling layer with the specified pooling operation. This function calls the following kernels: * * -# @ref NEFillBorderKernel (executed if padding size is different from zero) * -# @ref kernels::CpuPoolingKernel - * -# @ref CpuPoolingAssemblyDispatch + * -# @ref kernels::CpuPoolingAssemblyWrapperKernel */ class CpuPooling : public ICpuOperator { public: /** Constructor */ - CpuPooling(std::shared_ptr memory_manager = nullptr); + CpuPooling(); /** Prevent instances of this class from being copied (As this class contains pointers) */ CpuPooling(const CpuPooling &) = delete; /** Prevent instances of this class from being copied (As this class contains pointers) */ @@ -86,16 +83,16 @@ public: // Inherited methods overridden: void run(ITensorPack &tensors) override; + experimental::MemoryRequirements workspace() const override; private: - std::shared_ptr _memory_manager; - - std::unique_ptr _pooling_layer_kernel; - std::unique_ptr _border_handler; - std::unique_ptr _asm_glue; + std::unique_ptr _pooling_layer_kernel; + std::unique_ptr _border_handler; + std::unique_ptr _asm_glue; - bool _is_global_pooling_layer; - DataLayout _data_layout; + bool _is_global_pooling_layer; + DataLayout _data_layout; + experimental::MemoryRequirements _mem_req; }; } // namespace cpu } // namespace arm_compute -- cgit v1.2.1