ArmNN
 24.02
MemImportQueueDescriptor Struct Reference

#include <WorkloadData.hpp>

Inheritance diagram for MemImportQueueDescriptor:
[legend]
Collaboration diagram for MemImportQueueDescriptor:
[legend]

Public Member Functions

void Validate (const WorkloadInfo &workloadInfo) const
 
- Public Member Functions inherited from QueueDescriptor
virtual ~QueueDescriptor ()=default
 
void ValidateTensorNumDimensions (const TensorInfo &tensor, std::string const &descName, unsigned int numDimensions, std::string const &tensorName) const
 
void ValidateTensorNumDimNumElem (const TensorInfo &tensorInfo, unsigned int numDimension, unsigned int numElements, std::string const &tensorName) const
 
void ValidateInputsOutputs (const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
 
template<typename T >
const T * GetAdditionalInformation () const
 

Additional Inherited Members

- Public Attributes inherited from QueueDescriptor
std::vector< ITensorHandle * > m_Inputs
 
std::vector< ITensorHandle * > m_Outputs
 
void * m_AdditionalInfoObject
 
bool m_AllowExpandedDims = false
 
- Protected Member Functions inherited from QueueDescriptor
 QueueDescriptor ()
 
 QueueDescriptor (QueueDescriptor const &)=default
 
QueueDescriptoroperator= (QueueDescriptor const &)=default
 

Detailed Description

Definition at line 94 of file WorkloadData.hpp.

Member Function Documentation

◆ Validate()

void Validate ( const WorkloadInfo workloadInfo) const

Definition at line 526 of file WorkloadData.cpp.

527 {
528  ValidateNumInputs(workloadInfo, "MemImportQueueDescriptor", 1);
529  ValidateNumOutputs(workloadInfo, "MemImportQueueDescriptor" , 1);
530 
531  if (workloadInfo.m_InputTensorInfos.size() != 1)
532  {
533  throw InvalidArgumentException(fmt::format("Number of input infos ({}) is not 1.",
534  workloadInfo.m_InputTensorInfos.size()));
535 
536  }
537 
538  if (workloadInfo.m_InputTensorInfos.size() != workloadInfo.m_OutputTensorInfos.size())
539  {
540  throw InvalidArgumentException(fmt::format(
541  "Number of input infos ({0}) does not match the number of output infos ({1})",
542  workloadInfo.m_InputTensorInfos.size(), workloadInfo.m_OutputTensorInfos.size()));
543  }
544 
545  for (std::size_t i = 0; i < workloadInfo.m_InputTensorInfos.size(); ++i)
546  {
547  if (workloadInfo.m_InputTensorInfos[i].GetNumElements() !=
548  workloadInfo.m_OutputTensorInfos[i].GetNumElements())
549  {
550  throw InvalidArgumentException(fmt::format(
551  "Number of elements for tensor input and output {} does not match", i ));
552  }
553  }
554 
555  if (m_Inputs.size() != 1)
556  {
557  throw InvalidArgumentException(fmt::format("Number of inputs ({}) is not 1.", m_Inputs.size()));
558  }
559 
560  if (m_Inputs.size() != m_Outputs.size())
561  {
562  throw InvalidArgumentException(fmt::format(
563  "Number of inputs ({0}) does not match the number of outputs ({1})",
564  m_Inputs.size(), m_Outputs.size()));
565  }
566 
567  for (unsigned int i = 0; i < m_Inputs.size(); ++i)
568  {
569  if (!m_Inputs[i])
570  {
571  throw InvalidArgumentException(fmt::format("Invalid null input {}", i));
572  }
573 
574  if (!m_Outputs[i])
575  {
576  throw InvalidArgumentException(fmt::format("Invalid null output {}", i));
577  }
578  }
579 }

References QueueDescriptor::m_Inputs, WorkloadInfo::m_InputTensorInfos, QueueDescriptor::m_Outputs, and WorkloadInfo::m_OutputTensorInfos.


The documentation for this struct was generated from the following files:
armnn::WorkloadInfo::m_OutputTensorInfos
std::vector< TensorInfo > m_OutputTensorInfos
Definition: WorkloadInfo.hpp:19
armnn::InvalidArgumentException
Definition: Exceptions.hpp:80
armnn::QueueDescriptor::m_Outputs
std::vector< ITensorHandle * > m_Outputs
Definition: WorkloadData.hpp:27
armnn::WorkloadInfo::m_InputTensorInfos
std::vector< TensorInfo > m_InputTensorInfos
Definition: WorkloadInfo.hpp:18
armnn::QueueDescriptor::m_Inputs
std::vector< ITensorHandle * > m_Inputs
Definition: WorkloadData.hpp:26