Skip to content

Instantly share code, notes, and snippets.

@fernandoc1
Created July 12, 2016 13:14
Show Gist options
  • Save fernandoc1/b8940f475efb793ff1dcd15800186894 to your computer and use it in GitHub Desktop.
Save fernandoc1/b8940f475efb793ff1dcd15800186894 to your computer and use it in GitHub Desktop.
Testing OpenCV's OpenCL module
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/ocl/ocl.hpp>
#include <CL/cl.h>
#include <iostream>
int main(int argc, const char** argv)
{
cv::ocl::DevicesInfo devInfo;
int res = cv::ocl::getOpenCLDevices(devInfo);
if(res == 0)
{
std::cerr << "There is no OPENCL Here !" << std::endl;
return -1;
}
else
{
for(unsigned int i = 0 ; i < devInfo.size() ; ++i)
{
std::cout << "Device : " << devInfo[i]->deviceName << " is present" << std::endl;
}
}
}
all:
g++ main.cpp -lopencv_core -lopencv_ocl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment