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

Function do_execute

src/core/impl/graph/cg_impl_partial.cpp:278–297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276 }
277
278 void do_execute(ExecEnv& env) override {
279 for (auto&& dep_entry : node_prop().dep_map()) {
280 auto var = dep_entry.first;
281 auto type = dep_entry.second;
282 auto runner = [this, var, type]() {
283 const DeviceTensorND* dv_ptr = nullptr;
284 const DeviceTensorND* hv_ptr = nullptr;
285 if (type & DepType::DEV_VALUE) {
286 dv_ptr = &var->dev_tensor();
287 }
288 if (type & DepType::HOST_VALUE) {
289 hv_ptr = &owner_graph()->static_infer_manager().infer_value(var);
290 }
291 for (auto&& i : m_value_listeners.at(var)) {
292 i(var, dv_ptr, hv_ptr);
293 }
294 };
295 env.dispatch_on_comp_node(var->comp_node(), runner);
296 }
297 }
298};
299MGB_DYN_TYPE_OBJ_FINAL_IMPL(ComputingGraphImpl::MultiPartCompiler::VarSinkOpr);
300

Callers 3

cg_impl_seq.cppFile · 0.70
as_recorded_seqMethod · 0.70
executeMethod · 0.70

Calls 5

infer_valueMethod · 0.80
dev_tensorMethod · 0.45
atMethod · 0.45
dispatch_on_comp_nodeMethod · 0.45
comp_nodeMethod · 0.45

Tested by

no test coverage detected