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

Method cleanup

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

Source from the content-addressed store, hash-verified

285}
286
287void ComputingGraphImpl::cleanup() {
288 if (m_recorded_seq_level2_dtor_chk) {
289 m_recorded_seq_level2_dtor_chk->enable();
290 }
291 // clear device memory storage and return them to comp node
292 clear_device_memory();
293
294 // so opr dtors would incur no overhead when deleting vars
295 m_var_node_pool.disable_freelist();
296
297 // TODO: call this after each graph exec when we have faster impl
298 CompNode::try_coalesce_all_free_memory();
299
300 options().user_data.clear_all_user_data();
301 components().~Components();
302 m_var_receiver.clear();
303 m_opr_refkeeper.clear();
304}
305
306void* ComputingGraphImpl::alloc_varnode_storage() {
307 return m_var_node_pool.alloc_raw();

Callers

nothing calls this directly

Calls 4

clear_all_user_dataMethod · 0.80
enableMethod · 0.45
disable_freelistMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected