24.02
|
#include <TosaRefBackend.hpp>
Public Member Functions | |
TosaRefBackend ()=default | |
~TosaRefBackend ()=default | |
const BackendId & | GetId () 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 ModelOptions &modelOptions) const override |
std::vector< ITensorHandleFactory::FactoryId > | GetHandleFactoryPreferences () const override |
(Optional) Returns a vector of supported TensorHandleFactory ids in preference order. More... | |
void | RegisterTensorHandleFactories (class TensorHandleFactoryRegistry ®istry) override |
(Optional) Register TensorHandleFactories Either this method or CreateMemoryManager() and IWorkloadFactory::CreateTensor() IWorkloadFactory::CreateSubtensor() methods must be implemented. More... | |
std::unique_ptr< ICustomAllocator > | GetDefaultAllocator () 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 |
bool | SupportsTensorAllocatorAPI () const |
ITensorHandleFactory::FactoryId | GetBackwardCompatibleFavoriteHandleFactory () |
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 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... | |
Static Public Member Functions | |
static const BackendId & | GetIdStatic () |
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< 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 > |
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 () |
Definition at line 12 of file TosaRefBackend.hpp.
|
default |
|
default |
|
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 60 of file TosaRefBackend.cpp.
|
overridevirtual |
Create context specifically used for profiling interaction from backends.
Reimplemented from IBackendInternal.
Definition at line 65 of file TosaRefBackend.cpp.
|
overridevirtual |
Reimplemented from IBackendInternal.
Definition at line 71 of file TosaRefBackend.cpp.
|
overridevirtual |
Reimplemented from IBackendInternal.
Definition at line 44 of file TosaRefBackend.cpp.
References TensorHandleFactoryRegistry::RegisterCopyAndImportFactoryPair(), TensorHandleFactoryRegistry::RegisterFactory(), and TensorHandleFactoryRegistry::RegisterMemoryManager().
|
overridevirtual |
Implements IBackendInternal.
Definition at line 38 of file TosaRefBackend.cpp.
|
overridevirtual |
Returns the default memory allocator for the backend.
Reimplemented from IBackendInternal.
Definition at line 189 of file TosaRefBackend.cpp.
|
overridevirtual |
(Optional) Returns a vector of supported TensorHandleFactory ids in preference order.
Reimplemented from IBackendInternal.
Definition at line 170 of file TosaRefBackend.cpp.
References TosaRefTensorHandleFactory::GetIdStatic().
|
inlineoverridevirtual |
Implements IBackend.
Definition at line 19 of file TosaRefBackend.hpp.
References TosaRefBackend::GetIdStatic().
Referenced by TosaRefBackend::OptimizeSubgraphView().
|
static |
Definition at line 32 of file TosaRefBackend.cpp.
References armnn::TosaRefBackendId().
Referenced by TosaRefBackend::GetId().
|
overridevirtual |
|
overridevirtual |
Reimplemented from IBackendInternal.
Definition at line 82 of file TosaRefBackend.cpp.
References INetwork::AddPrecompiledLayer(), OptimizationViews::AddSubstitution(), SubgraphView::begin(), SubgraphView::end(), TosaRefBackend::GetId(), OptimizationViews::GetINetwork(), SubgraphView::GetIOutputSlot(), SubgraphView::GetNumInputSlots(), SubgraphView::GetNumOutputSlots(), IConnectableLayer::GetOutputSlot(), IOutputSlot::GetTensorInfo(), GetTosaMappingFromLayer(), Layer::GetType(), armnn::Input, armnn::Output, and IOutputSlot::SetTensorInfo().
|
overridevirtual |
(Optional) Register TensorHandleFactories Either this method or CreateMemoryManager() and IWorkloadFactory::CreateTensor() IWorkloadFactory::CreateSubtensor() methods must be implemented.
Reimplemented from IBackendInternal.
Definition at line 175 of file TosaRefBackend.cpp.
References TensorHandleFactoryRegistry::RegisterCopyAndImportFactoryPair(), TensorHandleFactoryRegistry::RegisterFactory(), and TensorHandleFactoryRegistry::RegisterMemoryManager().