| 256 | |
| 257 | |
| 258 | size_t gpu_getCurrentAvailableMemoryInBytes() { |
| 259 | #if COMPILE_CUDA |
| 260 | assert_gpuHasBeenBound(hasGpuBeenBound); |
| 261 | |
| 262 | // note that in distributed settings, all GPUs |
| 263 | // are being simultaneously queried, and it is |
| 264 | // possible their values differ per-node |
| 265 | |
| 266 | size_t free, total; |
| 267 | CUDA_CHECK( cudaMemGetInfo(&free, &total) ); |
| 268 | return free; |
| 269 | |
| 270 | #else |
| 271 | error_gpuQueriedButGpuNotCompiled(); |
| 272 | return 0; |
| 273 | #endif |
| 274 | } |
| 275 | |
| 276 | |
| 277 | size_t gpu_getTotalMemoryInBytes() { |
no test coverage detected