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

Try fixing the makefile

This commit is contained in:
Steffo 2022-11-28 15:08:26 +01:00
parent 118b18a2a1
commit 2ab3f9b06b
Signed by: steffo
GPG key ID: 6965406171929D01
2 changed files with 14 additions and 9 deletions

View file

@ -6,7 +6,7 @@ run_benchmarks() {
for i in $(seq $runs)
do
exet=$(./atax_acc)
exet=$(./atax.elf)
totalt=$(awk "BEGIN{print $totalt+$exet}")
echo -n "."
# echo "Run #$i: " $(awk "BEGIN{printf(\"%.3g\", $exet)}") "seconds"
@ -43,7 +43,7 @@ do
fi
echo "Flags: $cxxflags"
make --silent "EXTRA_CXXFLAGS=$cxxflags" clean all
make --silent "EXTRA_CXXFLAGS=$cxxflags" "atax.elf"
run_benchmarks
done

View file

@ -1,7 +1,3 @@
-include ../../../utilities/options.mk
-include ../../../utilities/c2.mk
# -DPOLYBENCH_TIME makes Polybench output the execution time of the program
CXXFLAGS+= -DPOLYBENCH_TIME
# -Wall and -Wextra enable more warnings
@ -15,16 +11,25 @@ CXXFLAGS+= ${EXTRA_CXXFLAGS}
# Select the location of the local CUDA install
CUDA_HOME:=/opt/cuda
# Specify the directory of the nvc compiler
NVCC=$(CUDA_HOME)/bin/nvcc
NVCC:=$(CUDA_HOME)/bin/nvcc
# Specify the flags for the nvc compiler
NVCFLAGS:=$(CXXFLAGS) $(NVOPT)
INCPATHS:=-I../../../utilities
# Create an automake definition for .cu files
$(BUILD_DIR)/%.cu.o: %.cu
$(MKDIR_P) $(dir $@)
%.cu.o:
$(NVCC) $(NVCFLAGS) -c $< -o $@
%.exe: %.cu.o
$(NVCC) $(NVCFLAGS) $(INCPATHS) $^ -o $@ $(LDFLAGS)
%.elf: %.cu.o
$(NVCC) $(NVCFLAGS) $(INCPATHS) $^ -o $@ $(LDFLAGS)
.PHONY: bench
bench: