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

Method start_profile

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

Source from the content-addressed store, hash-verified

1417}
1418
1419void ChannelImpl::start_profile() {
1420 MGB_LOCK_GUARD(m_spin);
1421 assert_available();
1422 auto capture_tensors = collect_valid_tensors();
1423 if (capture_tensors.size() > 0) {
1424 if (Profiler::is_profiling()) {
1425 m_worker.add_task(
1426 {Profiler::next_id(), StartProfile{std::move(capture_tensors)},
1427 get_channel_state().stack_manager.dump()});
1428 } else {
1429 m_worker.add_task({
1430 Profiler::next_id(),
1431 StartProfile{std::move(capture_tensors)},
1432 });
1433 }
1434 }
1435}
1436
1437void ChannelImpl::stop_profile() {
1438 MGB_LOCK_GUARD(m_spin);

Callers

nothing calls this directly

Calls 4

is_profilingFunction · 0.85
sizeMethod · 0.45
add_taskMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected