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

Method iter

src/gopt/impl/framework.cpp:161–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161void SubGraph::iter(const Callback& cb, std::shared_ptr<ExtraDep> extra_dep) const {
162 Callback on_opr;
163
164 if (m_owner_opt_state) {
165 on_opr = [state = m_owner_opt_state, &cb](OperatorNodeBase* opr) {
166 state->m_opr_property_flag = OprPropertyFlag::ALL;
167 state->m_cur_iter_src_opr = cg::get_opr_root_source_opr(opr);
168 state->m_cur_iter_opr_priority = opr->node_prop().attribute().priority;
169 state->m_cur_iter_opr_stream_prop_type =
170 state->m_comp_node_opt.stream_prop_type(opr->output(0));
171 mgb_assert(state->m_oprs_inserted.empty());
172 cb(opr);
173 state->m_opr_property_flag = OprPropertyFlag::NONE;
174 state->m_cur_iter_src_opr = nullptr;
175 state->m_oprs_inserted.clear();
176 };
177 } else {
178 on_opr = cb;
179 }
180
181 cg::DepOprIter dep_iter{on_opr, std::move(extra_dep)};
182 for (auto i : m_endpoint_oprs)
183 dep_iter.add(i);
184}
185
186ThinHashMap<VarNode*, size_t> SubGraph::get_var2nr_val_dep_oprs() const {
187 ThinHashMap<VarNode*, size_t> ret;

Callers 15

applyMethod · 0.45
replace_vars_internalFunction · 0.45
find_h2dMethod · 0.45
detect_replaceMethod · 0.45
update_graphMethod · 0.45
applyMethod · 0.45
applyMethod · 0.45
applyMethod · 0.45
applyMethod · 0.45
param_mergeFunction · 0.45
applyMethod · 0.45

Calls 7

cbFunction · 0.50
attributeMethod · 0.45
stream_prop_typeMethod · 0.45
outputMethod · 0.45
emptyMethod · 0.45
clearMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected