MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / TEST_CASE

Function TEST_CASE

test/rewrite_low_precision_test.cpp:57–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57TEST_CASE(simplify_pow2_div)
58{
59 migraphx::module m1;
60 {
61 auto x = m1.add_parameter("x", {migraphx::shape::half_type, {1}});
62 auto n = m1.add_literal(migraphx::half{5.0f});
63 auto two = m1.add_literal(migraphx::half{2.0f});
64
65 auto pow = m1.add_instruction(migraphx::make_op("pow"), x, two);
66 auto div = m1.add_instruction(migraphx::make_op("div"), pow, n);
67 m1.add_instruction(pass_op{}, div);
68 }
69 run_pass(m1);
70
71 migraphx::module m2;
72 {
73 auto x = m2.add_parameter("x", {migraphx::shape::half_type, {1}});
74 auto n = m2.add_literal(migraphx::half{5.0f});
75
76 auto x_div_n = m2.add_instruction(migraphx::make_op("div"), x, n);
77 auto mul = m2.add_instruction(migraphx::make_op("mul"), x_div_n, x);
78 m2.add_instruction(pass_op{}, mul);
79 }
80 EXPECT(m1 == m2);
81}
82
83TEST_CASE(no_simplify_float_pow2_div)
84{

Callers

nothing calls this directly

Calls 15

make_targetFunction · 0.85
verify_rms_rangeFunction · 0.85
add_parameterMethod · 0.80
get_main_moduleMethod · 0.80
lensMethod · 0.80
backMethod · 0.80
run_passFunction · 0.70
make_opFunction · 0.50
argumentClass · 0.50
add_literalMethod · 0.45
add_instructionMethod · 0.45
compileMethod · 0.45

Tested by

no test coverage detected