Created
July 12, 2016 13:14
-
-
Save fernandoc1/b8940f475efb793ff1dcd15800186894 to your computer and use it in GitHub Desktop.
Testing OpenCV's OpenCL module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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