ArmNN
 24.02
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(), StackLayer::CreateWorkload(), StridedSliceLayer::CreateWorkload(), SwitchLayer::CreateWorkload(), L2NormalizationLayer::CreateWorkload(), SliceLayer::CreateWorkload(), TileLayer::CreateWorkload(), RsqrtLayer::CreateWorkload(), CastLayer::CreateWorkload(), DebugLayer::CreateWorkload(), BatchMatMulLayer::CreateWorkload(), DequantizeLayer::CreateWorkload(), NormalizationLayer::CreateWorkload(), Pooling2dLayer::CreateWorkload(), Pooling3dLayer::CreateWorkload(), ConcatLayer::CreateWorkload(), FakeQuantizationLayer::CreateWorkload(), ResizeLayer::CreateWorkload(), AdditionLayer::CreateWorkload(), ConvertFp16ToFp32Layer::CreateWorkload(), FloorLayer::CreateWorkload(), ShapeLayer::CreateWorkload(), BatchToSpaceNdLayer::CreateWorkload(), SoftmaxLayer::CreateWorkload(), SplitterLayer::CreateWorkload(), MeanLayer::CreateWorkload(), MaximumLayer::CreateWorkload(), ReverseV2Layer::CreateWorkload(), SpaceToBatchNdLayer::CreateWorkload(), SubtractionLayer::CreateWorkload(), SpaceToDepthLayer::CreateWorkload(), GatherLayer::CreateWorkload(), LogicalBinaryLayer::CreateWorkload(), LogSoftmaxLayer::CreateWorkload(), DepthToSpaceLayer::CreateWorkload(), ElementwiseUnaryLayer::CreateWorkload(), MinimumLayer::CreateWorkload(), ArgMinMaxLayer::CreateWorkload(), MultiplicationLayer::CreateWorkload(), PadLayer::CreateWorkload(), ComparisonLayer::CreateWorkload(), PermuteLayer::CreateWorkload(), DivisionLayer::CreateWorkload(), TransposeLayer::CreateWorkload(), PreluLayer::CreateWorkload(), ElementwiseBinaryLayer::CreateWorkload(), ReduceLayer::CreateWorkload(), ReshapeLayer::CreateWorkload(), ConstantLayer::CreateWorkload(), ChannelShuffleLayer::CreateWorkload(), Convolution3dLayer::CreateWorkload(), Convolution2dLayer::CreateWorkload(), FullyConnectedLayer::CreateWorkload(), DepthwiseConvolution2dLayer::CreateWorkload(), FusedLayer::CreateWorkload(), DetectionPostProcessLayer::CreateWorkload(), TransposeConvolution2dLayer::CreateWorkload(), PreCompiledLayer::CreateWorkload(), UnidirectionalSequenceLstmLayer::CreateWorkload(), LstmLayer::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 1614 of file WorkloadFactory.cpp.

1618 {
1619  return IsLayerConfigurationSupported(backendId, connectableLayer, dataType, outReasonIfUnsupported);
1620 }

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 1643 of file WorkloadFactory.cpp.

1648 {
1649  return IsLayerConfigurationSupported(backendId,
1650  connectableLayer,
1651  dataType,
1652  outReasonIfUnsupported,
1653  modelOptions);
1654 }

◆ IsLayerSupported() [3/4]

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

Definition at line 1622 of file WorkloadFactory.cpp.

1625 {
1626  auto layer = PolymorphicDowncast<const Layer*>(&connectableLayer);
1627  return IsLayerConfigurationSupported(layer->GetBackendId(), connectableLayer, dataType, outReasonIfUnsupported);
1628 }

◆ IsLayerSupported() [4/4]

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

Definition at line 1630 of file WorkloadFactory.cpp.

1634 {
1635  auto layer = PolymorphicDowncast<const Layer*>(&connectableLayer);
1636  return IsLayerConfigurationSupported(layer->GetBackendId(),
1637  connectableLayer,
1638  dataType,
1639  outReasonIfUnsupported,
1640  modelOptions);
1641 }

◆ SupportsSubTensors()


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