| 216 | } |
| 217 | |
| 218 | void ChannelImpl::del_impl(Handle handle) { |
| 219 | mgb_assert(m_valid_handle.count(handle), "invalid handle: %p", handle); |
| 220 | auto* info = reinterpret_cast<TensorInfo*>(handle); |
| 221 | m_valid_handle.erase(handle); |
| 222 | if (Profiler::is_profiling()) { |
| 223 | m_worker.add_task( |
| 224 | {Profiler::next_id(), Del{info}, |
| 225 | get_channel_state().stack_manager.dump()}); |
| 226 | } else { |
| 227 | m_worker.add_task({ |
| 228 | Profiler::next_id(), |
| 229 | Del{info}, |
| 230 | }); |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | void ChannelImpl::drop(Handle handle) { |
| 235 | MGB_LOCK_GUARD(m_spin); |
nothing calls this directly
no test coverage detected