-
Notifications
You must be signed in to change notification settings - Fork 0
/
d.cu
33 lines (31 loc) · 1.29 KB
/
d.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
// nvcc d.cu -o d
// device query
#include "common.h"
int main (void) {
cudaDeviceProp prop;
int count;
HANDLE_ERROR(cudaGetDeviceCount(&count));
for (int i = 0; i < count; i++) {
HANDLE_ERROR(cudaGetDeviceProperties(&prop, i));
printf("\n --- General Information for device %d ---\n", i);
printf("Name: %s\n", prop.name);
printf("Compute capability: %d.%d\n", prop.major, prop.minor);
printf("Clock rate: %d\n", prop.clockRate);
printf("Total global Mem: %.2f GB\n", prop.totalGlobalMem/1000000000.0);
printf("Total constant Mem: %ld \n", prop.totalConstMem);
printf("Multiprocessor count: %d\n", prop.multiProcessorCount);
printf("Shared Mem per mp: %ld\n", prop.sharedMemPerBlock);
printf("Registers per mp: %d\n", prop.regsPerBlock);
printf("Threads in warp: %d\n", prop.warpSize);
printf("Max threads per block: %d\n", prop.maxThreadsPerBlock);
printf("Max threads dimensions: (%d,%d,%d)\n",
prop.maxThreadsDim[0],
prop.maxThreadsDim[1],
prop.maxThreadsDim[2]);
printf("Max grid dimensions: (%d,%d,%d)\n",
prop.maxGridSize[0],
prop.maxGridSize[1],
prop.maxGridSize[2]);
printf("\n");
}
}