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

Function TEST_CASE

test/api/test_module_construct.cpp:29–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27#include "test.hpp"
28
29TEST_CASE(add_literals)
30{
31 migraphx::program p;
32 migraphx::module m = p.get_main_module();
33 migraphx::shape param_shape{migraphx_shape_float_type, {3, 3}};
34 std::vector<float> x_values(9, 1);
35 auto x = m.add_literal(param_shape, x_values.data());
36 std::vector<float> y_values(9, -1);
37 auto y = m.add_literal(param_shape, y_values.data());
38 auto add_op = migraphx::operation("add");
39 auto r = m.add_instruction(add_op, {x, y});
40 m.add_return({r});
41 // run on ref target
42 p.compile(migraphx::target("ref"));
43 migraphx::program_parameters pp;
44 auto outputs = p.eval(pp);
45 auto output = outputs[0];
46 std::vector<float> expected(9, 0);
47 CHECK(output == migraphx::argument(param_shape, expected.data()));
48}
49
50TEST_CASE(if_then_else_op)
51{

Callers

nothing calls this directly

Calls 14

get_main_moduleMethod · 0.80
add_parameterMethod · 0.80
operationClass · 0.50
targetClass · 0.50
argumentClass · 0.50
create_programFunction · 0.50
run_progFunction · 0.50
add_literalMethod · 0.45
dataMethod · 0.45
add_instructionMethod · 0.45
add_returnMethod · 0.45
compileMethod · 0.45

Tested by

no test coverage detected