aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/CL/functions/CLSoftmaxLayer.cpp
diff options
context:
space:
mode:
authorSang-Hoon Park <sang-hoon.park@arm.com>2021-03-10 17:03:40 +0000
committerSang-Hoon Park <sang-hoon.park@arm.com>2021-03-11 12:34:19 +0000
commitd7de9c50c85be2a01b9fef2867c3be140685fd6d (patch)
treefe12b93148a64ed78d7270059e241415678a4751 /src/runtime/CL/functions/CLSoftmaxLayer.cpp
parent00f4dfce66c0e1cb820b443f111b7c01846d4d5b (diff)
downloadComputeLibrary-d7de9c50c85be2a01b9fef2867c3be140685fd6d.tar.gz
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 <sang-hoon.park@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5249 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/runtime/CL/functions/CLSoftmaxLayer.cpp')
-rw-r--r--src/runtime/CL/functions/CLSoftmaxLayer.cpp5
1 files changed, 5 insertions, 0 deletions
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<IS_LOG>::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<TensorType, std::unique_ptr<CLTensor>> &wt)
+ {
+ auto tensor = wt.second.get();
tensor->allocator()->allocate();
});
}