Skip to content

Commit

Permalink
Merge pull request #79 from opencompl/sasha/makefiles-cycles
Browse files Browse the repository at this point in the history
build up cycles.csv files by prepending folder names
  • Loading branch information
superlopuh authored Nov 6, 2023
2 parents 4eb5a48 + 185ab0f commit c5f79ad
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 1 deletion.
6 changes: 6 additions & 0 deletions kernels/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

FOLDERS =
FOLDERS += dense
FOLDERS += dsum

include ./Makefile.folders
25 changes: 25 additions & 0 deletions kernels/Makefile.folders
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion kernels/Makefile.kernels
Original file line number Diff line number Diff line change
Expand Up @@ -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); \
Expand Down
8 changes: 8 additions & 0 deletions kernels/cycles.csv
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions kernels/dense/8x8xf64/cycles.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
linalg,7075
6 changes: 6 additions & 0 deletions kernels/dense/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@


FOLDERS =
FOLDERS += 8x8xf64

include ../Makefile.folders
1 change: 1 addition & 0 deletions kernels/dense/cycles.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8x8xf64,linalg,7075
6 changes: 6 additions & 0 deletions kernels/dsum/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@


FOLDERS =
FOLDERS += 8x16xf32

include ../Makefile.folders
7 changes: 7 additions & 0 deletions kernels/dsum/cycles.csv
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c5f79ad

Please sign in to comment.