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

Method set_memory_allocator

lite/src/mge/network_impl.cpp:138–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138void NetworkImplDft::set_memory_allocator(std::shared_ptr<Allocator> user_allocator) {
139 auto allocator = std::make_shared<UserStaticMemAlloc>(user_allocator);
140 LITE_ASSERT(m_load_config.comp_graph);
141 m_load_config.comp_graph->set_device_memory_allocator(allocator);
142}
143
144//! share the runtime memory with other network, the weights is not shared
145void NetworkImplDft::share_runtime_memory_with(Network::NetworkImplBase* network_impl) {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected