neon: add dotprod dispatch implementation#22271
Conversation
alalek
left a comment
There was a problem hiding this comment.
Thank you for contribution!
Please take a look on PRs which add .simd.hpp files for dispatching.
Please read this Wiki page: https://github.com/opencv/opencv/wiki/CPU-optimizations-build-options
| set(CPU_ALL_OPTIMIZATIONS "SSE;SSE2;SSE3;SSSE3;SSE4_1;SSE4_2;POPCNT;AVX;FP16;AVX2;FMA3;AVX_512F") | ||
| list(APPEND CPU_ALL_OPTIMIZATIONS "AVX512_COMMON;AVX512_KNL;AVX512_KNM;AVX512_SKX;AVX512_CNL;AVX512_CLX;AVX512_ICL") | ||
| list(APPEND CPU_ALL_OPTIMIZATIONS NEON VFPV3 FP16) | ||
| list(APPEND CPU_ALL_OPTIMIZATIONS NEON VFPV3 FP16 DOTPROD) |
There was a problem hiding this comment.
DOTPROD
such common name may confuse.
NEON_DOTPROD or ARM_DOTPROD or AARCH64_DOT should be more clear.
There was a problem hiding this comment.
Thank you.
I used NEON_DOTPROD as a keyword.
modules/core/src/matmul.dotprod.hpp
Outdated
| @@ -0,0 +1,168 @@ | |||
| /*M/////////////////////////////////////////////////////////////////////////////////////// | |||
There was a problem hiding this comment.
Please use short license header: https://github.com/opencv/opencv/wiki/Coding_Style_Guide#file-structure
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
There was a problem hiding this comment.
I totally misunderstood the dispatch framework.
This file is not used so I removed from the PR.
modules/core/src/matmul.dotprod.hpp
Outdated
|
|
||
|
|
||
|
|
||
| #ifndef CV_CPU_OPTIMIZATION_DECLARATIONS_ONLY |
There was a problem hiding this comment.
This should be used with .simd.hpp files only.
modules/core/src/matmul.dotprod.hpp
* read vector at runtime
* add enum
b1e9d0a to
b3269b0
Compare
dot product instruction is an extended instruction of NEON on Aarch64.
I've used dispatch framework so it won't harm the other platforms.
Performance are reasonable
Topics I'd like to ask specifically for review
DOTPRODfor Armv8?enum, and theDOTPRODwhich gets shown for the configCV_NEON_DOTbut will be there a better way?Here's the performance summary
Jetson Orin and RK3588 support this dot product instructions.
Other platforms don't, but it's not making a harm.
I also confirmed that this PR doesn't harm the Arm 32bit build.
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.