1
Fork 0
mirror of https://github.com/Steffo99/unimore-hpc-assignments.git synced 2024-11-23 00:24:23 +00:00

Significantly simplify the makefile

This commit is contained in:
Steffo 2022-11-28 16:22:38 +01:00
parent da121a4cdc
commit 32850e8131
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -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 # -DPOLYBENCH_TIME makes Polybench output the execution time of the program
CXXFLAGS+= -DPOLYBENCH_TIME CXXFLAGS+= -DPOLYBENCH_TIME
# -O3 applies all compiler optimization, improving from 800ms to 300ms # -O3 applies all compiler optimization, improving from 800ms to 300ms
@ -13,19 +16,12 @@ NVCC:=$(CUDA_HOME)/bin/nvcc
NVCFLAGS:=$(CXXFLAGS) $(NVOPT) NVCFLAGS:=$(CXXFLAGS) $(NVOPT)
INCPATHS:=-I../../../utilities %.elf: %.cu.o polybench.cu.o
$(NVCC) $(NVCFLAGS) $^ -o $@ $(LDFLAGS)
%.cu.o: %.cu
# Create an automake definition for .cu files
%.cu.o:
$(NVCC) $(NVCFLAGS) -c $< -o $@ $(NVCC) $(NVCFLAGS) -c $< -o $@
%.exe: %.cu.o
$(NVCC) $(NVCFLAGS) $(INCPATHS) $^ -o $@ $(LDFLAGS)
%.elf: %.cu.o
$(NVCC) $(NVCFLAGS) $(INCPATHS) $^ -o $@ $(LDFLAGS)
.PHONY: bench .PHONY: bench