ArmNN
 24.08
IWorkloadFactory Class Referenceabstract

#include <WorkloadFactory.hpp>

Inheritance diagram for IWorkloadFactory:
[legend]

Public Member Functions

virtual ~IWorkloadFactory ()
 
virtual void AfterWorkloadsCreated ()
 
virtual const BackendIdGetBackendId () const =0
 
virtual bool SupportsSubTensors () const =0
 
virtual std::unique_ptr< ITensorHandleCreateSubTensorHandle (ITensorHandle &parent, TensorShape const &subTensorShape, unsigned int const *subTensorOrigin) const =0
 
virtual std::unique_ptr< ITensorHandleCreateTensorHandle (const TensorInfo &tensorInfo, const bool IsMemoryManaged=true) const =0
 
virtual std::unique_ptr< ITensorHandleCreateTensorHandle (const TensorInfo &tensorInfo, DataLayout dataLayout, const bool IsMemoryManaged=true) const =0
 
virtual std::unique_ptr< IWorkloadCreateWorkload (LayerType type, const QueueDescriptor &descriptor, const WorkloadInfo &info) const =0
 Backends should implement their own CreateWorkload function with a switch statement. More...
 

Static Public Member Functions

static bool IsLayerSupported (const BackendId &backendId, const IConnectableLayer &layer, Optional< DataType > dataType, std::string &outReasonIfUnsupported)
 
static bool IsLayerSupported (const IConnectableLayer &layer, Optional< DataType > dataType, std::string &outReasonIfUnsupported)
 
static bool IsLayerSupported (const IConnectableLayer &layer, Optional< DataType > dataType, std::string &outReasonIfUnsupported, const ModelOptions &modelOptions)
 
static bool IsLayerSupported (const BackendId &backendId, const IConnectableLayer &layer, Optional< DataType > dataType, std::string &outReasonIfUnsupported, const ModelOptions &modelOptions)
 

Detailed Description

Definition at line 22 of file WorkloadFactory.hpp.

Constructor & Destructor Documentation

◆ ~IWorkloadFactory()

virtual ~IWorkloadFactory ( )
inlinevirtual

Definition at line 25 of file WorkloadFactory.hpp.

25 { }

Member Function Documentation

◆ AfterWorkloadsCreated()

virtual void AfterWorkloadsCreated ( )
inlinevirtual

Reimplemented in ClWorkloadFactory.

Definition at line 27 of file WorkloadFactory.hpp.

27 {};

◆ CreateSubTensorHandle()

virtual std::unique_ptr<ITensorHandle> CreateSubTensorHandle ( ITensorHandle parent,
TensorShape const &  subTensorShape,
unsigned int const *  subTensorOrigin 
) const
pure virtual

◆ CreateTensorHandle() [1/2]

virtual std::unique_ptr<ITensorHandle> CreateTensorHandle ( const TensorInfo tensorInfo,
const bool  IsMemoryManaged = true 
) const
pure virtual

◆ CreateTensorHandle() [2/2]

virtual std::unique_ptr<ITensorHandle> CreateTensorHandle ( const TensorInfo tensorInfo,
DataLayout  dataLayout,
const bool  IsMemoryManaged = true 
) const
pure virtual

◆ CreateWorkload()

virtual std::unique_ptr<IWorkload> CreateWorkload ( LayerType  type,
const QueueDescriptor descriptor,
const WorkloadInfo info 
) const
pure virtual

Backends should implement their own CreateWorkload function with a switch statement.

The case for the switch should be the LayerType and based on that they will call their specific workload creation functionality.

Implemented in WorkloadFactoryBase, RefWorkloadFactory, ClWorkloadFactory, TosaRefWorkloadFactory, NeonWorkloadFactory, GpuFsaWorkloadFactory, and SampleDynamicWorkloadFactory.

