MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Compile

Function Compile

tensorflow/lite/delegates/gpu/metal/api.cc:259–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257} // namespace
258
259Status Compile(const GraphFloat32& graph, const RuntimeOptions& options,
260 CompiledModel* compiled_model) {
261 for (const auto& node : graph.nodes()) {
262 std::vector<ValueId> inputs;
263 for (auto& input : graph.FindInputs(node->id)) {
264 inputs.push_back(static_cast<ValueId>(input->id));
265 }
266 std::vector<ValueId> outputs;
267 for (auto& output : graph.FindOutputs(node->id)) {
268 outputs.push_back(static_cast<ValueId>(output->id));
269 }
270 std::vector<ComputeTaskDescriptorPtr> tasks;
271 auto custom_status =
272 RegisterCustomOps(graph, node, inputs, outputs, options, &tasks);
273 if (!custom_status.ok()) {
274 auto primary_status =
275 RegisterPrimaryOps(graph, node, inputs, outputs, options, &tasks);
276 if (!primary_status.ok()) {
277 return UnimplementedError(absl::Substitute(
278 "Unsupported op type: $0; custom registry error: "
279 "$1; primary registry error: $2;",
280 node->operation.type, custom_status.error_message(),
281 primary_status.error_message()));
282 }
283 }
284 compiled_model->insert(compiled_model->end(), tasks.begin(), tasks.end());
285 }
286 return OkStatus();
287}
288
289} // namespace metal
290} // namespace gpu

Callers

nothing calls this directly

Calls 12

RegisterCustomOpsFunction · 0.85
RegisterPrimaryOpsFunction · 0.85
OkStatusFunction · 0.85
FindInputsMethod · 0.80
FindOutputsMethod · 0.80
UnimplementedErrorFunction · 0.50
nodesMethod · 0.45
push_backMethod · 0.45
okMethod · 0.45
insertMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected