Skip to content

Commit

Permalink
Amd aocc support (#1684)
Browse files Browse the repository at this point in the history
Added AMD AOCC Compiler support to WRF 

TYPE: choose one of [new feature]

KEYWORDS: AMD, AOCC, Compiler Support, ZEN Architecture, Configure

SOURCE:  amd-toolchain-support@github.com 

DESCRIPTION OF CHANGES:
Problem: Added AMD AOCC Compiler Support
Earlier there is no support for AMD AOCC Complier. Now we have added support. 

Solution:
Added AMD AOCC Compiler support to configure using stanzas. 

LIST OF MODIFIED FILES: 
M       arch/configure.defaults

TESTS CONDUCTED: 
1. Compiled and tested with AOCC Compiler. Functional test with AOCC 3.2.0 is done.
2. Passed regression tests.

RELEASE NOTE: Provided AMD AOCC Compiler support at the time of configuring WRF for AMD Architectures including Zen1, Zen2 and Zen3.
  • Loading branch information
amd-toolchain-support authored Jan 28, 2023
1 parent 95ccc01 commit 1243d08
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions arch/configure.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -2068,6 +2068,59 @@ RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

###########################################################
#ARCH AMD Linux x86_64, AOCC flang compiler with AOCC clang #serial smpar dmpar dm+sm
# Supported AMDARCH are znver1, znver2 and znver3 for ZEN1, ZEN2 and ZEN3 respectively
# For optimized AMDFCFLAGS and AMDLDFLAGS, please reach out to toolchainsupport@amd.com
#

DESCRIPTION = AMD ($SFC/$SCC) : AMD ZEN1/ ZEN2/ ZEN3 Architectures
DMPARALLEL = 1
OMPCPP = -D_OPENMP
OMP = -fopenmp
OMPCC = -fopenmp
SFC = flang
SCC = clang
CCOMP = clang
DM_FC = mpif90
DM_CC = mpicc
FC = CONFIGURE_FC
CC = CONFIGURE_CC
LD = $(FC)
RWORDSIZE = CONFIGURE_RWORDSIZE

AMDARCH = -march=znver3
AMDMATHLIB = -fveclib=AMDLIBM
AMDLDFLAGS = -Wl,-mllvm -Wl,-enable-loop-reversal -Wl,-mllvm -Wl,-enable-gather -Wl,-mllvm -Wl,-vectorize-noncontigous-memory-aggressively
AMDFCFLAGS =

PROMOTION = #-fdefault-real-8
ARCH_LOCAL = -DNONSTANDARD_SYSTEM_SUBR -DWRF_USE_CLM -DRPC_TYPES=2
CFLAGS_LOCAL = -w -c -m64 -Ofast -ffast-math $(AMDARCH)
LDFLAGS_LOCAL = -m64 -Ofast -Mstack_arrays $(AMDARCH) $(AMDLDFLAGS) $(AMDMATHLIB) -lamdlibm -lomp
CPLUSPLUSLIB =
ESMF_LDFLAG = $(CPLUSPLUSLIB)
FCOPTIM = -Ofast -ffast-math $(AMDARCH) -Mbyteswapio -Mstack_arrays -ftree-vectorize -Mbyteswapio -funroll-loops -finline-aggressive -finline-hint-functions $(AMDMATHLIB) $(AMDFCFLAGS)
FCREDUCEDOPT = -O3 $(AMDARCH) -ffast-math -Mstack_arrays -DFCREDUCEDOPT
FCNOOPT = -O0
FCDEBUG = # -g $(FCNOOPT)
FORMAT_FIXED = -Mfixed
FORMAT_FREE = -Mfreeform
FCSUFFIX =
BYTESWAPIO = -Mbyteswapio
FCBASEOPTS_NO_G = -w $(FORMAT_FREE) $(BYTESWAPIO)
FCBASEOPTS = -Ofast -ffast-math $(FCBASEOPTS_NO_G) $(FCDEBUG)
MODULE_SRCH_FLAG=
TRADFLAG = -traditional
CPP = /lib/cpp -P
AR = llvm-ar
ARFLAGS = ru
M4 = m4
RANLIB = llvm-ranlib
RLFLAGS =
CC_TOOLS = $(SCC)
NETCDFPAR_BUILD = CONFIGURE_NETCDFPAR_BUILD

#insert new stanza here

###########################################################
Expand Down

1 comment on commit 1243d08

@binglius
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-vectorize-noncontigous-memory-aggressively should be -vectorize-non-contiguous-memory-aggressively

Please sign in to comment.