15#include <client/include/IProfilingService.hpp>
27 NullWorkload()=
delete;
30template <
typename QueueDescriptor>
37 m_Guid(
arm::pipe::IProfilingService::GetNextGuid()),
43 virtual const std::string&
GetName()
const override
75 const arm::pipe::ProfilingGuid
m_Guid;
88 std::vector<armnn::DataType> dataTypes = {DataTypes...};
91 if (!
info.m_InputTensorInfos.empty())
93 expectedInputType = info.m_InputTensorInfos.front().GetDataType();
95 if (std::find(dataTypes.begin(), dataTypes.end(), expectedInputType) == dataTypes.end())
97 throw armnn::Exception(
"Trying to create workload with incorrect type");
99 if (std::all_of(std::next(
info.m_InputTensorInfos.begin()),
100 info.m_InputTensorInfos.end(),
102 return it.GetDataType() == expectedInputType;
105 throw armnn::Exception(
"Trying to create workload with incorrect type");
110 if (!
info.m_OutputTensorInfos.empty())
112 expectedOutputType = info.m_OutputTensorInfos.front().GetDataType();
114 if (!info.m_InputTensorInfos.empty())
116 expectedInputType = info.m_InputTensorInfos.front().GetDataType();
118 if (expectedOutputType != expectedInputType)
120 throw armnn::Exception(
"Trying to create workload with incorrect type");
123 else if (std::find(dataTypes.begin(), dataTypes.end(), expectedOutputType) == dataTypes.end())
125 throw armnn::Exception(
"Trying to create workload with incorrect type");
127 if (std::all_of(std::next(
info.m_OutputTensorInfos.begin()),
128 info.m_OutputTensorInfos.end(),
130 return it.GetDataType() == expectedOutputType;
133 throw armnn::Exception(
"Trying to create workload with incorrect type");
139template <
typename QueueDescriptor, armnn::DataType InputDataType, armnn::DataType OutputDataType>
147 if (std::all_of(
info.m_InputTensorInfos.begin(),
148 info.m_InputTensorInfos.end(),
150 return it.GetDataType() == InputDataType;
153 throw armnn::Exception(
"Trying to create workload with incorrect type");
155 if (std::all_of(
info.m_OutputTensorInfos.begin(),
156 info.m_OutputTensorInfos.end(),
158 return it.GetDataType() == OutputDataType;
161 throw armnn::Exception(
"Trying to create workload with incorrect type");
167template <
typename QueueDescriptor, armnn::DataType DataType>
175 if (!
info.m_InputTensorInfos.empty())
177 if (info.m_InputTensorInfos.front().GetDataType() != DataType)
179 throw armnn::Exception(
"Trying to create workload with incorrect type");
183 if (std::all_of(
info.m_OutputTensorInfos.begin(),
184 info.m_OutputTensorInfos.end(),
186 return it.GetDataType() == DataType;
189 throw armnn::Exception(
"Trying to create workload with incorrect type");
194template <
typename QueueDescriptor>
199template <
typename QueueDescriptor>
202template <
typename QueueDescriptor>
205template <
typename QueueDescriptor>
208template <
typename QueueDescriptor>
211template <
typename QueueDescriptor>
216template <
typename QueueDescriptor>
221template <
typename QueueDescriptor>
226template <
typename QueueDescriptor>
231template <
typename QueueDescriptor>
236template <
typename QueueDescriptor>
241template <
typename QueueDescriptor>
virtual bool SupportsTensorHandleReplacement() const override
const arm::pipe::ProfilingGuid m_Guid
const QueueDescriptor & GetData() const
void PostAllocationConfigure() override
arm::pipe::ProfilingGuid GetGuid() const final
void ReplaceInputTensorHandle(ITensorHandle *tensorHandle, unsigned int slot) override
void ReplaceOutputTensorHandle(ITensorHandle *tensorHandle, unsigned int slot) override
virtual const std::string & GetName() const override
BaseWorkload(const QueueDescriptor &descriptor, const WorkloadInfo &info)
Workload interface to enqueue a layer computation.
MultiTypedWorkload(const QueueDescriptor &descriptor, const WorkloadInfo &info)
TypedWorkload(const QueueDescriptor &descriptor, const WorkloadInfo &info)
Copyright (c) 2021 ARM Limited and Contributors.
TypedWorkload< QueueDescriptor, armnn::DataType::Float32 > Float32Workload
TypedWorkload< QueueDescriptor, armnn::DataType::Signed32 > Int32Workload
MultiTypedWorkload< QueueDescriptor, armnn::DataType::Float32, armnn::DataType::Boolean > BaseFloat32ComparisonWorkload
MultiTypedWorkload< QueueDescriptor, armnn::DataType::BFloat16, armnn::DataType::Float32 > BFloat16ToFloat32Workload
MultiTypedWorkload< QueueDescriptor, armnn::DataType::Float16, armnn::DataType::Float32 > Float16ToFloat32Workload
MultiTypedWorkload< QueueDescriptor, armnn::DataType::QAsymmU8, armnn::DataType::Boolean > BaseUint8ComparisonWorkload
MultiTypedWorkload< QueueDescriptor, armnn::DataType::QAsymmU8, armnn::DataType::Float32 > Uint8ToFloat32Workload
MultiTypedWorkload< QueueDescriptor, armnn::DataType::Float32, armnn::DataType::BFloat16 > Float32ToBFloat16Workload
TypedWorkload< QueueDescriptor, armnn::DataType::Float16, armnn::DataType::Float32 > FloatWorkload
TypedWorkload< QueueDescriptor, armnn::DataType::Boolean > BooleanWorkload
MultiTypedWorkload< QueueDescriptor, armnn::DataType::Float32, armnn::DataType::Float16 > Float32ToFloat16Workload
TypedWorkload< QueueDescriptor, armnn::DataType::QAsymmU8 > Uint8Workload
void IgnoreUnused(Ts &&...)
Contains information about TensorInfos of a layer.