GPUAvailable Function

public function GPUAvailable() result(avail)

Arguments

None

Return Value logical


Calls

proc~~gpuavailable~~CallsGraph proc~gpuavailable GPUAvailable interface~hipgetdevicecount hipGetDeviceCount proc~gpuavailable->interface~hipgetdevicecount

Called by

proc~~gpuavailable~~CalledByGraph proc~gpuavailable GPUAvailable proc~init_lagrange Init_Lagrange proc~init_lagrange->proc~gpuavailable proc~init_lagrange~2 Init_Lagrange proc~init_lagrange~2->proc~gpuavailable proc~init_scalar1d~2 Init_Scalar1D proc~init_scalar1d~2->proc~gpuavailable proc~init_scalar1d Init_Scalar1D proc~init_scalar1d->proc~gpuavailable

Contents

Source Code


Source Code

                  function GPUAvailable() result(avail)
                    implicit none
                    logical :: avail
                    ! Local
                    integer(c_int) :: gpuCount
                    integer(kind(hipSuccess)) :: err

                    err = hipGetDeviceCount(gpuCount)
                    if(gpuCount > 0 .and. err == hipSuccess) then
                      avail = .true.
                    else
                      avail = .false.
                    endif

                  endfunction GPUAvailable