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

Method init_for_exec

src/core/impl/graph/cg_impl_seq.cpp:446–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

444}
445
446void ComputingGraphImpl::ComputingSequence::init_for_exec() {
447 if (m_first_exec) {
448 on_first_exec();
449 }
450
451 // add all tasks into exec env
452 m_exec_env.clear();
453 if (!m_have_parent_graph) {
454 record_all_event(m_event_start);
455 }
456 for (auto i : *m_opr_seq) {
457 m_exec_env.set_active_opr(i);
458 i->execute(m_exec_env);
459 }
460 m_exec_env.set_active_opr(nullptr);
461 record_all_event(m_event_end);
462
463 m_cg_event_version = m_owner_graph->event().version();
464}
465
466void ComputingGraphImpl::ComputingSequence::on_first_exec() {
467 mgb_assert(m_first_exec);

Callers

nothing calls this directly

Calls 4

set_active_oprMethod · 0.80
clearMethod · 0.45
executeMethod · 0.45
versionMethod · 0.45

Tested by

no test coverage detected