aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/layers/DetectionPostProcessLayer.cpp
diff options
context:
space:
mode:
authorFrancis Murtagh <francis.murtagh@arm.com>2021-04-20 16:37:55 +0100
committerFrancis Murtagh <francis.murtagh@arm.com>2021-04-20 16:38:04 +0100
commit4af561666b0ce5c12164447a5f7eb9722abb85f8 (patch)
tree8fc485d875aa91d6920c9104505541fb94b832b6 /src/armnn/layers/DetectionPostProcessLayer.cpp
parentec8b333001808f532d17a7ca2efd563f4181ff40 (diff)
downloadarmnn-4af561666b0ce5c12164447a5f7eb9722abb85f8.tar.gz
IVGCVSW-5816 Constant memory access
* Add new class ManagedConstTensorHandle to Unmap when out of scope * Integrate into existing layers that have constants * Add unit tests Signed-off-by: Francis Murtagh <francis.murtagh@arm.com> Change-Id: I0a05e14e438804b37e9862e76b5ca329483f6b45
Diffstat (limited to 'src/armnn/layers/DetectionPostProcessLayer.cpp')
-rw-r--r--src/armnn/layers/DetectionPostProcessLayer.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/armnn/layers/DetectionPostProcessLayer.cpp b/src/armnn/layers/DetectionPostProcessLayer.cpp
index e5bbeca424..b5086172dd 100644
--- a/src/armnn/layers/DetectionPostProcessLayer.cpp
+++ b/src/armnn/layers/DetectionPostProcessLayer.cpp
@@ -80,14 +80,16 @@ Layer::ConstantTensors DetectionPostProcessLayer::GetConstantTensorsByRef()
void DetectionPostProcessLayer::Accept(ILayerVisitor& visitor) const
{
- ConstTensor anchorTensor(m_Anchors->GetTensorInfo(), m_Anchors->GetConstTensor<void>());
+ ManagedConstTensorHandle managedAnchors(m_Anchors);
+ ConstTensor anchorTensor(managedAnchors.GetTensorInfo(), managedAnchors.Map());
visitor.VisitDetectionPostProcessLayer(this, GetParameters(), anchorTensor, GetName());
+ m_Anchors->Unmap();
}
void DetectionPostProcessLayer::ExecuteStrategy(IStrategy& strategy) const
{
- std::vector<armnn::ConstTensor> constTensors { {m_Anchors->GetTensorInfo(), m_Anchors->GetConstTensor<void>()} };
-
+ ManagedConstTensorHandle managedAnchors(m_Anchors);
+ std::vector<armnn::ConstTensor> constTensors { {managedAnchors.GetTensorInfo(), managedAnchors.Map()} };
strategy.ExecuteStrategy(this, GetParameters(), constTensors, GetName());
}