ArmNN
 24.02
ManagedConstTensorHandle Class Reference

#include <TensorHandle.hpp>

Public Member Functions

 ManagedConstTensorHandle (std::shared_ptr< ConstTensorHandle > ptr)
 
const void * Map (bool blocking=true)
 RAII Managed resource Unmaps MemoryArea once out of scope. More...
 
 ManagedConstTensorHandle (const ConstTensorHandle &other)=delete
 
ManagedConstTensorHandleoperator= (const ManagedConstTensorHandle &other)=delete
 
ManagedConstTensorHandleoperator= (ManagedConstTensorHandle &&other) noexcept=delete
 
 ~ManagedConstTensorHandle ()
 
void Unmap ()
 
const TensorInfoGetTensorInfo () const
 
bool IsMapped () const
 

Detailed Description

Definition at line 187 of file TensorHandle.hpp.

Constructor & Destructor Documentation

◆ ManagedConstTensorHandle() [1/2]

ManagedConstTensorHandle ( std::shared_ptr< ConstTensorHandle ptr)
inlineexplicit

Definition at line 191 of file TensorHandle.hpp.

192  : m_Mapped(false)
193  , m_TensorHandle(std::move(ptr)) {};

◆ ManagedConstTensorHandle() [2/2]

ManagedConstTensorHandle ( const ConstTensorHandle other)
delete

◆ ~ManagedConstTensorHandle()

Definition at line 220 of file TensorHandle.hpp.

221  {
222  // Bias tensor handles need to be initialized empty before entering scope of if statement checking if enabled
223  if (m_TensorHandle)
224  {
225  Unmap();
226  }
227  }

References ManagedConstTensorHandle::Unmap().

Member Function Documentation

◆ GetTensorInfo()

◆ IsMapped()

bool IsMapped ( ) const
inline

Definition at line 244 of file TensorHandle.hpp.

245  {
246  return m_Mapped;
247  }

◆ Map()

const void* Map ( bool  blocking = true)
inline

RAII Managed resource Unmaps MemoryArea once out of scope.

Definition at line 196 of file TensorHandle.hpp.

197  {
198  if (m_TensorHandle)
199  {
200  auto pRet = m_TensorHandle->Map(blocking);
201  m_Mapped = true;
202  return pRet;
203  }
204  else
205  {
206  throw armnn::Exception("Attempting to Map null TensorHandle");
207  }
208 
209  }

Referenced by BatchNormalizationLayer::ExecuteStrategy(), ConstantLayer::ExecuteStrategy(), DetectionPostProcessLayer::ExecuteStrategy(), TransposeConvolution2dLayer::ExecuteStrategy(), LstmLayer::ExecuteStrategy(), UnidirectionalSequenceLstmLayer::ExecuteStrategy(), QuantizedLstmLayer::ExecuteStrategy(), and QLstmLayer::ExecuteStrategy().

◆ operator=() [1/2]

ManagedConstTensorHandle& operator= ( const ManagedConstTensorHandle other)
delete

◆ operator=() [2/2]

ManagedConstTensorHandle& operator= ( ManagedConstTensorHandle &&  other)
deletenoexcept

◆ Unmap()

void Unmap ( )
inline

Definition at line 229 of file TensorHandle.hpp.

230  {
231  // Only unmap if mapped and TensorHandle exists.
232  if (m_Mapped && m_TensorHandle)
233  {
234  m_TensorHandle->Unmap();
235  m_Mapped = false;
236  }
237  }

Referenced by ManagedConstTensorHandle::~ManagedConstTensorHandle().


The documentation for this class was generated from the following file:
armnn::ManagedConstTensorHandle::Unmap
void Unmap()
Definition: TensorHandle.hpp:229
armnn::Exception
Base class for all ArmNN exceptions so that users can filter to just those.
Definition: Exceptions.hpp:46