Referenced by ActivationLayer::CreateWorkload(), BroadcastToLayer::CreateWorkload(), ConvertFp32ToFp16Layer::CreateWorkload(), FillLayer::CreateWorkload(), QuantizeLayer::CreateWorkload(), RankLayer::CreateWorkload(), AbsLayer::CreateWorkload(), GatherNdLayer::CreateWorkload(), InstanceNormalizationLayer::CreateWorkload(), SplitterLayer::CreateWorkload(), StackLayer::CreateWorkload(), StridedSliceLayer::CreateWorkload(), SoftmaxLayer::CreateWorkload(), L2NormalizationLayer::CreateWorkload(), ShapeLayer::CreateWorkload(), SwitchLayer::CreateWorkload(), RsqrtLayer::CreateWorkload(), CastLayer::CreateWorkload(), DebugLayer::CreateWorkload(), BatchMatMulLayer::CreateWorkload(), DequantizeLayer::CreateWorkload(), NormalizationLayer::CreateWorkload(), Pooling2dLayer::CreateWorkload(), Pooling3dLayer::CreateWorkload(), TileLayer::CreateWorkload(), ConcatLayer::CreateWorkload(), FakeQuantizationLayer::CreateWorkload(), ResizeLayer::CreateWorkload(), AdditionLayer::CreateWorkload(), ConvertFp16ToFp32Layer::CreateWorkload(), FloorLayer::CreateWorkload(), ScatterNdLayer::CreateWorkload(), BatchToSpaceNdLayer::CreateWorkload(), SliceLayer::CreateWorkload(), MeanLayer::CreateWorkload(), MaximumLayer::CreateWorkload(), ReverseV2Layer::CreateWorkload(), SpaceToBatchNdLayer::CreateWorkload(), SubtractionLayer::CreateWorkload(), ArgMinMaxLayer::CreateWorkload(), SpaceToDepthLayer::CreateWorkload(), LogicalBinaryLayer::CreateWorkload(), LogSoftmaxLayer::CreateWorkload(), DepthToSpaceLayer::CreateWorkload(), ElementwiseUnaryLayer::CreateWorkload(), MinimumLayer::CreateWorkload(), MultiplicationLayer::CreateWorkload(), PadLayer::CreateWorkload(), ComparisonLayer::CreateWorkload(), PermuteLayer::CreateWorkload(), DivisionLayer::CreateWorkload(), TransposeLayer::CreateWorkload(), PreluLayer::CreateWorkload(), ElementwiseBinaryLayer::CreateWorkload(), ReduceLayer::CreateWorkload(), GatherLayer::CreateWorkload(), ChannelShuffleLayer::CreateWorkload(), ConstantLayer::CreateWorkload(), ReshapeLayer::CreateWorkload(), Convolution2dLayer::CreateWorkload(), FullyConnectedLayer::CreateWorkload(), Convolution3dLayer::CreateWorkload(), DepthwiseConvolution2dLayer::CreateWorkload(), FusedLayer::CreateWorkload(), DetectionPostProcessLayer::CreateWorkload(), TransposeConvolution2dLayer::CreateWorkload(), PreCompiledLayer::CreateWorkload(), LstmLayer::CreateWorkload(), UnidirectionalSequenceLstmLayer::CreateWorkload(), BatchNormalizationLayer::CreateWorkload(), QuantizedLstmLayer::CreateWorkload(), and QLstmLayer::CreateWorkload().

◆ GetBackendId()

◆ IsLayerSupported() [1/4]

bool IsLayerSupported ( const BackendId backendId,
const IConnectableLayer layer,
Optional< DataType dataType,
std::string &  outReasonIfUnsupported 
)
static

Definition at line 1629 of file WorkloadFactory.cpp.

1633 {
1634  return IsLayerConfigurationSupported(backendId, connectableLayer, dataType, outReasonIfUnsupported);
1635 }

Referenced by armnn::AttemptBackendAssignment(), GpuFsaWorkloadFactory::IsLayerSupported(), TosaRefWorkloadFactory::IsLayerSupported(), NeonWorkloadFactory::IsLayerSupported(), ClWorkloadFactory::IsLayerSupported(), and RefWorkloadFactory::IsLayerSupported().

◆ IsLayerSupported() [2/4]

bool IsLayerSupported ( const BackendId backendId,
const IConnectableLayer layer,
Optional< DataType dataType,
std::string &  outReasonIfUnsupported,
const ModelOptions modelOptions 
)
static

Definition at line 1658 of file WorkloadFactory.cpp.

1663 {
1664  return IsLayerConfigurationSupported(backendId,
1665  connectableLayer,
1666  dataType,
1667  outReasonIfUnsupported,
1668  modelOptions);
1669 }

◆ IsLayerSupported() [3/4]

bool IsLayerSupported ( const IConnectableLayer layer,
Optional< DataType dataType,
std::string &  outReasonIfUnsupported 
)
static

Definition at line 1637 of file WorkloadFactory.cpp.

1640 {
1641  auto layer = PolymorphicDowncast<const Layer*>(&connectableLayer);
1642  return IsLayerConfigurationSupported(layer->GetBackendId(), connectableLayer, dataType, outReasonIfUnsupported);
1643 }

◆ IsLayerSupported() [4/4]

bool IsLayerSupported ( const IConnectableLayer layer,
Optional< DataType dataType,
std::string &  outReasonIfUnsupported,
const ModelOptions modelOptions 
)
static

Definition at line 1645 of file WorkloadFactory.cpp.

1649 {
1650  auto layer = PolymorphicDowncast<const Layer*>(&connectableLayer);
1651  return IsLayerConfigurationSupported(layer->GetBackendId(),
1652  connectableLayer,
1653  dataType,
1654  outReasonIfUnsupported,
1655  modelOptions);
1656 }

◆ SupportsSubTensors()


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