MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / finalize

Method finalize

src/module.cpp:876–899  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

874}
875
876void module::finalize(std::vector<context>& contexts)
877{
878 assert(not contexts.empty());
879 const bool trace = enabled(MIGRAPHX_TRACE_FINALIZE{});
880 for(auto ins : iterator_for(*this))
881 {
882 if(trace)
883 {
884 std::cout << "Finalize: ";
885 this->debug_print(ins);
886 }
887 ins->finalize(contexts[ins->get_target_id()]);
888 for(const auto& smod : ins->module_inputs())
889 {
890 smod->finalize(contexts);
891 }
892 }
893
894 // Warn when an instruction is not normalized
895 auto ins = std::find_if(begin(), end(), [](auto& i) { return i.need_normalization(); });
896 if(ins != end())
897 std::cerr << "WARNING: Instruction needs normalization, performance may be affected."
898 << std::endl;
899}
900
901std::unordered_map<instruction_ref, instruction_ref>
902module::get_ins_param_map(const std::vector<instruction_ref>& inputs, bool reverse) const

Callers

nothing calls this directly

Calls 9

debug_printMethod · 0.95
iterator_forFunction · 0.85
beginFunction · 0.85
endFunction · 0.85
get_target_idMethod · 0.80
enabledFunction · 0.70
find_ifFunction · 0.50
emptyMethod · 0.45
need_normalizationMethod · 0.45

Tested by

no test coverage detected