一、瞭解自己GPU的性能
方式有很多,我這裏是編譯opencv-gpu版本後,可以輸出的相關信息。相關代碼和結果:
#include "opencv2/opencv.hpp"
#include "opencv2/core/cuda.hpp"
using namespace std;
using namespace cv;
using namespace cv::cuda;
int main()
{
int num_devices = cv::cuda::getCudaEnabledDeviceCount();
cuda::printCudaDeviceInfo(cuda::getDevice());
cout << num_devices << endl;
int i;
cin >> i;
}
結果: