diff --git a/LR_Modules/response_kernels.f90 b/LR_Modules/response_kernels.f90 index 1e6fa55d2..08e8a2ad0 100644 --- a/LR_Modules/response_kernels.f90 +++ b/LR_Modules/response_kernels.f90 @@ -170,12 +170,15 @@ SUBROUTINE sternheimer_kernel(first_iter, time_reversed, npert, lrdvpsi, iudvpsi ! IF (nksq > 1 .OR. (noncolin .AND. domag)) THEN IF (lgamma) THEN + !civn: in this case evq is a pointer to evc CALL get_buffer(evc, lrwfc, iuwfc, ikmk) !$acc update device(evc) ELSE + !civn: in this case evq is allocated separately and needs to be updated on device CALL get_buffer(evc, lrwfc, iuwfc, ikmk) !$acc update device(evc) CALL get_buffer(evq, lrwfc, iuwfc, ikmkmq) + !$acc update device(evq) ENDIF ENDIF ! diff --git a/PHonon/PH/allocate_phq.f90 b/PHonon/PH/allocate_phq.f90 index 3a0ecb757..4635bc56f 100644 --- a/PHonon/PH/allocate_phq.f90 +++ b/PHonon/PH/allocate_phq.f90 @@ -63,6 +63,7 @@ subroutine allocate_phq ! q!=0 : evq is allocated and calculated at point k+q ! allocate (evq ( npwx*npol , nbnd)) + !$acc enter data create(evq) endif ! allocate (dvpsi ( npwx*npol , nbnd)) diff --git a/PHonon/PH/deallocate_phq.f90 b/PHonon/PH/deallocate_phq.f90 index 6c9ce25fe..b29969fb1 100644 --- a/PHonon/PH/deallocate_phq.f90 +++ b/PHonon/PH/deallocate_phq.f90 @@ -54,6 +54,7 @@ subroutine deallocate_phq if (lgamma) then if(associated(evq)) nullify(evq) else + !$acc exit data delete(evq) if(associated(evq)) deallocate(evq) !why not if allocated? end if diff --git a/PHonon/PH/solve_linter.f90 b/PHonon/PH/solve_linter.f90 index 5cd9619ee..d6172ea36 100644 --- a/PHonon/PH/solve_linter.f90 +++ b/PHonon/PH/solve_linter.f90 @@ -267,6 +267,7 @@ SUBROUTINE solve_linter (irr, imode0, npe, drhoscf) ! IF (nksq > 1 .OR. nsolv == 2) THEN CALL get_buffer(evc, lrwfc, iuwfc, ikmk) + !$acc update device(evc) ENDIF ! DO ipert = 1, npe