| 56 | } |
| 57 | |
| 58 | const std::pair<size_t, size_t> Platform::GetGPUMemSize(const int device) { |
| 59 | std::pair<size_t, size_t> ret{0, 0}; |
| 60 | if (Platform::CheckDevice(device)) { |
| 61 | CUDA_CHECK(cudaSetDevice(device)); |
| 62 | size_t free = 0, total = 0; |
| 63 | CUDA_CHECK(cudaMemGetInfo(&free, &total)); |
| 64 | ret = std::make_pair(free, total); |
| 65 | } else { |
| 66 | LOG(ERROR) << "The device (ID = " << device << ") is not available"; |
| 67 | } |
| 68 | return ret; |
| 69 | } |
| 70 | |
| 71 | const vector<std::pair<size_t, size_t>> Platform::GetGPUMemSize() { |
| 72 | vector<std::pair<size_t, size_t>> mem; |