| 588 | } |
| 589 | |
| 590 | void CambriconCompNode::EventImpl::do_device_wait_by(Impl* cn_impl) { |
| 591 | if (cn_impl->dyn_typeinfo() == CambriconCompNodeImpl::typeinfo()) { |
| 592 | auto imp = static_cast<CambriconCompNodeImpl*>(cn_impl); |
| 593 | auto queue = imp->m_env.cnrt_env().queue; |
| 594 | imp->activate(); |
| 595 | MGB_CNRT_CHECK(cnrtQueueWaitNotifier(m_cnrt_notifier, queue, 0)); |
| 596 | return; |
| 597 | } |
| 598 | if (cn_impl->env().property().type == DeviceType::CPU) { |
| 599 | auto waiter = [this]() { MGB_CNRT_CHECK(cnrtWaitNotifier(m_cnrt_notifier)); }; |
| 600 | cn_impl->add_callback(std::move(waiter)); |
| 601 | return; |
| 602 | } |
| 603 | mgb_throw(MegBrainError, "unimplemented event device_wait_by config"); |
| 604 | } |
| 605 | |
| 606 | /* ================== CambriconCompNode static methods ================*/ |
| 607 |
nothing calls this directly
no test coverage detected