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

Function TEST_CASE

test/ref_dev_examples.cpp:38–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36 */
37
38TEST_CASE(add_two_literals)
39{
40 /*!
41 * Simple MIGraphX program to add two literal values.
42 * Equivalent to adding two constant scalar values together.
43 */
44 // create the program a get a pointer to the main module
45 migraphx::program p;
46 auto* mm = p.get_main_module();
47
48 // add two literals to the program
49 auto one = mm->add_literal(1);
50 auto two = mm->add_literal(2);
51
52 // make the "add" operation between the two literals and add it to the program
53 mm->add_instruction(migraphx::make_op("add"), one, two);
54
55 // compile the program on the reference device
56 p.compile(migraphx::make_target("ref"));
57
58 // evaulate the program and retreive the result
59 auto result = p.eval({}).back();
60 std::cout << "add_two_literals: 1 + 2 = " << result << "\n";
61 EXPECT(result.at<int>() == 3);
62}
63
64TEST_CASE(add_parameters)
65{

Callers

nothing calls this directly

Calls 15

make_targetFunction · 0.85
verify_rms_rangeFunction · 0.85
get_main_moduleMethod · 0.80
backMethod · 0.80
add_parameterMethod · 0.80
make_opFunction · 0.50
argumentClass · 0.50
add_literalMethod · 0.45
add_instructionMethod · 0.45
compileMethod · 0.45
evalMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected