mirror of
https://github.com/Steffo99/unimore-hpc-assignments.git
synced 2024-11-22 16:14:24 +00:00
Significantly simplify the makefile
This commit is contained in:
parent
da121a4cdc
commit
32850e8131
1 changed files with 6 additions and 10 deletions
|
@ -1,3 +1,6 @@
|
|||
# Remove all make implicit rules because this is already complex enough as it is
|
||||
MAKEFLAGS+= -r
|
||||
|
||||
# -DPOLYBENCH_TIME makes Polybench output the execution time of the program
|
||||
CXXFLAGS+= -DPOLYBENCH_TIME
|
||||
# -O3 applies all compiler optimization, improving from 800ms to 300ms
|
||||
|
@ -13,19 +16,12 @@ NVCC:=$(CUDA_HOME)/bin/nvcc
|
|||
NVCFLAGS:=$(CXXFLAGS) $(NVOPT)
|
||||
|
||||
|
||||
INCPATHS:=-I../../../utilities
|
||||
%.elf: %.cu.o polybench.cu.o
|
||||
$(NVCC) $(NVCFLAGS) $^ -o $@ $(LDFLAGS)
|
||||
|
||||
|
||||
# Create an automake definition for .cu files
|
||||
%.cu.o:
|
||||
%.cu.o: %.cu
|
||||
$(NVCC) $(NVCFLAGS) -c $< -o $@
|
||||
|
||||
%.exe: %.cu.o
|
||||
$(NVCC) $(NVCFLAGS) $(INCPATHS) $^ -o $@ $(LDFLAGS)
|
||||
|
||||
%.elf: %.cu.o
|
||||
$(NVCC) $(NVCFLAGS) $(INCPATHS) $^ -o $@ $(LDFLAGS)
|
||||
|
||||
|
||||
.PHONY: bench
|
||||
|
||||
|
|
Loading…
Reference in a new issue