forked from CIS565-Fall-2013/Performance-Lab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (37 loc) · 1.05 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
CUDA?=/usr/local/cuda
CXX=g++ -DLINUX -w
LIB=lib
ifeq ($(shell uname), Linux)
ifeq ($(shell uname -m), x86_64)
LIB=lib64
endif
endif
PWD?=$(shell pwd)
INCLUDES +=\
-I$(CUDA)/include \
-I/usr/include
LIBRARIES +=\
-L$(CUDA)/$(LIB) -lcuda -lcudart -lnvToolsExt
NVCC=$(CUDA)/bin/nvcc
CUDA_OPTIMISE=-O3
NVCCFLAGS += -ccbin $(CXX) $(ARCH_FLAGS) $(CUDA_DEBUG) $(CUDA_OPTIMISE)\
-gencode=arch=compute_20,code=sm_20 \
-gencode=arch=compute_30,code=sm_30 \
-gencode=arch=compute_35,code=sm_35 \
-lineinfo --machine 64 \
-Xcompiler -fPIC
all: bin/cudaBenchmark bin/transpose bin/reduction Makefile
bin/cudaBenchmark: src/cudaBenchmark.cu
@$(NVCC) $(NVCCFLAGS) $(LIBRARIES) $(INCLUDES) $(DEFINES) $< -o $@
@echo creating $@ from $<
bin/transpose: src/transpose.cu
@$(NVCC) $(NVCCFLAGS) $(LIBRARIES) $(INCLUDES) $(DEFINES) $< -o $@
@echo creating $@ from $<
bin/reduction: src/reduction.cu
@$(NVCC) $(NVCCFLAGS) $(LIBRARIES) $(INCLUDES) $(DEFINES) $< -o $@
@echo creating $@ from $<
.PHONY: clean
clean:
@echo "Cleaning..."
@-rm bin/*
@echo "Complete!"