From 9aed8fb43441228343b925b42464a55042c47ca0 Mon Sep 17 00:00:00 2001 From: Nikhil Raj Date: Wed, 17 Nov 2021 13:16:45 +0000 Subject: IVGCVSW-6040 Update 21.11 Doxygen Documents Signed-off-by: Nikhil Raj Change-Id: Ia36ec98c4bebc27a69103911ea3409cd7db587a5 --- 21.11/classarmnn_1_1_ref_backend.xhtml | 747 +++++++++++++++++++++++++++++++++ 1 file changed, 747 insertions(+) create mode 100644 21.11/classarmnn_1_1_ref_backend.xhtml (limited to '21.11/classarmnn_1_1_ref_backend.xhtml') diff --git a/21.11/classarmnn_1_1_ref_backend.xhtml b/21.11/classarmnn_1_1_ref_backend.xhtml new file mode 100644 index 0000000000..c257a7ffe8 --- /dev/null +++ b/21.11/classarmnn_1_1_ref_backend.xhtml @@ -0,0 +1,747 @@ + + + + + + + + + + + + + +ArmNN: RefBackend Class Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  21.11 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ + +
+ +

#include <RefBackend.hpp>

+
+Inheritance diagram for RefBackend:
+
+
+ + +IBackendInternal +IBackend + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 RefBackend ()=default
 
 ~RefBackend ()=default
 
const BackendIdGetId () const override
 
IBackendInternal::IMemoryManagerUniquePtr CreateMemoryManager () const override
 
IBackendInternal::IWorkloadFactoryPtr CreateWorkloadFactory (const IBackendInternal::IMemoryManagerSharedPtr &memoryManager=nullptr) const override
 
IBackendInternal::IWorkloadFactoryPtr CreateWorkloadFactory (class TensorHandleFactoryRegistry &tensorHandleFactoryRegistry) const override
 
IBackendInternal::IBackendContextPtr CreateBackendContext (const IRuntime::CreationOptions &) const override
 Create the runtime context of the backend. More...
 
IBackendInternal::IBackendProfilingContextPtr CreateBackendProfilingContext (const IRuntime::CreationOptions &creationOptions, IBackendProfilingPtr &backendProfiling) override
 Create context specifically used for profiling interaction from backends. More...
 
IBackendInternal::ILayerSupportSharedPtr GetLayerSupport () const override
 
OptimizationViews OptimizeSubgraphView (const SubgraphView &subgraph) const override
 
std::vector< ITensorHandleFactory::FactoryIdGetHandleFactoryPreferences () const override
 (Optional) Returns a vector of supported TensorHandleFactory ids in preference order. More...
 
void RegisterTensorHandleFactories (class TensorHandleFactoryRegistry &registry) override
 (Optional) Register TensorHandleFactories Either this method or CreateMemoryManager() and IWorkloadFactory::CreateTensor()/IWorkloadFactory::CreateSubtensor() methods must be implemented. More...
 
BackendCapabilities GetCapabilities () const override
 Returns a BackendCapability if the backend lists the capability The BackendCapability must then be inspected to check whether or not that BackendCapability is supported Otherwise returns an EmptyOptional if the BackendCapability is unlisted. More...
 
std::unique_ptr< ICustomAllocatorGetDefaultAllocator () const override
 Returns the default memory allocator for the backend. More...
 
- Public Member Functions inherited from IBackendInternal
 ~IBackendInternal () override=default
 Allow backends created by the factory function to be destroyed through IBackendInternal. More...
 
virtual IWorkloadFactoryPtr CreateWorkloadFactory (const IMemoryManagerSharedPtr &memoryManager, const ModelOptions &modelOptions) const
 
virtual IWorkloadFactoryPtr CreateWorkloadFactory (class TensorHandleFactoryRegistry &tensorHandleFactoryRegistry, const ModelOptions &modelOptions) const
 
virtual IWorkloadFactoryPtr CreateWorkloadFactory (class TensorHandleFactoryRegistry &tensorHandleFactoryRegistry, const ModelOptions &modelOptions, MemorySourceFlags inputFlags, MemorySourceFlags outputFlags) const
 
