获取GPU属性
cudaDeviceProp prop;
int count;
for (int i=0;i<count;i++)
{
cudaGetDeviceProperties(&prop,i);
cout<<prop.name<<endl;
}
menset快速初始化一个值
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
cudaDeviceProp prop;
int dev;
cudaGetDevice(&dev);
cout << "ID:" << dev << endl;
memset(&prop, 0, sizeof(cudaDeviceProp));
prop.major = 1;
prop.minor = 3;
cudaChooseDevice(&dev, &prop);
cout << "name:" << prop.name << endl;
cout << dev << endl;
cudaSetDevice(dev);
}