Elffuss BraidHub

kikocis/kleidiai public

main · 2.6 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// To date, only AArch64 has these 8-bit kernels.
8#ifdef __aarch64__
9
10#include "gemm-wrappers.hpp"
11
12#include "kai_ops_kernels.hpp"
13#include "gemm_transpose.hpp"
14
15// gemm_s8_new - GEMM only
16template void benchmark<gemm_s8_new, false, QuantizationType::NONE, false>(GemmProblem *, int, int, int, mapfn, const char *);
17template void test<gemm_transposeB<int8_t, int32_t>, gemm_s8_new, false>(GemmProblem *, int, int, const char *, FILE *);
18template void print_kernels<gemm_s8_new, false>(GemmProblem *, unsigned int);
19
20// gemm_s8fp32 - dequantize result to FP32
21template void benchmark<gemm_s8fp32, false, QuantizationType::FLOAT, false>(GemmProblem *, int, int, int, mapfn, const char *);
22template void test_dequantized<sgemm_new, gemm_s8fp32>(GemmProblem *, int, int, const char *, FILE *);
23template void print_kernels<gemm_s8fp32, false>(GemmProblem *, unsigned int);
24
25// gemm_s8fp16 - dequantize result to FP16
26template void benchmark<gemm_s8fp16, false, QuantizationType::FLOAT, false>(GemmProblem *, int, int, int, mapfn, const char *);
27template void test_dequantized<hgemm_new, gemm_s8fp16>(GemmProblem *, int, int, const char *, FILE *);
28template void print_kernels<gemm_s8fp16, false>(GemmProblem *, unsigned int);
29
30// gemm_s8_quant - requantizing (per layer) GEMM
31template void benchmark<gemm_s8_quant, false, QuantizationType::INTEGER, false>(GemmProblem *, int, int, int, mapfn, const char *);
32template void test_quantized<sgemm_new, gemm_s8_quant>(GemmProblem *, int, int, const char *, FILE *);
33template void print_kernels<gemm_s8_quant, false>(GemmProblem *, unsigned int);
34
35template void benchmark<depthwise_s8q, false, QuantizationType::INTEGER, false>(GemmProblem *, int, int, int, mapfn, const char *);
36template void benchmark<depthwise_s8q, false, QuantizationType::INTEGER, true>(GemmProblem *, int, int, int, mapfn, const char *);
37template void test_quantized<depthwise_fp32, depthwise_s8q>(GemmProblem *, int, int, const char *, FILE *);
38template void test_quantized<depthwise_fp32, depthwise_s8q, true>(GemmProblem *, int, int, const char *, FILE *);
39template void print_kernels<depthwise_s8q, false>(GemmProblem *, unsigned int);
40
41// gemm_s8_quant_perchannel - requantizing (per channel) GEMM
42template void benchmark<gemm_s8_quant, false, QuantizationType::INTEGER, true>(GemmProblem *, int, int, int, mapfn, const char *);
43template void test_quantized<sgemm_new, gemm_s8_quant, true>(GemmProblem *, int, int, const char *, FILE *);
44
45#endif // aarch64