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

Method prefault

src/core/impl/graph/var_node_mem_mgr.cpp:70–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70void StaticDeviceMemoryManager::prefault() {
71 for (auto&& i : m_storage) {
72 if (i.first.device_type() == CompNode::DeviceType::CPU) {
73 auto storage = i.second;
74 auto set = [storage]() { memset(storage.ptr(), 0, storage.size()); };
75 CompNodeEnv::from_comp_node(i.first).cpu_env().dispatch(set);
76 i.first.sync();
77 }
78 }
79}
80
81#if MGB_THREAD_SAFE
82size_t StaticDeviceMemoryManager::clear_all() {

Callers 1

after_fake_execMethod · 0.80

Calls 5

device_typeMethod · 0.45
ptrMethod · 0.45
sizeMethod · 0.45
dispatchMethod · 0.45
syncMethod · 0.45

Tested by

no test coverage detected