GPUAvailable Function

public function GPUAvailable() result(avail)

Arguments

None

Return Value logical


Calls

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

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