Advertisement
Guest User

Untitled

a guest
Apr 21st, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement