ArmNN
 24.02
MemCopyQueueDescriptor Struct Reference

#include <WorkloadData.hpp>

Inheritance diagram for MemCopyQueueDescriptor:
[legend]
Collaboration diagram for MemCopyQueueDescriptor:
[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 86 of file WorkloadData.hpp.

Member Function Documentation

◆ Validate()

void Validate ( const WorkloadInfo workloadInfo) const

Definition at line 490 of file WorkloadData.cpp.

491 {
492  const std::string descriptorName{"MemCopyQueueDescriptor"};
493 
494  ValidateNumInputs(workloadInfo, descriptorName, 1);
495  ValidateNumOutputs(workloadInfo, descriptorName , 1);
496 
497  const TensorInfo& inputTensorInfo = workloadInfo.m_InputTensorInfos[0];
498  const TensorInfo& outputTensorInfo = workloadInfo.m_OutputTensorInfos[0];
499 
500  ValidateTensorNumElementsMatch(inputTensorInfo, outputTensorInfo, descriptorName, "input", "output");
501  ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName, "input", "output");
502 
503  if (m_Inputs.size() != m_Outputs.size())
504  {
505  throw InvalidArgumentException(fmt::format(
506  "{0}: Number of inputs ({1}) does not match the number of outputs ({2}).",
507  descriptorName, m_Inputs.size(), m_Outputs.size()));
508  }
509 
510  for (unsigned int i = 0; i < m_Inputs.size(); ++i)
511  {
512  if (!m_Inputs[i])
513  {
514  throw InvalidArgumentException(fmt::format(
515  "{0}: Invalid NULL input {1}.", descriptorName, i));
516  }
517 
518  if (!m_Outputs[i])
519  {
520  throw InvalidArgumentException(fmt::format("{0}: Invalid NULL output {1}", descriptorName, i));
521  }
522  }
523 }

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::TensorInfo
Definition: Tensor.hpp:152
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