ArmNN
 24.08
SplitterQueueDescriptor Struct Reference

#include <WorkloadData.hpp>

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

Classes

struct  ViewOrigin
 

Public Member Functions

void Validate (const WorkloadInfo &workloadInfo) const
 
- Public Member Functions inherited from QueueDescriptorWithParameters< ViewsDescriptor >
virtual ~QueueDescriptorWithParameters ()=default
 
- 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
 

Public Attributes

std::vector< ViewOriginm_ViewOrigins
 
- Public Attributes inherited from QueueDescriptorWithParameters< ViewsDescriptor >
ViewsDescriptor m_Parameters
 
- Public Attributes inherited from QueueDescriptor
std::vector< ITensorHandle * > m_Inputs
 
std::vector< ITensorHandle * > m_Outputs
 
void * m_AdditionalInfoObject
 
bool m_AllowExpandedDims = false
 

Additional Inherited Members

- Protected Member Functions inherited from QueueDescriptorWithParameters< ViewsDescriptor >
 QueueDescriptorWithParameters ()=default
 
 QueueDescriptorWithParameters (QueueDescriptorWithParameters const &)=default
 
QueueDescriptorWithParametersoperator= (QueueDescriptorWithParameters const &)=default
 
- Protected Member Functions inherited from QueueDescriptor
 QueueDescriptor ()
 
 QueueDescriptor (QueueDescriptor const &)=default
 
QueueDescriptoroperator= (QueueDescriptor const &)=default
 

Detailed Description

Definition at line 111 of file WorkloadData.hpp.

Member Function Documentation

◆ Validate()

void Validate ( const WorkloadInfo workloadInfo) const

Definition at line 748 of file WorkloadData.cpp.

749 {
750  const std::string descriptorName{"SplitterQueueDescriptor"};
751 
752  ValidateNumInputs(workloadInfo, descriptorName, 1);
753 
754  // Check the supported data types
755  std::vector<DataType> supportedTypes =
756  {
765  };
766 
767  const TensorInfo& inputTensorInfo = workloadInfo.m_InputTensorInfos[0];
768  for (unsigned long i = 0ul; i < workloadInfo.m_OutputTensorInfos.size(); ++i)
769  {
770  const TensorInfo& outputTensorInfo = workloadInfo.m_OutputTensorInfos[i];
771  ValidateDataTypes(outputTensorInfo, supportedTypes, descriptorName);
772 
773  const std::string outputName = "output_" + std::to_string(i);
774  ValidateTensorDataTypesMatch(inputTensorInfo, outputTensorInfo, descriptorName, "input", outputName);
775  }
776 
777  if (workloadInfo.m_OutputTensorInfos.size() <= 0)
778  {
779  throw InvalidArgumentException(descriptorName + ": At least one output needs to be provided.");
780  }
781 
782  if (workloadInfo.m_OutputTensorInfos.size() != m_ViewOrigins.size())
783  {
785  descriptorName + ": Number of split windows "
786  "has to match number of workloadInfo.m_OutputTensorInfos. "
787  "Number of windows: " +
788  to_string(m_ViewOrigins.size()) +
789  ". Number of workloadInfo.m_OutputTensorInfos: " + to_string(workloadInfo.m_OutputTensorInfos.size()));
790  }
791 
792  //The dimensionality of all the windows has to match the dimensionality (not shape) of the input.
793  std::size_t inputDims = workloadInfo.m_InputTensorInfos[0].GetNumDimensions();
794  for(unsigned int w = 0; w < m_ViewOrigins.size(); ++w )
795  {
796  //Checks that the dimensionality of input is same as the split windows.
797  ViewOrigin const& e = m_ViewOrigins[w];
798  if (e.m_Origin.size() != inputDims)
799  {
800  throw InvalidArgumentException(descriptorName + ": Window origin have to "
801  "have the same dimensionality as the input tensor. "
802  "Window origin (index: " +
803  to_string(w) + ") has " + to_string(e.m_Origin.size()) +
804  " dimensions, the input "
805  "tensor has " +
806  to_string(inputDims) + " dimensions.");
807  }
808  for (unsigned int i = 0; i < e.m_Origin.size(); ++i)
809  {
810  if (e.m_Origin[i] + workloadInfo.m_OutputTensorInfos[w].GetShape()[i] >
811  workloadInfo.m_InputTensorInfos[0].GetShape()[i])
812  {
813  throw InvalidArgumentException(descriptorName + ": Window extent coordinates have to "
814  "be smaller or equal than the size of the input in that coord.");
815  }
816  }
817  }
818 }

References armnn::BFloat16, armnn::Boolean, armnn::Float16, armnn::Float32, WorkloadInfo::m_InputTensorInfos, SplitterQueueDescriptor::ViewOrigin::m_Origin, WorkloadInfo::m_OutputTensorInfos, SplitterQueueDescriptor::m_ViewOrigins, armnn::QAsymmS8, armnn::QAsymmU8, armnn::QSymmS16, and armnn::Signed32.

Member Data Documentation

◆ m_ViewOrigins

std::vector<ViewOrigin> m_ViewOrigins

The documentation for this struct was generated from the following files:
armnn::DataType::Boolean
@ Boolean
armnn::TensorInfo
Definition: Tensor.hpp:152
armnn::DataType::Float32
@ Float32
armnn::DataType::QAsymmU8
@ QAsymmU8
armnn::SplitterQueueDescriptor::m_ViewOrigins
std::vector< ViewOrigin > m_ViewOrigins
Definition: WorkloadData.hpp:124
armnn::DataType::QSymmS16
@ QSymmS16
armnn::DataType::BFloat16
@ BFloat16
armnn::WorkloadInfo::m_OutputTensorInfos
std::vector< TensorInfo > m_OutputTensorInfos
Definition: WorkloadInfo.hpp:19
armnn::DataType::Float16
@ Float16
armnn::InvalidArgumentException
Definition: Exceptions.hpp:80
armnn::DataType::Signed32
@ Signed32
armnn::DataType::QAsymmS8
@ QAsymmS8
armnn::WorkloadInfo::m_InputTensorInfos
std::vector< TensorInfo > m_InputTensorInfos
Definition: WorkloadInfo.hpp:18