diff options
-rw-r--r-- | SpMV/baselines/cpu/Makefile | 10 | ||||
-rwxr-xr-x | SpMV/baselines/cpu/run-perf.sh | 6 |
2 files changed, 15 insertions, 1 deletions
diff --git a/SpMV/baselines/cpu/Makefile b/SpMV/baselines/cpu/Makefile index 5b2367b..a24b764 100644 --- a/SpMV/baselines/cpu/Makefile +++ b/SpMV/baselines/cpu/Makefile @@ -1,7 +1,15 @@ +native ?= 1 + +CFLAGS = + +ifeq (${native}, 1) + CFLAGS += -march=native +endif + all: spmv spmv: app.c - gcc -Wall -Wextra -pedantic -march=native -O2 -o spmv -fopenmp app.c + gcc -Wall -Wextra -pedantic ${CFLAGS} -O3 -o spmv -fopenmp app.c spmv_O0: app.c gcc -o spmv_O0 -fopenmp app.c diff --git a/SpMV/baselines/cpu/run-perf.sh b/SpMV/baselines/cpu/run-perf.sh new file mode 100755 index 0000000..714498d --- /dev/null +++ b/SpMV/baselines/cpu/run-perf.sh @@ -0,0 +1,6 @@ +#!/bin/zsh + +make -B + +OMP_NUM_THREADS=1 perf stat record -o t1.perf -e ${(j:,:):-$(grep -v '^#' ../../../perf-events.txt | cut -d ' ' -f 1)} make run +OMP_NUM_THREADS=4 perf stat record -o t4.perf -e ${(j:,:):-$(grep -v '^#' ../../../perf-events.txt | cut -d ' ' -f 1)} make run |