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

Method flush

src/plugin/impl/opr_io_dump.cpp:244–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242 : OprIODumpBase(graph), m_fout(fout) {}
243
244void TextOprIODump::LazyValueRecorder::flush(TextOprIODump* iodump) const {
245 auto fout = iodump->m_fout.get();
246 m_cn.sync();
247 fprintf(fout, "==== recorded values\n");
248 for (size_t idx = 0; idx < m_oprs.size(); ++idx) {
249 auto opr = m_oprs[idx];
250 fprintf(fout, "#%zu: opr%zu %s{%s}\n", idx, opr->id, opr->name.c_str(),
251 opr->type->name);
252 for (auto&& ovar : opr->outputs) {
253 fprintf(fout, " var%zu: name=%s ", ovar.id, ovar.name.c_str());
254 print_host_val(fout, iodump->m_max_size, ovar.val.as_megdnn(), true);
255 fprintf(fout, "\n");
256 }
257 }
258}
259
260void TextOprIODump::dump_var(VarNode* var, bool lazy_sync) {
261 MGB_LOCK_GUARD(m_mtx);

Callers 3

flush_lazyMethod · 0.45
generate_code_fileFunction · 0.45

Calls 5

print_host_valFunction · 0.85
as_megdnnMethod · 0.80
getMethod · 0.45
syncMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected