-
Notifications
You must be signed in to change notification settings - Fork 2
/
MakefileBaseNVHPC
85 lines (67 loc) · 2.2 KB
/
MakefileBaseNVHPC
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
NVCC:=nvcc
CXX:=nvc++
#SM=70
#NGPU=1
# NUMA nodes
NSOCKETS=2
graph_ft_load=1
use_par_exec_policy=1
check=0
debug=0
ifeq ($(debug), 1)
CUFLAGS = -g -G -Ddebug --std=c++14 --gpu-architecture=compute_${SM} --gpu-code=sm_${SM},compute_${SM} \
-Xcompiler -fopenmp -DMULTIPHASE -DNGPU=1 -DPRINT
CXXFLAGS = -g -Ddebug -mcmodel=medium -Wextra -Wall -DMULTIPHASE -DNGPU=1 -DPRINT
else
CUFLAGS = -O3 -Xptxas -O3 --std=c++14 --gpu-architecture=compute_${SM} --gpu-code=sm_${SM},compute_${SM} \
-Xcompiler -O3 -Xcompiler -fopenmp -DMULTIPHASE -DPRINT -DNGPU=${NGPU}
CXXFLAGS = -O3 -mcmodel=medium -fopenmp -Wextra -Wall -DMULTIPHASE -DPRINT -DNGPU=${NGPU}
endif
ifeq ($(use_par_exec_policy), 1)
CXXFLAGS += -DUSE_PAR_EXEC_POLICY
endif
ifeq ($(check),1)
CUFLAGS += -DCHECK
CXXFLAGS += -DCHECK
endif
CUFLAGS += -DGRAPH_FT_LOAD=${NSOCKETS}
CXXFLAGS += -DGRAPH_FT_LOAD=${NSOCKETS}
ifeq ($(bit),32)
CUFLAGS += -DUSE_32BIT
CXXFLAGS += -DUSE_32BIT
else ifeq ($(bit),64)
CUFLAGS += -DUSE_64BIT
CXXFLAGS += -DUSE_64BIT
else
CUFLAGS += -DUSE_64BIT
CXXFLAGS += -DUSE_64BIT
endif
EXE:= run_${NGPU}_${SM}
all: ${EXE}
graph.o: graph.cpp graph.hpp types.hpp
${CXX} -cuda ${CXXFLAGS} -c $< -o $@
graph_gpu.o: graph_gpu.cpp graph_gpu.hpp cuda_wrapper.hpp types.hpp
${CXX} -cuda ${CXXFLAGS} -c $< -o $@
louvain_gpu.o: louvain_gpu.cpp louvain_gpu.hpp cuda_wrapper.hpp types.hpp
${CXX} -cuda ${CXXFLAGS} -c $< -o $@
main.o: main.cpp graph.hpp graph_gpu.hpp cuda_wrapper.hpp types.hpp louvain_gpu.hpp
${CXX} -cuda ${CXXFLAGS} -c $< -o $@
graph_cuda.o: graph_cuda.cu graph_cuda.hpp graph.cpp graph.hpp
${NVCC} ${CUFLAGS} -c $< -o $@
heap.o : heap.cpp heap.hpp types.hpp
${CXX} -cuda ${CXXFLAGS} -c $< -o $@
clustering.o: clustering.cpp clustering.hpp types.hpp
${CXX} -cuda ${CXXFLAGS} -c $< -o $@
ifeq ($(check),1)
graph_cpu.o: graph_cpu.cpp graph_cpu.hpp
${CXX} -cuda ${CXXFLAGS} -c $< -o $@
endif
ifeq ($(check),1)
${EXE}: graph_gpu.o graph_cuda.o graph.o louvain_gpu.o main.o heap.o clustering.o graph_cpu.o
${CXX} -cuda ${CXXFLAGS} $^ -o $@
else
${EXE}: graph_gpu.o graph_cuda.o graph.o louvain_gpu.o main.o heap.o clustering.o
${CXX} -cuda ${CXXFLAGS} $^ -o $@
endif
clean:
rm -f *.o ${EXE}