| 232 | } |
| 233 | |
| 234 | void ChannelImpl::drop(Handle handle) { |
| 235 | MGB_LOCK_GUARD(m_spin); |
| 236 | assert_available(); |
| 237 | auto& state = get_channel_state(); |
| 238 | if (state.options.enable_drop) { |
| 239 | mgb_assert( |
| 240 | m_valid_handle.find(handle) != m_valid_handle.end(), |
| 241 | "invalid handle: %p", handle); |
| 242 | auto* info = reinterpret_cast<TensorInfo*>(handle); |
| 243 | if (Profiler::is_profiling()) { |
| 244 | m_worker.add_task( |
| 245 | {Profiler::next_id(), Drop{info}, |
| 246 | get_channel_state().stack_manager.dump()}); |
| 247 | } else { |
| 248 | m_worker.add_task({ |
| 249 | Profiler::next_id(), |
| 250 | Drop{info}, |
| 251 | }); |
| 252 | } |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | void ChannelImpl::dispatch_default_cpu( |
| 257 | std::shared_ptr<OpDef> op, const SmallVector<TensorInfo*>& input_infos, |
no test coverage detected