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

Function create_pow2_div

test/rewrite_low_precision_test.cpp:43–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41
42template <migraphx::shape::type_t DType, typename T>
43static void
44create_pow2_div(migraphx::module& m, const std::vector<std::size_t>& input_lens, T divisor)
45{
46 migraphx::shape s_input{DType, input_lens};
47 migraphx::shape s_lit{DType, {1}};
48 auto l_pow_2 = m.add_literal(migraphx::literal{s_lit, {2.0f}});
49 auto l_div = m.add_literal(migraphx::literal{s_lit, {divisor}});
50
51 auto input = m.add_parameter("input", s_input);
52 auto pow = add_common_op(m, migraphx::make_op("pow"), {input, l_pow_2});
53 auto div = add_common_op(m, migraphx::make_op("div"), {pow, l_div});
54 m.add_return({div});
55}
56
57TEST_CASE(simplify_pow2_div)
58{

Callers

nothing calls this directly

Calls 5

add_common_opFunction · 0.85
add_parameterMethod · 0.80
make_opFunction · 0.50
add_literalMethod · 0.45
add_returnMethod · 0.45

Tested by

no test coverage detected