-
Notifications
You must be signed in to change notification settings - Fork 9
/
capability.cu
52 lines (50 loc) · 1.59 KB
/
capability.cu
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <iostream>
using namespace std;
int main(){
int count;
cudaGetDeviceCount(&count);
cout.width(45);
cout<<"Device Count: "<<count<<endl;
for(int i=0; i < count; i++){
cudaDeviceProp prop;
cudaGetDeviceProperties(&prop, i);
cout.width(45);
cout<<"Device Name: "<<prop.name<<endl;
cout.width(45);
cout<<"Clock rate in GHz: "<<prop.clockRate*1.0/1000/1000<<endl;
cout.width(45);
cout<<"Major revision number: "<<prop.major<<endl;
cout.width(45);
cout<<"Minor revision number: "<<prop.minor<<endl;
cout.width(45);
cout<<"Global memory in GB: "
<<prop.totalGlobalMem*1.0/1000/1000/1000<<endl;
cout.width(45);
cout<<"Total L2 cache (in bytes): "
<<prop.l2CacheSize<<endl;
cout.width(45);
cout<<"Shared memory per SM (in bytes): "
<<prop.sharedMemPerBlock<<endl;
cout.width(45);
cout<<"Number of registers per SM: "<<prop.regsPerBlock<<endl;
cout.width(45);
cout<<"Max number of threads per SM: "
<<prop.maxThreadsPerMultiProcessor<<endl;
cout.width(45);
cout<<"Number of threads per warp: "<<prop.warpSize<<endl;
cout.width(45);
cout<<"Maximum number of threads per block: "
<<prop.maxThreadsPerBlock<<endl;
cout.width(45);
cout<<"Maximum of each dimension of block: "
<<prop.maxThreadsDim[0]<<" x "
<<prop.maxThreadsDim[1]<<" x "<<prop.maxThreadsDim[2]<<endl;
cout.width(45);
cout<<"Maximum of each dimension of grid: "
<<prop.maxGridSize[0]<<" x "
<<prop.maxGridSize[1]<<" x "<<prop.maxGridSize[1]<<endl;
cout.width(45);
cout<<"Overlap: ";
cout<<((prop.deviceOverlap)?"enabled":"disabled")<<endl;
}
}