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

Method defrag

src/core/impl/graph/var_node_mem_mgr/defrag.cpp:59–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59void VarDevMemDefragmenter::defrag(
60 VarNode* req_var, const CompNodeInfo& cn_info, size_t extra_size) {
61 // pause all other comp nodes before calling defrag_impl()
62 auto exec_env =
63 ComputingGraphImpl::downcast(req_var->owner_graph())->current_exec_env();
64 mgb_assert(exec_env);
65 exec_env->pause_exec();
66 m_mem_mgr->owner_graph()->event().signal_inplace<event::BeforeMemDefrag>();
67 MGB_TRY { defrag_impl(req_var, cn_info, extra_size); }
68 MGB_FINALLY(exec_env->resume_exec(););
69}
70

Callers

nothing calls this directly

Calls 3

current_exec_envMethod · 0.80
owner_graphMethod · 0.45
pause_execMethod · 0.45

Tested by

no test coverage detected