Skip to content

Commit 07c5e54

Browse files
authored
Merge pull request #3045 from martin-frbg/nvidiasdk
Support NVIDIA HPC SDK 20.11 compilers on x86_64
2 parents 326469e + 005cce5 commit 07c5e54

File tree

4 files changed

+26
-11
lines changed

4 files changed

+26
-11
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ endif
5959
@$(CC) --version > /dev/null 2>&1;\
6060
if [ $$? -eq 0 ]; then \
6161
cverinfo=`$(CC) --version | sed -n '1p'`; \
62+
if [ -z "$${cverinfo}" ]; then \
63+
cverinfo=`$(CC) --version | sed -n '2p'`; \
64+
fi; \
6265
echo " C compiler ... $(C_COMPILER) (cmd & version : $${cverinfo})";\
6366
else \
6467
echo " C compiler ... $(C_COMPILER) (command line : $(CC))";\
@@ -67,6 +70,9 @@ ifeq ($(NOFORTRAN), $(filter 0,$(NOFORTRAN)))
6770
@$(FC) --version > /dev/null 2>&1;\
6871
if [ $$? -eq 0 ]; then \
6972
fverinfo=`$(FC) --version | sed -n '1p'`; \
73+
if [ -z "$${fverinfo}" ]; then \
74+
fverinfo=`$(FC) --version | sed -n '2p'`; \
75+
fi; \
7076
echo " Fortran compiler ... $(F_COMPILER) (cmd & version : $${fverinfo})";\
7177
else \
7278
echo " Fortran compiler ... $(F_COMPILER) (command line : $(FC))";\

Makefile.system

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ endif
181181

182182
# On x86_64 build getarch with march=native unless the compiler is PGI. This is required to detect AVX512 support in getarch.
183183
ifeq ($(HOSTARCH), x86_64)
184-
ifeq ($(findstring pgcc,$(HOSTCC)),)
184+
ifeq ($(findstring pgcc,$(HOSTCC))$(findstring nvc,$(HOSTCC)),)
185185
GETARCH_FLAGS += -march=native
186186
endif
187187
endif
@@ -847,9 +847,19 @@ endif
847847
endif
848848

849849
ifeq ($(C_COMPILER), PGI)
850+
PGCVERSIONGT20 := $(shell expr `$(CC) --version|sed -n "2p" |sed -e "s/[^0-9.]//g" |cut -d "." -f 1` \> 20)
851+
PGCVERSIONGTEQ20 := $(shell expr `$(CC) --version|sed -n "2p" |sed -e "s/[^0-9.]//g" |cut -d "." -f 1` \>= 20)
852+
PGCMINORVERSIONGE11 := $(shell expr `$(CC) --version|sed -n "2p" |sed -e "s/[^0-9.]//g" |cut -c 4-5` == 11)
853+
PGCVERSIONCHECK := $(PGCVERSIONGT20)$(PGCVERSIONEQ20)$(PGCMINORVERSIONGE11)
854+
ifeq ($(PGCVERSIONCHECK), $(filter $(PGCVERSIONCHECK), 110 111 011))
855+
NEWPGI := 1
856+
endif
850857
ifdef BINARY64
851858
ifeq ($(ARCH), x86_64)
852-
CCOMMON_OPT += -tp p7-64 -D__MMX__ -Mnollvm
859+
CCOMMON_OPT += -tp p7-64
860+
ifneq ($(NEWPGI),1)
861+
CCOMMON_OPT += -D__MMX__ -Mnollvm
862+
endif
853863
else
854864
ifeq ($(ARCH), power)
855865
ifeq ($(CORE), POWER8)
@@ -1040,7 +1050,7 @@ endif
10401050
else
10411051
FCOMMON_OPT += -tp p7
10421052
endif
1043-
FCOMMON_OPT += -Mrecursive
1053+
FCOMMON_OPT += -Mrecursive -Kieee
10441054
ifeq ($(USE_OPENMP), 1)
10451055
FCOMMON_OPT += -mp
10461056
endif

f_check

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if ($compiler eq "") {
3232
"xlf95", "xlf90", "xlf",
3333
"ppuf77", "ppuf95", "ppuf90", "ppuxlf",
3434
"pathf90", "pathf95",
35-
"pgf95", "pgf90", "pgf77",
35+
"pgf95", "pgf90", "pgf77", "pgfortran", "nvfortran",
3636
"flang", "egfortran",
3737
"ifort");
3838

@@ -64,7 +64,6 @@ if ($compiler eq "") {
6464
if (!$?) {
6565

6666
$data = `$compiler -O2 -S ftest.f > /dev/null 2>&1 && cat ftest.s && rm -f ftest.s`;
67-
6867
if ($data =~ /zhoge_/) {
6968
$bu = "_";
7069
}
@@ -87,7 +86,7 @@ if ($compiler eq "") {
8786
if ($compiler =~ /flang/) {
8887
$vendor = FLANG;
8988
$openmp = "-fopenmp";
90-
} elsif ($compiler =~ /pgf/) {
89+
} elsif ($compiler =~ /pgf/ || $compiler =~ /nvf/) {
9190
$vendor = PGI;
9291
$openmp = "-mp";
9392
} else {
@@ -123,7 +122,7 @@ if ($compiler eq "") {
123122
$openmp = "-mp";
124123
}
125124

126-
if ($data =~ /PGF/) {
125+
if ($data =~ /PGF/ || $data =~ /NVF/) {
127126
$vendor = PGI;
128127
$openmp = "-mp";
129128
}
@@ -177,7 +176,7 @@ if ($compiler eq "") {
177176
$openmp = "-mp";
178177
}
179178

180-
if ($compiler =~ /pgf/) {
179+
if ($compiler =~ /pgf/ || $compiler =~ /nvf/) {
181180
$vendor = PGI;
182181
$bu = "_";
183182
$openmp = "-mp";
@@ -330,7 +329,7 @@ if ($link ne "") {
330329
$flags =~ s/\@/\,/g;
331330
$linker_L .= "-Wl,". $flags . " " ;
332331
}
333-
if ($flags =~ /-lgomp/ && $ENV{"CC"} =~ /clang/) {
332+
if ($flags =~ /-lgomp/ && $CC =~ /clang/) {
334333
$flags = "-lomp";
335334
}
336335

kernel/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ ifeq ($(TARGET_CORE), COOPERLAKE)
3636
ifeq ($(GCCVERSIONGTEQ10), 1)
3737
override CFLAGS += -march=cooperlake
3838
else
39-
override CFLAGS += -march=skylake-avx512
39+
override CFLAGS += -march=skylake-avx512 -mavx512f
4040
endif
4141
ifeq ($(OSNAME), CYGWIN_NT)
4242
override CFLAGS += -fno-asynchronous-unwind-tables
@@ -47,7 +47,7 @@ ifeq ($(TARGET_CORE), COOPERLAKE)
4747
endif
4848
endif
4949
else ifeq ($(TARGET_CORE), SKYLAKEX)
50-
override CFLAGS += -DBUILD_KERNEL -DTABLE_NAME=gotoblas_$(TARGET_CORE) -march=skylake-avx512
50+
override CFLAGS += -DBUILD_KERNEL -DTABLE_NAME=gotoblas_$(TARGET_CORE) -march=skylake-avx512 -mavx512f
5151
ifeq ($(OSNAME), CYGWIN_NT)
5252
override CFLAGS += -fno-asynchronous-unwind-tables
5353
endif

0 commit comments

Comments
 (0)