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.
This commit is contained in:
Ariel Bernal 2015-11-25 16:20:04 -08:00
parent 37ce3b8cfe
commit 5c8683139f

View File

@ -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)