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

Method compile_commit

src/core/impl/graph/cg_impl.cpp:710–735  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

708}
709
710std::unique_ptr<AsyncExecutable> ComputingGraphImpl::compile_commit(
711 CompileState state) {
712 auto comp_seq = std::make_unique<ComputingSequence>(shared_from_this());
713 comp_seq->extra_info = std::move(state.extra_info);
714 comp_seq->set_output_vars(state.dest_vars);
715 auto opr_seq = state.opr_seq;
716 auto&& cmpnt = components();
717
718 comp_seq->setup_opr_seq(opr_seq);
719 for (auto&& i : *opr_seq) {
720 for (auto&& j : i->node_prop().dep_map()) {
721 if (OperatorNodeBase::NodeProp::is_device_value_dep(j.second)) {
722 comp_seq->extra_info.var2recvinfo.at(j.first).last_dev_value_reader = i;
723 }
724 }
725 }
726 comp_seq->attach_to_graph();
727
728 MGB_TRY {
729 var_node_mem_manager().reset_opr_seq(comp_seq->extra_info, opr_seq);
730 static_infer_comp_seq_manager().reset_dest(comp_seq->extra_info);
731 cmpnt.seq_comp_node_opt.init_ready_event(comp_seq->extra_info, *opr_seq);
732
733 if (options().allocate_static_mem_after_graph_compile)
734 var_node_mem_manager().alloc_var_node_mem_static();
735 }
736 MGB_FINALLY({ var_node_mem_manager().on_graph_compile_finished(); });
737
738 event().signal_inplace<event::CompSeqOrderDetermined>(this, comp_seq.get());

Callers

nothing calls this directly

Calls 8

setup_opr_seqMethod · 0.80
attach_to_graphMethod · 0.80
reset_destMethod · 0.80
init_ready_eventMethod · 0.80
set_output_varsMethod · 0.45
atMethod · 0.45
reset_opr_seqMethod · 0.45

Tested by

no test coverage detected