Ask Your Question
0

minMaxLoc crashed using opencl when location is needed

asked 2015-07-15 16:25:01 -0600

LBerger gravatar image

updated 2015-07-16 09:04:43 -0600

My program works well when setUseOpenCL is false. When setuseOpencl is true I have got problem when I want locatation of min and max. How can I solve it?

int main(int argc, char **argv)
{
cv::ocl::setUseOpenCL(true);
UMat m;

imread("f:lib/opencv/samples/data/lena.jpg", CV_LOAD_IMAGE_GRAYSCALE).copyTo(m);
vector<double> minIm(m.channels());         
vector<double> maxIm(m.channels());         
vector<Point> locMin(m.channels());         
vector<Point> locMax(m.channels());         
minMaxLoc(m,&minIm[0],&maxIm[0]); // that's OK with or without openCL
cout << "size =" << m.size()<<endl;
cout << "Max =" << maxIm[0] <<endl;
cout << "Min =" << minIm[0] <<endl;
minMaxLoc(m,&minIm[0],&maxIm[0],&locMin[0],&locMax[0]); // that's OK  without openCL but crashed with opencl
cout << "size =" << m.size()<<endl;
cout << "Max =" << maxIm[0] << " Location " << locMax[0]<<endl;
cout << "Min =" << minIm[0] << " Location " << locMin[0]<<endl;
return 0;
}

assertion is

size =[512 x 512] Max =248 Min =18 OpenCV Error: Assertion failed (clFinish_pfn(qq) == 0) in cv::ocl::Kernel::run, file ......\modules\core\src\ocl.cpp, line 3472

device is + "GeForce GTX 970" with windows 8.1 64 bits opencv 3.0 gold

there is a bug but it seems differents

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-07-16 09:03:50 -0600

LBerger gravatar image

updated 2015-07-16 09:35:14 -0600

So I have test my program with device Quadro FX 380 LP (windows 7 32 bits) and quadro 600 (linux 3.2.02 amd64-x86 opencv 3.0.0-dev) there is no problem. I think if there is a bug it's not opencv bug but a bug in GeForce GTX 970.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-07-15 16:25:01 -0600

Seen: 616 times

Last updated: Jul 16 '15