| 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 "kai/kai_common.h" |
| 12 | |
| 13 | namespace kai::benchmark { |
| 14 | |
| 15 | /// Abstraction for the unspecialized Indirect Matrix Multiplication micro-kernel interface |
| 16 | struct ImatmulBaseInterface { |
| 17 | bool takes_indirection = false; |
| 18 | size_t (*get_m_step)(void); // |
| 19 | void (*run_imatmul)( |
| 20 | size_t m, size_t n, size_t k_chunk_count, size_t k_chunk_length, // |
| 21 | const void* lhs_packed, // |
| 22 | const void* rhs_packed, // |
| 23 | void* dst, // |
| 24 | size_t dst_stride_row, // |
| 25 | float clamp_min, float clamp_max); |
| 26 | }; |
| 27 | |
| 28 | /// Abstraction for the unspecialized Indirect Matrix Multiplication micro-kernel interface with static quantization |
| 29 | struct ImatmulStaticQuantInterface { |
| 30 | bool takes_indirection = false; |
| 31 | size_t (*get_m_step)(void); // |
| 32 | void (*run_imatmul)( |
| 33 | size_t m, size_t n, size_t k_chunk_count, size_t k_chunk_length, // |
| 34 | const void* lhs_packed, // |
| 35 | const void* rhs_packed, // |
| 36 | void* dst, // |
| 37 | size_t dst_stride_row, // |
| 38 | const kai_matmul_requantize32_params* params); |
| 39 | }; |
| 40 | |
| 41 | /// Abstraction for the unspecialized Indirect Matrix Multiplication micro-kernel interface without LHS Packing |
| 42 | struct ImatmulNoLHSPackBaseInterface { |
| 43 | bool takes_indirection = true; |
| 44 | size_t (*get_m_step)(void); // |
| 45 | void (*run_imatmul)( |
| 46 | size_t m, size_t n, size_t k_chunk_count, size_t k_chunk_length, const void* indirection_buffer, |
| 47 | const void* pad_ptr, size_t lhs_ptr_offset, const void* rhs_packed, void* dst, size_t dst_stride_row, |
| 48 | float clamp_min, float clamp_max); |
| 49 | }; |
| 50 | |
| 51 | } // namespace kai::benchmark |