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

Method attach_to_graph

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

Source from the content-addressed store, hash-verified

336}
337
338void ComputingGraphImpl::ComputingSequence::attach_to_graph() {
339 auto gimpl = m_owner_graph;
340 if (gimpl->m_current_comp_seq) {
341 // remove previous handlers
342 auto prev_seq = static_cast<ComputingSequence*>(gimpl->m_current_comp_seq);
343 prev_seq->cleanup();
344 }
345#if !__DEPLOY_ON_XP_SP2__
346 //! disable VarSanityCheck when __DEPLOY_ON_XP_SP2__=1. caused by
347 //! VarSanityCheck depends on std::thread
348 if (gimpl->options().var_sanity_check_first_run) {
349 m_var_sanity_check = std::make_unique<VarSanityCheck>(gimpl);
350 }
351#endif
352 gimpl->m_current_comp_seq = this;
353}
354
355ComputingGraphImpl::ComputingSequence::~ComputingSequence() {
356 MGB_TRY { cleanup(); }

Callers 1

compile_commitMethod · 0.80

Calls 1

cleanupMethod · 0.45

Tested by

no test coverage detected