Commit 835cc1e2 authored by Paul's avatar Paul
Browse files

Format

parent 77be2528
...@@ -965,26 +965,25 @@ struct find_contiguous ...@@ -965,26 +965,25 @@ struct find_contiguous
} }
}; };
struct find_contiguous_pointwise struct find_contiguous_pointwise
{ {
auto matcher() const { auto matcher() const
return match::name("gpu::contiguous")(match::arg(0)(precompile_name("pointwise"))); {
return match::name("gpu::contiguous")(match::arg(0)(precompile_name("pointwise")));
} }
void apply(module& m, const match::matcher_result& r) const void apply(module& m, const match::matcher_result& r) const
{ {
auto ins = r.result; auto ins = r.result;
auto pw = ins->inputs().front(); auto pw = ins->inputs().front();
auto alloc = ins->inputs().back(); auto alloc = ins->inputs().back();
auto args = pw->inputs(); auto args = pw->inputs();
args.back() = alloc; args.back() = alloc;
m.replace_instruction(ins, pw->get_operator(), args, pw->module_inputs()); m.replace_instruction(ins, pw->get_operator(), args, pw->module_inputs());
} }
}; };
void fuse_ops::apply(module& m) const void fuse_ops::apply(module& m) const
{ {
match::find_matches(m, find_contiguous_pointwise{}, find_gelu{}, find_gelu_new{fast_math}); match::find_matches(m, find_contiguous_pointwise{}, find_gelu{}, find_gelu_new{fast_math});
......
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