Skip to content

Instantly share code, notes, and snippets.

@kaityo256
Created February 17, 2014 07:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaityo256/9046049 to your computer and use it in GitHub Desktop.
Save kaityo256/9046049 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <cuda.h>
int
main(void){
const int SIZE = 256;
char name[SIZE];
CUdevice device;
cuInit(0);
int count = 0;
cuDeviceGetCount(&count);
printf("Number of Devices = %d\n",count);
for(int i=0;i<count;i++){
cuDeviceGet(&device,0);
cuDeviceGetName(name,SIZE,device);
printf("%d: %s\n",i,name);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment