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

Function TEST_CASE

test/gpu/compile_hipblaslt.cpp:44–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44TEST_CASE(hipblaslt_op)
45{
46 if(not(migraphx::string_value_of(MIGRAPHX_SET_GEMM_PROVIDER{}) == "rocblas") and
47 migraphx::gpu::hipblaslt_supported() and not migraphx::gpu::gfx_default_rocblas())
48 {
49 migraphx::module m1;
50 {
51 migraphx::shape sa{migraphx::shape::float_type, {4, 2}};
52 migraphx::shape sb{migraphx::shape::float_type, {2, 3}};
53 migraphx::shape s_output{migraphx::shape::float_type, {4, 3}};
54 auto a = m1.add_parameter("a", sa);
55 auto b = m1.add_parameter("b", sb);
56 migraphx::operation dot_op = migraphx::make_op("dot");
57 m1.add_instruction(dot_op, a, b);
58 }
59
60 run_lowering(m1);
61 migraphx::module m2;
62 {
63 auto a = m2.add_parameter("a", {migraphx::shape::float_type, {4, 2}});
64 auto b = m2.add_parameter("b", {migraphx::shape::float_type, {2, 3}});
65
66 migraphx::shape output_shape{migraphx::shape::float_type, {4, 3}, {3, 1}};
67
68 // Add an allocate instruction for the output
69 auto output = m2.add_instruction(migraphx::op::allocate{output_shape, std::nullopt});
70
71 migraphx::op::dot dot_instance;
72 migraphx::gpu::hipblaslt_op hipblaslt_operator;
73 hipblaslt_operator.op = migraphx::gpu::hip_gemm<migraphx::op::dot>{dot_instance, 1, 0};
74 m2.add_instruction(hipblaslt_operator, a, b, output);
75 }
76 EXPECT(m1 == m2);
77 }
78}
79#endif
80
81int main(int argc, const char* argv[]) { test::run(argc, argv); }

Callers

nothing calls this directly

Calls 7

hipblaslt_supportedFunction · 0.85
gfx_default_rocblasFunction · 0.85
add_parameterMethod · 0.80
run_loweringFunction · 0.70
string_value_ofFunction · 0.50
make_opFunction · 0.50
add_instructionMethod · 0.45

Tested by

no test coverage detected