| 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 |
| 16 | template void benchmark<gemm_s8_new, false, QuantizationType::NONE, false>(GemmProblem *, int, int, int, mapfn, const char *); |
| 17 | template void test<gemm_transposeB<int8_t, int32_t>, gemm_s8_new, false>(GemmProblem *, int, int, const char *, FILE *); |
| 18 | template void print_kernels<gemm_s8_new, false>(GemmProblem *, unsigned int); |
| 19 | |
| 20 | // gemm_s8fp32 - dequantize result to FP32 |
| 21 | template void benchmark<gemm_s8fp32, false, QuantizationType::FLOAT, false>(GemmProblem *, int, int, int, mapfn, const char *); |
| 22 | template void test_dequantized<sgemm_new, gemm_s8fp32>(GemmProblem *, int, int, const char *, FILE *); |
| 23 | template void print_kernels<gemm_s8fp32, false>(GemmProblem *, unsigned int); |
| 24 | |
| 25 | // gemm_s8fp16 - dequantize result to FP16 |
| 26 | template void benchmark<gemm_s8fp16, false, QuantizationType::FLOAT, false>(GemmProblem *, int, int, int, mapfn, const char *); |
| 27 | template void test_dequantized<hgemm_new, gemm_s8fp16>(GemmProblem *, int, int, const char *, FILE *); |
| 28 | template void print_kernels<gemm_s8fp16, false>(GemmProblem *, unsigned int); |
| 29 | |
| 30 | // gemm_s8_quant - requantizing (per layer) GEMM |
| 31 | template void benchmark<gemm_s8_quant, false, QuantizationType::INTEGER, false>(GemmProblem *, int, int, int, mapfn, const char *); |
| 32 | template void test_quantized<sgemm_new, gemm_s8_quant>(GemmProblem *, int, int, const char *, FILE *); |
| 33 | template void print_kernels<gemm_s8_quant, false>(GemmProblem *, unsigned int); |
| 34 | |
| 35 | template void benchmark<depthwise_s8q, false, QuantizationType::INTEGER, false>(GemmProblem *, int, int, int, mapfn, const char *); |
| 36 | template void benchmark<depthwise_s8q, false, QuantizationType::INTEGER, true>(GemmProblem *, int, int, int, mapfn, const char *); |
| 37 | template void test_quantized<depthwise_fp32, depthwise_s8q>(GemmProblem *, int, int, const char *, FILE *); |
| 38 | template void test_quantized<depthwise_fp32, depthwise_s8q, true>(GemmProblem *, int, int, const char *, FILE *); |
| 39 | template void print_kernels<depthwise_s8q, false>(GemmProblem *, unsigned int); |
| 40 | |
| 41 | // gemm_s8_quant_perchannel - requantizing (per channel) GEMM |
| 42 | template void benchmark<gemm_s8_quant, false, QuantizationType::INTEGER, true>(GemmProblem *, int, int, int, mapfn, const char *); |
| 43 | template void test_quantized<sgemm_new, gemm_s8_quant, true>(GemmProblem *, int, int, const char *, FILE *); |
| 44 | |
| 45 | #endif // aarch64 |