Skip to content

Commit 1573dc6

Browse files
committed
counter_analysis_toolkit: add CMake support
To accommodate different instruction sets and precisions available in modern architectures, these changes add CMake as a more flexible build system for the Counter Analysis Toolkit. These changes have been tested on the Intel Sapphire Rapids architecture.
1 parent c6a23b3 commit 1573dc6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+562
-50
lines changed

src/counter_analysis_toolkit/CMakeLists.txt

Lines changed: 494 additions & 0 deletions
Large diffs are not rendered by default.

src/counter_analysis_toolkit/README

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 44 additions & 0 deletions

src/counter_analysis_toolkit/replicate.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
PAPIDIR?=${PAPI_DIR}
1+
PAPI_DIR?=${PAPI_DIR}
22
USEMPI?=false
3-
LDFLAGS=-L$(PAPIDIR)/lib -lpapi -lm -lpthread -ldl -lrt
4-
INCFLAGS=-I$(PAPIDIR)/include
3+
LDFLAGS=-L$(PAPI_DIR)/lib -lpapi -lm -lpthread -ldl -lrt
4+
INCFLAGS=-I$(PAPI_DIR)/include
55
CFLAGS+=-g -Wall -Wextra
66
OPT0=-O0
77
OPT1=-O1
@@ -62,11 +62,11 @@ ifeq ($(ARCH),ARM)
6262
endif
6363

6464
all: branch.o d_cache eventstock.o flops i_cache instr vector
65-
make cat_collect PAPIDIR=$(PAPIDIR)
65+
make cat_collect PAPI_DIR=$(PAPI_DIR)
6666

6767
d_cache: timing_kernels.o prepareArray.o compar.o dcache.o
6868

69-
i_cache: icache.o icache_seq_kernel_0.o
69+
i_cache: icache.o icache_seq_kernel.o
7070

7171
vector: weak_symbols.o vec.o vec_scalar_verify.o $(VECSRC)
7272

@@ -92,15 +92,15 @@ flops: flops.c flops.h cat_arch.h
9292
$(CC) $(CFLAGS) $(FLOP) $(OPT1) $(INCFLAGS) -c flops.c -o flops.o
9393

9494
icache.o: icache.c icache.h
95-
bash gen_seq_dlopen.sh
95+
bash gen_seq_dlopen.sh ${PWD}
9696
$(CC) $(CFLAGS) $(OPT0) $(INCFLAGS) -c icache.c -o icache.o
9797

98-
icache_seq_kernel_0.o: icache_seq.c icache_seq.h
98+
icache_seq_kernel.o: icache_seq.c icache_seq.h icache_seq_kernel.c
9999
$(CC) $(CFLAGS) $(OPT0) $(INCFLAGS) -c icache_seq.c -o icache_seq.o
100-
$(CC) $(CFLAGS) $(OPT0) $(INCFLAGS) -fPIC -c icache_seq_kernel.c -o icache_seq_kernel_0.o
101-
$(CC) $(CFLAGS) $(OPT0) -shared -o icache_seq_kernel_0.so icache_seq_kernel_0.o
102-
bash replicate.sh
103-
rm icache_seq_kernel_0.o
100+
$(CC) $(CFLAGS) $(OPT0) $(INCFLAGS) -fPIC -c icache_seq_kernel.c -o icache_seq_kernel.o
101+
$(CC) $(CFLAGS) $(OPT0) -shared -o icache_seq_kernel_0.so icache_seq_kernel.o
102+
bash replicate.sh ${PWD}
103+
rm ${PWD}/icache_seq_kernel.o
104104

105105
instr: instructions.c instr.h
106106
-$(CC) -c $(CFLAGS) $(OPT2) -ftree-vectorize $(FLOP) $(INSTR) $(INCFLAGS) instructions.c -o instructions.o
File renamed without changes.

0 commit comments

Comments
 (0)