"test/verify/0ck_elementwise_half_test.cpp" did not exist on "6bf3493aa8e7c9f73051d5e19fb227d73846225c"
Commit d068a978 authored by Paul's avatar Paul
Browse files

Format

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