在CMake中,我使用OpenCL Enable ON编译了OpenCV(它自动检测到了
当我使用
我从这个链接下载了AMD-APP-SDK并尝试构建,但没有OpenCL二进制文件(而是看到opengl dll文件[glew32.dll和glut32.dll])。如何通过链接OPENCL_LIBRARY构建带有OpenCL的OpenCV?
OPENCL_INCLUDE_DIR
路径,但是OPENCL_LIBRARY
为空,即使在点击“config”之后也是如此。对于OPENCL_LIBRARY
,我也没有看到浏览按钮...在生成OpenCV二进制文件后,我运行了下面的代码。#include <iostream>
#include <fstream>
#include <string>
#include <iterator>
#include <opencv2/opencv.hpp>
#include <opencv2/core/ocl.hpp>
int main()
{
if (!cv::ocl::haveOpenCL())
cout << "OpenCL is not avaiable..." << endl;
else cout << "OpenCL is AVAILABLE! :) " << endl; //this is the output
cv::ocl::setUseOpenCL(true);
cout << context.ndevices() << " GPU devices are detected." << endl;
for (int i = 0; i < context.ndevices(); i++)
{
cv::ocl::Device device = context.device(i);
cout << "name: " << device.name() << endl;
cout << "available: " << device.available() << endl;
cout << "imageSupport: " << device.imageSupport() << endl;
cout << "OpenCL_C_Version: " << device.OpenCL_C_Version() << endl;
cout << endl;
} //this works & i can see my video card name & opencl version
cv::ocl::Device(context.device(0));
}
当我使用
UMat
来测量性能时,有(UMat)或没有(Mat)OpenCL的性能没有任何区别。我从这个链接下载了AMD-APP-SDK并尝试构建,但没有OpenCL二进制文件(而是看到opengl dll文件[glew32.dll和glut32.dll])。如何通过链接OPENCL_LIBRARY构建带有OpenCL的OpenCV?