ArmNN
 24.02
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 746 of file WorkloadData.cpp.

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

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