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

Method host_wait

src/core/impl/comp_node/impl_helper.cpp:30–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30void CompNodeImplHelper::EventImplHelper::host_wait() {
31 if (sm_cpu_sync_level >= 2) {
32 while (!finished())
33 ;
34 return;
35 }
36 if (sm_cpu_sync_level >= 1) {
37#if __DEPLOY_ON_XP_SP2__
38#if MGB_HAVE_THREAD
39 __builtin_trap();
40#else
41 return;
42#endif
43#else
44 while (!finished()) {
45 std::this_thread::yield();
46 }
47#endif
48 return;
49 }
50 mgb_assert(!sm_cpu_sync_level, "invalid cpu sync level: %d", sm_cpu_sync_level);
51
52 host_wait_cv();
53}
54
55void CompNodeImplHelper::EventImplHelper::host_wait_cv() {
56#if __DEPLOY_ON_XP_SP2__

Callers 15

utility.cppFile · 0.80
process_eventsMethod · 0.80
rotateMethod · 0.80
compileMethod · 0.80
~GraphProfilerMethod · 0.80
to_jsonMethod · 0.80
TESTFunction · 0.80
syncMethod · 0.80
syncMethod · 0.80
syncMethod · 0.80
do_waitMethod · 0.80

Calls

no outgoing calls

Tested by 3

TESTFunction · 0.64
~ReformatProfilerMethod · 0.64
durationMethod · 0.64