Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#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