Commit c1ee4cf4 authored by Paul's avatar Paul
Browse files

Format

parent fb706c81
......@@ -200,8 +200,9 @@ cpp_generator::function cpp_generator::generate_module(const module& m,
const generate_module_callback& g)
{
function f;
f.set_name(to_c_id(m.name())).set_types(m).set_body(
m, [&](instruction_ref ins, const auto& names) -> std::string {
f.set_name(to_c_id(m.name()))
.set_types(m)
.set_body(m, [&](instruction_ref ins, const auto& names) -> std::string {
if(ins->name() == "@literal")
{
std::string string_literal;
......
......@@ -37,10 +37,7 @@ struct identity
shape compute_shape(std::vector<shape> inputs) const { return inputs.at(0); }
argument compute(shape, std::vector<argument> args) const { return args[0]; }
value attributes() const
{
return {{"pointwise", true}, {"point_op", "${0}"}};
}
value attributes() const { return {{"pointwise", true}, {"point_op", "${0}"}}; }
std::ptrdiff_t output_alias(const std::vector<shape>&) const { return 0; }
};
......
......@@ -215,15 +215,14 @@ struct fused_concat_compiler : compiler<fused_concat_compiler>
v["post"] = "MIGRAPHX_LIFT(" + mod_names_lookup.at(last_mod->name()) + ")";
std::unordered_map<std::string, std::size_t> mod_args;
std::transform(ins->module_inputs().begin(),
ins->module_inputs().end()-1,
ins->module_inputs().end() - 1,
std::inserter(mod_args, mod_args.end()),
[&](module_ref mod) {
const auto& name = mod_names_lookup.at(mod->name());
return std::make_pair(name, mod->get_parameter_names().size());
});
v["args"] = mod_args;
auto prefix_name = transform_accumulate(
ins->module_inputs().begin(),
auto prefix_name = transform_accumulate(ins->module_inputs().begin(),
ins->module_inputs().end() - 1,
std::string{},
std::plus<>{},
......@@ -233,9 +232,8 @@ struct fused_concat_compiler : compiler<fused_concat_compiler>
return "";
return name + "_";
});
v["kernel"] = prefix_name +
"concat_" + generate_name_from_ops(*(ins->module_inputs().back())) +
"_kernel";
v["kernel"] = prefix_name + "concat_" +
generate_name_from_ops(*(ins->module_inputs().back())) + "_kernel";
return compile_op(ctx, to_shapes(ins->inputs()), v);
}
};
......
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