add universal hardware support check function

* use hasSIMD128 rather than calling checkHardwareSupport
  * add SIMD check in spartialgradient.cpp
  * add SIMD check in stereosgbm.cpp
  * add SIMD check in canny.cpp
This commit is contained in:
Tomoaki Teshima
2016-10-29 13:24:31 +09:00
parent ecb8fb964d
commit cba22349b7
7 changed files with 180 additions and 144 deletions
+3 -3
View File
@@ -301,7 +301,7 @@ public:
void operator()(const Range &boundaries) const
{
#if CV_SIMD128
bool haveSIMD = checkHardwareSupport(CV_CPU_SSE2) || checkHardwareSupport(CV_CPU_NEON);
bool haveSIMD = hasSIMD128();
#endif
const int type = src.type(), cn = CV_MAT_CN(type);
@@ -709,7 +709,7 @@ public:
uchar* pdst = dst.ptr() + (ptrdiff_t)(dst.step * boundaries.start);
#if CV_SIMD128
bool haveSIMD = checkHardwareSupport(CV_CPU_SSE2) || checkHardwareSupport(CV_CPU_NEON);
bool haveSIMD = hasSIMD128();
#endif
for (int i = boundaries.start; i < boundaries.end; i++, pmap += mapstep, pdst += dst.step)
@@ -962,7 +962,7 @@ static void CannyImpl(Mat& dx, Mat& dy, Mat& dst,
#define CANNY_POP(d) (d) = *--stack_top
#if CV_SIMD128
bool haveSIMD = checkHardwareSupport(CV_CPU_SSE2) || checkHardwareSupport(CV_CPU_NEON);
bool haveSIMD = hasSIMD128();
#endif
// calculate magnitude and angle of gradient, perform non-maxima suppression.