-
Notifications
You must be signed in to change notification settings - Fork 1
/
MakefileBase
81 lines (65 loc) · 2.13 KB
/
MakefileBase
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
NVCC:=nvcc
CC:=g++
#SM=70
graph_ft_load=0
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
CFLAGS = -g -Ddebug -std=c++14 -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}
CFLAGS = -O3 -std=c++14 -Wextra -Wall -DMULTIPHASE -DPRINT -DNGPU=${NGPU}
endif
ifeq ($(check),1)
CUFLAGS += -DCHECK
CFLAGS += -DCHECK
endif
ifeq ($(graph_ft_load),1)
CUFLAGS += -DGRAPH_FT_LOAD=4
CFLAGS += -DGRAPH_FT_LOAD=4
else
CUFLAGS += -DGRAPH_FT_LOAD=2
CFLAGS += -DGRAPH_FT_LOAD=2
endif
ifeq ($(bit),32)
CUFLAGS += -DUSE_32BIT
CFLAGS += -DUSE_32BIT
else ifeq ($(bit),64)
CUFLAGS += -DUSE_64BIT
CFLAGS += -DUSE_64BIT
else
CUFLAGS += -DUSE_64BIT
CFLAGS += -DUSE_64BIT
endif
EXE:= run_${NGPU}_${SM}
all: ${EXE}
graph.o: graph.cpp graph.hpp types.hpp
${NVCC} -x cu ${CUFLAGS} -dc -c $< -o $@
graph_gpu.o: graph_gpu.cpp graph_gpu.hpp cuda_wrapper.hpp types.hpp
${NVCC} -x cu ${CUFLAGS} -dc -c $< -o $@
louvain_gpu.o: louvain_gpu.cpp louvain_gpu.hpp cuda_wrapper.hpp types.hpp
${NVCC} -x cu ${CUFLAGS} -dc -c $< -o $@
main.o: main.cpp graph.hpp graph_gpu.hpp cuda_wrapper.hpp types.hpp louvain_gpu.hpp
${NVCC} -x cu ${CUFLAGS} -dc -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
${NVCC} -x cu ${CUFLAGS} -dc -c $< -o $@
clustering.o: clustering.cpp clustering.hpp types.hpp
${NVCC} -x cu ${CUFLAGS} -dc -c $< -o $@
ifeq ($(check),1)
graph_cpu.o: graph_cpu.cpp graph_cpu.hpp
${NVCC} -x cu ${CUFLAGS} -dc -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
${NVCC} ${CUFLAGS} $^ -o $@
else
${EXE}: graph_gpu.o graph_cuda.o graph.o louvain_gpu.o main.o heap.o clustering.o
${NVCC} ${CUFLAGS} $^ -o $@
endif
clean:
rm -f *.o ${EXE}