23.08
|
Go to the documentation of this file.
54 auto &nodes = g.
nodes();
55 for(
auto &node : nodes)
59 node->set_assigned_target(target);
64 for(
auto &
tensor : tensors)
68 tensor->desc().target = target;
96 pm.
append(std::make_unique<NodeFusionMutator>());
97 pm.
append(std::make_unique<GroupedConvolutionMutator>());
98 pm.
append(std::make_unique<InPlaceOperationMutator>());
101 pm.
append(std::make_unique<DepthConcatSubTensorMutator>());
102 pm.
append(std::make_unique<SplitLayerSubTensorMutator>());
103 pm.
append(std::make_unique<NodeExecutionMethodMutator>());
112 if(backend.second->is_backend_supported())
114 backend.second->release_backend_context(ctx);
123 if(backend.second->backend_allocator())
125 backend.second->sync();
135 if(backend->is_backend_supported())
157 switch(data_layout_dimension)
179 std::vector<NodeIdxPair> driving_nodes;
186 auto output_edge = g->
edge(output_edge_id);
187 if(output_edge !=
nullptr)
190 driving_nodes.push_back({ output_edge->consumer_id(), output_edge->consumer_idx() });
194 return driving_nodes;
199 std::vector<NodeIdxPair> driver_nodes;
206 auto input_edge = g->
edge(input_edge_id);
207 if(input_edge !=
nullptr)
210 driver_nodes.push_back({ input_edge->producer_id(), input_edge->producer_idx() });
225 tensor->set_handle(std::move(handle));
@ NCHW
Num samples, channels, height, width.
const Edge * edge(EdgeID id) const
Get edge object given its id.
std::vector< NodeIdxPair > get_driving_nodes(const INode &node)
Get the list of driving nodes of a given node.
@ CL
OpenCL capable target device.
void force_target_to_graph(Graph &g, Target target)
Forces a single target to all graph constructs.
DataLayout
[DataLayout enum definition]
virtual bool is_backend_supported()=0
Checks if an instantiated backend is actually supported.
DataLayoutDimension
[DataLayout enum definition]
@ QASYMM8
quantized, asymmetric fixed-point 8-bit number unsigned
void setup_requested_backend_context(GraphContext &ctx, Target target)
Setups requested backend context if it exists, is supported and hasn't been initialized already.
Device backend interface.
@ NEON
Arm® Neon™ capable target device.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
const std::set< EdgeID > & output_edges() const
Returns output edge set.
size_t get_dimension_size(const TensorDescriptor &descriptor, const DataLayoutDimension data_layout_dimension)
Get size of a tensor's given dimension depending on its layout.
bool contains(Target target) const
Checks if a backend for a given target exists.
Graph configuration structure.
std::vector< NodeIdxPair > get_driver_nodes(const INode &node)
Get the list of driver nodes of a given node.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
#define ARM_COMPUTE_ERROR_ON_MSG(cond, msg)
DataLayout layout
Data layout.
@ QASYMM8_SIGNED
quantized, asymmetric fixed-point 8-bit number signed
virtual std::unique_ptr< ITensorHandle > create_tensor(const Tensor &tensor)=0
Create a backend Tensor.
std::vector< std::unique_ptr< Tensor > > & tensors()
Returns tensors of graph.
bool is_target_supported(Target target)
Checks if a specific target is supported.
TensorShape shape
Tensor shape.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
CLTensor * tensor
Pointer to the auxiliary tensor.
void configure_tensor(Tensor *tensor)
Configures tensor.
const std::vector< EdgeID > & input_edges() const
Returns input edge set.
DataType synthetic_type
The data type of the synthetic graph
size_t get_dimension_idx(DataLayout data_layout, const DataLayoutDimension data_layout_dimension)
Get index of a tensor's given dimension depending on its layout.
PassManager create_default_pass_manager(Target target, const GraphConfig &cfg)
Creates a default PassManager.
Target get_default_target()
Returns default target for execution.
Copyright (c) 2017-2023 Arm Limited.
IDeviceBackend * find_backend(Target target)
Finds a backend in the registry.
virtual void setup_backend_context(GraphContext &ctx)=0
Setups the given graph context.
void sync_backends()
Synchronize kernels execution on the backends.
const Graph * graph() const
Returns node's Graph.
void append(std::unique_ptr< IGraphMutator > pass, bool conditional=true)
Appends a mutation pass.
@ UNKNOWN
Unknown data layout.
void release_default_graph_context(GraphContext &ctx)
Default releases the graph context if not done manually.
IDeviceBackend & get_backend(Target target)
Get a backend from the registry.
const std::vector< NodeID > & nodes(NodeType type)
Returns graph input nodes.
static BackendRegistry & get()
Gets backend registry instance.
bool use_synthetic_type
Convert graph to a synthetic graph for a data type.