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

Function TEST_CASE

test/ref/identity.cpp:33–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31#include <test.hpp>
32
33TEST_CASE(identity_test)
34{
35 migraphx::program p;
36 auto* mm = p.get_main_module();
37 migraphx::shape s{migraphx::shape::float_type, {2, 2}};
38 std::vector<int> data{1, 2, 3, 4};
39 auto l = mm->add_literal(migraphx::literal{s, data});
40 mm->add_instruction(migraphx::make_op("identity"), l);
41 p.compile(migraphx::make_target("ref"));
42 auto result = p.eval({}).back();
43 std::vector<int> results_vector(4);
44 result.visit([&](auto output) { results_vector.assign(output.begin(), output.end()); });
45 EXPECT(std::equal(data.begin(), data.end(), results_vector.begin()));
46}
47
48TEST_CASE(identity_dyn_test)
49{

Callers

nothing calls this directly

Calls 15

make_targetFunction · 0.85
get_main_moduleMethod · 0.80
backMethod · 0.80
add_parameterMethod · 0.80
make_opFunction · 0.50
equalFunction · 0.50
argumentClass · 0.50
add_literalMethod · 0.45
add_instructionMethod · 0.45
compileMethod · 0.45
evalMethod · 0.45
visitMethod · 0.45

Tested by

no test coverage detected