aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Tello <pablo.tello@arm.com>2019-12-03 15:46:50 +0000
committerDerek Lamberti <derek.lamberti@arm.com>2019-12-06 15:10:38 +0000
commit9af1dcde23f778f99afd5497a4247a9c6cdfac30 (patch)
treecddb424d4076cd7f44b4a8edf1acbe2d288c66f8
parent9934e4e0a458130466a83acc994597bce3bea07b (diff)
downloadarmnn-9af1dcde23f778f99afd5497a4247a9c6cdfac30.tar.gz
MLCE-133 Fix dangling calls to Manage()
* If nobody consumes an output tensor, the call to Manage() is not closed by a corresponding call to Allocate() Change-Id: I6af9cff7aa1b7eb70bcf691c00c0ce07b48e7527 Signed-off-by: Pablo Tello <pablo.tello@arm.com>
-rw-r--r--src/armnn/Graph.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/armnn/Graph.cpp b/src/armnn/Graph.cpp
index fe6a7c8afa..d44e43c2cb 100644
--- a/src/armnn/Graph.cpp
+++ b/src/armnn/Graph.cpp
@@ -199,6 +199,11 @@ Status Graph::AllocateDynamicBuffers()
{
handleReferenceCounts[tensorHandle] = numConnections;
tensorHandle->Manage();
+ if (handleReferenceCounts[tensorHandle] == 0u)
+ {
+ // if nobody consumes this tensor we call Allocate()
+ tensorHandle->Allocate();
+ }
}
else
{