I'm trying to run simple code with OpenCL enabled on OpenCV.
I've read the intro to OCL documentation and, as instructed, I built opencv with this flag: WITH_OPENCL=ON.
I did this by doing cmake -DWITH_OPENCL=ON and then built opencv on Mac (OS X Yosemite).
I then tried to run my code, but, according to my code, haveOpenCL() is false.
#include <iostream>
#include <fstream>
#include <string>
#include <iterator>
#include <opencv2/opencv.hpp>
#include <opencv2/core/ocl.hpp>
using namespace std;
int main ()
{
cv::ocl::setUseOpenCL(true);
cout << cv::ocl::haveOpenCL() << endl;
if ( ! cv::ocl::haveOpenCL ())
{
cout << "OpenCL IS not avaiable ..." << endl ;
return 0;
}
Does anybody know how to get OpenCV-OpenCL up and running?
UPDATE:
I checked my cvconfig.h file in opencv/build and this is what it says about OpenCL: /* OpenCL Support / / #undef HAVE_OPENCL / / #undef HAVE_OPENCL_STATIC / / #undef HAVE_OPENCL_SVM */
I'm assuming that if OpenCL is really enabled, then the second line should be something like #define HAVE_OPENCL 1
This is auto-generated, so how can I fix this so that HAVE_OPENCL is 1?