1 #include <stdio.h> main()2int main() 3 { 4 int count = 0; 5 if (cudaSuccess != cudaGetDeviceCount(&count)){return -1;} 6 if (count == 0) {return -1;} 7 for (int device = 0; device < count; ++device) 8 { 9 cudaDeviceProp prop; 10 if (cudaSuccess != cudaGetDeviceProperties(&prop, device)){ continue;} 11 printf("%d.%d ", prop.major, prop.minor); 12 } 13 return 0; 14 } 15