Class | gpu_bind_class |
In: |
GPUSolverClass_v1.2/gpu_bind_class.F90
GPUSolverClass/gpu_bind_class.F90 |
Subroutine : | |
num_total_gpus : | integer, intent(out) |
num_use_gpus : | integer, intent(in) |
subroutine bind_cpu_to_gpu(num_total_gpus,num_use_gpus) implicit none integer, intent(out) :: num_total_gpus integer, intent(in) :: num_use_gpus integer(C_INT) :: f_num_tot_gpus integer(C_INT) :: f_num_use_gpus if (m_num_use_gpus /= num_use_gpus) then call unbind_cpu_to_gpu() endif if (.not.m_is_gpu_binded_to_cpu) then m_num_use_gpus = num_use_gpus f_num_use_gpus = num_use_gpus call bind_cpu_to_gpu_loc(f_num_tot_gpus,f_num_use_gpus) num_total_gpus = f_num_tot_gpus m_num_total_gpus = f_num_tot_gpus m_is_gpu_binded_to_cpu = .true. endif gpu_mult_count(:) = 0 gpu_nodeid = nodeid gpu_ipeo = ipeo gpu_nodeidup(0:NDIM-2) = nodeidup(1:NDIM-1) gpu_nodeiddn(0:NDIM-2) = nodeiddn(1:NDIM-1) return end subroutine
Subroutine : | |
num_total_gpus : | integer, intent(out) |
num_use_gpus : | integer, intent(in) |
subroutine bind_cpu_to_gpu(num_total_gpus,num_use_gpus) implicit none integer, intent(out) :: num_total_gpus integer, intent(in) :: num_use_gpus integer(C_INT) :: f_num_tot_gpus integer(C_INT) :: f_num_use_gpus if (m_num_use_gpus /= num_use_gpus) then call unbind_cpu_to_gpu() endif if (.not.m_is_gpu_binded_to_cpu) then m_num_use_gpus = num_use_gpus f_num_use_gpus = num_use_gpus call bind_cpu_to_gpu_loc(f_num_tot_gpus,f_num_use_gpus) num_total_gpus = f_num_tot_gpus m_num_total_gpus = f_num_tot_gpus m_is_gpu_binded_to_cpu = .true. endif gpu_mult_count(:) = 0 gpu_nodeid = nodeid gpu_ipeo = ipeo gpu_nodeidup(0:NDIM-2) = nodeidup(1:NDIM-1) gpu_nodeiddn(0:NDIM-2) = nodeiddn(1:NDIM-1) return end subroutine
Variable : | |
gpu_mult_count(MAXGPU) = 0 : | integer(C_INT), BIND(C,name="cu_mult_count"), save |
Variable : | |
gpu_mult_count(MAXGPU) = 0 : | integer(C_INT), BIND(C,name="cu_mult_count"), save |
Subroutine : |
subroutine unbind_cpu_to_gpu() implicit none if (m_is_gpu_binded_to_cpu) then call unbind_cpu_to_gpu_loc() m_is_gpu_binded_to_cpu = .false. endif gpu_mult_count(:) = 0 gpu_nodeid = nodeid gpu_ipeo = ipeo gpu_nodeidup(0:NDIM-2) = nodeidup(1:NDIM-1) gpu_nodeiddn(0:NDIM-2) = nodeiddn(1:NDIM-1) return end subroutine
Subroutine : |
subroutine unbind_cpu_to_gpu() implicit none if (m_is_gpu_binded_to_cpu) then call unbind_cpu_to_gpu_loc() m_is_gpu_binded_to_cpu = .false. endif gpu_mult_count(:) = 0 gpu_nodeid = nodeid gpu_ipeo = ipeo gpu_nodeidup(0:NDIM-2) = nodeidup(1:NDIM-1) gpu_nodeiddn(0:NDIM-2) = nodeiddn(1:NDIM-1) return end subroutine