| 42 | } |
| 43 | |
| 44 | TEST_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 | |
| 81 | int main(int argc, const char* argv[]) { test::run(argc, argv); } |
nothing calls this directly
no test coverage detected