MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / configure_all_nodes

Function configure_all_nodes

src/graph/detail/ExecutionHelpers.cpp:134–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132}
133
134ExecutionWorkload configure_all_nodes(Graph &g, GraphContext &ctx, const std::vector<NodeID> &node_order)
135{
136 ExecutionWorkload workload;
137 workload.graph = &g;
138 workload.ctx = &ctx;
139
140 // Reserve memory for tasks
141 workload.tasks.reserve(node_order.size());
142
143 // Create tasks
144 for (auto &node_id : node_order)
145 {
146 auto node = g.node(node_id);
147 if (node != nullptr)
148 {
149 Target assigned_target = node->assigned_target();
150 backends::IDeviceBackend &backend = backends::BackendRegistry::get().get_backend(assigned_target);
151 std::unique_ptr<IFunction> func = backend.configure_node(*node, ctx);
152 if (func != nullptr || is_utility_node(node))
153 {
154 workload.tasks.emplace_back(ExecutionTask(std::move(func), node));
155 }
156 }
157 }
158
159 // Add inputs and outputs
160 for (auto &node : g.nodes())
161 {
162 if (node != nullptr && node->type() == NodeType::Input)
163 {
164 workload.inputs.push_back(node->output(0));
165 }
166
167 if (node != nullptr && node->type() == NodeType::Output)
168 {
169 workload.outputs.push_back(node->input(0));
170 continue;
171 }
172 }
173
174 return workload;
175}
176
177void release_unused_tensors(Graph &g)
178{

Callers 1

finalize_graphMethod · 0.85

Calls 10

is_utility_nodeFunction · 0.85
ExecutionTaskClass · 0.85
nodeMethod · 0.80
assigned_targetMethod · 0.80
push_backMethod · 0.80
outputMethod · 0.80
inputMethod · 0.80
sizeMethod · 0.45
configure_nodeMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected