From 185ab0fc2460c67131348c2134c6fe099040bccf Mon Sep 17 00:00:00 2001 From: Sasha Lopoukhine Date: Mon, 6 Nov 2023 11:46:50 +0000 Subject: [PATCH] build up cycles.csv files by prepending folder names --- kernels/Makefile | 6 ++++++ kernels/Makefile.folders | 25 +++++++++++++++++++++++++ kernels/Makefile.kernels | 2 +- kernels/cycles.csv | 8 ++++++++ kernels/dense/8x8xf64/cycles.csv | 1 + kernels/dense/Makefile | 6 ++++++ kernels/dense/cycles.csv | 1 + kernels/dsum/Makefile | 6 ++++++ kernels/dsum/cycles.csv | 7 +++++++ 9 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 kernels/Makefile create mode 100644 kernels/Makefile.folders create mode 100644 kernels/cycles.csv create mode 100644 kernels/dense/8x8xf64/cycles.csv create mode 100644 kernels/dense/Makefile create mode 100644 kernels/dense/cycles.csv create mode 100644 kernels/dsum/Makefile create mode 100644 kernels/dsum/cycles.csv diff --git a/kernels/Makefile b/kernels/Makefile new file mode 100644 index 00000000..9c07771e --- /dev/null +++ b/kernels/Makefile @@ -0,0 +1,6 @@ + +FOLDERS = +FOLDERS += dense +FOLDERS += dsum + +include ./Makefile.folders diff --git a/kernels/Makefile.folders b/kernels/Makefile.folders new file mode 100644 index 00000000..ce00f080 --- /dev/null +++ b/kernels/Makefile.folders @@ -0,0 +1,25 @@ +.PHONY: + +CYCLES_CSV := cycles.csv + +.DEFAULT_GOAL := $(CYCLES_CSV) + +# Generate the target file by combining the specified files from TESTS +$(CYCLES_CSV): $(addsuffix /cycles.csv,$(FOLDERS)) + rm -f $(CYCLES_CSV) + @echo "Combining CSV files in folders specified in FOLDERS into $@" + @for folder in $(FOLDERS); do \ + (cd $$folder && make cycles.csv) || { echo "Error: make in $$folder failed"; exit 1; }; \ + awk -v folder=$$folder '{print folder "," $$0}' $$folder/cycles.csv >> $@; \ + done + +# Define a pattern rule to ensure each folder's cycles.csv is up-to-date +%/cycles.csv: FORCE + $(MAKE) -C $* + +# This target is used to force the rebuilding of the folders' cycles.csv files +FORCE: + + +clean: + rm -f *.csv diff --git a/kernels/Makefile.kernels b/kernels/Makefile.kernels index e6dc5044..5b7b7208 100644 --- a/kernels/Makefile.kernels +++ b/kernels/Makefile.kernels @@ -23,7 +23,7 @@ CYCLES_CSV := cycles.csv # Generate the target file by combining the specified files from TESTS $(CYCLES_CSV): $(addsuffix .csv, $(basename $(TESTS))) - rm $(CYCLES_CSV) + rm -f $(CYCLES_CSV) @echo "Combining CSV files specified in TESTS into $@" @for file in $(TESTS); do \ filename=$$(basename $$file .x); \ diff --git a/kernels/cycles.csv b/kernels/cycles.csv new file mode 100644 index 00000000..4fd68f88 --- /dev/null +++ b/kernels/cycles.csv @@ -0,0 +1,8 @@ +dense,8x8xf64,linalg,7075 +dsum,8x16xf32,baseline,1202 +dsum,8x16xf32,noalias,1202 +dsum,8x16xf32,ssr1d,253 +dsum,8x16xf32,ssr1d_frep1d,187 +dsum,8x16xf32,ssr2d,273 +dsum,8x16xf32,linalg,1089 +dsum,8x16xf32,scf,1227 diff --git a/kernels/dense/8x8xf64/cycles.csv b/kernels/dense/8x8xf64/cycles.csv new file mode 100644 index 00000000..aec6e58a --- /dev/null +++ b/kernels/dense/8x8xf64/cycles.csv @@ -0,0 +1 @@ +linalg,7075 diff --git a/kernels/dense/Makefile b/kernels/dense/Makefile new file mode 100644 index 00000000..10baaa33 --- /dev/null +++ b/kernels/dense/Makefile @@ -0,0 +1,6 @@ + + +FOLDERS = +FOLDERS += 8x8xf64 + +include ../Makefile.folders diff --git a/kernels/dense/cycles.csv b/kernels/dense/cycles.csv new file mode 100644 index 00000000..f6685dc0 --- /dev/null +++ b/kernels/dense/cycles.csv @@ -0,0 +1 @@ +8x8xf64,linalg,7075 diff --git a/kernels/dsum/Makefile b/kernels/dsum/Makefile new file mode 100644 index 00000000..2b5ee99b --- /dev/null +++ b/kernels/dsum/Makefile @@ -0,0 +1,6 @@ + + +FOLDERS = +FOLDERS += 8x16xf32 + +include ../Makefile.folders diff --git a/kernels/dsum/cycles.csv b/kernels/dsum/cycles.csv new file mode 100644 index 00000000..fb4c4f6e --- /dev/null +++ b/kernels/dsum/cycles.csv @@ -0,0 +1,7 @@ +8x16xf32,baseline,1202 +8x16xf32,noalias,1202 +8x16xf32,ssr1d,253 +8x16xf32,ssr1d_frep1d,187 +8x16xf32,ssr2d,273 +8x16xf32,linalg,1089 +8x16xf32,scf,1227