test/nextgen/operators/matmul/matmul_operator.hpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // | ||
| 2 | // SPDX-FileCopyrightText: Copyright 2025 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 | #include <memory> | ||
| 11 | #include <optional> | ||
| 12 | #include <string_view> | ||
| 13 | #include <vector> | ||
| 14 | |||
| 15 | #include "test/common/data_type.hpp" | ||
| 16 | #include "test/common/span.hpp" | ||
| 17 | #include "test/nextgen/harness/kernel_wrapper.hpp" | ||
| 18 | #include "test/nextgen/operators/matmul/matmul_bias_mode.hpp" | ||
| 19 | #include "test/nextgen/quantization/quantizer.hpp" | ||
| 20 | |||
| 21 | namespace kai::test { | ||
| 22 | |||
| 23 | /// Matrix multiplication operator. | ||
| 24 | struct MatMulOperator { | ||
| 25 | std::string_view name; | ||
| 26 | |||
| 27 | bool (*is_cpu_supported)(); | ||
| 28 | bool (*is_shape_suitable)(size_t shape_m, size_t shape_n, size_t shape_k); | ||
| 29 | |||
| 30 | std::vector<MatMulBiasMode> supported_bias_modes; | ||
| 31 | |||
| 32 | std::optional<std::unique_ptr<Quantizer>> lhs_quant; | ||
| 33 | std::optional<std::unique_ptr<Quantizer>> rhs_quant; | ||
| 34 | std::optional<std::unique_ptr<Quantizer>> bias_quant; | ||
| 35 | |||
| 36 | DataType acc_dtype; | ||
| 37 | DataType dst_dtype; | ||
| 38 | |||
| 39 | std::optional<std::unique_ptr<KernelWrapper>> pack_lhs; | ||
| 40 | std::optional<std::unique_ptr<KernelWrapper>> pack_rhs; | ||
| 41 | std::unique_ptr<KernelWrapper> matmul; | ||
| 42 | }; | ||
| 43 | |||
| 44 | [[nodiscard]] Span<const MatMulOperator> get_available_matmul_operators(); | ||
| 45 | |||
| 46 | } // namespace kai::test | ||
| 47 |