Compute Library
 21.11
IDeviceBackend Class Referenceabstract

Device backend interface. More...

#include <IDeviceBackend.h>

Public Member Functions

virtual ~IDeviceBackend ()=default
 Virtual Destructor. More...
 
virtual void initialize_backend ()=0
 Initializes the backend. More...
 
virtual void setup_backend_context (GraphContext &ctx)=0
 Setups the given graph context. More...
 
virtual void release_backend_context (GraphContext &ctx)=0
 Release the backend specific resources associated to a given graph context. More...
 
virtual bool is_backend_supported ()=0
 Checks if an instantiated backend is actually supported. More...
 
virtual IAllocatorbackend_allocator ()=0
 Gets a backend memory allocator. More...
 
virtual std::unique_ptr< ITensorHandlecreate_tensor (const Tensor &tensor)=0
 Create a backend Tensor. More...
 
virtual std::unique_ptr< ITensorHandlecreate_subtensor (ITensorHandle *parent, TensorShape shape, Coordinates coords, bool extend_parent)=0
 Create a backend Sub-Tensor. More...
 
virtual std::unique_ptr< arm_compute::IFunctionconfigure_node (INode &node, GraphContext &ctx)=0
 Configure a backend Node. More...
 
virtual Status validate_node (INode &node)=0
 Validate a node. More...
 
virtual std::shared_ptr< arm_compute::IMemoryManagercreate_memory_manager (MemoryManagerAffinity affinity)=0
 Create a backend memory manager given its affinity. More...
 
virtual std::shared_ptr< arm_compute::IWeightsManagercreate_weights_manager ()=0
 Create a backend weights manager. More...
 
virtual void sync ()=0
 Synchronize kernels execution on the backend. More...
 

Detailed Description

Device backend interface.

Definition at line 48 of file IDeviceBackend.h.

Constructor & Destructor Documentation

◆ ~IDeviceBackend()

virtual ~IDeviceBackend ( )
virtualdefault

Virtual Destructor.

Member Function Documentation

◆ backend_allocator()

virtual IAllocator* backend_allocator ( )
pure virtual

Gets a backend memory allocator.

Returns
Backend memory allocator

Implemented in CLDeviceBackend, and NEDeviceBackend.

◆ configure_node()

virtual std::unique_ptr<arm_compute::IFunction> configure_node ( INode node,
GraphContext ctx 
)
pure virtual

Configure a backend Node.

Note
This creates an appropriate configured backend function for the given node
Parameters
[in]nodeThe node we want to configure
[in]ctxContext to use
Returns
Backend execution function

Implemented in CLDeviceBackend, and NEDeviceBackend.

Referenced by arm_compute::graph::detail::configure_all_nodes().

◆ create_memory_manager()

virtual std::shared_ptr<arm_compute::IMemoryManager> create_memory_manager ( MemoryManagerAffinity  affinity)
pure virtual

Create a backend memory manager given its affinity.

Parameters
[in]affinityMemory Manager affinity
Returns
Memory manager

Implemented in CLDeviceBackend, and NEDeviceBackend.

◆ create_subtensor()

virtual std::unique_ptr<ITensorHandle> create_subtensor ( ITensorHandle parent,
TensorShape  shape,
Coordinates  coords,
bool  extend_parent 
)
pure virtual

Create a backend Sub-Tensor.

Parameters
[in]parentParent sub-tensor handle
[in]shapeShape of the sub-tensor
[in]coordsStarting coordinates of the sub-tensor
[in]extend_parentExtends parent shape if true
Returns
Backend sub-tensor handle

Implemented in CLDeviceBackend, and NEDeviceBackend.

Referenced by DepthConcatSubTensorMutator::mutate(), and SplitLayerSubTensorMutator::mutate().

◆ create_tensor()

virtual std::unique_ptr<ITensorHandle> create_tensor ( const Tensor tensor)
pure virtual

Create a backend Tensor.

Parameters
[in]tensorThe tensor we want to create a backend tensor for
Returns
Backend tensor handle

Implemented in CLDeviceBackend, and NEDeviceBackend.

Referenced by arm_compute::graph::detail::configure_all_tensors(), and arm_compute::graph::configure_tensor().

◆ create_weights_manager()

virtual std::shared_ptr<arm_compute::IWeightsManager> create_weights_manager ( )
pure virtual

Create a backend weights manager.

Returns
Weights manager

Implemented in CLDeviceBackend, and NEDeviceBackend.

◆ initialize_backend()

virtual void initialize_backend ( )
pure virtual

Initializes the backend.

Implemented in CLDeviceBackend, and NEDeviceBackend.

◆ is_backend_supported()

virtual bool is_backend_supported ( )
pure virtual

Checks if an instantiated backend is actually supported.

Returns
True if the backend is supported else false

Implemented in CLDeviceBackend, and NEDeviceBackend.

Referenced by BackendRegistry::get_backend(), and arm_compute::graph::is_target_supported().

◆ release_backend_context()

virtual void release_backend_context ( GraphContext ctx)
pure virtual

Release the backend specific resources associated to a given graph context.

Parameters
[in,out]ctxGraph context

Implemented in CLDeviceBackend, and NEDeviceBackend.

◆ setup_backend_context()

virtual void setup_backend_context ( GraphContext ctx)
pure virtual

Setups the given graph context.

Parameters
[in,out]ctxGraph context

Implemented in CLDeviceBackend, and NEDeviceBackend.

Referenced by arm_compute::graph::setup_requested_backend_context().

◆ sync()

virtual void sync ( )
pure virtual

Synchronize kernels execution on the backend.

On GPU, this results in a blocking call waiting for all kernels to be completed.

Implemented in CLDeviceBackend, and NEDeviceBackend.

◆ validate_node()

virtual Status validate_node ( INode node)
pure virtual

Validate a node.

Parameters
[in]nodeThe node we want to validate
Returns
An error status

Implemented in CLDeviceBackend, and NEDeviceBackend.

Referenced by GroupedConvolutionMutator::mutate(), and arm_compute::graph::detail::validate_all_nodes().


The documentation for this class was generated from the following file: