10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-19 12:32:30 +01:00

Forgot file

This commit is contained in:
Anthony Scemama 2024-06-28 21:37:14 +02:00
parent c7df9a72cc
commit b467bef6dd
2 changed files with 45 additions and 34 deletions

View File

@ -271,40 +271,40 @@ subroutine ccsd_energy_space_x(nO,nV,d_cc_space_v_oovv,d_cc_space_f_vo,tau_x,t1,
integer :: i,j,a,b
double precision :: e
energy = 0d0
!$omp parallel &
!$omp shared(nO,nV,energy,tau_x,t1,&
!$omp d_cc_space_f_vo,d_cc_space_v_oovv) &
!$omp private(i,j,a,b,e) &
!$omp default(none)
e = 0d0
!$omp do
do a = 1, nV
do i = 1, nO
e = e + 2d0 * d_cc_space_f_vo%f(a,i) * t1%f(i,a)
enddo
enddo
!$omp end do nowait
!$omp do
do b = 1, nV
do a = 1, nV
do j = 1, nO
do i = 1, nO
e = e + tau_x%f(i,j,a,b) * d_cc_space_v_oovv%f(i,j,a,b)
enddo
enddo
enddo
enddo
!$omp end do nowait
!$omp critical
energy = energy + e
!$omp end critical
!$omp end parallel
!
!
! call gpu_ddot(blas_handle, nO*nO*nV*nV*1_8, tau_x, 1, d_cc_space_v_oovv, 1, energy)
! call gpu_ddot(blas_handle, nO*nV*1_8, d_cc_space_f_vo, 1, t1, 1, e)
! energy = energy + 2.d0*e
! energy = 0d0
! !$omp parallel &
! !$omp shared(nO,nV,energy,tau_x,t1,&
! !$omp d_cc_space_f_vo,d_cc_space_v_oovv) &
! !$omp private(i,j,a,b,e) &
! !$omp default(none)
! e = 0d0
! !$omp do
! do a = 1, nV
! do i = 1, nO
! e = e + 2d0 * d_cc_space_f_vo%f(a,i) * t1%f(i,a)
! enddo
! enddo
! !$omp end do nowait
! !$omp do
! do b = 1, nV
! do a = 1, nV
! do j = 1, nO
! do i = 1, nO
! e = e + tau_x%f(i,j,a,b) * d_cc_space_v_oovv%f(i,j,a,b)
! enddo
! enddo
! enddo
! enddo
! !$omp end do nowait
! !$omp critical
! energy = energy + e
! !$omp end critical
! !$omp end parallel
call gpu_ddot(blas_handle, nO*nO*nV*nV*1_8, tau_x, 1, d_cc_space_v_oovv, 1, energy)
call gpu_ddot(blas_handle, nO*nV*1_8, d_cc_space_f_vo, 1, t1, 1, e)
energy = energy + 2.d0*e
end

11
src/gpu/gpu.irp.f Normal file
View File

@ -0,0 +1,11 @@
use gpu
BEGIN_PROVIDER [ type(gpu_blas), blas_handle ]
implicit none
BEGIN_DOC
! Handle for cuBLAS or RocBLAS
END_DOC
call gpu_blas_create(blas_handle)
END_PROVIDER