-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgpuprop.cu
More file actions
29 lines (23 loc) · 761 Bytes
/
gpuprop.cu
File metadata and controls
29 lines (23 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
using namespace std;
#include <helper_cuda.h>
void gpu_test()
{
cout << endl;
int deviceCount = -1;
checkCudaErrors(cudaGetDeviceCount(&deviceCount));
if (deviceCount == 0) {
fprintf(stderr, "error: no devices supporting CUDA.\n");
exit(EXIT_FAILURE);
}
cout << " deviceCount " << deviceCount << endl;
int dev = 0;
cudaDeviceProp prop;
checkCudaErrors(cudaGetDeviceProperties(&prop, dev));
cout << " Using device: " << dev << "\n"
<< " Name: " << prop.name << ","
<< " Global mem: " << prop.totalGlobalMem/1024.0/1024/1024 << ","
<< " Compute v" << (int) prop.major << "." << (int)prop.minor << ","
<< " Clock: " << (int) prop.clockRate << " KHz" << endl;
cout << endl;
}