-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
180 lines (147 loc) · 4.09 KB
/
Makefile
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
#===============================================================================
# Compiler Options
#===============================================================================
COMPILER = fujitsu
OPTIMIZE = yes
DEBUG = no
PROFILE = no
SM = cc70 # --- NVIDIA arch
ARCH = gfx90a # --- AMD arch
ENABLE_OMP_OFFLOAD = 0
SAVE_TEMP = 0
#===============================================================================
# Program name & source code list
#===============================================================================
OBJ = main.o
SRC = main.cpp
TARGET = louvain_omp_$(COMPILER)
#===============================================================================
# Sets Flags
#===============================================================================
# Standard Flags
CFLAGS := -std=c++11 #-Wall
# Linker Flags
LDFLAGS = -lm
OPTFLAGS = -DPRINT_DIST_STATS -DPRINT_EXTRA_NEDGES
# Fujitsu Compiler
ifeq ($(COMPILER),fujitsu)
CC = FCC
CFLAGS +=-Kfast -Kopenmp -march=armv8.2-a -mcpu=a64fx #-DZFILL_CACHE_LINES
endif
# ARM Compiler
ifeq ($(COMPILER),armcpu)
CC = armclang++
CFLAGS +=-Ofast -fopenmp -mcpu=a64fx #-DZFILL_CACHE_LINES
endif
ifeq ($(COMPILER),gnucpu)
CC = g++
CFLAGS +=-O3 -fopenmp #-DZFILL_CACHE_LINES
endif
# GCC Compiler
ifeq ($(COMPILER),gnu)
CC = g++
ifeq ($(ENABLE_OMP_OFFLOAD),1)
CFLAGS += -O3 -fopenmp -flto
endif
endif
# Intel Compiler
ifeq ($(COMPILER),intel)
CC = icpx
ifeq ($(ENABLE_OMP_OFFLOAD),1)
CFLAGS += -fiopenmp -fopenmp-targets=spir64 -D__STRICT_ANSI__
endif
endif
# LLVM Clang Compiler
ifeq ($(COMPILER),llvm_nv)
CC = clang++
ifeq ($(ENABLE_OMP_OFFLOAD),1)
CFLAGS += -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -fopenmp-cuda-mode
#CFLAGS += -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target --cuda-path=${OLCF_CUDA_ROOT} -Xcuda-ptxas --maxrregcount=60 -fopenmp-cuda-mode
#CFLAGS += -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target --cuda-path=${OLCF_CUDA_ROOT} -fopenmp-new-driver -foffload-lto
#CFLAGS += -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -Xopenmp-target --cuda-path=${OLCF_CUDA_ROOT} -Xcuda-ptxas --maxrregcount=120 -fopenmp-new-driver -foffload-lto -fopenmp-assume-no-thread-state
endif
endif
# IBM XL Compiler
ifeq ($(COMPILER),xl)
CC = xlC
ifeq ($(ENABLE_OMP_OFFLOAD),1)
CFLAGS += -qsmp=omp -qoffload -qstrict
endif
endif
# NVIDIA NVHPC Compiler
ifeq ($(COMPILER),nvhpc)
CC = nvc++
ifeq ($(ENABLE_OMP_OFFLOAD),1)
#CFLAGS += -mp=gpu -gpu=managed
CFLAGS += -mp=gpu -gpu=${SM}
#CFLAGS += -mp=gpu -Minfo=mp -gpu=${SM}
endif
endif
# AOMP Compiler
ifeq ($(COMPILER),llvm_amd)
CC = clang++
ifeq ($(ENABLE_OMP_OFFLOAD),1)
CFLAGS += -fopenmp -fopenmp-targets=amdgcn-amd-amdhsa -Xopenmp-target=amdgcn-amd-amdhsa -march=${ARCH}
endif
endif
# Debug Flags
ifeq ($(DEBUG),yes)
CFLAGS += -g
LDFLAGS += -g
endif
# Profiling Flags
ifeq ($(PROFILE),yes)
CFLAGS += -pg
LDFLAGS += -pg
endif
# Optimization Flags
ifeq ($(OPTIMIZE),yes)
CFLAGS += #-O3
endif
# Using device offload
ifeq ($(ENABLE_OMP_OFFLOAD),1)
CFLAGS += -DUSE_OMP_OFFLOAD
else
CFLAGS += -DGRAPH_FT_LOAD=4 #-I/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/
endif
# Compiler Trace
ifeq ($(SAVE_TEMPS),1)
CFLAGS += -save-temps
endif
# Team size
ifeq ($(ENABLE_OMP_OFFLOAD),1)
TS=32
ifeq ($(TS), 16)
OPTFLAGS += -DTS16
else ifeq ($(TS), 32)
OPTFLAGS += -DTS32
else ifeq ($(TS), 64)
OPTFLAGS += -DTS64
else ifeq ($(TS), 128)
OPTFLAGS += -DTS128
else ifeq ($(TS), 256)
OPTFLAGS += -DTS256
else ifeq ($(TS), 512)
OPTFLAGS += -DTS512
else
OPTFLAGS += -DTS32
endif
TARGET := $(TARGET)_$(TS)
endif
#===============================================================================
# Targets to Build
#===============================================================================
#$(LDAPP) $(CXX) $(CXXFLAGS_THREADS) -o $@ $+ $(LDFLAGS) $(CXXFLAGS)
CFLAGS += -I. $(OPTFLAGS)
OBJS = $(OBJ)
TARGETS = $(TARGET)
all: $(TARGETS)
$(TARGET): $(OBJ)
$(CC) $(CFLAGS) -o $@ $+ $(LDFLAGS)
$(OBJ): $(SRC)
$(CC) $(INCLUDE) $(CFLAGS) -c $< -o $@
.PHONY: clean
clean:
rm -rf *~ *.dSYM nc.vg.* $(OBJS) $(TARGETS)
run:
./$(TARGET) -n 1000