QMCPACK
CUDAruntime.hpp File Reference

handle CUDA/HIP runtime selection. More...

+ Include dependency graph for CUDAruntime.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

size_t getCUDAdeviceFreeMem ()
 

Detailed Description

handle CUDA/HIP runtime selection.

Definition in file CUDAruntime.hpp.

Function Documentation

◆ getCUDAdeviceFreeMem()

size_t getCUDAdeviceFreeMem ( )

Definition at line 15 of file CUDAruntime.cpp.

References cudaErrorCheck, and cudaMemGetInfo.

Referenced by qmcplusplus::print_mem().

16 {
17  size_t free, total;
18  cudaErrorCheck(cudaMemGetInfo(&free, &total), "cudaMemGetInfo failed!");
19  return free;
20 }
#define cudaErrorCheck(ans, cause)
Definition: CUDAerror.h:21
#define cudaMemGetInfo
Definition: cuda2hip.h:145