| 1547 | } |
| 1548 | |
| 1549 | void ChannelImpl::sample_on_device(CompNode device, bool force) { |
| 1550 | if (!Profiler::is_profiling()) { |
| 1551 | return; |
| 1552 | } |
| 1553 | if (!force) { |
| 1554 | thread_local int last_sample_id = 0; |
| 1555 | int sample_rate = Profiler::get_option("sample_rate", 0); |
| 1556 | if (!sample_rate || ((++last_sample_id) % sample_rate != 0)) { |
| 1557 | return; |
| 1558 | } |
| 1559 | } |
| 1560 | MGB_RECORD_EVENT(SampleDeviceEvent, device); |
| 1561 | auto [total, free] = device.get_mem_status_bytes(); |
| 1562 | MGB_RECORD_EVENT(SampleDeviceFinishEvent, device, total, free); |
| 1563 | } |
| 1564 | |
| 1565 | void ChannelImpl::DynamicSublinear::pin(const SmallVector<TensorInfo*>& vec) { |
| 1566 | for (auto i : vec) { |
nothing calls this directly
no test coverage detected