Commit d068a978 authored by Paul's avatar Paul
Browse files

Format

parent c97080ce
......@@ -92,7 +92,7 @@ template <class T>
auto to_value_impl(rank<4>, const optional<T>& x)
{
value result{};
if (x.has_value())
if(x.has_value())
to_value(*x);
return result;
}
......@@ -208,7 +208,7 @@ void from_value_impl(rank<5>, const value& v, T& x)
template <class T>
void from_value_impl(rank<6>, const value& v, optional<T>& x)
{
if (not v.is_null())
if(not v.is_null())
x = from_value<T>(v);
}
......
......@@ -103,7 +103,7 @@ void stream_write_value_impl(rank<0>, std::ostream& os, const T& x)
template <class T>
void stream_write_value_impl(rank<0>, std::ostream& os, const optional<T>& x)
{
if (x.has_value())
if(x.has_value())
stream_write_value_impl(rank<2>{}, os, *x);
else
os << "none";
......
......@@ -39,9 +39,9 @@ MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_GPU_COMPILE_PARALLEL);
struct precompile_op
{
operation op = op::identity{};
std::size_t additional_args = 1;
bool ignore_modules = false;
operation op = op::identity{};
std::size_t additional_args = 1;
bool ignore_modules = false;
optional<shape> output_shape = {};
template <class Self, class F>
......@@ -64,7 +64,7 @@ struct precompile_op
r = op.compute_shape(inputs);
else
r = op.compute_shape(inputs, mods);
if (output_shape.has_value())
if(output_shape.has_value())
r = *output_shape;
return r;
}
......
......@@ -663,15 +663,16 @@ struct find_contiguous_tranpose_precompile
void apply(module& m, const match::matcher_result& r) const
{
auto ins = r.result;
auto op_ins = r.instructions["op"];
auto op_ins = r.instructions["op"];
auto alloc = op_ins->inputs().back();
auto transpose = r.instructions["transpose"];
auto perm = transpose->get_operator().to_value()["permutation"].to_vector<int64_t>();
auto iperm = invert_permutation(perm);
auto s = shape::from_permutation(op_ins->get_shape().type(), op_ins->get_shape().lens(), iperm);
auto v = op_ins->get_operator().to_value();
auto s =
shape::from_permutation(op_ins->get_shape().type(), op_ins->get_shape().lens(), iperm);
auto v = op_ins->get_operator().to_value();
v["output_shape"] = to_value(s);
auto new_op = make_op("gpu::precompile_op", v);
auto new_op = make_op("gpu::precompile_op", v);
m.replace_instruction(op_ins, new_op, op_ins->inputs(), op_ins->module_inputs());
}
};
......
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