Files
opencv-MIRROR/modules/core/src/reduce.dispatch.cpp
Yuantao Feng 2e778c52c1 Merge pull request #27510 from fengyuentau:4x/core/reduce_simd
core: vectorize cv::reduce #27510

- [ ] ~reduceR_~ Dropped due to performance
- [x] reduceC_

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
2026-07-15 22:36:29 +03:00

63 lines
1.7 KiB
C++

// 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
#include "precomp.hpp"
#include "reduce.simd.hpp"
#include "reduce.simd_declarations.hpp"
namespace cv {
typedef void (*ReduceFunc)( const Mat& src, Mat& dst );
ReduceFunc getReduceCSumFunc(int sdepth, int ddepth);
ReduceFunc getReduceCAvgFunc(int sdepth, int ddepth);
ReduceFunc getReduceCMaxFunc(int sdepth, int ddepth);
ReduceFunc getReduceCMinFunc(int sdepth, int ddepth);
ReduceFunc getReduceCSum2Func(int sdepth, int ddepth);
ReduceFunc getReduceRSumFunc(int sdepth, int ddepth);
ReduceFunc getReduceCSumFunc(int sdepth, int ddepth)
{
CV_INSTRUMENT_REGION();
CV_CPU_DISPATCH(getReduceCSumFunc, (sdepth, ddepth),
CV_CPU_DISPATCH_MODES_ALL);
}
ReduceFunc getReduceCAvgFunc(int sdepth, int ddepth)
{
CV_INSTRUMENT_REGION();
CV_CPU_DISPATCH(getReduceCAvgFunc, (sdepth, ddepth),
CV_CPU_DISPATCH_MODES_ALL);
}
ReduceFunc getReduceCMaxFunc(int sdepth, int ddepth)
{
CV_INSTRUMENT_REGION();
CV_CPU_DISPATCH(getReduceCMaxFunc, (sdepth, ddepth),
CV_CPU_DISPATCH_MODES_ALL);
}
ReduceFunc getReduceCMinFunc(int sdepth, int ddepth)
{
CV_INSTRUMENT_REGION();
CV_CPU_DISPATCH(getReduceCMinFunc, (sdepth, ddepth),
CV_CPU_DISPATCH_MODES_ALL);
}
ReduceFunc getReduceCSum2Func(int sdepth, int ddepth)
{
CV_INSTRUMENT_REGION();
CV_CPU_DISPATCH(getReduceCSum2Func, (sdepth, ddepth),
CV_CPU_DISPATCH_MODES_ALL);
}
ReduceFunc getReduceRSumFunc(int sdepth, int ddepth)
{
CV_INSTRUMENT_REGION();
CV_CPU_DISPATCH(getReduceRSumFunc, (sdepth, ddepth),
CV_CPU_DISPATCH_MODES_ALL);
}
} // namespace cv