From 5c8683139fdfa9d4cd8dde05fa62e214139c4916 Mon Sep 17 00:00:00 2001 From: Ariel Bernal Date: Wed, 25 Nov 2015 16:20:04 -0800 Subject: [PATCH] Fix for #5710. OpenCL HOG Object detect assigns the wrong SIMD size. In oder to guarantee SIMDness between the two compilation steps we choose the highest SIMD size that is optimized in the kernel for the first step. --- modules/objdetect/src/hog.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/objdetect/src/hog.cpp b/modules/objdetect/src/hog.cpp index 057387b3e9..fd4989c452 100644 --- a/modules/objdetect/src/hog.cpp +++ b/modules/objdetect/src/hog.cpp @@ -1224,7 +1224,7 @@ static bool ocl_normalize_hists(int nbins, int block_stride_x, int block_stride_ } else { - k.create("normalize_hists_kernel", ocl::objdetect::objdetect_hog_oclsrc, ""); + k.create("normalize_hists_kernel", ocl::objdetect::objdetect_hog_oclsrc, "-D WAVE_SIZE=32"); if(k.empty()) return false; if(is_cpu) @@ -1651,7 +1651,7 @@ static bool ocl_classify_hists(int win_height, int win_width, int block_stride_y { case 180: nthreads = 180; - k.create("classify_hists_180_kernel", ocl::objdetect::objdetect_hog_oclsrc, ""); + k.create("classify_hists_180_kernel", ocl::objdetect::objdetect_hog_oclsrc, "-D WAVE_SIZE=32"); if(k.empty()) return false; if(is_cpu) @@ -1667,7 +1667,7 @@ static bool ocl_classify_hists(int win_height, int win_width, int block_stride_y case 252: nthreads = 256; - k.create("classify_hists_252_kernel", ocl::objdetect::objdetect_hog_oclsrc, ""); + k.create("classify_hists_252_kernel", ocl::objdetect::objdetect_hog_oclsrc, "-D WAVE_SIZE=32"); if(k.empty()) return false; if(is_cpu) @@ -1683,7 +1683,7 @@ static bool ocl_classify_hists(int win_height, int win_width, int block_stride_y default: nthreads = 256; - k.create("classify_hists_kernel", ocl::objdetect::objdetect_hog_oclsrc, ""); + k.create("classify_hists_kernel", ocl::objdetect::objdetect_hog_oclsrc, "-D WAVE_SIZE=32"); if(k.empty()) return false; if(is_cpu) -- GitLab