-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeviceProperties.cu
More file actions
32 lines (28 loc) · 1.21 KB
/
DeviceProperties.cu
File metadata and controls
32 lines (28 loc) · 1.21 KB
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
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <stdio.h>
int main() {
int nd;
cudaGetDeviceCount(&nd);
printf("Total Number of Devices: %d\n", nd);
for (int d = 0; d < nd; d++) {
cudaDeviceProp dp;
cudaGetDeviceProperties(&dp, d);
printf("Device %d\n", d);
printf(" Name: %s\n", dp.name);
printf(" Clock Rate: %d kHz\n", dp.clockRate);
printf(" Number of SMs: %d\n", dp.multiProcessorCount);
printf(" Number of Cores per SM: %d\n", 4864);
printf(" Warp Size: %d\n", dp.warpSize);
printf(" Global Memory: %.2f MB\n", dp.totalGlobalMem / (1024.0 * 1024.0));
printf(" Constant Memory: %u bytes\n", dp.totalConstMem);
printf(" Shared Memory per Block: %u bytes\n", dp.sharedMemPerBlock);
printf(" Registers per Block: %d\n", dp.regsPerBlock);
printf(" Max Threads per Block: %d\n", dp.maxThreadsPerBlock);
printf(" Max Block Dimensions: [%d, %d, %d]\n", dp.maxThreadsDim[0], dp.maxThreadsDim[1], dp.maxThreadsDim[2]);
printf(" Max Grid Dimensions: [%d, %d, %d]\n", dp.maxGridSize[0], dp.maxGridSize[1], dp.maxGridSize[2]);
printf("\n");
}
return 0;
}