mirror of
https://github.com/Steffo99/unimore-hpc-assignments.git
synced 2024-11-26 01:54:22 +00:00
Try fixing the makefile
This commit is contained in:
parent
118b18a2a1
commit
2ab3f9b06b
2 changed files with 14 additions and 9 deletions
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue