2023-07-16 09:54:58 +02:00
|
|
|
|
|
|
|
module gpu_module
|
|
|
|
use iso_c_binding
|
|
|
|
implicit none
|
|
|
|
|
|
|
|
interface
|
2023-07-17 02:55:14 +02:00
|
|
|
subroutine compute_r2_space_chol_gpu(nO,nV,cholesky_mo_num, t1, t2, tau,&
|
2023-07-17 14:51:50 +02:00
|
|
|
cc_space_v_oo_chol, cc_space_v_ov_chol, cc_space_v_vo_chol, cc_space_v_vv_chol, &
|
2023-07-16 21:18:57 +02:00
|
|
|
cc_space_v_oooo, cc_space_v_vooo, cc_space_v_oovv, cc_space_v_vvoo, &
|
2023-07-20 14:53:40 +02:00
|
|
|
cc_space_v_oovo, cc_space_v_ovvo, &
|
2023-07-17 14:00:54 +02:00
|
|
|
cc_space_f_vo, H_vv, g_occ, r2) bind(C)
|
2023-07-16 09:54:58 +02:00
|
|
|
import c_int, c_double
|
|
|
|
integer(c_int), value :: nO, nV, cholesky_mo_num
|
|
|
|
real(c_double), intent(in) :: t1(nO,nV)
|
2023-07-17 02:55:14 +02:00
|
|
|
real(c_double), intent(in) :: t2(nO,nO,nV,nV)
|
2023-07-16 09:54:58 +02:00
|
|
|
real(c_double), intent(in) :: tau(nO,nO,nV,nV)
|
2023-07-17 14:51:50 +02:00
|
|
|
real(c_double), intent(in) :: cc_space_v_oo_chol(cholesky_mo_num,nO,nO)
|
2023-07-17 02:55:14 +02:00
|
|
|
real(c_double), intent(in) :: cc_space_v_ov_chol(cholesky_mo_num,nO,nV)
|
2023-07-16 09:54:58 +02:00
|
|
|
real(c_double), intent(in) :: cc_space_v_vo_chol(cholesky_mo_num,nV,nO)
|
|
|
|
real(c_double), intent(in) :: cc_space_v_vv_chol(cholesky_mo_num,nV,nV)
|
2023-07-16 20:34:35 +02:00
|
|
|
real(c_double), intent(in) :: cc_space_v_oooo(nO,nO,nO,nO)
|
|
|
|
real(c_double), intent(in) :: cc_space_v_vooo(nV,nO,nO,nO)
|
|
|
|
real(c_double), intent(in) :: cc_space_v_oovv(nO,nO,nV,nV)
|
2023-07-16 21:18:57 +02:00
|
|
|
real(c_double), intent(in) :: cc_space_v_vvoo(nV,nV,nO,nO)
|
2023-07-20 14:53:40 +02:00
|
|
|
real(c_double), intent(in) :: cc_space_v_oovo(nO,nO,nV,nO)
|
|
|
|
real(c_double), intent(in) :: cc_space_v_ovvo(nO,nV,nV,nO)
|
2023-07-17 02:55:14 +02:00
|
|
|
real(c_double), intent(in) :: cc_space_f_vo(nV,nO)
|
|
|
|
real(c_double), intent(in) :: H_vv(nV,nV)
|
2023-07-17 14:00:54 +02:00
|
|
|
real(c_double), intent(in) :: g_occ(nO,nO)
|
2023-07-16 09:54:58 +02:00
|
|
|
real(c_double), intent(out) :: r2(nO,nO,nV,nV)
|
|
|
|
end subroutine
|
|
|
|
|
2023-07-17 02:55:14 +02:00
|
|
|
|
|
|
|
|
2023-07-16 15:39:37 +02:00
|
|
|
subroutine gpu_dgemm(transa, transb, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc) bind(C)
|
|
|
|
import c_int, c_double, c_char
|
|
|
|
character(c_char), value :: transa, transb
|
|
|
|
integer(c_int), value :: m,n,k,lda,ldb,ldc
|
|
|
|
real(c_double), value :: alpha, beta
|
|
|
|
real(c_double) :: A(lda,*), B(ldb,*), C(ldc,*)
|
|
|
|
end subroutine
|
2023-07-16 09:54:58 +02:00
|
|
|
|
|
|
|
end interface
|
|
|
|
|
|
|
|
end module
|