From d7de9c50c85be2a01b9fef2867c3be140685fd6d Mon Sep 17 00:00:00 2001 From: Sang-Hoon Park Date: Wed, 10 Mar 2021 17:03:40 +0000 Subject: Change the order of internal tensor allocation in CLSoftmaxLayer Fix issue that internal tensors' backing memory was shared due to lifetime set incorrectly. Resolves: COMPMID-4298 Change-Id: I232bf764cf38442e028029dd2380d5b7644db9af Signed-off-by: Sang-Hoon Park Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5249 Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio Comments-Addressed: Arm Jenkins --- src/runtime/CL/functions/CLSoftmaxLayer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/runtime/CL/functions/CLSoftmaxLayer.cpp b/src/runtime/CL/functions/CLSoftmaxLayer.cpp index e0bb6c3333..e47537bd31 100644 --- a/src/runtime/CL/functions/CLSoftmaxLayer.cpp +++ b/src/runtime/CL/functions/CLSoftmaxLayer.cpp @@ -93,6 +93,11 @@ void CLSoftmaxLayerGeneric::allocate_workspace() ARM_COMPUTE_ERROR_ON_NULLPTR(tensor); tensor->allocator()->init(tensor_info); _impl->memory_group.manage(tensor); + }); + + std::for_each(_impl->workspace_tensors.begin(), _impl->workspace_tensors.end(), [](std::pair> &wt) + { + auto tensor = wt.second.get(); tensor->allocator()->allocate(); }); } -- cgit v1.2.1