9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-09 06:53:38 +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 integer :: i,j,a,b
double precision :: e double precision :: e
energy = 0d0 ! energy = 0d0
!$omp parallel & ! !$omp parallel &
!$omp shared(nO,nV,energy,tau_x,t1,& ! !$omp shared(nO,nV,energy,tau_x,t1,&
!$omp d_cc_space_f_vo,d_cc_space_v_oovv) & ! !$omp d_cc_space_f_vo,d_cc_space_v_oovv) &
!$omp private(i,j,a,b,e) & ! !$omp private(i,j,a,b,e) &
!$omp default(none) ! !$omp default(none)
e = 0d0 ! e = 0d0
!$omp do ! !$omp do
do a = 1, nV ! do a = 1, nV
do i = 1, nO ! do i = 1, nO
e = e + 2d0 * d_cc_space_f_vo%f(a,i) * t1%f(i,a) ! e = e + 2d0 * d_cc_space_f_vo%f(a,i) * t1%f(i,a)
enddo ! enddo
enddo ! enddo
!$omp end do nowait ! !$omp end do nowait
!$omp do ! !$omp do
do b = 1, nV ! do b = 1, nV
do a = 1, nV ! do a = 1, nV
do j = 1, nO ! do j = 1, nO
do i = 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) ! e = e + tau_x%f(i,j,a,b) * d_cc_space_v_oovv%f(i,j,a,b)
enddo ! enddo
enddo ! enddo
enddo ! enddo
enddo ! enddo
!$omp end do nowait ! !$omp end do nowait
!$omp critical ! !$omp critical
energy = energy + e ! energy = energy + e
!$omp end critical ! !$omp end critical
!$omp end parallel ! !$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*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) call gpu_ddot(blas_handle, nO*nV*1_8, d_cc_space_f_vo, 1, t1, 1, e)
! energy = energy + 2.d0*e energy = energy + 2.d0*e
end 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