| 39 | TEST_SUITE(UNIT) |
| 40 | TEST_SUITE(MLGOHeuristics) |
| 41 | TEST_CASE(CorrectDotMLGOShouldLoadCorrectly, framework::DatasetMode::ALL) |
| 42 | { |
| 43 | std::string mlgo_str = R"_( |
| 44 | |
| 45 | <header> |
| 46 | |
| 47 | gemm-version, [1,2,1] |
| 48 | ip-type,gpu |
| 49 | </header> |
| 50 | <heuristics-table> |
| 51 | 0, g76 , 8, f32, best-performance, static, gemm-type, [m,n,k,n] |
| 52 | |
| 53 | 1, g71 , 8, f16, best-performance, static, gemm-config-reshaped-only-rhs, [m,n,k,n] |
| 54 | 2, g76 , 8, f16, best-performance, static, gemm-config-reshaped, [m,n,k,n] |
| 55 | </heuristics-table> |
| 56 | <heuristic, 0> |
| 57 | b , 0, var, m, ==, num, 10., 1, 2 |
| 58 | l , 1, gemm-type, reshaped |
| 59 | b , 2, var, r_mn, >=, num, 2., 3, 6 |
| 60 | |
| 61 | b , 3, var, n, >=, num, 200., 4, 5 |
| 62 | l, 4, gemm-type, reshaped-only-rhs |
| 63 | l , 5, gemm-type, reshaped |
| 64 | l , 6, gemm-type, reshaped-only-rhs |
| 65 | </heuristic> |
| 66 | <heuristic, 1> |
| 67 | b ,0,var, n, >, num, 100., 1, 4 |
| 68 | b ,1,var, r_mnk, <=, num, 20., 2, 3 |
| 69 | |
| 70 | |
| 71 | l ,2,gemm-config-reshaped-only-rhs, [4, 4,4,2,1,0,1] |
| 72 | l ,3,gemm-config-reshaped-only-rhs,[ 2, 2,4,2,1,1, 1 ] |
| 73 | b ,4,var, n, >=, num, 199.12, 5, 6 |
| 74 | l ,5,gemm-config-reshaped-only-rhs, [1, 4,3,4,0,0,0] |
| 75 | l ,6,gemm-config-reshaped-only-rhs, [5, 4,4,5,1,1,0] |
| 76 | </heuristic> |
| 77 | |
| 78 | <heuristic, 2> |
| 79 | l ,0,gemm-config-reshaped,[4,2,4,2,8,1,0,1,0] |
| 80 | |
| 81 | </heuristic> |
| 82 | |
| 83 | )_"; |
| 84 | std::stringstream ss(mlgo_str); |
| 85 | MLGOHeuristics heuristics; |
| 86 | heuristics.reload_from_stream(ss); |
| 87 | |
| 88 | ARM_COMPUTE_EXPECT(heuristics.query_gemm_type(Query{"g76", DataType::F32, 10, 1024, 20, 1}).second == |
| 89 | GEMMType::RESHAPED, |
| 90 | framework::LogLevel::ERRORS); |
| 91 | ARM_COMPUTE_EXPECT(heuristics.query_gemm_type(Query{"g76", DataType::F32, 400, 201, 5, 1}).second == |
| 92 | GEMMType::RESHAPED_ONLY_RHS, |
| 93 | framework::LogLevel::ERRORS); |
| 94 | ARM_COMPUTE_EXPECT(heuristics.query_gemm_type(Query{"g76", DataType::F32, 400, 200, 199, 16}).second == |
| 95 | GEMMType::RESHAPED_ONLY_RHS, |
| 96 | framework::LogLevel::ERRORS); |
| 97 | ARM_COMPUTE_EXPECT(heuristics.query_gemm_type(Query{"g76", DataType::F32, 400, 199, 512, 4}).second == |
| 98 | GEMMType::RESHAPED, |
nothing calls this directly
no test coverage detected