21.05
|
#include <MockBackend.hpp>
Public Member Functions | |
MockBackend ()=default | |
~MockBackend ()=default | |
const BackendId & | GetId () const override |
IBackendInternal::IMemoryManagerUniquePtr | CreateMemoryManager () const override |
IBackendInternal::IWorkloadFactoryPtr | CreateWorkloadFactory (const IBackendInternal::IMemoryManagerSharedPtr &memoryManager=nullptr) 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::Optimizations | GetOptimizations () const override |
IBackendInternal::ILayerSupportSharedPtr | GetLayerSupport () const override |
OptimizationViews | OptimizeSubgraphView (const SubgraphView &subgraph) const override |
Public Member Functions inherited from IBackendInternal | |
~IBackendInternal () override=default | |
Allow backends created by the factory function to be destroyed through IBackendInternal. More... | |
virtual ISubGraphConverterPtr | CreateSubGraphConverter (const std::shared_ptr< SubGraph > &subGraph) const |
virtual SubGraphUniquePtr | OptimizeSubGraph (const SubGraph &subGraph, bool &optimizationAttempted) const |
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 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 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 bool | HasCapability (BackendCapability) const |
Returns true if backend support the capability false otherwise. 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< 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 > |
using | GraphUniquePtr = std::unique_ptr< Graph > |
using | SubgraphViewUniquePtr = std::unique_ptr< SubgraphView > |
using | supported = std::unique_ptr< ISubGraphConverter > |
using | instead = std::unique_ptr< SubGraph > |
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 143 of file MockBackend.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 100 of file MockBackend.cpp.
|
overridevirtual |
Create context specifically used for profiling interaction from backends.
Reimplemented from IBackendInternal.
Definition at line 105 of file MockBackend.cpp.
References armnn::IgnoreUnused(), MockBackendProfilingService::Instance(), and MockBackendProfilingService::SetProfilingContextPtr().
|
overridevirtual |
Reimplemented from IBackendInternal.
Definition at line 115 of file MockBackend.cpp.
|
overridevirtual |
Implements IBackendInternal.
Definition at line 94 of file MockBackend.cpp.
|
inlineoverridevirtual |
|
static |
Definition at line 88 of file MockBackend.cpp.
References armnn::MockBackendId().
Referenced by BOOST_AUTO_TEST_CASE(), MockBackendInitialiser::MockBackendInitialiser(), and MockBackendInitialiser::~MockBackendInitialiser().
|
overridevirtual |
Implements IBackendInternal.
Definition at line 125 of file MockBackend.cpp.
|
overridevirtual |
Reimplemented from IBackendInternal.
Definition at line 120 of file MockBackend.cpp.
|
overridevirtual |
Reimplemented from IBackendInternal.
Definition at line 131 of file MockBackend.cpp.
References OptimizationViews::AddFailedSubgraph(), Graph::AddLayer(), OptimizationViews::AddSubstitution(), OptimizationViews::AddUntouchedSubgraph(), ARMNN_ASSERT, OptimizationViews::GetGraph(), SubgraphView::GetLayers(), Layer::GetType(), armnn::Input, armnn::MockBackendId(), armnn::Output, SubgraphViewSelector::SelectSubgraphs(), and Layer::SetBackendId().