ArmNN
 22.08
TypedWorkload< QueueDescriptor, DataTypes > Class Template Reference

#include <Workload.hpp>

Inheritance diagram for TypedWorkload< QueueDescriptor, DataTypes >:
BaseWorkload< QueueDescriptor > IWorkload ClBatchNormalizationFloatWorkload ClFloorFloatWorkload ClL2NormalizationFloatWorkload ClLstmFloatWorkload ClNormalizationFloatWorkload ClUnidirectionalSequenceLstmFloatWorkload NeonFloorFloatWorkload NeonL2NormalizationFloatWorkload NeonLstmFloatWorkload NeonNormalizationFloatWorkload NeonUnidirectionalSequenceLstmFloatWorkload RefFakeQuantizationFloat32Workload

Public Member Functions

 TypedWorkload (const QueueDescriptor &descriptor, const WorkloadInfo &info)
 
- Public Member Functions inherited from BaseWorkload< QueueDescriptor >
 BaseWorkload (const QueueDescriptor &descriptor, const WorkloadInfo &info)
 
void ExecuteAsync (ExecutionData &executionData) override
 
void PostAllocationConfigure () override
 
const QueueDescriptorGetData () const
 
arm::pipe::ProfilingGuid GetGuid () const final
 
virtual bool SupportsTensorHandleReplacement () const override
 
void ReplaceInputTensorHandle (ITensorHandle *tensorHandle, unsigned int slot) override
 
void ReplaceOutputTensorHandle (ITensorHandle *tensorHandle, unsigned int slot) override
 
- Public Member Functions inherited from IWorkload
virtual ~IWorkload ()
 
virtual void Execute () const =0
 
virtual void RegisterDebugCallback (const DebugCallbackFunction &)
 
virtual armnn::Optional< armnn::MemoryRequirementsGetMemoryRequirements ()
 

Additional Inherited Members

- Protected Attributes inherited from BaseWorkload< QueueDescriptor >
QueueDescriptor m_Data
 
const arm::pipe::ProfilingGuid m_Guid
 

Detailed Description

template<typename QueueDescriptor, armnn::DataType... DataTypes>
class armnn::TypedWorkload< QueueDescriptor, DataTypes >

Definition at line 94 of file Workload.hpp.

Constructor & Destructor Documentation

◆ TypedWorkload()

TypedWorkload ( const QueueDescriptor descriptor,
const WorkloadInfo info 
)
inline

Definition at line 98 of file Workload.hpp.

99  : BaseWorkload<QueueDescriptor>(descriptor, info)
100  {
101  std::vector<armnn::DataType> dataTypes = {DataTypes...};
102  armnn::DataType expectedInputType;
103 
104  if (!info.m_InputTensorInfos.empty())
105  {
106  expectedInputType = info.m_InputTensorInfos.front().GetDataType();
107 
108  if (std::find(dataTypes.begin(), dataTypes.end(), expectedInputType) == dataTypes.end())
109  {
110  ARMNN_ASSERT_MSG(false, "Trying to create workload with incorrect type");
111  }
112  ARMNN_ASSERT_MSG(std::all_of(std::next(info.m_InputTensorInfos.begin()),
113  info.m_InputTensorInfos.end(),
114  [&](auto it){
115  return it.GetDataType() == expectedInputType;
116  }),
117  "Trying to create workload with incorrect type");
118  }
119  armnn::DataType expectedOutputType;
120 
121  if (!info.m_OutputTensorInfos.empty())
122  {
123  expectedOutputType = info.m_OutputTensorInfos.front().GetDataType();
124 
125  if (!info.m_InputTensorInfos.empty())
126  {
127  if (expectedOutputType != expectedInputType)
128  {
129  ARMNN_ASSERT_MSG(false, "Trying to create workload with incorrect type");
130  }
131  }
132  else if (std::find(dataTypes.begin(), dataTypes.end(), expectedOutputType) == dataTypes.end())
133  {
134  ARMNN_ASSERT_MSG(false, "Trying to create workload with incorrect type");
135  }
136  ARMNN_ASSERT_MSG(std::all_of(std::next(info.m_OutputTensorInfos.begin()),
137  info.m_OutputTensorInfos.end(),
138  [&](auto it){
139  return it.GetDataType() == expectedOutputType;
140  }),
141  "Trying to create workload with incorrect type");
142  }
143  }
DataType
Definition: Types.hpp:48
#define ARMNN_ASSERT_MSG(COND, MSG)
Definition: Assert.hpp:15

The documentation for this class was generated from the following file: