24.08
|
#include <IBackendInternal.hpp>
Public Types | |
using | IWorkloadFactoryPtr = std::unique_ptr< IWorkloadFactory > |
using | IBackendContextPtr = std::unique_ptr< IBackendContext > |
using | IBackendProfilingContextPtr = std::shared_ptr< arm::pipe::IBackendProfilingContext > |
This is the bridge between backend and backend profiling we'll keep it in the backend namespace. More... | |
using | IBackendProfilingPtr = std::unique_ptr< arm::pipe::IBackendProfiling > |
using | ILayerSupportSharedPtr = std::shared_ptr< ILayerSupport > |
using | IBackendSpecificModelContextPtr = std::shared_ptr< IBackendModelContext > |
using | IMemoryManagerUniquePtr = std::unique_ptr< IMemoryManager > |
using | IMemoryManagerSharedPtr = std::shared_ptr< IMemoryManager > |
Public Member Functions | |
~IBackendInternal () override=default | |
Allow backends created by the factory function to be destroyed through IBackendInternal. More... | |
virtual IMemoryManagerUniquePtr | CreateMemoryManager () const |
virtual IWorkloadFactoryPtr | CreateWorkloadFactory (const IMemoryManagerSharedPtr &memoryManager=nullptr) const =0 |
virtual IWorkloadFactoryPtr | CreateWorkloadFactory (class TensorHandleFactoryRegistry &tensorHandleFactoryRegistry) const |
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 IBackendContextPtr | CreateBackendContext (const IRuntime::CreationOptions &) const |
Create the runtime context of the backend. More... | |
virtual IBackendSpecificModelContextPtr | CreateBackendSpecificModelContext (const ModelOptions &modelOptions) const |
virtual IBackendProfilingContextPtr | CreateBackendProfilingContext (const IRuntime::CreationOptions &creationOptions, IBackendProfilingPtr &backendProfiling) |
Create context specifically used for profiling interaction from backends. More... | |
virtual ILayerSupportSharedPtr | GetLayerSupport () const =0 |
virtual ILayerSupportSharedPtr | GetLayerSupport (const ModelOptions &modelOptions) const |
virtual OptimizationViews | OptimizeSubgraphView (const SubgraphView &subgraph) const |
virtual OptimizationViews | OptimizeSubgraphView (const SubgraphView &subgraph, const ModelOptions &modelOptions) const |
bool | SupportsTensorAllocatorAPI () const |
ITensorHandleFactory::FactoryId | GetBackwardCompatibleFavoriteHandleFactory () |
virtual std::vector< ITensorHandleFactory::FactoryId > | GetHandleFactoryPreferences () const |
(Optional) Returns a vector of supported TensorHandleFactory ids in preference order. More... | |
virtual void | RegisterTensorHandleFactories (class TensorHandleFactoryRegistry &) |
(Optional) Register TensorHandleFactories Either this method or CreateMemoryManager() and IWorkloadFactory::CreateTensor() IWorkloadFactory::CreateSubtensor() methods must be implemented. More... | |
virtual void | RegisterTensorHandleFactories (class TensorHandleFactoryRegistry ®istry, MemorySourceFlags inputFlags, MemorySourceFlags outputFlags) |
(Optional) Register TensorHandleFactories Either this method or CreateMemoryManager() and IWorkloadFactory::CreateTensor() IWorkloadFactory::CreateSubtensor() methods must be implemented. More... | |
virtual BackendCapabilities | GetCapabilities () const |
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... | |
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 std::unique_ptr< ICustomAllocator > | GetDefaultAllocator () const |
Returns the default memory allocator for the backend. More... | |
virtual unsigned int | GetNumberOfCacheFiles () const |
Returns the number of files cached if backend supports caching. More... | |
virtual ExecutionData | CreateExecutionData (WorkingMemDescriptor &workingMemDescriptor) const |
Returns ExecutionData for the backend. More... | |
virtual void | UpdateExecutionData (ExecutionData &executionData, WorkingMemDescriptor &workingMemDescriptor) const |
Update the ExecutionData for a layer. More... | |
Public Member Functions inherited from IBackend | |
virtual const BackendId & | GetId () const =0 |
Static Public Member Functions | |
static constexpr BackendVersion | GetApiVersion () |
Returns the version of the Backend API. More... | |
Protected Member Functions | |
IBackendInternal ()=default | |
Creation must be done through a specific backend interface. More... | |
Protected Member Functions inherited from IBackend | |
IBackend () | |
virtual | ~IBackend () |
Definition at line 77 of file IBackendInternal.hpp.
using IBackendContextPtr = std::unique_ptr<IBackendContext> |
Definition at line 90 of file IBackendInternal.hpp.
using IBackendProfilingContextPtr = std::shared_ptr<arm::pipe::IBackendProfilingContext> |
This is the bridge between backend and backend profiling we'll keep it in the backend namespace.
Definition at line 92 of file IBackendInternal.hpp.
using IBackendProfilingPtr = std::unique_ptr<arm::pipe::IBackendProfiling> |
Definition at line 93 of file IBackendInternal.hpp.
using IBackendSpecificModelContextPtr = std::shared_ptr<IBackendModelContext> |
Definition at line 96 of file IBackendInternal.hpp.
using ILayerSupportSharedPtr = std::shared_ptr<ILayerSupport> |
Definition at line 94 of file IBackendInternal.hpp.
using IMemoryManagerSharedPtr = std::shared_ptr<IMemoryManager> |
Definition at line 99 of file IBackendInternal.hpp.
using IMemoryManagerUniquePtr = std::unique_ptr<IMemoryManager> |
Definition at line 98 of file IBackendInternal.hpp.
using IWorkloadFactoryPtr = std::unique_ptr<IWorkloadFactory> |
Definition at line 89 of file IBackendInternal.hpp.
|
protecteddefault |
Creation must be done through a specific backend interface.
|
overridedefault |
Allow backends created by the factory function to be destroyed through IBackendInternal.
|
virtual |
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 in GpuFsaBackend, ClBackend, NeonBackend, RefBackend, and TosaRefBackend.
Definition at line 71 of file IBackendInternal.cpp.
|
virtual |
Create context specifically used for profiling interaction from backends.
Reimplemented in RefBackend, TosaRefBackend, GpuFsaBackend, ClBackend, and NeonBackend.
Definition at line 82 of file IBackendInternal.cpp.
|
virtual |
Reimplemented in ClBackend, and NeonBackend.
Definition at line 76 of file IBackendInternal.cpp.
|
inlinevirtual |
Returns ExecutionData for the backend.
workingMemDescriptor | - Vectors of input and output TensorHandles for a layer |
Reimplemented in RefBackend.
Definition at line 215 of file IBackendInternal.hpp.
References armnn::IgnoreUnused().
|
virtual |
Reimplemented in GpuFsaBackend, RefBackend, ClBackend, NeonBackend, and TosaRefBackend.
Definition at line 13 of file IBackendInternal.cpp.
|
virtual |
Reimplemented in GpuFsaBackend, ClBackend, RefBackend, NeonBackend, and TosaRefBackend.
Definition at line 18 of file IBackendInternal.cpp.
|
virtual |
Reimplemented in ClBackend, and NeonBackend.
Definition at line 42 of file IBackendInternal.cpp.
References IBackendInternal::CreateWorkloadFactory(), and IBackend::GetId().
|
virtual |
Reimplemented in GpuFsaBackend, and ClBackend.
Definition at line 60 of file IBackendInternal.cpp.
References IBackendInternal::CreateWorkloadFactory(), and armnn::IgnoreUnused().
|
virtual |
Reimplemented in ClBackend, and NeonBackend.
Definition at line 24 of file IBackendInternal.cpp.
References IBackendInternal::CreateWorkloadFactory(), and IBackend::GetId().
|
pure virtual |
Implemented in GpuFsaBackend, RefBackend, ClBackend, NeonBackend, and TosaRefBackend.
Referenced by IBackendInternal::CreateWorkloadFactory().
|
inlinestaticconstexpr |
Returns the version of the Backend API.
Definition at line 167 of file IBackendInternal.hpp.
Referenced by DynamicBackend::DynamicBackend(), GetVersion(), and DynamicBackendUtils::IsBackendCompatible().
ITensorHandleFactory::FactoryId GetBackwardCompatibleFavoriteHandleFactory | ( | ) |
Definition at line 132 of file IBackendInternal.cpp.
References IBackendInternal::GetHandleFactoryPreferences(), and ITensorHandleFactory::LegacyFactoryId.
|
inlinevirtual |
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 in GpuFsaBackend, ClBackend, NeonBackend, and RefBackend.
Definition at line 172 of file IBackendInternal.hpp.
|
inlinevirtual |
Returns the default memory allocator for the backend.
Reimplemented in GpuFsaBackend, ClBackend, NeonBackend, RefBackend, and TosaRefBackend.
Definition at line 201 of file IBackendInternal.hpp.
|
virtual |
(Optional) Returns a vector of supported TensorHandleFactory ids in preference order.
Reimplemented in GpuFsaBackend, NeonBackend, ClBackend, RefBackend, and TosaRefBackend.
Definition at line 143 of file IBackendInternal.cpp.
Referenced by armnn::CalculateSlotOption(), IBackendInternal::GetBackwardCompatibleFavoriteHandleFactory(), and IBackendInternal::SupportsTensorAllocatorAPI().
|
pure virtual |
Implemented in GpuFsaBackend, ClBackend, NeonBackend, RefBackend, and TosaRefBackend.
Referenced by IBackendInternal::GetLayerSupport().
|
virtual |
Reimplemented in ClBackend, and NeonBackend.
Definition at line 88 of file IBackendInternal.cpp.
References IBackend::GetId(), and IBackendInternal::GetLayerSupport().
|
inlinevirtual |
Returns the number of files cached if backend supports caching.
Reimplemented in ClBackend.
Definition at line 209 of file IBackendInternal.hpp.
|
virtual |
Definition at line 106 of file IBackendInternal.cpp.
References OptimizationViews::AddUntouchedSubgraph().
Referenced by IBackendInternal::OptimizeSubgraphView().
|
virtual |
Reimplemented in GpuFsaBackend, ClBackend, NeonBackend, RefBackend, and TosaRefBackend.
Definition at line 114 of file IBackendInternal.cpp.
References IBackendInternal::OptimizeSubgraphView().
|
inlinevirtual |
(Optional) Register TensorHandleFactories Either this method or CreateMemoryManager() and IWorkloadFactory::CreateTensor() IWorkloadFactory::CreateSubtensor() methods must be implemented.
Reimplemented in GpuFsaBackend, ClBackend, NeonBackend, RefBackend, and TosaRefBackend.
Definition at line 157 of file IBackendInternal.hpp.
Referenced by IBackendInternal::RegisterTensorHandleFactories().
|
virtual |
(Optional) Register TensorHandleFactories Either this method or CreateMemoryManager() and IWorkloadFactory::CreateTensor() IWorkloadFactory::CreateSubtensor() methods must be implemented.
Reimplemented in GpuFsaBackend, and ClBackend.
Definition at line 125 of file IBackendInternal.cpp.
References IBackendInternal::RegisterTensorHandleFactories().
bool SupportsTensorAllocatorAPI | ( | ) | const |
Definition at line 120 of file IBackendInternal.cpp.
References IBackendInternal::GetHandleFactoryPreferences().
|
inlinevirtual |
Update the ExecutionData for a layer.
It is used to swap in pre-imported tensor handles
executionData | - Backend specific ExecutionData generated for a layer |
workingMemDescriptor | - Vectors of input and output TensorHandles for a layer |
Reimplemented in RefBackend.
Definition at line 225 of file IBackendInternal.hpp.
References armnn::IgnoreUnused().
|
inlinevirtual |
Signals the backend to use a custom memory allocator provided by the user.
allocator | - a pointer to the provided ICustomAllocator to use with this backend |
errMsg | - Optional string variable to return error messages |
Reimplemented in GpuFsaBackend, and ClBackend.
Definition at line 182 of file IBackendInternal.hpp.
References IBackend::GetId(), armnn::IgnoreUnused(), and OptionalReferenceSwitch< std::is_reference< T >::value, T >::value().