mirror of
https://github.com/opencv/opencv.git
synced 2026-11-17 06:47:47 -06:00
core: accelerate cv::gemm with ARMPL cblas_sgemm/cblas_dgemm - #29983 ## Summary - Adds an ARM Performance Library (ArmPL) HAL backend for cv::gemm (cv_hal_gemm32f / cv_hal_gemm64f), replacing OpenCV's default GEMM path with ArmPL's cblas_sgemm / cblas_dgemm for float and double matrix multiplication on AArch64. ## Changes **hal/armpl/include/armpl_hal_core.hpp:** - declare armpl_hal_gemm32f / armpl_hal_gemm64f and register them as cv_hal_gemm32f / cv_hal_gemm64f. **hal/armpl/src/armpl_hal_core.cpp:** - Add a templated armpl_gemm helper that maps OpenCV's GEMM_1_T / GEMM_2_T / GEMM_3_T flags onto CBLAS transpose/layout arguments and calls cblas_sgemm / cblas_dgemm (row-major). - Fall back to OpenCV's default (non-HAL) implementation for small matrices. (m < 100, ARMPL_GEMM_SMALL_MATRIX_THRESH) ## Performance Benchmarks <img width="1080" height="275" alt="image" src="https://github.com/user-attachments/assets/cddce8ce-93ca-4c8e-8b37-a9d42ead0c53" />