| 60 | #endif /* __cplusplus */ |
| 61 | |
| 62 | int getDeviceVersion(void) |
| 63 | { |
| 64 | int device; |
| 65 | struct cudaDeviceProp properties; |
| 66 | |
| 67 | if (cudaGetDevice(&device) != cudaSuccess) { |
| 68 | printf("failed to get device\n"); |
| 69 | return 0; |
| 70 | } |
| 71 | |
| 72 | if (cudaGetDeviceProperties(&properties, device) != cudaSuccess) { |
| 73 | printf("failed to get properties\n"); |
| 74 | return 0; |
| 75 | } |
| 76 | |
| 77 | return properties.major * 100 + properties.minor * 10; |
| 78 | } |
| 79 | |
| 80 | size_t getDeviceMemory(void) |
| 81 | { |