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

Function TEST_CASE

test/eliminate_identity_test.cpp:40–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38static void run_pass(migraphx::program& p) { run_pass(*p.get_main_module()); }
39
40TEST_CASE(simple_test)
41{
42 migraphx::program p;
43
44 auto* mm = p.get_main_module();
45
46 auto one = mm->add_literal(1);
47 auto one_identity = mm->add_instruction(migraphx::make_op("identity"), one);
48 auto two = mm->add_literal(2);
49 auto two_identity = mm->add_instruction(migraphx::make_op("identity"), two);
50 mm->add_instruction(migraphx::make_op("add"), one_identity, two_identity);
51 run_pass(p);
52 EXPECT(std::none_of(mm->begin(), mm->end(), [](const migraphx::instruction& ins) {
53 return ins.name() == "identity";
54 }));
55 auto result = p.eval({}).back();
56 EXPECT(result == migraphx::literal{3});
57}
58
59TEST_CASE(simple_test_end)
60{

Callers

nothing calls this directly

Calls 13

get_main_moduleMethod · 0.80
backMethod · 0.80
add_parameterMethod · 0.80
run_passFunction · 0.70
make_opFunction · 0.50
none_ofFunction · 0.50
any_ofFunction · 0.50
add_literalMethod · 0.45
add_instructionMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected