MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / add

Method add

src/core/impl/graph/operator_node.cpp:658–683  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

656/* ===================== PostExecActions ===================== */
657
658void PostExecActions::add(VarNode* var) {
659 mgb_assert(m_comp_node == var->comp_node());
660 auto graph = ComputingGraphImpl::downcast(var->owner_graph());
661
662 auto&& infer_mgr = graph->static_infer_manager_impl();
663 auto&& extra_info = graph->current_comp_seq_extra_info();
664 Item item;
665 if (graph->var_node_mem_manager().on_var_node_device_comp_finish_needed(var)) {
666 item.need_mem_mgr = &graph->var_node_mem_manager();
667 }
668 if (extra_info.missing_for_shape.count(var))
669 item.shape_sync_hdl = infer_mgr.get_tag_handler_for_shape(var);
670 if (extra_info.missing_for_value.count(var))
671 item.value_sync_hdl = infer_mgr.get_tag_handler_for_value(var);
672
673 if (!item.empty() || !cg::is_static_var_storage(var)) {
674 item.var = var;
675
676 // always check with recv_info since it incurs no additional cost
677 // note: if item.empty() && !is_static_storage, then we only check
678 // recv_info
679 item.recv_info = &graph->var_receiver_in_current_comp_seq(var);
680
681 m_items.push_back(item);
682 }
683}
684
685void PostExecActions::perform() {
686 bool enable = true;

Callers 2

to_jsonMethod · 0.45
process_oprMethod · 0.45

Calls 9

is_static_var_storageFunction · 0.85
comp_nodeMethod · 0.45
owner_graphMethod · 0.45
countMethod · 0.45
emptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected