Skip to content

Commit

Permalink
use ACC_SETUP_source_spatials rerun
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisZYJ committed Jul 31, 2024
1 parent 2dad007 commit 3540905
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/common/include/macros.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,30 @@
#endif
#:enddef

#:def ACC_SETUP_source_spatials(*args)
#ifdef CRAY_ACC_WAR
block

@:LOG({'@:ACC_SETUP_source_spatials(${', '.join(args)}$)'})

#:for arg in args
!$acc enter data copyin(${arg}$)
if (allocated(${arg}$%coord)) then
!$acc enter data create(${arg}$%coord)
end if
if (allocated(${arg}$%val)) then
!$acc enter data create(${arg}$%val)
end if
if (allocated(${arg}$%angle)) then
!$acc enter data create(${arg}$%angle)
end if
if (allocated(${arg}$%xyz_to_r_ratios)) then
!$acc enter data create(${arg}$%xyz_to_r_ratios)
end if
#:endfor
end block
#endif
#:enddef

#define t_vec3 real(kind(0d0)), dimension(1:3)
#define t_mat4x4 real(kind(0d0)), dimension(1:4,1:4)
1 change: 1 addition & 0 deletions src/simulation/m_acoustic_src.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ contains
@:ALLOCATE(source_spatials(ai)%xyz_to_r_ratios(1:3, 1:count))
end if
end if
@:ACC_SETUP_source_spatials(source_spatials(ai))
! Second pass: Store the values
count = 0 ! Reset counter
Expand Down

0 comments on commit 3540905

Please sign in to comment.