Skip to content

Instantly share code, notes, and snippets.

@KellenSunderland
Last active March 27, 2018 09:22
Show Gist options
  • Save KellenSunderland/ac4c81806b3fe054893a035feccd4645 to your computer and use it in GitHub Desktop.
Save KellenSunderland/ac4c81806b3fe054893a035feccd4645 to your computer and use it in GitHub Desktop.
Cuda Device Check
#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