Skip to content

Commit

Permalink
Merge pull request #33
Browse files Browse the repository at this point in the history
- Propagate acc link flags
- LOKI: change default mode to scc-stack
  • Loading branch information
wdeconinck authored Oct 7, 2024
2 parents 2a9135a + 81aa838 commit c2fae44
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ ecbuild_add_option( FEATURE LOKI
REQUIRED_PACKAGES "loki" )

# Set default Loki transformation mode
set( LOKI_MODE "scc-hoist" CACHE STRING "Transformation mode for Loki source transformations" )
set( LOKI_MODE "scc-stack" CACHE STRING "Transformation mode for Loki source transformations" )

### OpenACC
if( ${CMAKE_VERSION} VERSION_LESS "3.25" AND HAVE_LOKI AND NOT LOKI_MODE MATCHES "idem|idem-stack" )
Expand Down
3 changes: 2 additions & 1 deletion src/ecwam/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,8 @@ ecwam_target_fortran_module_directory(
INSTALL_DIRECTORY module/${ecwam}
)

if( HAVE_ACC )
if( HAVE_ACC AND CMAKE_Fortran_COMPILER_ID MATCHES "PGI|NVHPC")
target_link_options( ${ecwam} INTERFACE SHELL:${OpenACC_Fortran_FLAGS} )
target_compile_options( ${ecwam} PRIVATE "-gpu=maxregcount:128" )
endif()

Expand Down
2 changes: 1 addition & 1 deletion src/programs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ foreach( program
ecbuild_add_executable(
TARGET ${PROJECT_NAME}-${program}
SOURCES ${program}.F90
LIBS ${PROJECT_NAME} ${OpenMP_Fortran_LIBRARIES} $<${HAVE_ACC}:OpenACC::OpenACC_Fortran>
LIBS ${PROJECT_NAME} ${OpenMP_Fortran_LIBRARIES}
LINKER_LANGUAGE Fortran
)
ecwam_target_compile_definitions_FILENAME(${PROJECT_NAME}-${program})
Expand Down

0 comments on commit c2fae44

Please sign in to comment.