ArmNN
 20.05
ITensorHandleFactory Class Referenceabstract

#include <ITensorHandleFactory.hpp>

Inheritance diagram for ITensorHandleFactory:
ClTensorHandleFactory NeonTensorHandleFactory RefTensorHandleFactory

Public Types

using FactoryId = std::string
 

Public Member Functions

virtual ~ITensorHandleFactory ()
 Some TensorHandleFactory decisions are deferred to run-time. More...
 
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 =0
 
virtual std::unique_ptr< ITensorHandleCreateTensorHandle (const TensorInfo &tensorInfo, DataLayout dataLayout) const =0
 
virtual std::unique_ptr< ITensorHandleCreateTensorHandle (const TensorInfo &tensorInfo, const bool IsMemoryManaged) const
 Utility Functions for backends which require TensorHandles to have unmanaged memory. More...
 
virtual std::unique_ptr< ITensorHandleCreateTensorHandle (const TensorInfo &tensorInfo, DataLayout dataLayout, const bool IsMemoryManaged) const
 
virtual const FactoryIdGetId () const =0
 
virtual bool SupportsSubTensors () const =0
 
virtual bool SupportsMapUnmap () const final
 
virtual MemorySourceFlags GetExportFlags () const
 
virtual MemorySourceFlags GetImportFlags () const
 

Static Public Attributes

static const FactoryId LegacyFactoryId = "armnn_legacy_factory"
 
static const FactoryId DeferredFactoryId = "armnn_deferred_factory"
 Use the workload factory to create the tensor handle. More...
 

Detailed Description

Definition at line 18 of file ITensorHandleFactory.hpp.

Member Typedef Documentation

◆ FactoryId

using FactoryId = std::string

Definition at line 21 of file ITensorHandleFactory.hpp.

Constructor & Destructor Documentation

◆ ~ITensorHandleFactory()

virtual ~ITensorHandleFactory ( )
inlinevirtual

Some TensorHandleFactory decisions are deferred to run-time.

Definition at line 25 of file ITensorHandleFactory.hpp.

References ITensorHandleFactory::CreateSubTensorHandle(), and ITensorHandleFactory::CreateTensorHandle().

25 {}

Member Function Documentation

◆ CreateSubTensorHandle()

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

◆ CreateTensorHandle() [1/4]

◆ CreateTensorHandle() [2/4]

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

◆ CreateTensorHandle() [3/4]

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

Utility Functions for backends which require TensorHandles to have unmanaged memory.

These should be overloaded if required to facilitate direct import of input tensors and direct export of output tensors.

Reimplemented in ClTensorHandleFactory, and NeonTensorHandleFactory.

Definition at line 39 of file ITensorHandleFactory.hpp.

References ITensorHandleFactory::CreateTensorHandle(), and armnn::IgnoreUnused().

41  {
42  IgnoreUnused(IsMemoryManaged);
43  return CreateTensorHandle(tensorInfo);
44  }
void IgnoreUnused(Ts &&...)
virtual std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo) const =0

◆ CreateTensorHandle() [4/4]

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

Reimplemented in ClTensorHandleFactory, and NeonTensorHandleFactory.

Definition at line 46 of file ITensorHandleFactory.hpp.

References ITensorHandleFactory::CreateTensorHandle(), ITensorHandleFactory::GetId(), armnn::IgnoreUnused(), and ITensorHandleFactory::SupportsSubTensors().

49  {
50  IgnoreUnused(IsMemoryManaged);
51  return CreateTensorHandle(tensorInfo, dataLayout);
52  }
void IgnoreUnused(Ts &&...)
virtual std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo) const =0

◆ GetExportFlags()

virtual MemorySourceFlags GetExportFlags ( ) const
inlinevirtual

Reimplemented in ClTensorHandleFactory, NeonTensorHandleFactory, and RefTensorHandleFactory.

Definition at line 60 of file ITensorHandleFactory.hpp.

Referenced by armnn::CalculateEdgeStrategy(), and armnn::RequiresCopy().

60 { return 0; }

◆ GetId()

virtual const FactoryId& GetId ( ) const
pure virtual

◆ GetImportFlags()

virtual MemorySourceFlags GetImportFlags ( ) const
inlinevirtual

◆ SupportsMapUnmap()

virtual bool SupportsMapUnmap ( ) const
inlinefinalvirtual

◆ SupportsSubTensors()

virtual bool SupportsSubTensors ( ) const
pure virtual

Member Data Documentation

◆ DeferredFactoryId

const ITensorHandleFactory::FactoryId DeferredFactoryId = "armnn_deferred_factory"
static

Use the workload factory to create the tensor handle.

Definition at line 23 of file ITensorHandleFactory.hpp.

Referenced by armnn::CalculateSlotOptionForOutput().

◆ LegacyFactoryId


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