Elffuss BraidHub

kikocis/kleidiai public

main · 3.1 KiBRawPermalink
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
11namespace kai::test {
12
13/// Matrix multiplication tensor slots.
14enum class MatMulSlot : size_t {
15 CONFIG, ///< Matrix multiplication operator configuration.
16 PACK_ARGS, ///< Packing arguments.
17 MATMUL_ARGS, ///< Matrix multiplication micro-kernel parameters.
18
19 // If the input is floating-point:
20 // * DATA contains the input data.
21 // * CVT_DATA contains the converted input data if the operator computes
22 // in different data type (lower precision for better performance).
23 // * QDATA, QSCALE, QZP are unused.
24 //
25 // If the input is quantized:
26 // * DATA contains the source floating-point data in F32 which later
27 // will be used to determine the quantization parameters and then quantized.
28 // * CVT_DATA is unused.
29 // * QDATA, QSCALE, QZP contain the quantized data and quantization parameters
30 // calculated from the source floating-point data.
31
32 LHS_DATA, ///< LHS data.
33 LHS_CVT_DATA, ///< LHS data after conversion.
34 LHS_QDATA, ///< LHS data after quantization.
35 LHS_QSCALE, ///< LHS quantization scale.
36 LHS_QZP, ///< LHS quantization zero-point.
37 LHS_QZP_NEG, ///< Negative LHS quantization zero-point.
38 LHS_PACKED, ///< Packed LHS.
39 LHS_PACKED_IMP, ///< Packed LHS from micro-kernel.
40
41 RHS_DATA, ///< RHS data.
42 RHS_CVT_DATA, ///< RHS data after conversion.
43 RHS_T_DATA, ///< Transposed RHS data.
44 RHS_T_CVT_DATA, ///< Transposed RHS data after conversion.
45 RHS_T_QDATA, ///< Transposed RHS data after quantization.
46 RHS_T_QDATA_SIGN, ///< Transposed RHS data after quantization with opposite signedness.
47 RHS_T_QDATA_SIGN_SUM, ///< Row sum of transposed RHS after quantization with opposite signedness.
48 RHS_T_QSCALE, ///< Transposed RHS quantization scale.
49 RHS_T_QZP, ///< Transposed RHS quantization zero-point.
50 RHS_PACKED, ///< Packed RHS.
51 RHS_PACKED_IMP, ///< Packed RHS from micro-kernel.
52
53 ACC_BIAS_GLOBAL_DATA, ///< Accumulator bias data, global.
54 ACC_BIAS_M_DATA, ///< Accumulator bias data per M.
55 ACC_BIAS_N_DATA, ///< Accumulator bias data per N.
56
57 SCALE_BIAS_GLOBAL_DATA, ///< Scaled accumulator bias data, global.
58 SCALE_BIAS_M_DATA, ///< Scaled accumulator bias data per M.
59 SCALE_BIAS_N_DATA, ///< Scaled accumulator bias data per N.
60
61 ACC_SCALE_GLOBAL_DATA, ///< Accumulator scale data, global.
62 ACC_SCALE_M_DATA, ///< Accumulator scale data per M.
63 ACC_SCALE_N_DATA, ///< Accumulator scale data per N.
64
65 DST_DATA, ///< Output data (can be floating-point or quantized).
66 DST_QSCALE, ///< Output quantization scale.
67 DST_QZP, ///< Output quantization zero-point.
68 DST_DATA_IMP, ///< Output data from micro-kernel.
69
70 LAST, ///< Sentinel value equal to the number of slots.
71};
72
73} // namespace kai::test