Commit dc296a73 authored by Paul's avatar Paul
Browse files

Format

parent 5616894f
...@@ -165,7 +165,9 @@ struct pointwise_compiler : compiler<pointwise_compiler> ...@@ -165,7 +165,9 @@ struct pointwise_compiler : compiler<pointwise_compiler>
if(op.name() == "contiguous") if(op.name() == "contiguous")
{ {
return replace(compile_op( return replace(compile_op(
ctx, to_shapes(ins->inputs()), {{"lambda", "[](auto x) { return x; }"}, {"kernel", "contiguous_kernel"}})); ctx,
to_shapes(ins->inputs()),
{{"lambda", "[](auto x) { return x; }"}, {"kernel", "contiguous_kernel"}}));
} }
else else
{ {
...@@ -183,18 +185,19 @@ struct pointwise_compiler : compiler<pointwise_compiler> ...@@ -183,18 +185,19 @@ struct pointwise_compiler : compiler<pointwise_compiler>
g.add_point_op("greater", "migraphx::abs(${0} > ${1})"); g.add_point_op("greater", "migraphx::abs(${0} > ${1})");
g.add_point_op("not", "migraphx::abs(not ${0})"); g.add_point_op("not", "migraphx::abs(not ${0})");
// Add explict conversions // Add explict conversions
g.fresult( g.fresult([](const shape& s) {
[](const shape& s) { return "migraphx::convert<" + shape::cpp_type(s.type()) + ">"; }); return "migraphx::convert<" + shape::cpp_type(s.type()) + ">";
});
auto name = g.create_function( auto name = g.create_function(
g.generate_module(*pm).set_attributes({"__device__"}).set_generic_types(*pm)); g.generate_module(*pm).set_attributes({"__device__"}).set_generic_types(*pm));
std::string lambda = "MIGRAPHX_LIFT(" + name + ")"; std::string lambda = "MIGRAPHX_LIFT(" + name + ")";
auto op_names = get_op_names(*pm); auto op_names = get_op_names(*pm);
op_names.push_back("kernel"); op_names.push_back("kernel");
auto op_name_string = join_strings(op_names, "_"); auto op_name_string = join_strings(op_names, "_");
return replace( return replace(compile_op(
compile_op(ctx, ctx,
to_shapes(ins->inputs()), to_shapes(ins->inputs()),
{{"lambda", lambda}, {"preamble", g.str()}, {"kernel", op_name_string}})); {{"lambda", lambda}, {"preamble", g.str()}, {"kernel", op_name_string}}));
} }
} }
}; };
......
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