| 36 | */ |
| 37 | |
| 38 | TEST_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 | |
| 64 | TEST_CASE(add_parameters) |
| 65 | { |
nothing calls this directly
no test coverage detected