Ask Your Question

mbkv's profile - activity

2015-08-03 08:45:43 -0600 received badge  Student (source)
2015-08-03 08:32:36 -0600 asked a question Why does cv::ocl::haveOpenCL() not return?

I am trying to use a simple code to check for presence of OpenCL support in Fedora 21. "clinfo" on my system lists my CPU as supporting OpenCL specifications.

 #include <opencv2/core/ocl.hpp> // check OCL
 if (!cv::ocl::haveOpenCL())
 {
     cout << "OpenCL is not avaiable..." << endl;
     return -1;
 }
else
{
    cout << "Hi1" << endl;
}
std::exit(-1);

The call to haveOpenCL() in the above code does not return. I checked and it seems that the problem occurs in the function call g_isOpenCLAvailable = ::clGetPlatformIDs(0, NULL, &n) == CL_SUCCESS; in the source file ocl.cpp. I have provided the gdb backtrace below.

(gdb) bt #0 0x00007ffff33fadd3 in pthread_mutex_unlock () at /lib64/libpthread.so.0 
#1 0x00007ffff7ded4c9 in tls_get_addr_tail () at /lib64/ld-linux-x86-64.so.2
#2 0x00007ffff2f3704c in __cxa_get_globals () at /lib64/libstdc++.so.6 
#3 0x00007ffff2f38063 in __cxa_throw () at /lib64/libstdc++.so.6 
#4 0x00007ffff41333ff in (anonymous namespace)::opencl_fn3<58, int, unsigned int, _cl_platform_id**, unsigned int*>::switch_fn(unsigned int, _cl_platform_id**, unsigned int*) () at  /home/myopencv3build/lib/libopencv_core.so.3.0 
#5 0x00007ffff414d096 in cv::ocl::haveOpenCL() () at /home/myopencv3build/lib/libopencv_core.so.3.0 
#6 0x0000000000405096 in main(int, char**) (argc=3, argv=0x7fffffffdb78) at /home/mysources/bgsub.cpp:69

Any help in resolving this would be greatly appreciated. Update: bug filed in the official channel https://github.com/Itseez/opencv/issu...

2015-08-03 07:53:45 -0600 commented question meaning of nstripes parameter in parallel_for_ in OpenCV3

It does not. Because it is the tbb API, whereas in OpenCV parallel_for(), this parameter has been passed on to the pthreads API

2015-08-03 03:49:50 -0600 received badge  Editor (source)
2015-08-03 03:48:52 -0600 asked a question meaning of nstripes parameter in parallel_for_ in OpenCV3

What does the parameter "nstripes" mean in paralell_for_() function in OpenCV3? From my initial search, I found the following points.

  1. "Specifying proper nstripes can be crucial for good performance" says the OpenCV3 presentation in CVPR 2015.

  2. Browsing the source files, I found that this parameter is passed to the underlying pthreads wrapper.

  3. Most importantly, this parameter cannot exceed the size of the first parameter Range passed to parallel_for_

  4. In bgfg_gaussmix2.cpp, the parallel_for_ is invoked with nstripes parameter equal to "image.total()/(double)(1 << 16)", that is, the total number of pixels divided by 256*256. Why is this so?