Last active
March 27, 2018 09:22
-
-
Save KellenSunderland/ac4c81806b3fe054893a035feccd4645 to your computer and use it in GitHub Desktop.
Cuda Device Check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
int nDevices; | |
cudaGetDeviceCount(&nDevices); | |
for (int i = 0; i < nDevices; i++) { | |
cudaDeviceProp prop; | |
cudaGetDeviceProperties(&prop, i); | |
printf("Device Number: %d\n", i); | |
printf(" Device name: %s\n", prop.name); | |
printf(" Device compute arch: %d.%d\n", prop.major, prop.minor); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment