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

Function TEST_CASE

test/ref/pointwise.cpp:33–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31#include <test.hpp>
32
33TEST_CASE(pointwise_test)
34{
35 migraphx::program p;
36 auto* mm = p.get_main_module();
37 migraphx::shape s{migraphx::shape::float_type, {3}};
38 auto l1 = mm->add_literal(migraphx::literal{s, {-1, 0, 1}});
39 auto l2 = mm->add_literal(migraphx::literal{s, {1, 2, 3}});
40 auto* pm = p.create_module("pointwise");
41 {
42 auto x1 = pm->add_parameter("x1", {migraphx::shape::float_type});
43 auto x2 = pm->add_parameter("x2", {migraphx::shape::float_type});
44 auto add = pm->add_instruction(migraphx::make_op("add"), x1, x2);
45 pm->add_return({add});
46 }
47 mm->add_instruction(migraphx::make_op("pointwise"), {l1, l2}, {pm});
48 p.compile(migraphx::make_target("ref"));
49 auto result = p.eval({}).back();
50 std::vector<float> results_vector(3);
51 result.visit([&](auto output) { results_vector.assign(output.begin(), output.end()); });
52 std::vector<float> gold = {0, 2, 4};
53 EXPECT(migraphx::verify::verify_rms_range(results_vector, gold));
54}
55
56TEST_CASE(pointwise_multi_out_test)
57{

Callers

nothing calls this directly

Calls 15

make_targetFunction · 0.85
verify_rms_rangeFunction · 0.85
get_main_moduleMethod · 0.80
add_parameterMethod · 0.80
backMethod · 0.80
make_opFunction · 0.50
add_literalMethod · 0.45
create_moduleMethod · 0.45
add_instructionMethod · 0.45
add_returnMethod · 0.45
compileMethod · 0.45
evalMethod · 0.45

Tested by

no test coverage detected