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

Method clear_device_memory

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

Source from the content-addressed store, hash-verified

822}
823
824size_t ComputingGraphImpl::clear_device_memory() {
825#if !MGB_BUILD_SLIM_SERVING
826 if (options().eager_evaluation) {
827 for (auto& opr : m_opr_refkeeper) {
828 if (!opr->same_type<mgb::opr::SharedDeviceTensor>() &&
829 !opr->same_type<mgb::opr::ImmutableTensor>()) {
830 for (auto& var : opr->output()) {
831 if (var->mem_plan().valid())
832 var->mem_plan().release_chunk();
833 }
834 }
835 }
836 }
837#endif
838 return var_node_mem_manager().clear_static_device_memory();
839}
840
841void ComputingGraphImpl::set_as_subgraph(ComputingGraph& par_graph) {
842 m_parent_graph = ComputingGraphImpl::downcast(&par_graph);

Callers 5

checkMethod · 0.45
TEST_FFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
scn_do_executeMethod · 0.45

Calls 3

outputMethod · 0.45
validMethod · 0.45

Tested by 3

TEST_FFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36