Enable GaussianBlur OpenCL fast paths on non-Intel GPUs.

Remove Intel-only gates from dedicated 3x3/5x5 GaussianBlur kernels and
single-pass separable filter paths so AMD and other OpenCL devices can
use the same optimized implementations with existing fallbacks.
This commit is contained in:
Madan mohan Manokar
2026-08-26 11:34:38 +05:30
parent f63983d8e8
commit 400ded6619
2 changed files with 3 additions and 8 deletions

View File

@@ -946,7 +946,6 @@ bool ocl_sepFilter2D(
double delta, int borderType
)
{
const ocl::Device & d = ocl::Device::getDefault();
Size imgSize = _src.size();
int type = _src.type(), sdepth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type);
@@ -1008,8 +1007,7 @@ bool ocl_sepFilter2D(
imgSize.width > optimizedSepFilterLocalWidth + anchor.x &&
imgSize.height > optimizedSepFilterLocalHeight + anchor.y &&
(!(borderType & BORDER_ISOLATED) || _src.offset() == 0) &&
anchor == Point(kernelX.cols >> 1, kernelY.cols >> 1) &&
OCL_PERFORMANCE_CHECK(d.isIntel()), // TODO FIXIT
anchor == Point(kernelX.cols >> 1, kernelY.cols >> 1),
ocl_sepFilter2D_SinglePass(
_src, _dst, kernelX, kernelY, delta,
borderType & ~BORDER_ISOLATED, ddepth,
@@ -1052,7 +1050,6 @@ bool ocl_sepFilter2D_BitExact(
int shift_bits
)
{
const ocl::Device & d = ocl::Device::getDefault();
Size imgSize = _src.size();
int type = _src.type(), sdepth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type);
@@ -1082,8 +1079,7 @@ bool ocl_sepFilter2D_BitExact(
imgSize.width > optimizedSepFilterLocalWidth + anchor.x &&
imgSize.height > optimizedSepFilterLocalHeight + anchor.y &&
(!(borderType & BORDER_ISOLATED) || _src.offset() == 0) &&
anchor == Point(kernelX.cols >> 1, kernelY.cols >> 1) &&
OCL_PERFORMANCE_CHECK(d.isIntel()), // TODO FIXIT
anchor == Point(kernelX.cols >> 1, kernelY.cols >> 1),
ocl_sepFilter2D_SinglePass(
_src, _dst, kernelX, kernelY, delta,
borderType & ~BORDER_ISOLATED, ddepth, bdepth,

View File

@@ -318,10 +318,9 @@ Ptr<FilterEngine> createGaussianFilter( int type, Size ksize,
static bool ocl_GaussianBlur_8UC1(InputArray _src, OutputArray _dst, Size ksize, int ddepth,
InputArray _kernelX, InputArray _kernelY, int borderType)
{
const ocl::Device & dev = ocl::Device::getDefault();
int type = _src.type(), sdepth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type);
if ( !(dev.isIntel() && (type == CV_8UC1) &&
if ( !(type == CV_8UC1 &&
(_src.offset() == 0) && (_src.step() % 4 == 0) &&
((ksize.width == 5 && (_src.cols() % 4 == 0)) ||
(ksize.width == 3 && (_src.cols() % 16 == 0) && (_src.rows() % 2 == 0)))) )