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

Method preprocess

src/core/impl/graph/cg_impl_seq.cpp:298–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296}
297
298void ComputingGraphImpl::ComputingSequence::preprocess(ExecContext* ctx) {
299 assert_latest_comp_seq();
300 ++m_run_id;
301 m_prev_exec_time = None;
302
303 ctx->m_mem_reallocated =
304 m_owner_graph->var_node_mem_manager().alloc_var_node_mem_static();
305
306 bool first_exec = m_first_exec;
307#if !__DEPLOY_ON_XP_SP2__
308 if (!first_exec) {
309 // var sanity check only for first run
310 m_var_sanity_check.reset();
311 }
312#endif
313
314 m_owner_graph->event().signal_inplace<event::CompSeqExecBeforeStart>(
315 m_owner_graph, this, &ctx->m_cleanup_callback, &m_used_comp_node,
316 m_owner_graph->event().version());
317
318 if (first_exec || m_cg_event_version != m_owner_graph->event().version()) {
319 init_for_exec();
320 }
321 ctx->m_enable_comp_node_seq_recorder = m_enable_comp_node_seq_recorder;
322}
323
324std::shared_ptr<void> ComputingGraphImpl::ComputingSequence::on_comp_node_finalize() {
325 cleanup();

Callers 1

ExecContextMethod · 0.45

Calls 3

resetMethod · 0.45
versionMethod · 0.45

Tested by

no test coverage detected