-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
76 lines (58 loc) · 1.89 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
#===============================================================================
# Test Makefile
#
#
# Author: Yichao Cheng ([email protected])
# Created on: 2014-10-28
# Last Modified: 2014-10-28
#
#===============================================================================
#-------------------------------------------------------------------------------
# Compilers and flags
#-------------------------------------------------------------------------------
NVCC = "$(shell which nvcc)"
NVCCFLAGS = -G -g -std=c++11
force_x64 = 1
force_sm35 = 1
disable_l1_cache = 0
# CUDA Capability 2.0 or 3.5
GEN_SM20 = -gencode=arch=compute_20,code=\"sm_20,compute_20\"
GEN_SM35 = -gencode=arch=compute_35,code=\"sm_35,compute_35\"
ifneq ($(force_sm35), 1)
NVCCFLAGS += $(GEN_SM20)
else
NVCCFLAGS += $(GEN_SM35)
endif
# Disable L1 cache by "-Xptxas -dlcm=cg" option at compile time can
# reduce over-fetch (e.g, in the case of scattered memory accesses)
ifneq ($(disable_l1_cache), 1)
NVCCFLAGS +=
else
NVCCFLAGS += -Xptxas -dlcm=cg
endif
# 64 or 32 bit (compile with 32-bit device pointers by default)
ifneq ($(force_x64), 1)
NVCCFLAGS += -m32
CCFLAGS += -m32
else
NVCCFLAGS += -m64
CCFLAGS += -m64
endif
#-------------------------------------------------------------------------------
# Directories
#-------------------------------------------------------------------------------
CUDA_INC_DIR = "$(shell dirname $(NVCC))/../include"
CUDA_LIB_DIR = "$(shell dirname $(NVCC))/../lib64"
#-------------------------------------------------------------------------------
# Rules
#-------------------------------------------------------------------------------
OLIVE = $(wildcard *.h)
ALL = BFS PageRank SSSP
TEST = testBFS testPageRank
# testCsrGraph
all: $(ALL) $(TEST)
%: %.cu $(OLIVE)
$(NVCC) -o $@ $< $(NVCCFLAGS) -I$(CUDA_INC_DIR) -L$(CUDA_LIB_DIR) -lcudart
.PHONY: clean
clean:
rm -f $(OBJ_DIR)/*.o