Commit bcf02ae4 authored by Maksim Shabunin's avatar Maksim Shabunin

Merge pull request #3678 from mshabunin:explicit-sse-disable

parents 8919c316 9efc57f2
...@@ -98,6 +98,10 @@ if(CMAKE_COMPILER_IS_GNUCXX) ...@@ -98,6 +98,10 @@ if(CMAKE_COMPILER_IS_GNUCXX)
add_extra_compiler_option(-pthread) add_extra_compiler_option(-pthread)
endif() endif()
if(CMAKE_COMPILER_IS_CLANGCXX)
add_extra_compiler_option(-Qunused-arguments)
endif()
if(OPENCV_WARNINGS_ARE_ERRORS) if(OPENCV_WARNINGS_ARE_ERRORS)
add_extra_compiler_option(-Werror) add_extra_compiler_option(-Werror)
endif() endif()
...@@ -127,6 +131,8 @@ if(CMAKE_COMPILER_IS_GNUCXX) ...@@ -127,6 +131,8 @@ if(CMAKE_COMPILER_IS_GNUCXX)
endif() endif()
if(ENABLE_SSE2) if(ENABLE_SSE2)
add_extra_compiler_option(-msse2) add_extra_compiler_option(-msse2)
elseif(X86 OR X86_64)
add_extra_compiler_option(-mno-sse2)
endif() endif()
if(ENABLE_NEON) if(ENABLE_NEON)
add_extra_compiler_option("-mfpu=neon") add_extra_compiler_option("-mfpu=neon")
...@@ -139,6 +145,8 @@ if(CMAKE_COMPILER_IS_GNUCXX) ...@@ -139,6 +145,8 @@ if(CMAKE_COMPILER_IS_GNUCXX)
if(NOT MINGW) if(NOT MINGW)
if(ENABLE_AVX) if(ENABLE_AVX)
add_extra_compiler_option(-mavx) add_extra_compiler_option(-mavx)
elseif(X86 OR X86_64)
add_extra_compiler_option(-mno-avx)
endif() endif()
if(ENABLE_AVX2) if(ENABLE_AVX2)
add_extra_compiler_option(-mavx2) add_extra_compiler_option(-mavx2)
...@@ -152,18 +160,26 @@ if(CMAKE_COMPILER_IS_GNUCXX) ...@@ -152,18 +160,26 @@ if(CMAKE_COMPILER_IS_GNUCXX)
if(NOT OPENCV_EXTRA_CXX_FLAGS MATCHES "-mavx") if(NOT OPENCV_EXTRA_CXX_FLAGS MATCHES "-mavx")
if(ENABLE_SSE3) if(ENABLE_SSE3)
add_extra_compiler_option(-msse3) add_extra_compiler_option(-msse3)
elseif(X86 OR X86_64)
add_extra_compiler_option(-mno-sse3)
endif() endif()
if(ENABLE_SSSE3) if(ENABLE_SSSE3)
add_extra_compiler_option(-mssse3) add_extra_compiler_option(-mssse3)
elseif(X86 OR X86_64)
add_extra_compiler_option(-mno-ssse3)
endif() endif()
if(ENABLE_SSE41) if(ENABLE_SSE41)
add_extra_compiler_option(-msse4.1) add_extra_compiler_option(-msse4.1)
elseif(X86 OR X86_64)
add_extra_compiler_option(-mno-sse4.1)
endif() endif()
if(ENABLE_SSE42) if(ENABLE_SSE42)
add_extra_compiler_option(-msse4.2) add_extra_compiler_option(-msse4.2)
elseif(X86 OR X86_64)
add_extra_compiler_option(-mno-sse4.2)
endif() endif()
if(ENABLE_POPCNT) if(ENABLE_POPCNT)
......
...@@ -183,6 +183,9 @@ protected: ...@@ -183,6 +183,9 @@ protected:
method, totalTestsCount - successfulTestsCount, totalTestsCount, maxError, mode); method, totalTestsCount - successfulTestsCount, totalTestsCount, maxError, mode);
ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY); ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY);
} }
cout << "mode: " << mode << ", method: " << method << " -> "
<< ((double)successfulTestsCount / totalTestsCount) * 100 << "%"
<< " (err < " << maxError << ")" << endl;
} }
} }
} }
......
...@@ -34,5 +34,11 @@ PERF_TEST_P(MomentsFixture_val, Moments1, ...@@ -34,5 +34,11 @@ PERF_TEST_P(MomentsFixture_val, Moments1,
TEST_CYCLE() m = cv::moments(src, binaryImage); TEST_CYCLE() m = cv::moments(src, binaryImage);
SANITY_CHECK_MOMENTS(m, 1e-4, ERROR_RELATIVE); int len = (int)sizeof(cv::Moments) / sizeof(double);
cv::Mat mat(1, len, CV_64F, (void*)&m);
//adding 1 to moments to avoid accidental tests fail on values close to 0
mat += 1;
SANITY_CHECK_MOMENTS(m, 2e-4, ERROR_RELATIVE);
} }
...@@ -438,9 +438,9 @@ static int countViolations(const cv::Mat& expected, const cv::Mat& actual, const ...@@ -438,9 +438,9 @@ static int countViolations(const cv::Mat& expected, const cv::Mat& actual, const
if (v > 0 && max_violation != 0 && max_allowed != 0) if (v > 0 && max_violation != 0 && max_allowed != 0)
{ {
int loc[10]; int loc[10] = {0};
cv::minMaxIdx(maximum, 0, max_allowed, 0, loc, mask); cv::minMaxIdx(maximum, 0, max_allowed, 0, loc, mask);
*max_violation = diff64f.at<double>(loc[1], loc[0]); *max_violation = diff64f.at<double>(loc[0], loc[1]);
} }
return v; return v;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment