Skip to content

Commit 971c0e8

Browse files
committed
adding openacc to fortran
1 parent 679f3c8 commit 971c0e8

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ else ()
9999
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenacc -fopt-info-optimized-omp")
100100
message(STATUS "Using GNU C++ compiler, added OpenACC compiler switches")
101101
endif ()
102+
if ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "^NVHPC|PGI")
103+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -acc -Minfo=acc")
104+
elseif ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "^GNU")
105+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fopenacc -fopt-info-optimized-omp")
106+
endif ()
102107
message(STATUS "OpenACC enabled")
103108
endif ()
104109
endif ()

upwind/fortran/upwind.F90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ subroutine upwind_advect(obj, deltaTime)
120120

121121
! iterate over the cells
122122
!$OMP PARALLEL DO PRIVATE(i, j, inds, oldIndex, upI)
123+
!$acc parallel loop
123124
do i = 1, obj % ntot
124125

125126
! compute the index set of this cell

0 commit comments

Comments
 (0)