MCPcopy Create free account
hub / github.com/QuEST-Kit/QuEST / gpu_getCurrentAvailableMemoryInBytes

Function gpu_getCurrentAvailableMemoryInBytes

quest/src/gpu/gpu_config.cpp:258–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256
257
258size_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
277size_t gpu_getTotalMemoryInBytes() {

Callers 7

assertQuregFitsInGpuMemFunction · 0.85
assertMatrixFitsInGpuMemFunction · 0.85
printGpuInfoFunction · 0.85
printQuregSizeLimitsFunction · 0.85

Calls 2

assert_gpuHasBeenBoundFunction · 0.85

Tested by

no test coverage detected