virtual IBackendSpecificModelContextPtr CreateBackendSpecificModelContext (const ModelOptions &modelOptions) const
 
virtual ILayerSupportSharedPtr GetLayerSupport (const ModelOptions &modelOptions) const
 
virtual OptimizationViews OptimizeSubgraphView (const SubgraphView &subgraph, const ModelOptions &modelOptions) const
 
bool SupportsTensorAllocatorAPI () const
 
ITensorHandleFactory::FactoryId GetBackwardCompatibleFavoriteHandleFactory ()
 
virtual void RegisterTensorHandleFactories (class TensorHandleFactoryRegistry &registry, MemorySourceFlags inputFlags, MemorySourceFlags outputFlags)
 (Optional) Register TensorHandleFactories Either this method or CreateMemoryManager() and IWorkloadFactory::CreateTensor()/IWorkloadFactory::CreateSubtensor() methods must be implemented. More...
 
virtual bool HasCapability (BackendCapability) const
 Returns true if backend support the capability false otherwise. More...
 
virtual bool UseCustomMemoryAllocator (std::shared_ptr< ICustomAllocator > allocator, armnn::Optional< std::string &> errMsg)
 Signals the backend to use a custom memory allocator provided by the user. More...
 
virtual unsigned int GetNumberOfCacheFiles () const
 Returns the number of files cached if backend supports caching. More...
 
+ + + + + + + +

+Static Public Member Functions

static const BackendIdGetIdStatic ()
 
- Static Public Member Functions inherited from IBackendInternal
static constexpr BackendVersion GetApiVersion ()
 Returns the version of the Backend API. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Additional Inherited Members

- Public Types inherited from IBackendInternal
using IWorkloadFactoryPtr = std::unique_ptr< IWorkloadFactory >
 
using IBackendContextPtr = std::unique_ptr< IBackendContext >
 
using IBackendProfilingContextPtr = std::shared_ptr< armnn::profiling::IBackendProfilingContext >
 This is the bridge between backend and backend profiling we'll keep it in the backend namespace. More...
 
using IBackendProfilingPtr = std::unique_ptr< armnn::profiling::IBackendProfiling >
 
using OptimizationPtr = std::unique_ptr< Optimization >
 
using Optimizations = std::vector< OptimizationPtr >
 
using ILayerSupportSharedPtr = std::shared_ptr< ILayerSupport >
 
using IBackendSpecificModelContextPtr = std::shared_ptr< IBackendModelContext >
 
using IMemoryManagerUniquePtr = std::unique_ptr< IMemoryManager >
 
using IMemoryManagerSharedPtr = std::shared_ptr< IMemoryManager >
 
- Protected Member Functions inherited from IBackendInternal
 IBackendInternal ()=default
 Creation must be done through a specific backend interface. More...
 
- Protected Member Functions inherited from IBackend
 IBackend ()
 
virtual ~IBackend ()
 
+

Detailed Description

+
+

Definition at line 29 of file RefBackend.hpp.

+

Constructor & Destructor Documentation

+ +

◆ RefBackend()

+ +
+
+ + + + + +
+ + + + + + + +
RefBackend ()
+
+default
+
+ +
+
+ +

◆ ~RefBackend()

+ +
+
+ + + + + +
+ + + + + + + +
~RefBackend ()
+
+default
+
+ +
+
+

Member Function Documentation

+ +

◆ CreateBackendContext()

+ +
+
+ + + + + +
+ + + + + + + + +
IBackendInternal::IBackendContextPtr CreateBackendContext (const IRuntime::CreationOptions) const
+
+overridevirtual
+
+ +

Create the runtime context of the backend.

+

Implementations may return a default-constructed IBackendContextPtr if no context is needed at runtime. Implementations must throw BackendUnavailableException if the backend cannot be used (for example, necessary accelerator hardware is not present). The default implementation always returns a default-constructed pointer.

+ +

Reimplemented from IBackendInternal.

+ +

Definition at line 46 of file RefBackend.cpp.

+ +

Referenced by RefBackend::GetId().

