CMakeでOpenCLを有効にしてOpenCVを構築しました(のパスを自動的に検出しましたが、OPENCL_LIBRARY
の設定をクリックしてもOPENCL_LIBRARY
は空でした) OpenCVのバイナリはその後、私はパフォーマンスを測定するためにUMat
を利用する場合には、(UMAT)とのまたは(マット)のOpenCLのないパフォーマンスはどんな違いがありませんでしたOpenCVで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));
}
以下のコードを実行します。
私がダウンロードしましたAMD-APP-SDKからこのlinkを試してみました構築するのにOpenCLバイナリはありませんでした(代わりに、私はopenglのdllファイル[glew32.dll & glut32.dll]を見ました)。 OPENCL_LIBRARYをリンクしてOpenCLでOpenCVを構築するにはどうすればよいですか?
C:/ windows/System32にopencl.dllが見つかりましたが、削除しました。しかし、GPUが使用されました。 もお答えできます[こちら](http://stackoverflow.com/questions/41688751/understanding-the-usage-of-opencl-in-opencv-mat-umat-objects?noredirect=1#comment70603090_41688751)質問 –