From 94f799e8f6f605333d40472860fb472e8ba6d83d Mon Sep 17 00:00:00 2001 From: Manuel Bottini Date: Wed, 9 Jun 2021 16:37:32 +0100 Subject: Fix incorrect memory handling in ported functions Details of the functions: - ClSoftmax - CpuSoftmax - CpuPool2d Change-Id: Icd2c14d5df010c3b2301e2693ce6f414d7c61916 Resolves: COMPMID-4404 Signed-off-by: Manuel Bottini Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5797 Reviewed-by: Georgios Pinitas Tested-by: Arm Jenkins Comments-Addressed: Arm Jenkins --- src/runtime/cpu/operators/CpuPool2d.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/runtime/cpu/operators/CpuPool2d.cpp') diff --git a/src/runtime/cpu/operators/CpuPool2d.cpp b/src/runtime/cpu/operators/CpuPool2d.cpp index b225199c40..e746c8fb3b 100644 --- a/src/runtime/cpu/operators/CpuPool2d.cpp +++ b/src/runtime/cpu/operators/CpuPool2d.cpp @@ -30,6 +30,8 @@ #include "src/core/cpu/kernels/CpuPool2dKernel.h" #include "src/core/cpu/kernels/internal/CpuPool2dAssemblyWrapperKernel.h" +using namespace arm_compute::experimental; + namespace arm_compute { namespace cpu @@ -40,7 +42,7 @@ CpuPool2d::CpuPool2d() _asm_glue(), _is_global_pooling_layer(false), _data_layout(DataLayout::NCHW), - _mem_req() + _aux_mem(1) { } @@ -71,7 +73,7 @@ void CpuPool2d::configure(ITensorInfo *src, ITensorInfo *dst, const PoolingLayer // Get kernel's memory requirements constexpr size_t alignment = 4096; const size_t workspace_size = pooling_wrapper->get_working_size(num_threads); - _mem_req.push_back({ TensorType::ACL_INT_0, workspace_size, alignment }); + _aux_mem[0] = MemoryInfo(TensorType::ACL_INT_0, MemoryLifetime::Temporary, workspace_size, alignment); _asm_glue = std::move(pooling_wrapper); } @@ -150,7 +152,7 @@ void CpuPool2d::run(ITensorPack &tensors) experimental::MemoryRequirements CpuPool2d::workspace() const { - return _mem_req; + return _aux_mem; } } // namespace cpu } // namespace arm_compute -- cgit v1.2.1