I am using GlobalMemoryStatusEX in order to find out the amount of memory in my system. Is there a similar way to find the amount of memory on my graphics card? Here is a piece of my code :
use kernel32
use ifwinty
implicit none
type(T_MEMORYSTATUSEX) :: status
integer(8) :: RetVal
status%dwLength = sizeof(status)
RetVal = GlobalMemoryStatusEX(status)
write(*,*) 'Memory Available =',status%ullAvailPhys
I am using Intel Visual Fortran 2010 on Windows 7 x64. Thank you!
Since you tagged this question with the CUDA tag, I'll offer a CUDA answer. Not sure if it really makes sense given your environment.
I haven't tested this on IVF, but it works on gfortran and PGI fortran (linux). You can use the fortran
iso_c_binding
module available in many implementations to directly call routines from the CUDA runtime API library in fortran code. One of those routines is cudaMemGetInfo.Here's a fully worked example of calling it from gfortran (on linux):
In windows, you would need to have a properly installed CUDA environment, (which presumes visual studio). You would then need to locate the
cudart.lib
in that install, and link against that. I'm not 100% sure this would link successfully in IVF, since I don't know if it would link similarly to the way VS libraries link.