58 auto &nodes = g.
nodes();
59 for(
auto &node : nodes)
63 node->set_assigned_target(target);
68 for(
auto &tensor : tensors)
72 tensor->desc().target = target;
81 const bool is_target_gc = target ==
Target::GC;
86 pm.
append(std::make_unique<SyntheticDataTypeMutator>(), !is_target_gc);
88 pm.
append(std::make_unique<NodeFusionMutator>(), !is_target_gc);
89 pm.
append(std::make_unique<GroupedConvolutionMutator>());
90 pm.
append(std::make_unique<InPlaceOperationMutator>(), !is_target_gc);
93 pm.
append(std::make_unique<DepthConcatSubTensorMutator>(), !is_target_gc);
94 pm.
append(std::make_unique<SplitLayerSubTensorMutator>(), !is_target_gc);
95 pm.
append(std::make_unique<NodeExecutionMethodMutator>());
104 if(backend.second->is_backend_supported())
106 backend.second->release_backend_context(ctx);
116 if(backend->is_backend_supported())
138 switch(data_layout_dimension)
160 std::vector<NodeIdxPair> driving_nodes;
167 auto output_edge = g->
edge(output_edge_id);
168 if(output_edge !=
nullptr)
171 driving_nodes.push_back({ output_edge->consumer_id(), output_edge->consumer_idx() });
175 return driving_nodes;
180 if(tensor !=
nullptr && tensor->
handle() ==
nullptr)
184 std::unique_ptr<ITensorHandle> handle = backend.
create_tensor(*tensor);
void force_target_to_graph(Graph &g, Target target)
Forces a single target to all graph constructs.
TensorShape shape
Tensor shape.
Neon capable target device.
Graph configuration structure Device target types.
void configure_tensor(Tensor *tensor)
Configures tensor.
const std::set< EdgeID > & output_edges() const
Returns output edge set.
std::vector< NodeIdxPair > get_driving_nodes(const INode &node)
Get the list of driving nodes of a given node.
void set_handle(std::unique_ptr< ITensorHandle > backend_tensor)
Sets the backend tensor.
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 convert_to_uint8
Convert graph to a synthetic uint8 graph.
ITensorHandle * handle()
Backend tensor handle accessor.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
DataLayoutDimension
[DataLayout enum definition]
virtual bool is_backend_supported()=0
Checks if an instantiated backend is actually supported.
const Graph * graph() const
Returns node's Graph.
IDeviceBackend & get_backend(Target target)
Get a backend from the registry.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
const DataLayout data_layout
virtual void setup_backend_context(GraphContext &ctx)=0
Setups the given graph context.
Copyright (c) 2017-2021 Arm Limited.
virtual std::unique_ptr< ITensorHandle > create_tensor(const Tensor &tensor)=0
Create a backend Tensor.
TensorDescriptor & desc()
TensorInfo metadata accessor.
Target get_default_target()
Returns default target for execution.
GLES compute capable target device.
std::vector< std::unique_ptr< Tensor > > & tensors()
Returns tensors of graph.
#define ARM_COMPUTE_ERROR_ON_MSG(cond, msg)
void setup_requested_backend_context(GraphContext &ctx, Target target)
Setups requested backend context if it exists, is supported and hasn't been initialized already...
bool is_target_supported(Target target)
Checks if a specific target is supported.
bool contains(Target target) const
Checks if a backend for a given target exists.
static BackendRegistry & get()
Gets backend registry instance.
Num samples, channels, height, width.
void append(std::unique_ptr< IGraphMutator > pass, bool conditional=true)
Appends a mutation pass.
const std::vector< NodeID > & nodes(NodeType type)
Returns graph input nodes.
PassManager create_default_pass_manager(Target target, const GraphConfig &cfg)
Creates a default PassManager.
const Edge * edge(EdgeID id) const
Get edge object given its id.
Device backend interface.
IDeviceBackend * find_backend(Target target)
Finds a backend in the registry.
DataLayout layout
Data layout.
OpenCL capable target device.
DataLayout
[DataLayout enum definition]
void release_default_graph_context(GraphContext &ctx)
Default releases the graph context if not done manually.
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.