| 874 | } |
| 875 | |
| 876 | void 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 | |
| 901 | std::unordered_map<instruction_ref, instruction_ref> |
| 902 | module::get_ins_param_map(const std::vector<instruction_ref>& inputs, bool reverse) const |
nothing calls this directly
no test coverage detected