// 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. // // Copyright (C) 2026, Advanced Micro Devices, Inc., all rights reserved. #include "precomp.hpp" #include "stat.simd.hpp" #include "stat.simd_declarations.hpp" // defines CV_CPU_DISPATCH_MODES_ALL=AVX2,...,BASELINE based on CMakeLists.txt content namespace cv { namespace hal { // Resolve the SIMD implementation ONCE via a cached function pointer. normHamming // is called per-descriptor in hot matcher loops on short (32/64-byte) descriptors, // where a per-call dispatch chain + CV_INSTRUMENT_REGION dominate the cost. static NormHammingFunc getNormHammingFunc() { CV_CPU_DISPATCH(getNormHammingFunc, (), CV_CPU_DISPATCH_MODES_ALL); } static NormHammingDiffFunc getNormHammingDiffFunc() { CV_CPU_DISPATCH(getNormHammingDiffFunc, (), CV_CPU_DISPATCH_MODES_ALL); } int normHamming(const uchar* a, int n) { static const NormHammingFunc fn = getNormHammingFunc(); return fn(a, n); } int normHamming(const uchar* a, const uchar* b, int n) { static const NormHammingDiffFunc fn = getNormHammingDiffFunc(); return fn(a, b, n); } }} //cv::hal