ArmNN
 24.02
OutputHandler Class Reference

#include <OutputHandler.hpp>

Public Member Functions

void SetTensorInfo (const TensorInfo &tensorInfo)
 
  • Sets the TensorInfo used by this output handler.
More...
 
void CreateTensorHandles (const IWorkloadFactory &factory, const bool IsMemoryManaged=true)
 
  • Creates tensor handles used by the intermediate tensors.
More...
 
void CreateTensorHandles (const ITensorHandleFactory &factory, const bool IsMemoryManaged=true)
 
const TensorInfoGetTensorInfo () const
  More...
 
ITensorHandleGetData () const
 
  • Gets the allocated tensor memory.
More...
 
void CollectWorkloadOutputs (WorkloadDataCollector &dataCollector) const
 Fill the outputs for a given queue descriptor. More...
 
void SetData (std::unique_ptr< ITensorHandle > data)
 
void SetAllocatedData ()
 
void UseAllocatedData ()
 
bool IsTensorInfoSet () const
 Returns true if SetTensorInfo() has been called at least once on this. More...
 

Detailed Description

Definition at line 28 of file OutputHandler.hpp.

Member Function Documentation

◆ CollectWorkloadOutputs()

void CollectWorkloadOutputs ( WorkloadDataCollector dataCollector) const

Fill the outputs for a given queue descriptor.

Definition at line 33 of file OutputHandler.cpp.

34 {
35  dataCollector.Push(m_TensorHandle.get(), m_TensorInfo);
36 }

References WorkloadDataCollector::Push().

◆ CreateTensorHandles() [1/2]

void CreateTensorHandles ( const ITensorHandleFactory factory,
const bool  IsMemoryManaged = true 
)

Definition at line 28 of file OutputHandler.cpp.

29 {
30  m_TensorHandle = factory.CreateTensorHandle(m_TensorInfo, IsMemoryManaged);
31 }

References ITensorHandleFactory::CreateTensorHandle().

◆ CreateTensorHandles() [2/2]

void CreateTensorHandles ( const IWorkloadFactory factory,
const bool  IsMemoryManaged = true 
)

  • Creates tensor handles used by the intermediate tensors.

Does not allocate memory.

Parameters
factory- Factory to be used for handler creation.

Definition at line 21 of file OutputHandler.cpp.

22 {
24  m_TensorHandle = factory.CreateTensorHandle(m_TensorInfo, IsMemoryManaged);
26 }

References ARMNN_NO_DEPRECATE_WARN_BEGIN, ARMNN_NO_DEPRECATE_WARN_END, and IWorkloadFactory::CreateTensorHandle().

Referenced by Layer::CreateTensorHandles().

◆ GetData()

ITensorHandle* GetData ( ) const
inline

  • Gets the allocated tensor memory.

Returns
- Pointer to the tensor memory.

Definition at line 46 of file OutputHandler.hpp.

46 { return m_TensorHandle.get(); }

Referenced by LoadedNetwork::EnqueueWorkload().

◆ GetTensorInfo()

const TensorInfo& GetTensorInfo ( ) const
inline

Returns
- References to the output TensorInfo.

Definition at line 42 of file OutputHandler.hpp.

42 { return m_TensorInfo; }

Referenced by OutputSlot::GetTensorInfo(), TransposeAsReshapeImpl::Run(), PermuteAsReshapeImpl::Run(), OptimizeConsecutiveReshapesImpl::Run(), and OutputSlot::ValidateTensorShape().

◆ IsTensorInfoSet()

bool IsTensorInfoSet ( ) const
inline

Returns true if SetTensorInfo() has been called at least once on this.

Definition at line 58 of file OutputHandler.hpp.

58 { return m_bTensorInfoSet; }

Referenced by OutputSlot::IsTensorInfoSet().

◆ SetAllocatedData()

void SetAllocatedData ( )

Definition at line 38 of file OutputHandler.cpp.

39 {
40  // Set allocated data only once
41  if (!m_AllocatedTensorHandle)
42  {
43  m_AllocatedTensorHandle = std::move(m_TensorHandle);
44  }
45 }

◆ SetData()

void SetData ( std::unique_ptr< ITensorHandle data)
inline

Definition at line 51 of file OutputHandler.hpp.

51 { m_TensorHandle = std::move(data); }

◆ SetTensorInfo()

void SetTensorInfo ( const TensorInfo tensorInfo)

  • Sets the TensorInfo used by this output handler.

Parameters
tensorInfo- TensorInfo for the output.

Definition at line 15 of file OutputHandler.cpp.

16 {
17  m_TensorInfo = tensorInfo;
18  m_bTensorInfoSet = true;
19 }

Referenced by InputSlot::Insert(), OutputSlot::MoveAllConnections(), DeleteBroadcastToImpl::Run(), MovePermuteUpImpl::Run(), MoveTransposeUpImpl::Run(), and OutputSlot::SetTensorInfo().

◆ UseAllocatedData()

void UseAllocatedData ( )
inline

Definition at line 55 of file OutputHandler.hpp.

55 { m_TensorHandle = m_AllocatedTensorHandle; }

The documentation for this class was generated from the following files:
ARMNN_NO_DEPRECATE_WARN_BEGIN
#define ARMNN_NO_DEPRECATE_WARN_BEGIN
Definition: Deprecated.hpp:33
ARMNN_NO_DEPRECATE_WARN_END
#define ARMNN_NO_DEPRECATE_WARN_END
Definition: Deprecated.hpp:34