| 1 | // |
| 2 | // SPDX-FileCopyrightText: Copyright 2025-2026 Arm Limited and/or its affiliates <open-source-office@arm.com> |
| 3 | // |
| 4 | // SPDX-License-Identifier: Apache-2.0 |
| 5 | // |
| 6 | |
| 7 | #pragma once |
| 8 | |
| 9 | #include <cstddef> |
| 10 | |
| 11 | #include "test/common/buffer.hpp" |
| 12 | #include "test/common/data_type.hpp" |
| 13 | #include "test/common/span.hpp" |
| 14 | |
| 15 | namespace kai::test { |
| 16 | |
| 17 | /// Matrix multiplication. |
| 18 | /// |
| 19 | /// @param[in] shape_m The size of M dimension. |
| 20 | /// @param[in] shape_n The size of N dimension. |
| 21 | /// @param[in] shape_k The size of K dimension. |
| 22 | /// @param[in] lhs The LHS matrix. |
| 23 | /// @param[in] rhs The RHS matrix. |
| 24 | /// |
| 25 | /// @return The output matrix. |
| 26 | using MatMulFn = |
| 27 | Buffer (*)(size_t shape_m, size_t shape_n, size_t shape_k, Span<const std::byte> lhs, Span<const std::byte> rhs); |
| 28 | |
| 29 | /// Creates a matrix multiplication function for the specified data types. |
| 30 | /// |
| 31 | /// The LHS matrix is non-transposed and the RHS matrix is transposed. |
| 32 | /// |
| 33 | /// @param[in] lhs_dtype The LHS data type. |
| 34 | /// @param[in] rhs_dtype The RHS data type. |
| 35 | /// @param[in] acc_dtype The accumulator data type. |
| 36 | /// |
| 37 | /// @return The function pointer. |
| 38 | [[nodiscard]] MatMulFn make_matmul_nt_t(DataType lhs_dtype, DataType rhs_dtype, DataType acc_dtype); |
| 39 | |
| 40 | } // namespace kai::test |