From f42bb0bd6528c7e77a2872158a0577b7e713cd63 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Mon, 28 Jul 2014 15:45:54 +0400 Subject: [PATCH 1/4] disable OpenCL difference norms with mask, since some of the tests fail --- modules/core/src/stat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/src/stat.cpp b/modules/core/src/stat.cpp index a26d3345c..a1415652c 100644 --- a/modules/core/src/stat.cpp +++ b/modules/core/src/stat.cpp @@ -2540,7 +2540,7 @@ static bool ocl_norm( InputArray _src1, InputArray _src2, int normType, InputArr normType &= ~NORM_RELATIVE; bool normsum = normType == NORM_L1 || normType == NORM_L2 || normType == NORM_L2SQR; - if ( !(normType == NORM_INF || normsum) ) + if ( !(normType == NORM_INF || normsum) || !_mask.empty() ) return false; if (normsum) From 97f6dd1820294a2b2a197839559cf824923ff447 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Mon, 28 Jul 2014 17:16:02 +0400 Subject: [PATCH 2/4] trying to make OpenCL builder green --- modules/core/src/stat.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/core/src/stat.cpp b/modules/core/src/stat.cpp index a1415652c..d99a1879e 100644 --- a/modules/core/src/stat.cpp +++ b/modules/core/src/stat.cpp @@ -2185,6 +2185,9 @@ static bool ocl_norm( InputArray _src, int normType, InputArray _mask, double & (!doubleSupport && depth == CV_64F)) return false; + if( depth == CV_32F && !_mask.empty() ) + return false; + UMat src = _src.getUMat(); if (normType == NORM_INF) From 1925fab42746e716635a9ea42d52c346eac8ff56 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Mon, 28 Jul 2014 19:32:06 +0400 Subject: [PATCH 3/4] disabled some more stuff --- modules/core/src/stat.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/core/src/stat.cpp b/modules/core/src/stat.cpp index d99a1879e..43abf7a6c 100644 --- a/modules/core/src/stat.cpp +++ b/modules/core/src/stat.cpp @@ -1452,6 +1452,9 @@ static bool ocl_minMaxIdx( InputArray _src, double* minVal, double* maxVal, int* CV_Assert(!haveSrc2 || _src2.type() == type); + if (depth == CV_32F) + return false; + if ((depth == CV_64F || ddepth == CV_64F) && !doubleSupport) return false; @@ -2185,7 +2188,7 @@ static bool ocl_norm( InputArray _src, int normType, InputArray _mask, double & (!doubleSupport && depth == CV_64F)) return false; - if( depth == CV_32F && !_mask.empty() ) + if( depth == CV_32F && (!_mask.empty() || normType == NORM_INF) ) return false; UMat src = _src.getUMat(); @@ -2543,7 +2546,7 @@ static bool ocl_norm( InputArray _src1, InputArray _src2, int normType, InputArr normType &= ~NORM_RELATIVE; bool normsum = normType == NORM_L1 || normType == NORM_L2 || normType == NORM_L2SQR; - if ( !(normType == NORM_INF || normsum) || !_mask.empty() ) + if ( !normsum || !_mask.empty() ) return false; if (normsum) From af83884dc7171bc1c9a5efaa9cef5de79c7d0984 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Mon, 28 Jul 2014 19:35:06 +0400 Subject: [PATCH 4/4] disabled ocl_minmaxloc on 32-bit data completely --- modules/core/src/stat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/src/stat.cpp b/modules/core/src/stat.cpp index 43abf7a6c..888fd7cac 100644 --- a/modules/core/src/stat.cpp +++ b/modules/core/src/stat.cpp @@ -1452,7 +1452,7 @@ static bool ocl_minMaxIdx( InputArray _src, double* minVal, double* maxVal, int* CV_Assert(!haveSrc2 || _src2.type() == type); - if (depth == CV_32F) + if (depth == CV_32S || depth == CV_32F) return false; if ((depth == CV_64F || ddepth == CV_64F) && !doubleSupport)