I've been using some OpenCV for a while now and I'm just starting to delve into the multi threading aspects although I'm having some difficulty getting the following code to work:
#include "opencv2/ocl/ocl.hpp"
int main(int argc, char *argv[])
{
cv::ocl::DevicesInfo devices;
cv::ocl::getOpenCLDevices(devices, cv::ocl::CVCL_DEVICE_TYPE_CPU);
return 0;
}
Returns
OpenCV Error: Gpu API call (-1001) in initializeOpenCLDevices, file /path/to/opencv/src/opencv-2.4.9/modules/ocl/src/cl_context.cpp, line 455
I definitely built OpenCV with OCL, if I go into my build directory it has the lib files: libopencv_ocl.so etc. and I checked with ldd to make sure the executable was linking correctly.
Note: the same thing happens when I try the:
cv::ocl::getOpenCLPlatforms
function.
Thanks in advance
-1001
indicates that the OpenCL ICD loader failed to find any OpenCL platforms on your system. Which OpenCL platform(s) are you using? – jprice