| 1417 | } |
| 1418 | |
| 1419 | void 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 | |
| 1437 | void ChannelImpl::stop_profile() { |
| 1438 | MGB_LOCK_GUARD(m_spin); |
nothing calls this directly
no test coverage detected