| 1 |
// Copyright 2024 Google LLC |
| 2 |
// |
| 3 |
// This source code is licensed under the BSD-style license found in the |
| 4 |
// LICENSE file in the root directory of this source tree. |
| 5 |
|
| 6 |
#include <stddef.h> |
| 7 |
#include "xnnpack/microparams.h" |
| 8 |
|
| 9 |
#if XNN_ENABLE_KLEIDIAI |
| 10 |
// Keep this line indented to avoid it being pulled out of the #ifdef when the |
| 11 |
// sources are amalgamated. |
| 12 |
#include "kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi4cxp/kai_matmul_clamp_f32_qai8dxp1x8_qsi4cxp4x8_1x4x32_neon_dotprod.h" |
| 13 |
#endif // XNN_ENABLE_KLEIDIAI |
| 14 |
|
| 15 |
// Wraps the |
| 16 |
// `kai_run_matmul_clamp_f32_qai8dxp1x8_qsi4cxp4x8_1x4x32_neon_dotprod` GEMM |
| 17 |
// microkernel with a name that is compatible with our tooling. |
| 18 |
void xnn_qp8_f32_qc4w_gemm_minmax_ukernel_1x4c16s2__aarch64_neondot( |
| 19 |
size_t m, size_t n, size_t k, const void* lhs_packed, |
| 20 |
const void* rhs_packed, float* dst, size_t dst_stride_row, |
| 21 |
size_t dst_stride_col, |
| 22 |
union xnn_f32_minmax_params |
| 23 |
minmax_params[XNN_RESTRICT XNN_MIN_ELEMENTS(1)]) { |
| 24 |
#if XNN_ENABLE_KLEIDIAI |
| 25 |
kai_run_matmul_clamp_f32_qai8dxp1x8_qsi4cxp4x8_1x4x32_neon_dotprod( |
| 26 |
m, n, k, lhs_packed, rhs_packed, dst, dst_stride_row, dst_stride_col, |
| 27 |
minmax_params->scalar.min, minmax_params->scalar.max); |
| 28 |
#else |
| 29 |
assert( |
| 30 |
"Calling KleidiAI microkernel wrapper, but XNNPACK was compiled without " |
| 31 |
"`XNN_ENABLE_KLEIDIAI`." && 0); |
| 32 |
#endif // XNN_ENABLE_KLEIDIAI |
| 33 |
} |