MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / cross_compnode_model_detect

Method cross_compnode_model_detect

lite/src/mge/network_impl.cpp:431–446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

429}
430
431void NetworkImplDft::cross_compnode_model_detect() {
432 mgb::ThinHashSet<LiteDeviceType> nr_used_device_type;
433 auto on_opr = [&](mgb::cg::OperatorNodeBase* opr) {
434 for (auto j : opr->output()) {
435 if (j->comp_node() != mgb::CompNode::default_cpu()) {
436 nr_used_device_type.insert(
437 get_device_from_locator(j->comp_node().locator()));
438 }
439 }
440 };
441 mgb::cg::DepOprIter dep_iter{on_opr};
442 for (auto i : m_load_result.output_var_list) {
443 dep_iter.add(i.node()->owner_opr());
444 }
445 m_nr_device_type = nr_used_device_type.size();
446}
447
448void NetworkImplDft::layout_transform_optimization() {
449 if (m_set_layout_transform) {

Callers

nothing calls this directly

Calls 8

outputMethod · 0.45
comp_nodeMethod · 0.45
insertMethod · 0.45
locatorMethod · 0.45
addMethod · 0.45
owner_oprMethod · 0.45
nodeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected