24.02
|
#include <GpuFsaBackend.hpp>
Classes | |
class | ClBackendCustomAllocatorMemoryRegion |
class | GpuFsaBackendCustomAllocatorWrapper |
Public Member Functions | |
GpuFsaBackend () | |
GpuFsaBackend (std::shared_ptr< ICustomAllocator > allocator) | |
~GpuFsaBackend ()=default | |
const BackendId & | GetId () const override |
IBackendInternal::IMemoryManagerUniquePtr | CreateMemoryManager () const override |
IBackendInternal::IWorkloadFactoryPtr | CreateWorkloadFactory (const IBackendInternal::IMemoryManagerSharedPtr &memoryManager=nullptr) const override |
IBackendInternal::IWorkloadFactoryPtr | CreateWorkloadFactory (TensorHandleFactoryRegistry ®istry) const override |
IWorkloadFactoryPtr | CreateWorkloadFactory (class TensorHandleFactoryRegistry &tensorHandleFactoryRegistry, const ModelOptions &modelOptions, MemorySourceFlags inputFlags, MemorySourceFlags outputFlags) const override |
std::vector< ITensorHandleFactory::FactoryId > | GetHandleFactoryPreferences () const override |
(Optional) Returns a vector of supported TensorHandleFactory ids in preference order. More... | |
void | RegisterTensorHandleFactories (TensorHandleFactoryRegistry ®istry) override |
(Optional) Register TensorHandleFactories Either this method or CreateMemoryManager() and IWorkloadFactory::CreateTensor() IWorkloadFactory::CreateSubtensor() methods must be implemented. More... | |
void | RegisterTensorHandleFactories (TensorHandleFactoryRegistry ®istry, MemorySourceFlags inputFlags, MemorySourceFlags outputFlags) override |
(Optional) Register TensorHandleFactories Either this method or CreateMemoryManager() and IWorkloadFactory::CreateTensor() IWorkloadFactory::CreateSubtensor() methods must be implemented. More... | |
IBackendInternal::IBackendContextPtr | CreateBackendContext (const IRuntime::CreationOptions &) const override |
Create the runtime context of the backend. More... | |
IBackendInternal::IBackendProfilingContextPtr | CreateBackendProfilingContext (const IRuntime::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::unique_ptr< ICustomAllocator > | GetDefaultAllocator () const override |
Returns the default memory allocator for the backend. 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... | |
virtual bool | UseCustomMemoryAllocator (std::shared_ptr< ICustomAllocator > allocator, armnn::Optional< std::string & >) override |
Signals the backend to use a custom memory allocator provided by the user. 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 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 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... | |
Public Attributes | |
std::shared_ptr< GpuFsaBackendCustomAllocatorWrapper > | m_CustomAllocator |
bool | m_UsingCustomAllocator = false |
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 54 of file GpuFsaBackend.hpp.
|
inline |
Definition at line 57 of file GpuFsaBackend.hpp.
|
inline |
Definition at line 58 of file GpuFsaBackend.hpp.
References GpuFsaBackend::UseCustomMemoryAllocator().
|
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 198 of file GpuFsaBackend.cpp.
|
overridevirtual |
Create context specifically used for profiling interaction from backends.
Reimplemented from IBackendInternal.
Definition at line 203 of file GpuFsaBackend.cpp.
|
overridevirtual |
Reimplemented from IBackendInternal.
Definition at line 75 of file GpuFsaBackend.cpp.
References GpuFsaBackend::m_CustomAllocator, and GpuFsaBackend::m_UsingCustomAllocator.
|
overridevirtual |
Reimplemented from IBackendInternal.
Definition at line 111 of file GpuFsaBackend.cpp.
References GpuFsaBackend::m_CustomAllocator, GpuFsaBackend::m_UsingCustomAllocator, armnn::Malloc, TensorHandleFactoryRegistry::RegisterFactory(), TensorHandleFactoryRegistry::RegisterMemoryManager(), and armnn::Undefined.
|
overridevirtual |
Implements IBackendInternal.
Definition at line 84 of file GpuFsaBackend.cpp.
|
overridevirtual |
Reimplemented from IBackendInternal.
Definition at line 90 of file GpuFsaBackend.cpp.
References GpuFsaBackend::m_CustomAllocator, GpuFsaBackend::m_UsingCustomAllocator, TensorHandleFactoryRegistry::RegisterFactory(), and TensorHandleFactoryRegistry::RegisterMemoryManager().
|
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 98 of file GpuFsaBackend.hpp.
References armnn::gpuFsaCapabilities.
|
overridevirtual |
Returns the default memory allocator for the backend.
Reimplemented from IBackendInternal.
Definition at line 215 of file GpuFsaBackend.cpp.
|
overridevirtual |
(Optional) Returns a vector of supported TensorHandleFactory ids in preference order.
Reimplemented from IBackendInternal.
Definition at line 146 of file GpuFsaBackend.cpp.
References GpuFsaTensorHandleFactory::GetIdStatic().
|
inlineoverridevirtual |
Implements IBackend.
Definition at line 65 of file GpuFsaBackend.hpp.
References GpuFsaBackend::GetIdStatic().
Referenced by GpuFsaBackend::OptimizeSubgraphView().
|
static |
Definition at line 69 of file GpuFsaBackend.cpp.
References armnn::GpuFsaBackendId().
Referenced by GpuFsaBackend::GetId().
|
overridevirtual |
|
overridevirtual |
Reimplemented from IBackendInternal.
Definition at line 220 of file GpuFsaBackend.cpp.
References armnn::Activation, INetwork::AddPrecompiledLayer(), OptimizationViews::AddSubstitution(), OptimizationViews::AddUntouchedSubgraph(), armnn::BatchMatMul, SubgraphView::begin(), armnn::Cast, armnn::Convolution2d, armnn::CreateInputsFrom(), armnn::CreateOutputsFrom(), armnn::CreateSubgraphViewFrom(), armnn::DepthwiseConvolution2d, armnn::ElementwiseBinary, SubgraphView::end(), InputSlot::GetConnectedOutputSlot(), Layer::GetGuid(), GpuFsaBackend::GetId(), OptimizationViews::GetINetwork(), Layer::GetInputSlot(), Layer::GetNumInputSlots(), SubgraphView::GetNumOutputSlots(), Layer::GetNumOutputSlots(), IConnectableLayer::GetOutputSlot(), Layer::GetOutputSlot(), Layer::GetParameters(), OptimizationViews::GetSubstitutions(), OutputSlot::GetTensorInfo(), Layer::GetType(), armnn::GpuFsaActivationCreateOp(), armnn::GpuFsaBatchMatMulCreateOp(), armnn::GpuFsaCastCreateOp(), armnn::GpuFsaConvolution2dCreateOp(), armnn::GpuFsaDepthwiseConvolution2dCreateOp(), armnn::GpuFsaElementwiseBinaryCreateOp(), armnn::GpuFsaPooling2dCreateOp(), armnn::GpuFsaReshapeCreateOp(), armnn::GpuFsaResizeCreateOp(), armnn::GpuFsaSoftmaxCreateOp(), armnn::Pooling2d, armnn::ReportUntouchedLayers(), armnn::Reshape, armnn::Resize, IOutputSlot::SetTensorInfo(), GpuFsaPreCompiledBlob::sketch, armnn::Softmax, and GpuFsaPreCompiledBlob::workloadContext.
|
overridevirtual |
(Optional) Register TensorHandleFactories Either this method or CreateMemoryManager() and IWorkloadFactory::CreateTensor() IWorkloadFactory::CreateSubtensor() methods must be implemented.
Reimplemented from IBackendInternal.
Definition at line 151 of file GpuFsaBackend.cpp.
References GpuFsaBackend::m_CustomAllocator, GpuFsaBackend::m_UsingCustomAllocator, TensorHandleFactoryRegistry::RegisterFactory(), and TensorHandleFactoryRegistry::RegisterMemoryManager().
|
overridevirtual |
(Optional) Register TensorHandleFactories Either this method or CreateMemoryManager() and IWorkloadFactory::CreateTensor() IWorkloadFactory::CreateSubtensor() methods must be implemented.
Reimplemented from IBackendInternal.
Definition at line 169 of file GpuFsaBackend.cpp.
References GpuFsaBackend::m_CustomAllocator, GpuFsaBackend::m_UsingCustomAllocator, armnn::Malloc, TensorHandleFactoryRegistry::RegisterFactory(), TensorHandleFactoryRegistry::RegisterMemoryManager(), and armnn::Undefined.
|
inlineoverridevirtual |
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 from IBackendInternal.
Definition at line 103 of file GpuFsaBackend.hpp.
References ARMNN_LOG, armnn::info, GpuFsaBackend::m_CustomAllocator, and GpuFsaBackend::m_UsingCustomAllocator.
Referenced by GpuFsaBackend::GpuFsaBackend().
std::shared_ptr<GpuFsaBackendCustomAllocatorWrapper> m_CustomAllocator |
Definition at line 301 of file GpuFsaBackend.hpp.
Referenced by GpuFsaBackend::CreateMemoryManager(), GpuFsaBackend::CreateWorkloadFactory(), GpuFsaBackend::RegisterTensorHandleFactories(), and GpuFsaBackend::UseCustomMemoryAllocator().
bool m_UsingCustomAllocator = false |
Definition at line 302 of file GpuFsaBackend.hpp.
Referenced by GpuFsaBackend::CreateMemoryManager(), GpuFsaBackend::CreateWorkloadFactory(), GpuFsaBackend::RegisterTensorHandleFactories(), and GpuFsaBackend::UseCustomMemoryAllocator().