// src/quant/arm/dot_neon.cpp - the Neon contract: ggml-cpu's dot products as its Arm flavour compiles them (armv8.2-a + dotprod + fp16 + i8mm, no SVE: the // DGX Spark's STRATA_PORTABLE build and the Mac's native build). The two-row i8mm forms are not here: the pool asks for one row at a time. // Compiled with the flags of cmake/backends/quant.cmake (GCC: -ffp-contract=fast like ggml's gnu11 C; Clang: its default, contraction within an expression). #include "tier_common.hpp" #include "../generic.hpp" #include "../registry.hpp" #include "strata/quant/dot.hpp" namespace strata::quant { namespace neon { #include "arm_helpers.inc" #include "arm_tables.inc" #include "arm_dots.inc" } // namespace neon namespace { #define ENTRY(T, ACT, NAME) {neon::dot_##NAME, Type::T, Type::ACT, Arith::Neon, Isa::Neon, "neon_" #NAME} const DotKernel kTable[] = { ENTRY(Q2_0, Q8_0, q2_0_q8_0), ENTRY(Q4_0, Q8_0, q4_0_q8_0), ENTRY(Q4_1, Q8_1, q4_1_q8_1), ENTRY(Q5_0, Q8_0, q5_0_q8_0), ENTRY(Q5_1, Q8_1, q5_1_q8_1), ENTRY(Q8_0, Q8_0, q8_0_q8_0), ENTRY(IQ4_NL, Q8_0, iq4_nl_q8_0), ENTRY(MXFP4, Q8_0, mxfp4_q8_0), ENTRY(NVFP4, Q8_0, nvfp4_q8_0), ENTRY(Q2_K, Q8_K, q2_K_q8_K), ENTRY(Q3_K, Q8_K, q3_K_q8_K), ENTRY(Q4_K, Q8_K, q4_K_q8_K), ENTRY(Q5_K, Q8_K, q5_K_q8_K), ENTRY(Q6_K, Q8_K, q6_K_q8_K), ENTRY(IQ1_S, Q8_K, iq1_s_q8_K), ENTRY(IQ1_M, Q8_K, iq1_m_q8_K), ENTRY(IQ2_XXS, Q8_K, iq2_xxs_q8_K), ENTRY(IQ2_XS, Q8_K, iq2_xs_q8_K), ENTRY(IQ2_S, Q8_K, iq2_s_q8_K), ENTRY(IQ3_XXS, Q8_K, iq3_xxs_q8_K), ENTRY(IQ3_S, Q8_K, iq3_s_q8_K), ENTRY(IQ4_XS, Q8_K, iq4_xs_q8_K), }; #undef ENTRY } // namespace DotTable neon_dot_table() noexcept { return {kTable, (int) (sizeof kTable / sizeof kTable[0])}; } } // namespace strata::quant