LCOV - code coverage report
Current view: top level - diagonalization - cusolver_diag.F90 (source / functions) Hit Total Coverage
Test: combined.info Lines: 0 2 0.0 %
Date: 2019-09-08 04:53:50 Functions: 0 1 0.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------
       2             : ! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
       3             : ! This file is part of FLEUR and available as free software under the conditions
       4             : ! of the MIT license as expressed in the LICENSE file in more detail.
       5             : !--------------------------------------------------------------------------------
       6             : MODULE m_cusolver_diag
       7             :   USE m_types_mat
       8             :   USE m_types_mpimat
       9             :   USE m_judft
      10             : #ifdef CPP_GPU  
      11             :   USE m_types_gpumat
      12             : #endif  
      13             :   IMPLICIT NONE
      14             :   PRIVATE
      15             : #ifdef CPP_CUSOLVER
      16             :   INTERFACE
      17             :      SUBROUTINE cusolver_real(H,S,n,ne,tol,max_sweeps,eig,z) BIND(C,name="cusolver_real") 
      18             :       USE iso_c_binding
      19             :       IMPLICIT NONE
      20             :       REAL(c_double)         :: H(*),S(*)
      21             :       INTEGER(c_int),VALUE   :: n,ne,max_sweeps
      22             :       REAL(c_double),VALUE   :: tol
      23             :       REAL(c_double)         :: eig(*),z(*)
      24             :     END SUBROUTINE cusolver_real
      25             :  END INTERFACE
      26             :  INTERFACE
      27             :     SUBROUTINE cusolver_complex(H,S,n,ne,tol,max_sweeps,eig,z) BIND(C,name="cusolver_real") 
      28             :       USE iso_c_binding
      29             :       IMPLICIT NONE
      30             :       COMPLEX(c_double)      :: H(*),S(*)
      31             :       INTEGER(c_int),VALUE   :: n,ne,max_sweeps
      32             :       REAL(c_double),VALUE   :: tol
      33             :       REAL(c_double)         :: eig(*)
      34             :       COMPLEX(c_double)      :: z(*)
      35             :     END SUBROUTINE cusolver_complex
      36             :  END INTERFACE
      37             : #endif
      38             :  PUBLIC cusolver_diag
      39             : 
      40             : CONTAINS
      41           0 :   SUBROUTINE cusolver_diag(hmat,smat,ne,eig,zmat)
      42             :     !Simple driver to solve Generalized Eigenvalue Problem using CuSolverDN
      43             :     IMPLICIT NONE
      44             :     CLASS(t_mat),INTENT(INOUT) :: hmat,smat
      45             :     INTEGER,INTENT(INOUT)      :: ne
      46             :     CLASS(t_mat),ALLOCATABLE,INTENT(OUT)    :: zmat
      47             :     REAL,INTENT(OUT)           :: eig(:)
      48             : 
      49             : #ifdef CPP_CUSOLVER
      50             :     INTEGER,PARAMETER:: max_sweeps=15
      51             :     REAL             :: tol=1E-7
      52             :     
      53             :     
      54             :     ALLOCATE(t_mat::zmat)
      55             :     CALL zmat%alloc(hmat%l_real,hmat%matsize1,ne)
      56             :     IF (hmat%l_real) THEN
      57             :        CALL cusolver_real(hmat%data_r,smat%data_r,smat%matsize1,ne,tol,max_sweeps,eig,zmat%data_r)
      58             :     ELSE
      59             :        CALL cusolver_complex(hmat%data_c,smat%data_c,smat%matsize1,ne,tol,max_sweeps,eig,zmat%data_c)
      60             :     END IF
      61             : #endif
      62             :        
      63           0 :   END SUBROUTINE cusolver_diag
      64             : 
      65             :     
      66             : END MODULE m_cusolver_diag

Generated by: LCOV version 1.13