Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option GPU_PHYSICS #322

Draft
wants to merge 7 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Added option `GPU_PHYSICS` which defaults to `OFF`. When `ON`, available
OpenACC ports of Phsyics routines will be built instead of their original
versions.

### Changed

## [3.30.0] - 2023-06-23
Expand Down
8 changes: 8 additions & 0 deletions compiler/flags/GNU_Fortran.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ set (NO_ALIAS "")

set (NO_RANGE_CHECK "-fno-range-check")

set (OPENACC_COMPILE "-fopenacc")
set (OPENACC_OFFLOAD_TARGETS "-foffload=nvptx-none")
set (OPENACC_OFFLOAD_OPTIONS "-foffload=-lgfortran -lgomp -lm")

cmake_host_system_information(RESULT proc_description QUERY PROCESSOR_DESCRIPTION)

if ( ${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL aarch64 )
Expand Down Expand Up @@ -202,6 +206,10 @@ endif ()
#set (GEOS_Fortran_Aggressive_Flags "-O2 -march=native -ffast-math -ftree-vectorize -funroll-loops --param max-unroll-times=4 ${PREFER_AVX128} -mno-fma -mveclibabi=svml")
#set (GEOS_Fortran_Aggressive_FPE_Flags "${DEBINFO} ${TRACEBACK} ${MISMATCH} ${ALLOW_BOZ}")

# OpenACC flags
# -------------
set (GEOS_Fortran_OpenACC_Flags "${OPENACC_COMPILE} ${OPENACC_OFFLOAD_TARGETS}")
set (GEOS_Fortran_OpenACC_Flags_Offload_Libs "${OPENACC_COMPILE} ${OPENACC_OFFLOAD_OPTIONS} ${OPENACC_OFFLOAD_TARGETS}")

# Common variables for every compiler
include(Generic_Fortran)
7 changes: 7 additions & 0 deletions esma.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ option(BUILD_SHARED_LIBS "Build the shared library" OFF)
set (ECBUILD_2_COMPAT_VALUE OFF)
include (ecbuild_system NO_POLICY_SCOPE)

### GPU Physics ###

option(GPU_PHYSICS "Build GPU ports of Physics components" OFF)
if (GPU_PHYSICS)
find_package (OpenACC)
endif ()

### Compiler Support ###

list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/compiler")
Expand Down