Commit 94db0f8a authored by Paul's avatar Paul
Browse files

Format

parent 8743826c
...@@ -156,7 +156,9 @@ struct module ...@@ -156,7 +156,9 @@ struct module
void print_cpp(std::ostream& os) const; void print_cpp(std::ostream& os) const;
std::unordered_map<instruction_ref, std::string> std::unordered_map<instruction_ref, std::string>
print_cpp(std::ostream& os, const std::string& mname, std::unordered_map<instruction_ref, std::string> names) const; print_cpp(std::ostream& os,
const std::string& mname,
std::unordered_map<instruction_ref, std::string> names) const;
void annotate(std::ostream& os, std::function<void(instruction_ref)> a) const; void annotate(std::ostream& os, std::function<void(instruction_ref)> a) const;
......
...@@ -782,7 +782,9 @@ static void print_cpp_shape(std::ostream& os, const migraphx::shape& s) ...@@ -782,7 +782,9 @@ static void print_cpp_shape(std::ostream& os, const migraphx::shape& s)
} }
std::unordered_map<instruction_ref, std::string> std::unordered_map<instruction_ref, std::string>
module::print_cpp(std::ostream& os, const std::string& mname, std::unordered_map<instruction_ref, std::string> names) const module::print_cpp(std::ostream& os,
const std::string& mname,
std::unordered_map<instruction_ref, std::string> names) const
{ {
// cppcheck-suppress variableScope // cppcheck-suppress variableScope
...@@ -791,9 +793,10 @@ module::print_cpp(std::ostream& os, const std::string& mname, std::unordered_map ...@@ -791,9 +793,10 @@ module::print_cpp(std::ostream& os, const std::string& mname, std::unordered_map
[&](auto ins, auto ins_names) { [&](auto ins, auto ins_names) {
auto op = cpp_op_var(ins_names.at(ins), ins); auto op = cpp_op_var(ins_names.at(ins), ins);
std::vector<std::string> input_vars; std::vector<std::string> input_vars;
std::transform(ins->inputs().begin(), ins->inputs().end(), std::back_inserter(input_vars), [&](auto input) { std::transform(ins->inputs().begin(),
return cpp_var_name(ins_names.at(input)); ins->inputs().end(),
}); std::back_inserter(input_vars),
[&](auto input) { return cpp_var_name(ins_names.at(input)); });
os << "auto " << cpp_var_name(ins_names.at(ins)) << " = "; os << "auto " << cpp_var_name(ins_names.at(ins)) << " = ";
if(ins->name() == "@literal") if(ins->name() == "@literal")
{ {
......
...@@ -757,7 +757,7 @@ void program::print_cpp(std::ostream& os) const ...@@ -757,7 +757,7 @@ void program::print_cpp(std::ostream& os) const
{ {
std::string var_name = "m" + mod->name(); std::string var_name = "m" + mod->name();
os << "migraphx::module_ref " << var_name << " = "; os << "migraphx::module_ref " << var_name << " = ";
if (mod->name() == "main") if(mod->name() == "main")
os << "p.get_main_module();"; os << "p.get_main_module();";
else else
os << "p.create_module(\"" << mod->name() << "\");"; os << "p.create_module(\"" << mod->name() << "\");";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment