• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright © 2019 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include <armnn/backends/WorkloadFactory.hpp>
9 
10 namespace armnn
11 {
12 
13 class WorkloadFactoryBase : public IWorkloadFactory
14 {
15 public:
SupportsSubTensors() const16     bool SupportsSubTensors() const override
17     { return false; };
18 
CreateSubTensorHandle(ITensorHandle &,TensorShape const &,unsigned int const *) const19     std::unique_ptr<ITensorHandle> CreateSubTensorHandle(ITensorHandle& /*parent*/,
20                                                          TensorShape const& /*subTensorShape*/,
21                                                          unsigned int const */*subTensorOrigin*/) const override
22     { return nullptr; };
23 
CreateInput(const InputQueueDescriptor &,const WorkloadInfo &) const24     std::unique_ptr<IWorkload> CreateInput(const InputQueueDescriptor& /*descriptor*/,
25                                            const WorkloadInfo& /*info*/) const override
26     { return nullptr; }
27 
CreateTensorHandle(const TensorInfo &,const bool) const28     std::unique_ptr<ITensorHandle> CreateTensorHandle(const TensorInfo& /*tensorInfo*/,
29                                                       const bool /*IsMemoryManaged*/) const override
30     { return nullptr; }
31 
CreateTensorHandle(const TensorInfo &,DataLayout,const bool) const32     std::unique_ptr<ITensorHandle> CreateTensorHandle(const TensorInfo& /*tensorInfo*/,
33                                                       DataLayout /*dataLayout*/,
34                                                       const bool /*IsMemoryManaged*/) const override
35     { return nullptr; }
36 
CreateWorkload(LayerType,const QueueDescriptor &,const WorkloadInfo &) const37     std::unique_ptr<IWorkload> CreateWorkload(LayerType /*type*/,
38                                               const QueueDescriptor& /*descriptor*/,
39                                               const WorkloadInfo& /*info*/) const override
40     { return nullptr; }
41 
CreateActivation(const ActivationQueueDescriptor &,const WorkloadInfo &) const42     std::unique_ptr<IWorkload> CreateActivation(const ActivationQueueDescriptor& /*descriptor*/,
43                                                 const WorkloadInfo& /*info*/) const override
44     { return nullptr; }
45 
CreateAddition(const AdditionQueueDescriptor &,const WorkloadInfo &) const46     std::unique_ptr<IWorkload> CreateAddition(const AdditionQueueDescriptor& /*descriptor*/,
47                                               const WorkloadInfo& /*info*/) const override
48     { return nullptr; }
49 
CreateArgMinMax(const ArgMinMaxQueueDescriptor &,const WorkloadInfo &) const50     std::unique_ptr<IWorkload> CreateArgMinMax(const ArgMinMaxQueueDescriptor& /*descriptor*/,
51                                                const WorkloadInfo& /*info*/) const override
52     { return nullptr; }
53 
CreateBatchNormalization(const BatchNormalizationQueueDescriptor &,const WorkloadInfo &) const54     std::unique_ptr<IWorkload> CreateBatchNormalization(const BatchNormalizationQueueDescriptor& /*descriptor*/,
55                                                         const WorkloadInfo& /*info*/) const override
56     { return nullptr; }
57 
CreateBatchToSpaceNd(const BatchToSpaceNdQueueDescriptor &,const WorkloadInfo &) const58     std::unique_ptr<IWorkload> CreateBatchToSpaceNd(const BatchToSpaceNdQueueDescriptor& /*descriptor*/,
59                                                     const WorkloadInfo& /*info*/) const override
60     { return nullptr; }
61 
CreateComparison(const ComparisonQueueDescriptor &,const WorkloadInfo &) const62     std::unique_ptr<IWorkload> CreateComparison(const ComparisonQueueDescriptor& /*descriptor*/,
63                                                 const WorkloadInfo& /*info*/) const override
64     { return nullptr; }
65 
CreateConcat(const ConcatQueueDescriptor &,const WorkloadInfo &) const66     std::unique_ptr<IWorkload> CreateConcat(const ConcatQueueDescriptor& /*descriptor*/,
67                                             const WorkloadInfo& /*info*/) const override
68     { return nullptr; }
69 
CreateConstant(const ConstantQueueDescriptor &,const WorkloadInfo &) const70     std::unique_ptr<IWorkload> CreateConstant(const ConstantQueueDescriptor& /*descriptor*/,
71                                               const WorkloadInfo& /*info*/) const override
72     { return nullptr; }
73 
CreateConvertFp16ToFp32(const ConvertFp16ToFp32QueueDescriptor &,const WorkloadInfo &) const74     std::unique_ptr<IWorkload> CreateConvertFp16ToFp32(const ConvertFp16ToFp32QueueDescriptor& /*descriptor*/,
75                                                        const WorkloadInfo& /*info*/) const override
76     { return nullptr; }
77 
CreateConvertFp32ToFp16(const ConvertFp32ToFp16QueueDescriptor &,const WorkloadInfo &) const78     std::unique_ptr<IWorkload> CreateConvertFp32ToFp16(const ConvertFp32ToFp16QueueDescriptor& /*descriptor*/,
79                                                        const WorkloadInfo& /*info*/) const override
80     { return nullptr; }
81 
CreateConvolution2d(const Convolution2dQueueDescriptor &,const WorkloadInfo &) const82     std::unique_ptr<IWorkload> CreateConvolution2d(const Convolution2dQueueDescriptor& /*descriptor*/,
83                                                    const WorkloadInfo& /*info*/) const override
84     { return nullptr; }
85 
CreateDebug(const DebugQueueDescriptor &,const WorkloadInfo &) const86     std::unique_ptr<IWorkload> CreateDebug(const DebugQueueDescriptor& /*descriptor*/,
87                                            const WorkloadInfo& /*info*/) const override
88     { return nullptr; }
89 
CreateDepthToSpace(const DepthToSpaceQueueDescriptor &,const WorkloadInfo &) const90     std::unique_ptr<IWorkload> CreateDepthToSpace(const DepthToSpaceQueueDescriptor& /*descriptor*/,
91                                                   const WorkloadInfo& /*info*/) const override
92     { return nullptr; }
93 
CreateDepthwiseConvolution2d(const DepthwiseConvolution2dQueueDescriptor &,const WorkloadInfo &) const94     std::unique_ptr<IWorkload> CreateDepthwiseConvolution2d(const DepthwiseConvolution2dQueueDescriptor& /*descriptor*/,
95                                                             const WorkloadInfo& /*info*/) const override
96     { return nullptr; }
97 
CreateDequantize(const DequantizeQueueDescriptor &,const WorkloadInfo &) const98     std::unique_ptr<IWorkload> CreateDequantize(const DequantizeQueueDescriptor& /*descriptor*/,
99                                                 const WorkloadInfo& /*info*/) const override
100     { return nullptr; }
101 
CreateDetectionPostProcess(const DetectionPostProcessQueueDescriptor &,const WorkloadInfo &) const102     std::unique_ptr<IWorkload> CreateDetectionPostProcess(const DetectionPostProcessQueueDescriptor& /*descriptor*/,
103                                                           const WorkloadInfo& /*info*/) const override
104     { return nullptr; }
105 
CreateDivision(const DivisionQueueDescriptor &,const WorkloadInfo &) const106     std::unique_ptr<IWorkload> CreateDivision(const DivisionQueueDescriptor& /*descriptor*/,
107                                               const WorkloadInfo& /*info*/) const override
108     { return nullptr; }
109 
CreateElementwiseUnary(const ElementwiseUnaryQueueDescriptor & descriptor,const WorkloadInfo & info) const110     std::unique_ptr<IWorkload> CreateElementwiseUnary(const ElementwiseUnaryQueueDescriptor& descriptor,
111                                                       const WorkloadInfo& info) const override
112     {
113         if (descriptor.m_Parameters.m_Operation == UnaryOperation::LogicalNot)
114         {
115             return CreateWorkload(armnn::LayerType::ElementwiseUnary, descriptor, info);
116         }
117         else
118         {
119             { return nullptr; }
120         }
121     }
122 
CreateFakeQuantization(const FakeQuantizationQueueDescriptor &,const WorkloadInfo &) const123     std::unique_ptr<IWorkload> CreateFakeQuantization(const FakeQuantizationQueueDescriptor& /*descriptor*/,
124                                                       const WorkloadInfo& /*info*/) const override
125     { return nullptr; }
126 
CreateFloor(const FloorQueueDescriptor &,const WorkloadInfo &) const127     std::unique_ptr<IWorkload> CreateFloor(const FloorQueueDescriptor& /*descriptor*/,
128                                            const WorkloadInfo& /*info*/) const override
129     { return nullptr; }
130 
CreateFullyConnected(const FullyConnectedQueueDescriptor &,const WorkloadInfo &) const131     std::unique_ptr<IWorkload> CreateFullyConnected(const FullyConnectedQueueDescriptor& /*descriptor*/,
132                                                     const WorkloadInfo& /*info*/) const override
133     { return nullptr; }
134 
CreateGather(const GatherQueueDescriptor &,const WorkloadInfo &) const135     std::unique_ptr<IWorkload> CreateGather(const GatherQueueDescriptor& /*descriptor*/,
136                                             const WorkloadInfo& /*info*/) const override
137     { return nullptr; }
138 
CreateInstanceNormalization(const InstanceNormalizationQueueDescriptor &,const WorkloadInfo &) const139     std::unique_ptr<IWorkload> CreateInstanceNormalization(const InstanceNormalizationQueueDescriptor& /*descriptor*/,
140                                                            const WorkloadInfo& /*info*/) const override
141     { return nullptr; }
142 
CreateL2Normalization(const L2NormalizationQueueDescriptor &,const WorkloadInfo &) const143     std::unique_ptr<IWorkload> CreateL2Normalization(const L2NormalizationQueueDescriptor& /*descriptor*/,
144                                                      const WorkloadInfo& /*info*/) const override
145     { return nullptr; }
146 
CreateLogSoftmax(const LogSoftmaxQueueDescriptor &,const WorkloadInfo &) const147     std::unique_ptr<IWorkload> CreateLogSoftmax(const LogSoftmaxQueueDescriptor& /*descriptor*/,
148                                                 const WorkloadInfo& /*info*/) const override
149     { return nullptr; }
150 
CreateLstm(const LstmQueueDescriptor &,const WorkloadInfo &) const151     std::unique_ptr<IWorkload> CreateLstm(const LstmQueueDescriptor& /*descriptor*/,
152                                           const WorkloadInfo& /*info*/) const override
153     { return nullptr; }
154 
CreateMaximum(const MaximumQueueDescriptor &,const WorkloadInfo &) const155     std::unique_ptr<IWorkload> CreateMaximum(const MaximumQueueDescriptor& /*descriptor*/,
156                                              const WorkloadInfo& /*info*/) const override
157     { return nullptr; }
158 
CreateMean(const MeanQueueDescriptor &,const WorkloadInfo &) const159     std::unique_ptr<IWorkload> CreateMean(const MeanQueueDescriptor& /*descriptor*/,
160                                           const WorkloadInfo& /*info*/) const override
161     { return nullptr; }
162 
CreateMemCopy(const MemCopyQueueDescriptor &,const WorkloadInfo &) const163     std::unique_ptr<IWorkload> CreateMemCopy(const MemCopyQueueDescriptor& /*descriptor*/,
164                                              const WorkloadInfo& /*info*/) const override
165     { return nullptr; }
166 
CreateMemImport(const MemImportQueueDescriptor &,const WorkloadInfo &) const167     std::unique_ptr<IWorkload> CreateMemImport(const MemImportQueueDescriptor& /*descriptor*/,
168                                                const WorkloadInfo& /*info*/) const override
169     { return nullptr; }
170 
CreateMerge(const MergeQueueDescriptor &,const WorkloadInfo &) const171     std::unique_ptr<IWorkload> CreateMerge(const MergeQueueDescriptor& /*descriptor*/,
172                                            const WorkloadInfo& /*info*/) const override
173     { return nullptr; }
174 
CreateMinimum(const MinimumQueueDescriptor &,const WorkloadInfo &) const175     std::unique_ptr<IWorkload> CreateMinimum(const MinimumQueueDescriptor& /*descriptor*/,
176                                              const WorkloadInfo& /*info*/) const override
177     { return nullptr; }
178 
CreateMultiplication(const MultiplicationQueueDescriptor &,const WorkloadInfo &) const179     std::unique_ptr<IWorkload> CreateMultiplication(const MultiplicationQueueDescriptor& /*descriptor*/,
180                                                     const WorkloadInfo& /*info*/) const override
181     { return nullptr; }
182 
CreateNormalization(const NormalizationQueueDescriptor &,const WorkloadInfo &) const183     std::unique_ptr<IWorkload> CreateNormalization(const NormalizationQueueDescriptor& /*descriptor*/,
184                                                    const WorkloadInfo& /*info*/) const override
185     { return nullptr; }
186 
CreateOutput(const OutputQueueDescriptor &,const WorkloadInfo &) const187     std::unique_ptr<IWorkload> CreateOutput(const OutputQueueDescriptor& /*descriptor*/,
188                                             const WorkloadInfo& /*info*/) const override
189     { return nullptr; }
190 
CreatePad(const PadQueueDescriptor &,const WorkloadInfo &) const191     std::unique_ptr<IWorkload> CreatePad(const PadQueueDescriptor& /*descriptor*/,
192                                          const WorkloadInfo& /*info*/) const override
193     { return nullptr; }
194 
CreatePermute(const PermuteQueueDescriptor &,const WorkloadInfo &) const195     std::unique_ptr<IWorkload> CreatePermute(const PermuteQueueDescriptor& /*descriptor*/,
196                                              const WorkloadInfo& /*info*/) const override
197     { return nullptr; }
198 
CreatePooling2d(const Pooling2dQueueDescriptor &,const WorkloadInfo &) const199     std::unique_ptr<IWorkload> CreatePooling2d(const Pooling2dQueueDescriptor& /*descriptor*/,
200                                                const WorkloadInfo& /*info*/) const override
201     { return nullptr; }
202 
CreatePooling3d(const Pooling3dQueueDescriptor &,const WorkloadInfo &) const203     std::unique_ptr<IWorkload> CreatePooling3d(const Pooling3dQueueDescriptor& /*descriptor*/,
204                                                const WorkloadInfo& /*info*/) const override
205     { return nullptr; }
206 
CreatePreCompiled(const PreCompiledQueueDescriptor &,const WorkloadInfo &) const207     std::unique_ptr<IWorkload> CreatePreCompiled(const PreCompiledQueueDescriptor& /*descriptor*/,
208                                                  const WorkloadInfo& /*info*/) const override
209     { return nullptr; }
210 
CreatePrelu(const PreluQueueDescriptor &,const WorkloadInfo &) const211     std::unique_ptr<IWorkload> CreatePrelu(const PreluQueueDescriptor& /*descriptor*/,
212                                            const WorkloadInfo& /*info*/) const override
213     { return nullptr; }
214 
CreateQuantize(const QuantizeQueueDescriptor &,const WorkloadInfo &) const215     std::unique_ptr<IWorkload> CreateQuantize(const QuantizeQueueDescriptor& /*descriptor*/,
216                                               const WorkloadInfo& /*info*/) const override
217     { return nullptr; }
218 
CreateQuantizedLstm(const QuantizedLstmQueueDescriptor &,const WorkloadInfo &) const219     std::unique_ptr<IWorkload> CreateQuantizedLstm(const QuantizedLstmQueueDescriptor& /*descriptor*/,
220                                                    const WorkloadInfo& /*info*/) const override
221     { return nullptr; }
222 
CreateRank(const RankQueueDescriptor &,const WorkloadInfo &) const223     std::unique_ptr<IWorkload> CreateRank(const RankQueueDescriptor& /*descriptor*/,
224                                           const WorkloadInfo& /*info*/) const override
225     { return nullptr; }
226 
CreateReshape(const ReshapeQueueDescriptor &,const WorkloadInfo &) const227     std::unique_ptr<IWorkload> CreateReshape(const ReshapeQueueDescriptor& /*descriptor*/,
228                                              const WorkloadInfo& /*info*/) const override
229     { return nullptr; }
230 
CreateResize(const ResizeQueueDescriptor &,const WorkloadInfo &) const231     std::unique_ptr<IWorkload> CreateResize(const ResizeQueueDescriptor& /*descriptor*/,
232                                             const WorkloadInfo& /*info*/) const override
233     { return nullptr; }
234 
CreateSlice(const SliceQueueDescriptor &,const WorkloadInfo &) const235     std::unique_ptr<IWorkload> CreateSlice(const SliceQueueDescriptor& /*descriptor*/,
236                                            const WorkloadInfo& /*info*/) const override
237     { return nullptr; }
238 
CreateSoftmax(const SoftmaxQueueDescriptor &,const WorkloadInfo &) const239     std::unique_ptr<IWorkload> CreateSoftmax(const SoftmaxQueueDescriptor& /*descriptor*/,
240                                              const WorkloadInfo& /*info*/) const override
241     { return nullptr; }
242 
CreateSpaceToBatchNd(const SpaceToBatchNdQueueDescriptor &,const WorkloadInfo &) const243     std::unique_ptr<IWorkload> CreateSpaceToBatchNd(const SpaceToBatchNdQueueDescriptor& /*descriptor*/,
244                                                     const WorkloadInfo& /*info*/) const override
245     { return nullptr; }
246 
CreateSpaceToDepth(const SpaceToDepthQueueDescriptor &,const WorkloadInfo &) const247     std::unique_ptr<IWorkload> CreateSpaceToDepth(const SpaceToDepthQueueDescriptor& /*descriptor*/,
248                                                   const WorkloadInfo& /*info*/) const override
249     { return nullptr; }
250 
CreateSubtraction(const SubtractionQueueDescriptor &,const WorkloadInfo &) const251     std::unique_ptr<IWorkload> CreateSubtraction(const SubtractionQueueDescriptor& /*descriptor*/,
252                                                  const WorkloadInfo& /*info*/) const override
253     { return nullptr; }
254 
CreateSplitter(const SplitterQueueDescriptor &,const WorkloadInfo &) const255     std::unique_ptr<IWorkload> CreateSplitter(const SplitterQueueDescriptor& /*descriptor*/,
256                                               const WorkloadInfo& /*info*/) const override
257     { return nullptr; }
258 
CreateStack(const StackQueueDescriptor &,const WorkloadInfo &) const259     std::unique_ptr<IWorkload> CreateStack(const StackQueueDescriptor& /*descriptor*/,
260                                            const WorkloadInfo& /*info*/) const override
261     { return nullptr; }
262 
CreateStridedSlice(const StridedSliceQueueDescriptor &,const WorkloadInfo &) const263     std::unique_ptr<IWorkload> CreateStridedSlice(const StridedSliceQueueDescriptor& /*descriptor*/,
264                                                   const WorkloadInfo& /*info*/) const override
265     { return nullptr; }
266 
CreateSwitch(const SwitchQueueDescriptor &,const WorkloadInfo &) const267     std::unique_ptr<IWorkload> CreateSwitch(const SwitchQueueDescriptor& /*descriptor*/,
268                                             const WorkloadInfo& /*info*/) const override
269     { return nullptr; }
270 
CreateTranspose(const TransposeQueueDescriptor &,const WorkloadInfo &) const271     std::unique_ptr<IWorkload> CreateTranspose(const TransposeQueueDescriptor& /*descriptor*/,
272                                                const WorkloadInfo& /*info*/) const override
273     { return nullptr; }
274 
CreateTransposeConvolution2d(const TransposeConvolution2dQueueDescriptor &,const WorkloadInfo &) const275     std::unique_ptr<IWorkload> CreateTransposeConvolution2d(const TransposeConvolution2dQueueDescriptor& /*descriptor*/,
276                                                             const WorkloadInfo& /*info*/) const override
277     { return nullptr; }
278 };
279 
280 } //namespace armnn