+
47 {
48  return IBackendContextPtr{};
49 }
std::unique_ptr< IBackendContext > IBackendContextPtr
+
+
+
+ +

◆ CreateBackendProfilingContext()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
IBackendInternal::IBackendProfilingContextPtr CreateBackendProfilingContext (const IRuntime::CreationOptionscreationOptions,
IBackendProfilingPtrbackendProfiling 
)
+
+overridevirtual
+
+ +

Create context specifically used for profiling interaction from backends.

+ +

Reimplemented from IBackendInternal.

+ +

Definition at line 51 of file RefBackend.cpp.

+ +

Referenced by RefBackend::GetId().

+
53 {
55 }
std::shared_ptr< armnn::profiling::IBackendProfilingContext > IBackendProfilingContextPtr
This is the bridge between backend and backend profiling we&#39;ll keep it in the backend namespace...
+
+
+
+ +

◆ CreateMemoryManager()

+ +
+
+ + + + + +
+ + + + + + + +
IBackendInternal::IMemoryManagerUniquePtr CreateMemoryManager () const
+
+overridevirtual
+
+ +

Reimplemented from IBackendInternal.

+ +

Definition at line 57 of file RefBackend.cpp.

+ +

Referenced by RefBackend::GetId().

+
58 {
59  return std::make_unique<RefMemoryManager>();
60 }
+
+
+ +

◆ CreateWorkloadFactory() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + +
IBackendInternal::IWorkloadFactoryPtr CreateWorkloadFactory (const IBackendInternal::IMemoryManagerSharedPtrmemoryManager = nullptr) const
+
+overridevirtual
+
+ +

Implements IBackendInternal.

+ +

Definition at line 29 of file RefBackend.cpp.

+ +

Referenced by RefBackend::GetId().

+
31 {
32  return std::make_unique<RefWorkloadFactory>(PolymorphicPointerDowncast<RefMemoryManager>(memoryManager));
33 }
+
+
+ +

◆ CreateWorkloadFactory() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + +
IBackendInternal::IWorkloadFactoryPtr CreateWorkloadFactory (class TensorHandleFactoryRegistrytensorHandleFactoryRegistry) const
+
+overridevirtual
+
+ +

Reimplemented from IBackendInternal.

+ +

Definition at line 35 of file RefBackend.cpp.

+ +

References TensorHandleFactoryRegistry::RegisterFactory(), and TensorHandleFactoryRegistry::RegisterMemoryManager().

+
37 {
38  auto memoryManager = std::make_shared<RefMemoryManager>();
39 
40  tensorHandleFactoryRegistry.RegisterMemoryManager(memoryManager);
41  tensorHandleFactoryRegistry.RegisterFactory(std::make_unique<RefTensorHandleFactory>(memoryManager));
42 
43  return std::make_unique<RefWorkloadFactory>(PolymorphicPointerDowncast<RefMemoryManager>(memoryManager));
44 }
+
+
+ +

◆ GetCapabilities()

+ +
+
+ + + + + +
+ + + + + + + +
BackendCapabilities GetCapabilities () const
+
+inlineoverridevirtual
+
+ +

Returns a BackendCapability if the backend lists the capability The BackendCapability must then be inspected to check whether or not that BackendCapability is supported Otherwise returns an EmptyOptional if the BackendCapability is unlisted.

+ +

Reimplemented from IBackendInternal.

+ +

Definition at line 59 of file RefBackend.hpp.

+ +

References armnn::cpuRefCapabilities, and RefBackend::GetDefaultAllocator().

+
60  {
61  return cpuRefCapabilities;
62  };
const BackendCapabilities cpuRefCapabilities("CpuRef", { {"NonConstWeights", true}, {"AsyncExecution", true}, {"ProtectedContentAllocation", false}, {"ConstantTensorsAsInputs", true}, {"PreImportIOTensors", true}, {"ExternallyManagedMemory", true}, {"MultiAxisPacking", false}, {"SingleAxisPacking", true} })
+
+
+
+ +

◆ GetDefaultAllocator()

+ +
+
+ + + + + +
+ + + + + + + +
std::unique_ptr< ICustomAllocator > GetDefaultAllocator () const
+
+overridevirtual
+
+ +

