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

Method push_scope

imperative/src/impl/interpreter/interpreter_impl.cpp:1464–1480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1462}
1463
1464void ChannelImpl::push_scope(std::string name, ScopeType type) {
1465 MGB_LOCK_GUARD(m_spin);
1466 assert_available();
1467 auto& state = get_channel_state();
1468 state.stack_manager.enter(name);
1469 MGB_RECORD_EVENT(ScopeEvent, name, type);
1470 if (Profiler::is_profiling()) {
1471 m_worker.add_task(
1472 {Profiler::next_id(), PushScope{name, type},
1473 get_channel_state().stack_manager.dump()});
1474 } else {
1475 m_worker.add_task({
1476 Profiler::next_id(),
1477 PushScope{name},
1478 });
1479 }
1480}
1481
1482void ChannelImpl::pop_scope(std::string name, ScopeType type) {
1483 MGB_LOCK_GUARD(m_spin);

Callers 1

apply_transformationMethod · 0.45

Calls 4

is_profilingFunction · 0.85
enterMethod · 0.45
add_taskMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected