SHARE
TWEET

Untitled

a guest Apr 21st, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void outputDeviceInfo(){
  2.     cudaError_t err;
  3.     int deviceId;
  4.     err = cudaGetDevice(&deviceId);
  5.     if (err == cudaSuccess){
  6.         struct cudaDeviceProp prop;
  7.         err = cudaGetDeviceProperties(&prop, deviceId);
  8.         if (err == cudaSuccess){
  9.             printf("Device %i: %s, sm %i.%i\n", deviceId, prop.name, prop.major, prop.minor);
  10.         }
  11.         else
  12.         {
  13.             printf("Err: Device properties could not be loaded (%s)\n", cudaGetErrorString(err));
  14.         }
  15.     }
  16.     else
  17.     {
  18.         printf("Err: Cuda Device ID could not be loaded (%s)\n", cudaGetErrorString(err));
  19.     }
  20. }
RAW Paste Data
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top