2022-11-28 16:22:38 +01:00
|
|
|
# Remove all make implicit rules because this is already complex enough as it is
|
|
|
|
MAKEFLAGS+= -r
|
|
|
|
|
2022-11-16 17:04:50 +01:00
|
|
|
# -DPOLYBENCH_TIME makes Polybench output the execution time of the program
|
2022-11-28 16:10:47 +01:00
|
|
|
CXXFLAGS+= -DPOLYBENCH_TIME
|
2022-11-16 01:43:59 +01:00
|
|
|
# -O3 applies all compiler optimization, improving from 800ms to 300ms
|
2022-11-28 16:11:00 +01:00
|
|
|
CXXFLAGS+= -O3
|
2022-11-17 02:59:31 +01:00
|
|
|
# Extend CFLAGS with command line parameters
|
2022-11-28 14:37:37 +01:00
|
|
|
CXXFLAGS+= ${EXTRA_CXXFLAGS}
|
|
|
|
|
|
|
|
# Select the location of the local CUDA install
|
2022-11-29 08:22:51 -05:00
|
|
|
CUDA_HOME:=/usr/local/cuda-10.0
|
2022-11-28 14:37:37 +01:00
|
|
|
# Specify the directory of the nvc compiler
|
2022-11-28 15:08:26 +01:00
|
|
|
NVCC:=$(CUDA_HOME)/bin/nvcc
|
2022-11-28 14:37:37 +01:00
|
|
|
# Specify the flags for the nvc compiler
|
|
|
|
NVCFLAGS:=$(CXXFLAGS) $(NVOPT)
|
2022-11-16 17:06:16 +01:00
|
|
|
|
2022-11-16 17:09:27 +01:00
|
|
|
|
2022-11-28 16:22:38 +01:00
|
|
|
%.elf: %.cu.o polybench.cu.o
|
|
|
|
$(NVCC) $(NVCFLAGS) $^ -o $@ $(LDFLAGS)
|
2022-11-28 15:08:26 +01:00
|
|
|
|
2022-11-28 16:22:38 +01:00
|
|
|
%.cu.o: %.cu
|
2022-11-28 14:41:35 +01:00
|
|
|
$(NVCC) $(NVCFLAGS) -c $< -o $@
|
2022-11-17 02:59:31 +01:00
|
|
|
|
2022-11-28 15:08:26 +01:00
|
|
|
|
2022-11-28 16:26:14 +01:00
|
|
|
.PHONY: bench clean
|
2022-11-16 17:09:27 +01:00
|
|
|
|
|
|
|
bench:
|
2022-11-16 17:39:09 +01:00
|
|
|
./.bench.sh
|
2022-11-28 16:26:14 +01:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm *.elf *.cu.o
|