From 1ae71fe205856d47c22c6e5b5f3aadebcee3504f Mon Sep 17 00:00:00 2001 From: krodyush Date: Wed, 18 Dec 2013 14:27:51 +0400 Subject: [PATCH] intel device guard was added because of perf degradation on some non intel platform. --- modules/ocl/src/filtering.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/ocl/src/filtering.cpp b/modules/ocl/src/filtering.cpp index 20895abee..35aa226de 100644 --- a/modules/ocl/src/filtering.cpp +++ b/modules/ocl/src/filtering.cpp @@ -1405,11 +1405,13 @@ Ptr cv::ocl::createSeparableLinearFilter_GPU(int srcType, int int cn = CV_MAT_CN(srcType); int bdepth = std::max(std::max(sdepth, ddepth), CV_32F); int bufType = CV_MAKETYPE(bdepth, cn); + Context* clCxt = Context::getContext(); //if image size is non-degenerate and large enough //and if filter support is reasonable to satisfy larger local memory requirements, //then we can use single pass routine to avoid extra runtime calls overhead - if( rowKernel.rows <= 21 && columnKernel.rows <= 21 && + if( clCxt && clCxt->supportsFeature(FEATURE_CL_INTEL_DEVICE) && + rowKernel.rows <= 21 && columnKernel.rows <= 21 && (rowKernel.rows & 1) == 1 && (columnKernel.rows & 1) == 1 && imgSize.width > optimizedSepFilterLocalSize + (rowKernel.rows>>1) && imgSize.height > optimizedSepFilterLocalSize + (columnKernel.rows>>1) )