forked from codyjrivera/tsm2x-imp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·50 lines (37 loc) · 1.24 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
CXX := g++
NVCC := nvcc
STD := -std=c++11
CCFLAGS := $(STD) -O3 -g
NVCCFLAGS := $(STD) -O3 -g
SRC_DIR := src
OBJ_DIR := obj
LINKFLAGS := -Wno-deprecated-gpu-targets
# Different Architecture Optimizations
# You may need to modify this for your own GPU setup
DEPLOY := -arch=sm_50 \
-gencode=arch=compute_70,code=sm_70 \
-gencode=arch=compute_70,code=compute_70
# -gencode=arch=compute_50,code=sm_50
# -gencode=arch=compute_52,code=sm_52
# -gencode=arch=compute_60,code=sm_60
# -gencode=arch=compute_61,code=sm_61
MAIN := $(SRC_DIR)/multiply.cu
CUFILES2 := $(SRC_DIR)/kernels.cu
CUFILES1 := $(filter-out $(MAIN), $(CUFILES2) $(wildcard $(SRC_DIR)/*.cu))
CUOBJS2 := $(CUFILES2:$(SRC_DIR)/%.cu=$(OBJ_DIR)/%.o)
CUOBJS1 := $(CUFILES1:$(SRC_DIR)/%.cu=$(OBJ_DIR)/%.o)
OBJS := $(CUOBJS1) $(CUOBJS2)
$(CUOBJS2): NVCCFLAGS += -rdc=true $(DEPLOY)
$(CUOBJS1): NVCCFLAGS +=
all: ; @$(MAKE) multiply gen print -j
multiply: $(OBJS)
$(NVCC) $(NVCCFLAGS) -lcublas -lcudart $(DEPLOY) $(LINKFLAGS) $(MAIN) -rdc=true $^ -o $@
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cu
$(NVCC) $(NVCCFLAGS) -c $< -o $@
gen: gen.cpp
$(CXX) $(CCFLAGS) $< -o $@
print: print.cpp
$(CXX) $(CCFLAGS) $< -o $@
.PHONY: clean
clean:
$(RM) $(OBJS) multiply gen print