### Android Build Commands Source: https://github.com/kleidi/kleidiai/blob/main/docs/matmul_qsi4cx/README.md Example commands to build the project for Android, including NDK setup and CMake configuration. ```bash mkdir build && cd build export NDK_PATH="your-android-ndk-path" cmake -DCMAKE_TOOLCHAIN_FILE=${NDK_PATH}/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-23 -DCMAKE_C_FLAGS=-march=armv8.2a+i8mm -DCMAKE_CXX_FLAGS=-march=armv8.2a+i8mm .. make ``` -------------------------------- ### CMake build script example Source: https://github.com/kleidi/kleidiai/blob/main/docs/matmul_qsi4cx/README.md An example CMakeLists.txt file to compile the matrix multiplication example. ```cmake cmake_minimum_required(VERSION 3.16) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") set(KLEIDIAI_PATH ../../) set(MATMUL_PACK_PATH ${KLEIDIAI_PATH}/kai/ukernels/matmul/pack/) set(MATMUL_PATH ${KLEIDIAI_PATH}/kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi4cxp/) # KleidiAI include directories include_directories( ${KLEIDIAI_PATH} ${MATMUL_PACK_PATH} ${MATMUL_PATH}) # Files requires to build the executable add_executable(matmul_clamp_f32_qai8dxp_qsi4cxp matmul_clamp_f32_qai8dxp_qsi4cxp.cpp ${MATMUL_PACK_PATH}/kai_rhs_pack_nxk_qsi4cxp_qs4cxs1s0.c ${MATMUL_PACK_PATH}/kai_rhs_pack_kxn_qsi4cxp_qs4cxs1s0.c ${MATMUL_PACK_PATH}/kai_lhs_quant_pack_qai8dxp_f32.c ${MATMUL_PATH}/kai_matmul_clamp_f32_qai8dxp4x8_qsi4cxp8x8_8x8x32_neon_i8mm.c) ``` -------------------------------- ### Quick Examples Source: https://github.com/kleidi/kleidiai/blob/main/benchmark/README.md Running matmul, imatmul, and dwconv with example dimensions. ```bash ./kleidiai_benchmark matmul -m 32 -n 32 -k 32 ./kleidiai_benchmark imatmul -m 32 -n 32 -c 4 -l 8 ./kleidiai_benchmark dwconv --input_height 32 --input_width 32 --channels 64 --padding 1,1,1,1 ``` -------------------------------- ### Install Configuration Files Source: https://github.com/kleidi/kleidiai/blob/main/CMakeLists.txt Installs the generated configuration and version files. ```cmake install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" ) ``` -------------------------------- ### Usage Example Source: https://github.com/kleidi/kleidiai/blob/main/examples/matmul_clamp_f32_qsi8d32p_qsi4c32p/README.md Example command to run the matmul_clamp_f32_qsi8d32p_qsi4c32p executable. ```bash $ ./matmul_clamp_f32_qsi8d32p_qsi4c32p --threads ``` -------------------------------- ### Install and run pre-commit hooks Source: https://github.com/kleidi/kleidiai/blob/main/CONTRIBUTING.md Commands to install and run pre-commit hooks locally. ```sh pre-commit install pre-commit run --all-files ``` -------------------------------- ### CMakeLists.txt Source: https://github.com/kleidi/kleidiai/blob/main/examples/matmul_clamp_f32_qai8dxp_qsi4cxp/CMakeLists.txt The CMakeLists.txt file used to build the matmul_clamp_f32_qai8dxp_qsi4cxp example. ```cmake # # SPDX-FileCopyrightText: Copyright 2024, 2026 Arm Limited and/or its affiliates # # SPDX-License-Identifier: Apache-2.0 # cmake_minimum_required(VERSION 3.16) project(matmul_clamp_f32_qai8dxp_qsi4cxp LANGUAGES C CXX ASM) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(KLEIDIAI_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../) include(FetchContent) set(KLEIDIAI_BUILD_TESTS OFF CACHE BOOL "" FORCE) set(KLEIDIAI_BUILD_BENCHMARK OFF CACHE BOOL "" FORCE) fetchcontent_declare( kleidiai SOURCE_DIR ${KLEIDIAI_PATH} ) fetchcontent_makeavailable(kleidiai) add_executable(matmul_clamp_f32_qai8dxp_qsi4cxp matmul_clamp_f32_qai8dxp_qsi4cxp.cpp ) target_link_libraries(matmul_clamp_f32_qai8dxp_qsi4cxp PRIVATE kleidiai) # Compile with DotProd and I8MM features enabled target_compile_options(matmul_clamp_f32_qai8dxp_qsi4cxp PRIVATE -march=armv8.2-a+dotprod+i8mm) ``` -------------------------------- ### Install Project Headers Source: https://github.com/kleidi/kleidiai/blob/main/CMakeLists.txt Installs header files from the 'kai' directory to the include directory. ```cmake install(DIRECTORY kai DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" FILES_MATCHING PATTERN *.h ) ``` -------------------------------- ### Installation Configuration Source: https://github.com/kleidi/kleidiai/blob/main/CMakeLists.txt Installs the main 'kleidiai' target to the appropriate runtime, library, and archive directories. ```cmake install(TARGETS kleidiai EXPORT ${PROJECT_NAME}Targets RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ) ``` -------------------------------- ### DWConv Benchmark Example Source: https://github.com/kleidi/kleidiai/blob/main/benchmark/README.md An example of running the dwconv benchmark with specific parameters and the resulting output. ```bash ./kleidiai_benchmark dwconv --input_height 32 --input_width 32 --channels 64 --stride 1,1 --padding 1,1,1,1 Run on (12 X 24 MHz CPU s) Load Average: 4.59, 3.95, 3.95 --------------------------------------------------------------------------------------------------------- Benchmark Time CPU Iterations --------------------------------------------------------------------------------------------------------- kai_dwconv_clamp_f32_f32_f32p1vlx1b_3x3_s1_4xc_sme2_mla 123 ns 123 ns 1234567 ``` -------------------------------- ### CMakeLists.txt Source: https://github.com/kleidi/kleidiai/blob/main/examples/conv2d_imatmul_clamp_f16_f16_f16p_sme2/CMakeLists.txt The CMakeLists.txt file configures the build for the conv2d_imatmul_clamp_f16_f16_f16p_sme2 example. ```cmake # # SPDX-FileCopyrightText: Copyright 2025-2026 Arm Limited and/or its affiliates # # SPDX-License-Identifier: Apache-2.0 # cmake_minimum_required(VERSION 3.16) project(conv2d_imatmul_clamp_f16_f16_f16p_sme2 LANGUAGES C CXX ASM) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(KLEIDIAI_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../) include(FetchContent) set(KLEIDIAI_BUILD_TESTS OFF CACHE BOOL "" FORCE) set(KLEIDIAI_BUILD_BENCHMARK OFF CACHE BOOL "" FORCE) fetchcontent_declare( kleidiai SOURCE_DIR ${KLEIDIAI_PATH} ) fetchcontent_makeavailable(kleidiai) add_executable(conv2d_imatmul_clamp_f16_f16_f16p_sme2 conv2d_imatmul_clamp_f16_f16_f16p.cpp ) target_link_libraries(conv2d_imatmul_clamp_f16_f16_f16p_sme2 PRIVATE kleidiai) target_compile_options(conv2d_imatmul_clamp_f16_f16_f16p_sme2 PRIVATE "-march=armv8.2-a+sve+sve2;-fno-tree-vectorize" ) target_compile_definitions(conv2d_imatmul_clamp_f16_f16_f16p_sme2 PRIVATE $<:KAI_DEBUG> ) ``` -------------------------------- ### Example of multithreaded micro-kernel usage Source: https://github.com/kleidi/kleidiai/blob/main/README.md This example demonstrates how to use micro-kernels in a multithreaded environment, referencing a specific example path. ```text /examples/matmul_clamp_f32_qsi8d32p_qsi4c32p ``` -------------------------------- ### Comments and documentation example Source: https://github.com/kleidi/kleidiai/blob/main/docs/coding_conventions.md Example demonstrating the use of `///` for documentation comments and `//` for ordinary code comments, along with descriptive third-person language. ```cpp /// Performs softmax activation function. /// /// @param[out] dst Output data buffer. /// @param[in] src Input data buffer. /// @param[in] length Number of elements. void softmax(float* dst, const float* src, size_t length) { // Finds max. // Regularizes. // Normalizes. } ``` -------------------------------- ### Install Project Targets Source: https://github.com/kleidi/kleidiai/blob/main/CMakeLists.txt Installs the project's targets, defining export locations and namespaces for CMake. ```cmake install(EXPORT ${PROJECT_NAME}Targets DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" NAMESPACE ${PROJECT_NAME}:: ) ``` -------------------------------- ### Example skeleton for RHS packing Source: https://github.com/kleidi/kleidiai/blob/main/docs/microkernel_testing.md This code snippet shows an example skeleton for creating a wrapper factory for RHS packing in a micro-kernel. ```cpp // test/nextgen/operators/matmul/pack_rhs/matmul_pack_rhs_wrapper.cpp std::unique_ptr> create_matmul_rhs_pack_kxn_f16p16x1biasf16_f16_f16_neon() { return std::make_unique( "matmul_rhs_pack_kxn_f16p16x1biasf16_f16_f16_neon", MatMulPackRhsFpInterface{ kai_get_n_step_rhs_pack_kxn_f16p16x1biasf16_f16_f16_neon, kai_get_rhs_offset_rhs_pack_kxn_f16p16x1biasf16_f16_f16_neon, kai_get_bias_offset_rhs_pack_kxn_f16p16x1biasf16_f16_f16_neon, kai_get_rhs_packed_stride_rhs_pack_kxn_f16p16x1biasf16_f16_f16_neon, kai_get_rhs_packed_offset_rhs_pack_kxn_f16p16x1biasf16_f16_f16_neon, kai_get_rhs_packed_size_rhs_pack_kxn_f16p16x1biasf16_f16_f16_neon, kai_run_rhs_pack_kxn_f16p16x1biasf16_f16_f16_neon, }, make_poly(DataType::FP16), // RHS input format make_poly(DataType::FP16), // Bias input format make_poly( 16, 1, 1, false, DataType::FP16, std::array{DataType::FP16}, std::array{})); // Packed RHS output format } ``` -------------------------------- ### Matmul Wrapper Factory Example Source: https://github.com/kleidi/kleidiai/blob/main/docs/microkernel_testing.md Example implementation of a matmul factory function for a specific micro-kernel, demonstrating how to configure input, output, and packing formats. ```cpp // test/nextgen/operators/matmul/matmul/matmul_wrapper.cpp std::unique_ptr> create_matmul_clamp_f16_f16_f16p_neon() { return std::make_unique( "matmul_clamp_f16_f16_f16p_neon", MatMulFpInterface{ kai_get_m_step_matmul_clamp_f16_f16_f16p_neon, ... kai_get_dst_size_matmul_clamp_f16_f16_f16p_neon, kai_run_matmul_clamp_f16_f16_f16p_neon, }, make_poly(DataType::FP16), // LHS input format make_poly( 16, 1, 1, false, DataType::FP16, std::array{DataType::FP16}, std::array{}), // Packed RHS input format make_poly(DataType::FP16)); // Output format } ``` -------------------------------- ### Assertions and assumptions example (softmax) Source: https://github.com/kleidi/kleidiai/blob/main/docs/coding_conventions.md Example showing the use of `KAI_ASSUME` for preconditions and `KAI_ASSERT` for invariants in the softmax function. ```cpp /// Performs softmax activation function. /// /// @param[out] dst Output data buffer. /// @param[in] src Input data buffer. /// @param[in] length Number of elements. void softmax(float* dst, const float* src, size_t length) { KAI_ASSUME(dst != NULL); KAI_ASSUME(src != NULL); KAI_ASSUME(length > 0); float max = -INFINITY; for (size_t i = 0; i < length; ++i) { if (src[i] > max) { max = src[i]; } } float sum = 0; for (size_t i = 0; i < length; ++i) { const float tmp = exp(src[i] - max); dst[i] = tmp; sum += tmp; } KAI_ASSERT(sum > 0); for (size_t i = 0; i < length; ++i) { dst[i] = dst[i] / sum; } } ``` -------------------------------- ### iMatmul Benchmark Example Output Source: https://github.com/kleidi/kleidiai/blob/main/benchmark/README.md Example output from running the imatmul benchmark. ```text ./kleidiai_benchmark imatmul -m 32 -n 32 -c 4 -l 16 Run on (12 X 24 MHz CPU s) Load Average: 4.59, 3.95, 3.95 --------------------------------------------------------------------------------------------------------- Benchmark Time CPU Iterations --------------------------------------------------------------------------------------------------------- imatmul_clamp_f16_f16p2vlx2_f16p2vlx2_2vlx2vl_sme2_mopa 123 ns 123 ns 1234567 imatmul_clamp_f16_f16p2vlx2_f16p2vlx2b_2vlx2vl_sme_mopa 123 ns 123 ns 1234567 imatmul_clamp_f32_f32p2vlx1_f32p2vlx1b_2vlx2vl_sme2_mopa 123 ns 123 ns 1234567 imatmul_clamp_f32_f32p2vlx1_f32p2vlx1b_2vlx2vl_sme_mopa 123 ns 123 ns 1234567 imatmul_clamp_qai8_qai8p2vlx4_qsi8cxp2vlx4sb_2vlx2vl_sme_mopa 123 ns 123 ns 1234567 imatmul_clamp_qai8_qai8p2vlx4_qsi8cxpsb2vlx4_2vlx2vl_sme2_mopa 123 ns 123 ns 1234567 ``` -------------------------------- ### Main function boilerplate Source: https://github.com/kleidi/kleidiai/blob/main/docs/matmul_qsi4cx/README.md A basic C main function structure to start the project. ```c int main(int argc, char** argv) { return 0; } ``` -------------------------------- ### Build Instructions Source: https://github.com/kleidi/kleidiai/blob/main/benchmark/README.md Standard build process using CMake and Make. ```bash mkdir -p build && cd build cmake -DKLEIDIAI_BUILD_BENCHMARK=ON -DCMAKE_BUILD_TYPE=Release ../ make -j ``` -------------------------------- ### Matmul Benchmark Example Output Source: https://github.com/kleidi/kleidiai/blob/main/benchmark/README.md Example output from running the matmul benchmark. ```text $ ./kleidiai_benchmark matmul -m 13 -n 17 -k 18 Run on (8 X 1800 MHz CPU s) Load Average: 10.01, 10.06, 10.06 ----------------------------------------------------------------------------------------------------- Benchmark Time CPU Iterations ----------------------------------------------------------------------------------------------------- matmul_clamp_f32_qai8dxp1x8_qsi4cxp4x8_1x4x32_neon_dotprod 123 ns 123 ns 1234567 matmul_clamp_f32_qai8dxp1x8_qsi4cxp8x8_1x8x32_neon_dotprod 123 ns 123 ns 1234567 matmul_clamp_f32_qai8dxp4x8_qsi4cxp4x8_4x4x32_neon_i8mm 123 ns 123 ns 1234567 matmul_clamp_f32_qai8dxp4x8_qsi4cxp4x8_8x4x32_neon_i8mm 123 ns 123 ns 1234567 matmul_clamp_f32_qai8dxp4x8_qsi4cxp8x8_4x8x32_neon_i8mm 123 ns 123 ns 1234567 matmul_clamp_f32_qai8dxp4x8_qsi4cxp8x8_8x8x32_neon_i8mm 123 ns 123 ns 1234567 ``` -------------------------------- ### Assertions and assumptions example (unused parameters) Source: https://github.com/kleidi/kleidiai/blob/main/docs/coding_conventions.md Example demonstrating the use of `KAI_UNUSED` for parameters that are not used within a function. ```c void kai_run_...( size_t num_groups, size_t n, size_t k, size_t nr, size_t kr, size_t sr, size_t rhs_stride_row, const void* rhs, const void* bias, const void* scale, void* rhs_packed, size_t extra_bytes, const void* params) { KAI_UNUSED(num_groups); KAI_UNUSED(nr); KAI_UNUSED(kr); KAI_UNUSED(sr); KAI_ASSUME(rhs != NULL); KAI_ASSUME(bias != NULL); KAI_UNUSED(scale); KAI_ASSUME(rhs_packed != NULL); KAI_UNUSED(extra_bytes); KAI_UNUSED(params); KernelArgs args; args.bias_ptr = bias; args.height = k; args.width = n; args.in = rhs; args.out = rhs_packed; args.in_stride = rhs_stride_row; kai_kernel_...(&args); } ``` -------------------------------- ### Input Parameters and Output Buffer Allocation for imatmul Micro-kernel Source: https://github.com/kleidi/kleidiai/blob/main/docs/imatmul/README.md Sets up parameters and allocates memory for the output buffer before invoking the imatmul micro-kernel. ```cpp size_t m, n, k_chunk_count, k_chunk_length; const size_t dst_size = kai_get_dst_size_imatmul_clamp_f16_f16p2vlx2_f16p2vlx2_2vlx2vl_sme2_mopa(m, n); float16_t* dst = new float16_t[dst_size / sizeof(float16_t)]; ``` -------------------------------- ### Code structure example Source: https://github.com/kleidi/kleidiai/blob/main/docs/coding_conventions.md Example illustrating the use of a leading `m_` for member variables in C++ classes to avoid name shadowing. ```cpp struct Foo { public: Foo(int x, int y) : m_x{x}, m_y{y} { } void set(int x, int y) { m_x = x; m_y = y; } private: int m_x; int m_y; }; ``` -------------------------------- ### Listing All Available Benchmarks Source: https://github.com/kleidi/kleidiai/blob/main/benchmark/README.md Command to list all available benchmarks. ```bash ./kleidiai_benchmark --benchmark_list_tests ``` -------------------------------- ### Bazel build and run commands Source: https://github.com/kleidi/kleidiai/blob/main/docs/microkernel_testing.md Commands to build the project using Bazel and run specific matmul tests. ```bash bazelisk test //test:kleidiai_test --test_filter='MatMulNext*' ``` -------------------------------- ### Prerequisites: Include Headers Source: https://github.com/kleidi/kleidiai/blob/main/docs/imatmul/README.md The necessary include headers for using the imatmul micro-kernels. ```cpp #include "kai_imatmul_clamp_f16_f16p2vlx2_f16p2vlx2_2vlx2vl_sme2_mopa.h" #include "kai_lhs_imatmul_pack_x16p2vlx2_x16p_sme.h" #include "kai_rhs_imatmul_pack_kxn_x16p2vlx2b_x16_x16_sme.h" ``` -------------------------------- ### CMakeLists.txt Source: https://github.com/kleidi/kleidiai/blob/main/examples/matmul_clamp_f32_qai8dxp_qsi4c32p/CMakeLists.txt The CMakeLists.txt file configures the build for the matmul_clamp_f32_qai8dxp_qsi4c32p example. ```cmake # # SPDX-FileCopyrightText: Copyright 2024, 2026 Arm Limited and/or its affiliates # # SPDX-License-Identifier: Apache-2.0 # cmake_minimum_required(VERSION 3.16) project(matmul_clamp_f32_qai8dxp_qsi4c32p LANGUAGES C CXX ASM) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(KLEIDIAI_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../) include(FetchContent) set(KLEIDIAI_BUILD_TESTS OFF CACHE BOOL "" FORCE) set(KLEIDIAI_BUILD_BENCHMARK OFF CACHE BOOL "" FORCE) fetchcontent_declare( kleidiai SOURCE_DIR ${KLEIDIAI_PATH} ) fetchcontent_makeavailable(kleidiai) add_executable(matmul_clamp_f32_qai8dxp_qsi4c32p matmul_clamp_f32_qai8dxp_qsi4c32p.cpp ) target_link_libraries(matmul_clamp_f32_qai8dxp_qsi4c32p PRIVATE kleidiai) target_compile_options(matmul_clamp_f32_qai8dxp_qsi4c32p PRIVATE -march=armv8.2-a+dotprod+i8mm) ``` -------------------------------- ### NEON Dot Product Assembly Files Source: https://github.com/kleidi/kleidiai/blob/main/CMakeLists.txt List of assembly and C source files for NEON dot product optimization in matrix multiplication kernels. ```cmake set(KLEIDIAI_FILES_NEON_DOTPROD_ASM kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi4c32p/kai_matmul_clamp_f32_qai8dxp1x4_qsi4c32p4x4_1x4_neon_dotprod.c kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi4c32p/kai_matmul_clamp_f32_qai8dxp1x4_qsi4c32p4x4_1x4_neon_dotprod_asm.S kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi4c32p/kai_matmul_clamp_f32_qai8dxp1x4_qsi4c32p8x4_1x8_neon_dotprod.c kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi4c32p/kai_matmul_clamp_f32_qai8dxp1x4_qsi4c32p8x4_1x8_neon_dotprod_asm.S kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi4c32p/kai_matmul_clamp_f32_qai8dxp1x8_qsi4c32p4x8_1x4x32_neon_dotprod.c kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi4c32p/kai_matmul_clamp_f32_qai8dxp1x8_qsi4c32p4x8_1x4x32_neon_dotprod_asm.S kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi4c32p/kai_matmul_clamp_f32_qai8dxp1x8_qsi4c32p8x8_1x8_neon_dotprod.c kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi4c32p/kai_matmul_clamp_f32_qai8dxp1x8_qsi4c32p8x8_1x8_neon_dotprod_asm.S kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi4c32p/kai_matmul_clamp_f32_qai8dxp1x8_qsi4c32p8x8_1x8x32_neon_dotprod.c kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi4c32p/kai_matmul_clamp_f32_qai8dxp1x8_qsi4c32p8x8_1x8x32_neon_dotprod_asm.S kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi4c32p/kai_matmul_clamp_f32_qai8dxp4x4_qsi4c32p4x4_16x4_neon_dotprod.c kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi4c32p/kai_matmul_clamp_f32_qai8dxp4x4_qsi4c32p4x4_16x4_neon_dotprod_asm.S kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi4c32p/kai_matmul_clamp_f32_qai8dxp4x4_qsi4c32p8x4_4x8_neon_dotprod.c kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi4c32p/kai_matmul_clamp_f32_qai8dxp4x4_qsi4c32p8x4_4x8_neon_dotprod_asm.S kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsu2cxp/kai_matmul_clamp_f32_qai8dxp1x4_qsu2cxp4x4bf32sf32_1x4_neon_dotprod.c kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsu2cxp/kai_matmul_clamp_f32_qai8dxp1x4_qsu2cxp4x4bf32sf32_1x4_neon_dotprod_asm.S kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsu2cxp/kai_matmul_clamp_f32_qai8dxp4x4_qsu2cxp4x4bf32sf32_8x4_neon_dotprod.c kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsu2cxp/kai_matmul_clamp_f32_qai8dxp4x4_qsu2cxp4x4bf32sf32_8x4_neon_dotprod_asm.S ) ``` -------------------------------- ### CMakeLists.txt Source: https://github.com/kleidi/kleidiai/blob/main/examples/matmul_clamp_f32_bf16p_bf16p/CMakeLists.txt The CMakeLists.txt file configures the build for the matmul_clamp_f32_bf16p_bf16p example. ```cmake # # SPDX-FileCopyrightText: Copyright 2024, 2026 Arm Limited and/or its affiliates # # SPDX-License-Identifier: Apache-2.0 # cmake_minimum_required(VERSION 3.16) project(matmul_clamp_f32_bf16p_bf16p LANGUAGES C CXX ASM) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(KLEIDIAI_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../) include(FetchContent) set(KLEIDIAI_BUILD_TESTS OFF CACHE BOOL "" FORCE) set(KLEIDIAI_BUILD_BENCHMARK OFF CACHE BOOL "" FORCE) fetchcontent_declare( kleidiai SOURCE_DIR ${KLEIDIAI_PATH} ) fetchcontent_makeavailable(kleidiai) add_executable(matmul_clamp_f32_bf16p_bf16p matmul_clamp_f32_bf16p_bf16p.cpp ) target_link_libraries(matmul_clamp_f32_bf16p_bf16p PRIVATE kleidiai) target_compile_options(matmul_clamp_f32_bf16p_bf16p PRIVATE -march=armv8.2-a+bf16 ) target_compile_definitions(matmul_clamp_f32_bf16p_bf16p PRIVATE $<:KAI_DEBUG> ) ``` -------------------------------- ### SVE Dot Product Assembly Files Source: https://github.com/kleidi/kleidiai/blob/main/CMakeLists.txt List of C and assembly files for SVE dot product kernels. ```cmake set(KLEIDIAI_FILES_SVE_DOTPROD_ASM kai/ukernels/matmul/matmul_clamp_f32_qsi8d32p_qsi4c32p/kai_matmul_clamp_f32_qsi8d32p1x4_qsi4c32p8x4_1x8_sve_dotprod_asm.S kai/ukernels/matmul/matmul_clamp_f32_qsi8d32p_qsi4c32p/kai_matmul_clamp_f32_qsi8d32p1x4_qsi4c32p8x4_1x8_sve_dotprod.c kai/ukernels/matmul/matmul_clamp_f32_qsi8d32p_qsi4c32p/kai_matmul_clamp_f32_qsi8d32p1x8_qsi4c32p8x8_1x8_sve_dotprod_asm.S kai/ukernels/matmul/matmul_clamp_f32_qsi8d32p_qsi4c32p/kai_matmul_clamp_f32_qsi8d32p1x8_qsi4c32p8x8_1x8_sve_dotprod.c ) ```