Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. cudaDeviceProp prop;
  2. int count;
  3. cudaGetDeviceCount(&count);
  4. cout << "Number of CUDA devices on this system: "
  5. << count << endl;
  6. for (int i = 0; i < count; i++) {
  7. cudaGetDeviceProperties(&prop, i);
  8. cout << "\n General Information for device " << i << endl;
  9. cudaGetDeviceProperties(&prop, i);
  10. cout << "\n--- General Information for device " << i << endl;
  11. cout << "Name: " << prop.name << endl;
  12. cout << "Clock rate: " << prop.clockRate / 1000<< "MHZ" << endl;
  13. cout << "Total global mem: " << prop.totalGlobalMem / 1024 / 1024 << "MB" << endl;
  14. cout << "Total constant Mem: " << prop.totalConstMem / 1024 << "KB" << endl;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement