From 2ab3f9b06be5e30dfe49028db550180572963e3c Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 28 Nov 2022 15:08:26 +0100 Subject: [PATCH] Try fixing the makefile --- OpenMP/linear-algebra/kernels/atax/.bench.sh | 4 ++-- OpenMP/linear-algebra/kernels/atax/Makefile | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/OpenMP/linear-algebra/kernels/atax/.bench.sh b/OpenMP/linear-algebra/kernels/atax/.bench.sh index f72b048..752c97c 100755 --- a/OpenMP/linear-algebra/kernels/atax/.bench.sh +++ b/OpenMP/linear-algebra/kernels/atax/.bench.sh @@ -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 diff --git a/OpenMP/linear-algebra/kernels/atax/Makefile b/OpenMP/linear-algebra/kernels/atax/Makefile index c8b4d0d..5975e40 100644 --- a/OpenMP/linear-algebra/kernels/atax/Makefile +++ b/OpenMP/linear-algebra/kernels/atax/Makefile @@ -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: