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)
|
for i in $(seq $runs)
|
||||||
do
|
do
|
||||||
exet=$(./atax_acc)
|
exet=$(./atax.elf)
|
||||||
totalt=$(awk "BEGIN{print $totalt+$exet}")
|
totalt=$(awk "BEGIN{print $totalt+$exet}")
|
||||||
echo -n "."
|
echo -n "."
|
||||||
# echo "Run #$i: " $(awk "BEGIN{printf(\"%.3g\", $exet)}") "seconds"
|
# echo "Run #$i: " $(awk "BEGIN{printf(\"%.3g\", $exet)}") "seconds"
|
||||||
|
@ -43,7 +43,7 @@ do
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Flags: $cxxflags"
|
echo "Flags: $cxxflags"
|
||||||
make --silent "EXTRA_CXXFLAGS=$cxxflags" clean all
|
make --silent "EXTRA_CXXFLAGS=$cxxflags" "atax.elf"
|
||||||
|
|
||||||
run_benchmarks
|
run_benchmarks
|
||||||
done
|
done
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
-include ../../../utilities/options.mk
|
|
||||||
-include ../../../utilities/c2.mk
|
|
||||||
|
|
||||||
|
|
||||||
# -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
|
||||||
# -Wall and -Wextra enable more warnings
|
# -Wall and -Wextra enable more warnings
|
||||||
|
@ -15,16 +11,25 @@ CXXFLAGS+= ${EXTRA_CXXFLAGS}
|
||||||
# Select the location of the local CUDA install
|
# Select the location of the local CUDA install
|
||||||
CUDA_HOME:=/opt/cuda
|
CUDA_HOME:=/opt/cuda
|
||||||
# Specify the directory of the nvc compiler
|
# Specify the directory of the nvc compiler
|
||||||
NVCC=$(CUDA_HOME)/bin/nvcc
|
NVCC:=$(CUDA_HOME)/bin/nvcc
|
||||||
# Specify the flags for the nvc compiler
|
# Specify the flags for the nvc compiler
|
||||||
NVCFLAGS:=$(CXXFLAGS) $(NVOPT)
|
NVCFLAGS:=$(CXXFLAGS) $(NVOPT)
|
||||||
|
|
||||||
|
|
||||||
|
INCPATHS:=-I../../../utilities
|
||||||
|
|
||||||
|
|
||||||
# Create an automake definition for .cu files
|
# Create an automake definition for .cu files
|
||||||
$(BUILD_DIR)/%.cu.o: %.cu
|
%.cu.o:
|
||||||
$(MKDIR_P) $(dir $@)
|
|
||||||
$(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
|
||||||
|
|
||||||
bench:
|
bench:
|
||||||
|
|
Loading…
Reference in a new issue