Skip to content

Commit

Permalink
Merge pull request #157
Browse files Browse the repository at this point in the history
Add support for AMD GPUs
  • Loading branch information
wdeconinck authored Oct 11, 2024
2 parents 4f2fa50 + 6840754 commit b4a4cc1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/trans/gpu/internal/trgtol_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ SUBROUTINE TRGTOL(ALLOCATOR,HTRGTOL,PREEL_REAL,KF_FS,KF_GP,KF_UV_G,KF_SCALARS_G,
USE OML_MOD, ONLY: OML_MY_THREAD
#if ECTRANS_HAVE_MPI
USE MPI_F08, ONLY: MPI_COMM, MPI_REQUEST, MPI_FLOAT, MPI_DOUBLE
! Missing: MPI_ISEND, MPI_IRECV on purpose due to cray-mpi bug (see https://github.com/ecmwf-ifs/ectrans/pull/157)
#endif
USE TPM_STATS, ONLY: GSTATS => GSTATS_NVTX
USE TPM_TRANS, ONLY: NPROMA
Expand Down
1 change: 1 addition & 0 deletions src/trans/gpu/internal/trltog_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ SUBROUTINE TRLTOG(ALLOCATOR,HTRLTOG,PREEL_REAL,KF_FS,KF_GP,KF_UV_G,KF_SCALARS_G,
USE ABORT_TRANS_MOD, ONLY: ABORT_TRANS
#if ECTRANS_HAVE_MPI
USE MPI_F08, ONLY: MPI_COMM, MPI_REQUEST, MPI_FLOAT, MPI_DOUBLE
! Missing: MPI_ISEND, MPI_IRECV on purpose due to cray-mpi bug (see https://github.com/ecmwf-ifs/ectrans/pull/157)
#endif
USE TPM_STATS, ONLY: GSTATS => GSTATS_NVTX
USE TPM_TRANS, ONLY: LDIVGP, LSCDERS, LUVDER, LVORGP, NPROMA
Expand Down
3 changes: 2 additions & 1 deletion src/trans/gpu/internal/trltom_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ SUBROUTINE TRLTOM(ALLOCATOR,HTRLTOM,PFBUF_IN,PFBUF,KF_FS)
USE TPM_DISTR, ONLY: D, NPRTRW, NPROC, MYPROC, MYSETW
USE TPM_GEN, ONLY: LSYNC_TRANS, NERR
#if ECTRANS_HAVE_MPI
USE MPI_F08, ONLY: MPI_COMM, MPI_FLOAT, MPI_DOUBLE, MPI_ALLTOALLV
USE MPI_F08, ONLY: MPI_COMM, MPI_FLOAT, MPI_DOUBLE
! Missing: MPI_ALLTOALLV on purpose due to cray-mpi bug (see https://github.com/ecmwf-ifs/ectrans/pull/157)
#endif
USE TPM_STATS, ONLY: GSTATS => GSTATS_NVTX
USE BUFFERED_ALLOCATOR_MOD, ONLY: BUFFERED_ALLOCATOR, ASSIGN_PTR, GET_ALLOCATION
Expand Down
9 changes: 9 additions & 0 deletions src/trans/gpu/internal/trmtol_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ SUBROUTINE TRMTOL(ALLOCATOR,HTRMTOL,PFBUF_IN,PFBUF,KF_LEG)
USE TPM_GEN, ONLY: LSYNC_TRANS, NERR
#if ECTRANS_HAVE_MPI
USE MPI_F08, ONLY: MPI_COMM, MPI_FLOAT, MPI_DOUBLE
! Missing: MPI_ALLTOALLV on purpose due to cray-mpi bug (see https://github.com/ecmwf-ifs/ectrans/pull/157)
#endif
USE BUFFERED_ALLOCATOR_MOD, ONLY: BUFFERED_ALLOCATOR, ASSIGN_PTR, GET_ALLOCATION
USE TPM_STATS, ONLY: GSTATS => GSTATS_NVTX
Expand Down Expand Up @@ -158,7 +159,12 @@ SUBROUTINE TRMTOL(ALLOCATOR,HTRMTOL,PFBUF_IN,PFBUF,KF_LEG)
#ifdef OMPGPU
#endif
#ifdef ACCGPU
#ifdef __HIP_PLATFORM_AMD__
! Workaround for AMD GPUs - ASYNC execution of this kernel gives numerical errors
!$ACC KERNELS DEFAULT(NONE) PRESENT(PFBUF,PFBUF_IN) COPYIN(FROM_RECV,TO_RECV,FROM_SEND,TO_SEND)
#else
!$ACC KERNELS ASYNC(1) DEFAULT(NONE) PRESENT(PFBUF,PFBUF_IN) COPYIN(FROM_RECV,TO_RECV,FROM_SEND,TO_SEND)
#endif
#endif
PFBUF(FROM_RECV:TO_RECV) = PFBUF_IN(FROM_SEND:TO_SEND)
#ifdef OMPGPU
Expand Down Expand Up @@ -213,7 +219,10 @@ SUBROUTINE TRMTOL(ALLOCATOR,HTRMTOL,PFBUF_IN,PFBUF,KF_LEG)
CALL GSTATS(421,1)

#ifdef ACCGPU
#ifndef __HIP_PLATFORM_AMD__
! Workaround for AMD GPUs - ASYNC execution of this kernel gives numerical errors
!$ACC WAIT(1)
#endif
#endif
CALL GSTATS(807,1)
ELSE
Expand Down

0 comments on commit b4a4cc1

Please sign in to comment.