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

Method wait_async_init

src/core/impl/comp_node_env.cpp:486–496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

484
485#if MGB_ENABLE_COMP_NODE_ASYNC_INIT
486void CompNodeEnv::wait_async_init() {
487 if (std::this_thread::get_id() == m_async_init_tid)
488 return;
489
490 MGB_LOCK_GUARD(m_async_init_mtx);
491 if (m_async_init_need_wait.load()) {
492 m_async_init_future.wait();
493 m_async_init_need_wait.store(false);
494 m_async_init_future.get();
495 }
496}
497#endif
498
499void CompNodeEnv::on_bad_device_type(DeviceType expected) const {

Callers 1

Calls 4

loadMethod · 0.45
waitMethod · 0.45
storeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected