-
Notifications
You must be signed in to change notification settings - Fork 109
/
make.defs.pgi
144 lines (143 loc) · 4.01 KB
/
make.defs.pgi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#
# This file shows the PGI toolchain options for PRKs.
#
# Base compilers and language options
#
# C99 is required in some implementations.
CC=pgcc -c11
# All of the Fortran code is written for the 2008 standard and requires preprocessing.
FC=pgfortran -Mpreprocess -Mfreeform
#FC=/opt/llvm/pgi-flang/bin/flang -Mpreprocess -Wl,-rpath=/opt/llvm/pgi-flang/lib
# C++11 may not be required but does no harm here.
CXX=pgc++ --c++17
#
# Compiler flags
#
DEFAULT_OPT_FLAGS=-O2 -tp=haswell
#
# OpenMP flags
#
OPENMPFLAG=-mp #-Minfo=mp,vect
OPENMPSIMDFLAG=-mp #-Minfo=mp,vect
OFFLOADFLAG=-mp -ta=multicore #-Minfo=mp,vect
OFFLOADFLAG+=-DGPU_SCHEDULE=""
OPENACCFLAG=-acc -ta=multicore #-Minfo=accel
#OPENACCFLAG=-acc -ta=tesla:cc70 -Minfo=accel
OPENACCFLAG+=-Mlarge_arrays
#
# OpenCL flags
#
# MacOS
#OPENCLFLAG=-framework OpenCL
# Linux
OPENCLDIR=/etc/alternatives/opencl-intel-tools
OPENCLFLAG=-I${OPENCLDIR} -L${OPENCLDIR}/lib64 -lOpenCL
#
# SYCL flags
#
# triSYCL
# https://github.com/triSYCL/triSYCL is header-only so just clone in Cxx11 directory...
SYCLDIR=./triSYCL
SYCLCXX=${CXX} ${OPENMPFLAG} $(DEFAULT_OPT_FLAGS)
SYCLFLAG=-I$(SYCLDIR)/include
#
# OCCA
#
#OCCADIR=${HOME}/prk-repo/Cxx11/occa
#
# TBB
#
TBBDIR=./tbb
TBBFLAG=-I${TBBDIR}/include -L${TBBDIR}/lib -ltbb
#
# Parallel STL, Boost, etc.
#
BOOSTFLAG=-I.
RANGEFLAG=-DUSE_BOOST_IRANGE ${BOOSTFLAG}
#RANGEFLAG=-DUSE_RANGES_TS -I./range-v3/include
PSTLFLAG=${OPENMPSIMDFLAG} ${TBBFLAG} -I./pstl/include ${RANGEFLAG}
KOKKOSDIR=/opt/kokkos/pgi
KOKKOSFLAG=-I${KOKKOSDIR}/include -L${KOKKOSDIR}/lib -lkokkos ${OPENMPFLAG} -ldl
RAJADIR=/opt/raja/pgi
RAJAFLAG=-I${RAJADIR}/include -L${RAJADIR}/lib -lRAJA ${OPENMPFLAG} ${TBBFLAG}
THRUSTDIR=/opt/nvidia/thrust
THRUSTFLAG=-I${THRUSTDIR} ${RANGEFLAG}
#
# CBLAS for C++ DGEMM
#
BLASFLAG=
CBLASFLAG=
#
# CUDA flags
#
# Linux w/ NVIDIA CUDA
# NVCC never supports the latest GCC.
# Use appropriate arch or code is compiled to ancient features.
#NVCC=nvcc --compiler-bindir=<path to older GCC> --gpu-architecture=sm_61
NVCC=nvcc
CUDAFLAGS=-g -O3 -std=c++11
CUDAFLAGS+=--gpu-architecture=sm_70
# https://github.com/tensorflow/tensorflow/issues/1066#issuecomment-200574233
# heavy hammer:
#CUDAFLAGS+=-D_X86INTRIN_H_INCLUDED
# big hammers:
#CUDAFLAGS+=-D_IMMINTRIN_H_INCLUDED
#CUDAFLAGS+=-D_FMA4INTRIN_H_INCLUDED
#CUDAFLAGS+=-D_XOPMMINTRIN_H_INCLUDED
# many tiny hammers:
#CUDAFLAGS+=-D_MWAITXINTRIN_H_INCLUDED
#CUDAFLAGS+=-D_AVX512FINTRIN_H_INCLUDED
#CUDAFLAGS+=-D_AVX512VLINTRIN_H_INCLUDED
#CUDAFLAGS+=-D_AVX512BWINTRIN_H_INCLUDED
#CUDAFLAGS+=-D_AVX512DQINTRIN_H_INCLUDED
#CUDAFLAGS+=-D_AVX512VLBWINTRIN_H_INCLUDED
#CUDAFLAGS+=-D_AVX512VBMIVLINTRIN_H_INCLUDED
#CUDAFLAGS+=-D_AVX512VBMIINTRIN_H_INCLUDED
#CUDAFLAGS+=-D_AVX512VLDQINTRIN_H_INCLUDED
#CUDAFLAGS+=-D_AVX512CDINTRIN_H_INCLUDED
#CUDAFLAGS+=-D_AVX512PFINTRIN_H_INCLUDED
#CUDAFLAGS+=-D_AVX512IFMAINTRIN_H_INCLUDED
#CUDAFLAGS+=-D_AVX512IFMAVLINTRIN_H_INCLUDED
#CUDAFLAGS+=-D_AVX512ERINTRIN_H_INCLUDED
#
# MPI-3
#
# We assume you have Intel MPI and have setup your environment with e.g.
# . /opt/intel/compilers_and_libraries/linux/mpi/intel64/bin/mpivars.sh
# in your .bashrc.
#
# mpiicc wraps icc. mpicc and mpigcc wrap gcc.
MPIDIR=
MPICC=${MPIDIR}/bin/mpicc
MPICXX=${MPIDIR}/bin/mpicxx
MPIINC=-I${MPIDIR}/include
MPILIB=-L${MPIDIR}/lib -lmpi
#MPILIB=-L/usr/local/opt/libevent/lib -L${MPIDIR}/lib -lmpi
#MPIINC=-I/usr/include/mpich-3.2-x86_64
#MPILIB=-L/usr/lib64/mpich-3.2/lib -lmpi
#
# Global Arrays
#
GADIR=../deps/ga
GAFLAG=-I${GADIR}/include
GAFLAG+=-L${GADIR}/lib -lga
GAFLAG+=-L${GADIR}/../armci-mpi/lib -larmci # ARMCI-MPI
#GAFLAG+=-L${GADIR}/lib -larmci -lcomex # ARMCI/ComEx
GAFLAG+=${MPIINC} ${MPILIB}
GAFLAG+=-lmpifort -lmpi
GAFLAG+=-i8 # GA is compiled with -i8 on 64-bit systems
#
# PETSc
#
PETSCDIR=../deps/petsc
PETSCFLAG=-I${PETSCDIR}/include
PETSCFLAG+=-L${PETSCDIR}/lib -lpetsc
PETSCFLAG+=-Wl,-rpath=${PETSCDIR}/lib
#
# Fortran 2008 coarrays
#
# see https://github.com/ParRes/Kernels/blob/master/FORTRAN/README.md for details
# single-node
#COARRAYFLAG=-fcoarray=single -lcaf_single
# multi-node
# COARRAYFLAG=-fcoarray=lib -lcaf_mpi