| 705 | } |
| 706 | |
| 707 | void PostExecActions::process_opr( |
| 708 | OperatorNodeBase& opr, OperatorNodeBase::ExecEnv& env) { |
| 709 | // PostExecActions should be empty most of the time; so we store the objects |
| 710 | // directly in a SmallVector and copy them to a shared_ptr when non-empty |
| 711 | SmallVector<PostExecActions> actions; |
| 712 | for (auto i : opr.output()) { |
| 713 | bool found = false; |
| 714 | for (auto&& j : actions) { |
| 715 | if (j.m_comp_node == i->comp_node()) { |
| 716 | j.add(i); |
| 717 | found = true; |
| 718 | break; |
| 719 | } |
| 720 | } |
| 721 | if (!found) { |
| 722 | actions.emplace_back(i); |
| 723 | } |
| 724 | } |
| 725 | |
| 726 | for (auto&& i : actions) { |
| 727 | if (!i.m_items.empty()) { |
| 728 | auto cn = i.m_comp_node; |
| 729 | MGB_IF_COND_EXEC(i.m_mask = ExecutionMask::get_from_opr(&opr)); |
| 730 | auto cb = [action = std::make_shared<PostExecActions>(std::move(i))]() { |
| 731 | action->perform(); |
| 732 | }; |
| 733 | env.dispatch_on_comp_node_with_mask(cn, cb, nullptr); |
| 734 | } |
| 735 | } |
| 736 | } |
| 737 | |
| 738 | // vim: syntax=cpp.doxygen foldmethod=marker foldmarker=f{{{,f}}} |
nothing calls this directly
no test coverage detected