-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (22 loc) · 670 Bytes
/
Makefile
File metadata and controls
30 lines (22 loc) · 670 Bytes
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
NVCC = nvcc
ifeq (,$(shell which nvprof))
NVCC_FLAGS = -O3
else
NVCC_FLAGS = -O3 --std=c++03
endif
LD_FLAGS = -lcudart
EXE = reduction
OBJ = main.o support.o
default: naive optimized
main-optimized.o: main.cu kernel.cu support.h
$(NVCC) -c -o $@ main.cu $(NVCC_FLAGS) -DOPTIMIZED
main.o: main.cu kernel.cu support.h
$(NVCC) -c -o $@ main.cu $(NVCC_FLAGS)
support.o: support.cu support.h
$(NVCC) -c -o $@ support.cu $(NVCC_FLAGS)
naive: $(OBJ)
$(NVCC) $(OBJ) -o $(EXE) $(LD_FLAGS)
optimized: main-optimized.o support.o
$(NVCC) main-optimized.o support.o -o $(EXE)-optimized $(LD_FLAGS)
clean:
rm -rf *.o $(EXE) $(EXE)-optimized