Skip to content

Commit

Permalink
Fiy type check in find_pow2_div
Browse files Browse the repository at this point in the history
  • Loading branch information
gyulaz-htec committed Mar 1, 2024
1 parent 8973085 commit e72105b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/rewrite_low_precision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ struct find_pow2_div
auto n = r.instructions["n"];
auto x = r.instructions["x"];

// sqrt(n) with integral numbers can cause huge accuracy loss due to float->int rounding
if(n->get_shape().type() != migraphx::shape::half_type)
if(x->get_shape().type() != migraphx::shape::half_type)
return;
auto n_sqrt = m.insert_instruction(ins, make_op("sqrt"), n);
auto x_div_n_rsqrt = m.insert_instruction(ins, make_op("div"), {x, n_sqrt});
Expand Down

0 comments on commit e72105b

Please sign in to comment.