Skip to content

Commit d6b6e5c

Browse files
authored
Merge pull request #73 from xianyi/develop
rebase
2 parents 31d3031 + 349b722 commit d6b6e5c

File tree

6 files changed

+74
-11
lines changed

6 files changed

+74
-11
lines changed

Makefile.power

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,56 @@ endif
2121

2222
ifeq ($(CORE), POWER9)
2323
ifeq ($(USE_OPENMP), 1)
24-
COMMON_OPT += -Ofast -mcpu=power9 -mtune=power9 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
24+
ifneq ($(C_COMPILER), PGI)
25+
CCOMMON_OPT += -Ofast -mcpu=power9 -mtune=power9 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
26+
else
27+
CCOMMON_OPT += -fast -Mvect=simd -Mcache_align -DUSE_OPENMP -mp
28+
endif
29+
ifneq ($(F_COMPILER), PGI)
2530
FCOMMON_OPT += -O2 -frecursive -mcpu=power9 -mtune=power9 -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
2631
else
27-
COMMON_OPT += -Ofast -mcpu=power9 -mtune=power9 -mvsx -malign-power -fno-fast-math
32+
FCOMMON_OPT += -O2 -Mrecursive -DUSE_OPENMP -mp
33+
endif
34+
else
35+
ifneq ($(C_COMPILER), PGI)
36+
CCOMMON_OPT += -Ofast -mcpu=power9 -mtune=power9 -mvsx -malign-power -fno-fast-math
37+
else
38+
CCOMMON_OPT += -fast -Mvect=simd -Mcache_align
39+
endif
40+
ifneq ($(F_COMPILER), PGI)
2841
FCOMMON_OPT += -O2 -frecursive -mcpu=power9 -mtune=power9 -malign-power -fno-fast-math
42+
else
43+
FCOMMON_OPT += -O2 -Mrecursive
44+
endif
2945
endif
3046
endif
3147

3248
ifeq ($(CORE), POWER8)
3349
ifeq ($(USE_OPENMP), 1)
34-
COMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
50+
ifneq ($(C_COMPILER), PGI)
51+
CCOMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
52+
else
53+
CCOMMON_OPT += -fast -Mvect=simd -Mcache_align -DUSE_OPENMP -mp
54+
endif
55+
ifneq ($(F_COMPILER), PGI)
3556
FCOMMON_OPT += -O2 -frecursive -mcpu=power8 -mtune=power8 -malign-power -DUSE_OPENMP -fno-fast-math -fopenmp
3657
else
37-
COMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -fno-fast-math
38-
FCOMMON_OPT += -O2 -frecursive -mcpu=power8 -mtune=power8 -malign-power -fno-fast-math
58+
FCOMMON_OPT += -O2 -Mrecursive -DUSE_OPENMP -mp
59+
endif
60+
else
61+
ifneq ($(C_COMPILER), PGI)
62+
CCOMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -malign-power -fno-fast-math
63+
else
64+
CCOMMON_OPT += -fast -Mvect=simd -Mcache_align
65+
endif
66+
ifneq ($(F_COMPILER), PGI)
3967
ifeq ($(OSNAME), AIX)
4068
FCOMMON_OPT += -O1 -frecursive -mcpu=power8 -mtune=power8 -malign-power -fno-fast-math
69+
else
70+
FCOMMON_OPT += -O2 -frecursive -mcpu=power8 -mtune=power8 -malign-power -fno-fast-math
71+
endif
72+
else
73+
FCOMMON_OPT += -O2 -Mrecursive
4174
endif
4275
endif
4376
endif

Makefile.system

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,8 +796,19 @@ endif
796796

797797
ifeq ($(C_COMPILER), PGI)
798798
ifdef BINARY64
799+
ifeq ($(ARCH), x86_64)
799800
CCOMMON_OPT += -tp p7-64 -D__MMX__ -Mnollvm
800801
else
802+
ifeq ($(ARCH), power)
803+
ifeq ($(CORE), POWER8)
804+
CCOMMON_OPT += -tp pwr8
805+
endif
806+
ifeq ($(CORE), POWER9)
807+
CCOMMON_OPT += -tp pwr9
808+
endif
809+
endif
810+
endif
811+
else
801812
CCOMMON_OPT += -tp p7
802813
endif
803814
endif
@@ -960,8 +971,19 @@ ifneq ($(INTERFACE64), 0)
960971
FCOMMON_OPT += -i8
961972
endif
962973
endif
974+
ifeq ($(ARCH), x86_64)
963975
FCOMMON_OPT += -tp p7-64
964976
else
977+
ifeq ($(ARCH), power)
978+
ifeq ($(CORE), POWER8)
979+
FCOMMON_OPT += -tp pwr8
980+
endif
981+
ifeq ($(CORE), POWER9)
982+
FCOMMON_OPT += -tp pwr9
983+
endif
984+
endif
985+
endif
986+
else
965987
FCOMMON_OPT += -tp p7
966988
endif
967989
FCOMMON_OPT += -Mrecursive

cmake/system_check.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,10 @@ set (CCOMMON_OPT "${CCOMMON_OPT} -DNO_AVX512")
116116
endif()
117117
file(REMOVE "avx512.c" "avx512.o")
118118
endif()
119+
120+
include(CheckIncludeFile)
121+
CHECK_INCLUDE_FILE("stdatomic.h" HAVE_C11)
122+
if (HAVE_C11 EQUAL 1)
123+
message (STATUS found stdatomic.h)
124+
set (CCOMMON_OPT "${CCOMMON_OPT} -DHAVE_C11")
125+
endif()

common_x86_64.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,8 @@ static __inline unsigned int blas_quickdivide(unsigned int x, unsigned int y){
228228
#define HUGE_PAGESIZE ( 2 << 20)
229229

230230
#ifndef BUFFERSIZE
231-
#if defined(SKYLAKEX)
232-
#define BUFFER_SIZE (32 << 21)
233-
#elif defined(HASWELL) || defined(ZEN)
234231
#define BUFFER_SIZE (32 << 22)
235232
#else
236-
#define BUFFER_SIZE (32 << 20)
237-
#endif
238-
#else
239233
#define BUFFER_SIZE (32 << BUFFERSIZE)
240234
#endif
241235

exports/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ endif
5555
endif
5656
endif
5757

58+
ifeq ($(C_COMPILER), PGI)
59+
EXTRALIB += -pgf90libs
60+
endif
61+
5862
ifneq (,$(filter 1 2,$(NOFORTRAN)))
5963
FEXTRALIB =
6064
endif

f_check

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ if ($compiler eq "") {
8282
if ($compiler =~ /flang/) {
8383
$vendor = FLANG;
8484
$openmp = "-fopenmp";
85+
} elsif ($compiler =~ /pgf/) {
86+
$vendor = PGI;
87+
$openmp = "-mp";
8588
} else {
8689
$vendor = G77;
8790
$openmp = "";

0 commit comments

Comments
 (0)