cuda編程(3):kernel的加載

一、瞭解自己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;
}

結果:

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章