Skip to content

Commit

Permalink
Merge pull request #361 from GEOS-ESM/feature/mathomp4/360-add-hygon-gcc
Browse files Browse the repository at this point in the history
Add support for Hygon with GCC
  • Loading branch information
mathomp4 committed May 20, 2024
2 parents 0b3c3d6 + 1dc5da8 commit 9770a74
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Added support for Hygon processors with GCC

### Changed

### Deprecated
Expand Down
9 changes: 9 additions & 0 deletions compiler/flags/GNU_Fortran.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,15 @@ elseif (${proc_description} MATCHES "EPYC")
set (GNU_TARGET_ARCH "znver2")
set (GNU_NATIVE_ARCH "native")
set (NO_FMA "-mno-fma")
elseif (${proc_description} MATCHES "Hygon")
# Tests on a Hygon showed it returned 'nocona' for the native arch
# see https://github.com/geoschem/GCHP/issues/391
# Intel was happy with AVX2, but this test was done with GCC 10
# Perhaps later versions of GCC would return a different value?
# Until then, nocona is definitely safe. Pentium 4!
set (GNU_TARGET_ARCH "nocona")
set (GNU_NATIVE_ARCH "native")
set (NO_FMA "-mno-fma")
elseif (${proc_description} MATCHES "Intel")
set (GNU_TARGET_ARCH "haswell")
set (GNU_NATIVE_ARCH "native")
Expand Down

0 comments on commit 9770a74

Please sign in to comment.