| 68 | } |
| 69 | |
| 70 | void 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 |
| 82 | size_t StaticDeviceMemoryManager::clear_all() { |
no test coverage detected