Returns the default memory allocator for the backend.

+
Returns
- Returns unique pointer to the Default Allocator of the Backend
+ +

Reimplemented from IBackendInternal.

+ +

Definition at line 90 of file RefBackend.cpp.

+ +

Referenced by RefBackend::GetCapabilities().

+
91 {
92  return std::make_unique<DefaultAllocator>();
93 }
+
+
+ +

◆ GetHandleFactoryPreferences()

+ +
+
+ + + + + +
+ + + + + + + +
std::vector< ITensorHandleFactory::FactoryId > GetHandleFactoryPreferences () const
+
+overridevirtual
+
+ +

(Optional) Returns a vector of supported TensorHandleFactory ids in preference order.

+ +

Reimplemented from IBackendInternal.

+ +

Definition at line 77 of file RefBackend.cpp.

+ +

References RefTensorHandleFactory::GetIdStatic().

+ +

Referenced by RefBackend::GetId().

+
78 {
79  return std::vector<ITensorHandleFactory::FactoryId> { RefTensorHandleFactory::GetIdStatic() };
80 }
static const FactoryId & GetIdStatic()
+
+
+
+ +

◆ GetId()

+ + + +

◆ GetIdStatic()

+ +
+
+ + + + + +
+ + + + + + + +
const BackendId & GetIdStatic ()
+
+static
+
+ +

Definition at line 23 of file RefBackend.cpp.

+ +

References armnn::RefBackendId().

+ +

Referenced by GetBackendId(), and RefBackend::GetId().

+
24 {
25  static const BackendId s_Id{RefBackendId()};
26  return s_Id;
27 }
constexpr const char * RefBackendId()
+
+
+
+ +

◆ GetLayerSupport()

+ +
+
+ + + + + +
+ + + + + + + +
IBackendInternal::ILayerSupportSharedPtr GetLayerSupport () const
+
+overridevirtual
+
+ +

Implements IBackendInternal.

+ +

Definition at line 62 of file RefBackend.cpp.

+ +

Referenced by RefBackend::GetId().

+
63 {
64  static ILayerSupportSharedPtr layerSupport{new RefLayerSupport};
65  return layerSupport;
66 }
std::shared_ptr< ILayerSupport > ILayerSupportSharedPtr
+
+
+
+ +

◆ OptimizeSubgraphView()

+ +
+
+ + + + + +
+ + + + + + + + +
OptimizationViews OptimizeSubgraphView (const SubgraphViewsubgraph) const
+
+overridevirtual
+
+ +

Reimplemented from IBackendInternal.

+ +

Definition at line 68 of file RefBackend.cpp.

+ +

References OptimizationViews::AddUntouchedSubgraph().

+ +

Referenced by RefBackend::GetId().

+
69 {
70  OptimizationViews optimizationViews;
71 
72  optimizationViews.AddUntouchedSubgraph(SubgraphView(subgraph));
73 
74  return optimizationViews;
75 }
+
+
+ +

◆ RegisterTensorHandleFactories()

+ +
+
+ + + + + +
+ + + + + + + + +
void RegisterTensorHandleFactories (class TensorHandleFactoryRegistry)
+
+overridevirtual
+
+ +

(Optional) Register TensorHandleFactories Either this method or CreateMemoryManager() and IWorkloadFactory::CreateTensor()/IWorkloadFactory::CreateSubtensor() methods must be implemented.

+ +

Reimplemented from IBackendInternal.

+ +

Definition at line 82 of file RefBackend.cpp.

+ +

References TensorHandleFactoryRegistry::RegisterFactory(), and TensorHandleFactoryRegistry::RegisterMemoryManager().

+ +

Referenced by RefBackend::GetId().

+
83 {
84  auto memoryManager = std::make_shared<RefMemoryManager>();
85 
86  registry.RegisterMemoryManager(memoryManager);
87  registry.RegisterFactory(std::make_unique<RefTensorHandleFactory>(memoryManager));
88 }
+
+
+
The documentation for this class was generated from the following files: +
+
+ + + + -- cgit v1.2.1