mirror of https://gitlab.com/QEF/q-e.git
GPU variables moved ordinary modules
This commit is contained in:
parent
d140ff04b5
commit
4c3ea7646f
|
@ -24,6 +24,20 @@ MODULE upf_spinorb
|
|||
!! transform real spherical harmonics into complex ones
|
||||
COMPLEX (DP), ALLOCATABLE :: fcoef(:,:,:,:,:)
|
||||
!! function needed to account for spinors.
|
||||
!
|
||||
! GPU vars
|
||||
COMPLEX(DP), ALLOCATABLE :: fcoef_d(:,:,:,:,:)
|
||||
#if defined(__CUDA)
|
||||
attributes (DEVICE) :: fcoef_d
|
||||
#endif
|
||||
|
||||
CONTAINS
|
||||
|
||||
SUBROUTINE deallocate_spinorb
|
||||
IMPLICIT NONE
|
||||
IF( ALLOCATED( fcoef ) ) DEALLOCATE( fcoef )
|
||||
IF( ALLOCATED( fcoef_d ) ) DEALLOCATE( fcoef_d )
|
||||
END SUBROUTINE deallocate_spinorb
|
||||
|
||||
END MODULE upf_spinorb
|
||||
|
||||
|
|
|
@ -12,8 +12,10 @@
|
|||
#if defined(__CUDA)
|
||||
USE cudafor
|
||||
#endif
|
||||
use upf_spinorb, ONLY: fcoef_d
|
||||
IMPLICIT NONE
|
||||
SAVE
|
||||
!
|
||||
INTEGER, PARAMETER :: DP = selected_real_kind(14,200)
|
||||
INTEGER, PARAMETER :: sgl = selected_real_kind(6,30)
|
||||
INTEGER, PARAMETER :: i4b = selected_int_kind(9)
|
||||
|
@ -23,12 +25,6 @@
|
|||
iverbosity = 1
|
||||
#endif
|
||||
!
|
||||
COMPLEX(DP), ALLOCATABLE :: fcoef_d(:, :, :, :, :)
|
||||
!
|
||||
#if defined(__CUDA)
|
||||
attributes (DEVICE) :: fcoef_d
|
||||
#endif
|
||||
|
||||
LOGICAL :: fcoef_ood = .false. ! used to flag out of date variables
|
||||
LOGICAL :: fcoef_d_ood = .false. ! used to flag out of date variables
|
||||
!
|
||||
|
@ -41,7 +37,7 @@
|
|||
! 1 -> inout , the variable needs to be synchronized AND will be changed
|
||||
! 2 -> out , NO NEED to synchronize the variable, everything will be overwritten
|
||||
!
|
||||
USE upf_spinorb, ONLY : fcoef
|
||||
USE upf_spinorb, ONLY : fcoef, fcoef_d
|
||||
implicit none
|
||||
INTEGER, INTENT(IN) :: intento
|
||||
CHARACTER(len=*), INTENT(IN), OPTIONAL :: debug_info
|
||||
|
@ -75,7 +71,7 @@
|
|||
!
|
||||
SUBROUTINE using_fcoef_d(intento, debug_info)
|
||||
!
|
||||
USE upf_spinorb, ONLY : fcoef
|
||||
USE upf_spinorb, ONLY : fcoef, fcoef_d
|
||||
implicit none
|
||||
INTEGER, INTENT(IN) :: intento
|
||||
CHARACTER(len=*), INTENT(IN), OPTIONAL :: debug_info
|
||||
|
@ -110,10 +106,9 @@
|
|||
#endif
|
||||
END SUBROUTINE using_fcoef_d
|
||||
!
|
||||
SUBROUTINE deallocate_spin_orb_gpu
|
||||
IF( ALLOCATED( fcoef_d ) ) DEALLOCATE( fcoef_d )
|
||||
SUBROUTINE deallocate_spinorb_gpu
|
||||
fcoef_d_ood = .false.
|
||||
END SUBROUTINE deallocate_spin_orb_gpu
|
||||
END SUBROUTINE deallocate_spinorb_gpu
|
||||
!=----------------------------------------------------------------------------=!
|
||||
END MODULE upf_spinorb_gpum
|
||||
!=----------------------------------------------------------------------------=!
|
||||
|
|
Loading…
Reference in New Issue