aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/xor_and_mat
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-06-06 12:01:53 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-06-06 12:01:53 +0200
commit33cc0aeef68f3adbb51484dbeafccfca5735f8ee (patch)
treee2085af4c0119e0727fd4cd613f92d75de263316 /test/monniaux/xor_and_mat
parent61e43b19a3fa145a91f3697349f032de73edc779 (diff)
downloadcompcert-kvx-33cc0aeef68f3adbb51484dbeafccfca5735f8ee.tar.gz
compcert-kvx-33cc0aeef68f3adbb51484dbeafccfca5735f8ee.zip
some more benchmarks
Diffstat (limited to 'test/monniaux/xor_and_mat')
-rw-r--r--test/monniaux/xor_and_mat/Makefile35
-rw-r--r--test/monniaux/xor_and_mat/int_mat_run.c32
-rw-r--r--test/monniaux/xor_and_mat/make.proto3
3 files changed, 44 insertions, 26 deletions
diff --git a/test/monniaux/xor_and_mat/Makefile b/test/monniaux/xor_and_mat/Makefile
index 005382de..be4d8158 100644
--- a/test/monniaux/xor_and_mat/Makefile
+++ b/test/monniaux/xor_and_mat/Makefile
@@ -1,21 +1,36 @@
+
include ../rules.mk
-PRODUCTS=int_mat.host int_mat.gcc.k1c.out int_mat.ccomp.k1c.out int_mat.ccomp.k1c.s int_mat.gcc.k1c.s int_mat.gcc.k1c int_mat.ccomp.k1c
-all: $(PRODUCTS)
+src=int_mat_run.c int_mat.c
-int_mat.host: int_mat.c int_mat_run.c xor_and.h
- $(CC) $(CFLAGS) int_mat.c int_mat_run.c -o $@
+PRODUCTS?=xor_and_mat.gcc.host xor_and_mat.ccomp.host xor_and_mat.gcc.k1c xor_and_mat.gcc.o1.k1c xor_and_mat.ccomp.k1c
+PRODUCTS_OUT=$(addsuffix .out,$(PRODUCTS))
-int_mat.gcc.k1c.s int_mat.ccomp.k1c.s int_mat_run.gcc.k1c.s: xor_and.h
+all: $(PRODUCTS)
+
+.PHONY:
+run: measures.csv
-int_mat.gcc.k1c: int_mat.gcc.k1c.o int_mat_run.gcc.k1c.o
- $(K1C_CC) $(K1C_CFLAGS) $+ -o $@
-int_mat.ccomp.k1c: int_mat.ccomp.k1c.o int_mat_run.gcc.k1c.o
+xor_and_mat.gcc.host: $(src:.c=.gcc.host.o) ../clock.gcc.host.o
+ $(CC) $(CFLAGS) $+ -o $@
+xor_and_mat.ccomp.host: $(src:.c=.ccomp.host.o) ../clock.gcc.host.o
+ $(CCOMP) $(CCOMPFLAGS) $+ -o $@
+xor_and_mat.gcc.k1c: $(src:.c=.gcc.k1c.o) ../clock.gcc.k1c.o
+ $(K1C_CC) $(K1C_CFLAGS) $+ -o $@
+xor_and_mat.gcc.o1.k1c: $(src:.c=.gcc.o1.k1c.o) ../clock.gcc.k1c.o
+ $(K1C_CC) $(K1C_CFLAGS_O1) $+ -o $@
+xor_and_mat.ccomp.k1c: $(src:.c=.ccomp.k1c.o) ../clock.gcc.k1c.o
$(K1C_CCOMP) $(K1C_CCOMPFLAGS) $+ -o $@
+measures.csv: $(PRODUCTS_OUT)
+ echo "benches, gcc host,ccomp host,gcc k1c,gcc o1 k1c,ccomp k1c" > $@
+ echo "xor_and_mat c2", $$(grep 'c2_time' xor_and_mat.gcc.host.out | cut -d':' -f2), $$(grep 'c2_time' xor_and_mat.ccomp.host.out | cut -d':' -f2), $$(grep 'c2_time' xor_and_mat.gcc.k1c.out | cut -d':' -f2), $$(grep 'c2_time' xor_and_mat.gcc.o1.k1c.out | cut -d':' -f2), $$(grep 'c2_time' xor_and_mat.ccomp.k1c.out | cut -d':' -f2)>> $@
+ echo "xor_and_mat c7", $$(grep 'c7_time' xor_and_mat.gcc.host.out | cut -d':' -f2), $$(grep 'c7_time' xor_and_mat.ccomp.host.out | cut -d':' -f2), $$(grep 'c7_time' xor_and_mat.gcc.k1c.out | cut -d':' -f2), $$(grep 'c7_time' xor_and_mat.gcc.o1.k1c.out | cut -d':' -f2), $$(grep 'c7_time' xor_and_mat.ccomp.k1c.out | cut -d':' -f2)>> $@
+
+.SECONDARY:
+.PHONY:
clean:
- $(RM) -f $(PRODUCTS) int_mat.gcc.k1c.o int_mat.ccomp.k1c.o int_mat_run.gcc.k1c.o
+ rm -f *.o *.s *.k1c *.csv
-.PHONY: clean
diff --git a/test/monniaux/xor_and_mat/int_mat_run.c b/test/monniaux/xor_and_mat/int_mat_run.c
index 53335de4..541b7f6a 100644
--- a/test/monniaux/xor_and_mat/int_mat_run.c
+++ b/test/monniaux/xor_and_mat/int_mat_run.c
@@ -3,50 +3,50 @@
#include <stdio.h>
#include <inttypes.h>
#include "xor_and.h"
-#include "../cycles.h"
+#include "../clock.h"
int main() {
const unsigned m = 60, n = 31, p = 50;
- cycle_count_config();
+ clock_prepare();
xor_and *a = malloc(sizeof(xor_and) * m * n);
xor_and_mat_random(m, n, a, n);
xor_and *b = malloc(sizeof(xor_and) * n * p);
xor_and_mat_random(n, p, b, p);
xor_and *c1 = malloc(sizeof(xor_and) * m * p);
- cycle_t c1_time = get_cycle();
+ cycle_t c1_time = get_current_cycle();
xor_and_mat_mul1(m, n, p, c1, p, a, n, b, p);
- c1_time = get_cycle()-c1_time;
+ c1_time = get_current_cycle()-c1_time;
xor_and *c2 = malloc(sizeof(xor_and) * m * p);
- cycle_t c2_time = get_cycle();
+ cycle_t c2_time = get_current_cycle();
xor_and_mat_mul2(m, n, p, c2, p, a, n, b, p);
- c2_time = get_cycle()-c2_time;
+ c2_time = get_current_cycle()-c2_time;
xor_and *c3 = malloc(sizeof(xor_and) * m * p);
- cycle_t c3_time = get_cycle();
+ cycle_t c3_time = get_current_cycle();
xor_and_mat_mul3(m, n, p, c3, p, a, n, b, p);
- c3_time = get_cycle()-c3_time;
+ c3_time = get_current_cycle()-c3_time;
xor_and *c4 = malloc(sizeof(xor_and) * m * p);
- cycle_t c4_time = get_cycle();
+ cycle_t c4_time = get_current_cycle();
xor_and_mat_mul4(m, n, p, c4, p, a, n, b, p);
- c4_time = get_cycle()-c4_time;
+ c4_time = get_current_cycle()-c4_time;
xor_and *c5 = malloc(sizeof(xor_and) * m * p);
- cycle_t c5_time = get_cycle();
+ cycle_t c5_time = get_current_cycle();
xor_and_mat_mul5(m, n, p, c5, p, a, n, b, p);
- c5_time = get_cycle()-c5_time;
+ c5_time = get_current_cycle()-c5_time;
xor_and *c6 = malloc(sizeof(xor_and) * m * p);
- cycle_t c6_time = get_cycle();
+ cycle_t c6_time = get_current_cycle();
xor_and_mat_mul6(m, n, p, c6, p, a, n, b, p);
- c6_time = get_cycle()-c6_time;
+ c6_time = get_current_cycle()-c6_time;
xor_and *c7 = malloc(sizeof(xor_and) * m * p);
- cycle_t c7_time = get_cycle();
+ cycle_t c7_time = get_current_cycle();
xor_and_mat_mul7(m, n, p, c7, p, a, n, b, p);
- c7_time = get_cycle()-c7_time;
+ c7_time = get_current_cycle()-c7_time;
printf("c1==c2: %s\n"
"c1==c3: %s\n"
diff --git a/test/monniaux/xor_and_mat/make.proto b/test/monniaux/xor_and_mat/make.proto
new file mode 100644
index 00000000..0c2f3dc1
--- /dev/null
+++ b/test/monniaux/xor_and_mat/make.proto
@@ -0,0 +1,3 @@
+sources: int_mat_run.c int_mat.c
+target: xor_and_mat
+measures: [[c2_time, c2], [c7_time, c7]]