From aa986aacbb80e9f92f77d65de74ba5051054eac7 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sun, 11 Jul 2021 01:19:52 +0200 Subject: Add divider benchmarks --- benchmarks/polybench-syn-div/Makefile | 15 ++ benchmarks/polybench-syn-div/benchmark-list-master | 27 ++++ benchmarks/polybench-syn-div/common.mk | 33 +++++ benchmarks/polybench-syn-div/data-mining/Makefile | 3 + .../polybench-syn-div/data-mining/covariance.c | 113 ++++++++++++++ benchmarks/polybench-syn-div/exec.csv | 27 ++++ benchmarks/polybench-syn-div/include/misc.h | 105 +++++++++++++ .../polybench-syn-div/linear-algebra/blas/Makefile | 3 + .../polybench-syn-div/linear-algebra/blas/gemm.c | 115 +++++++++++++++ .../polybench-syn-div/linear-algebra/blas/gemver.c | 155 ++++++++++++++++++++ .../linear-algebra/blas/gesummv.c | 116 +++++++++++++++ .../polybench-syn-div/linear-algebra/blas/symm.c | 114 ++++++++++++++ .../polybench-syn-div/linear-algebra/blas/syr2k.c | 123 ++++++++++++++++ .../polybench-syn-div/linear-algebra/blas/syrk.c | 109 ++++++++++++++ .../polybench-syn-div/linear-algebra/blas/trmm.c | 99 +++++++++++++ .../polybench-syn-div/linear-algebra/kernels/2mm.c | 132 +++++++++++++++++ .../polybench-syn-div/linear-algebra/kernels/3mm.c | 142 ++++++++++++++++++ .../linear-algebra/kernels/Makefile | 3 + .../linear-algebra/kernels/atas.c | 103 +++++++++++++ .../linear-algebra/kernels/bicg.c | 120 +++++++++++++++ .../linear-algebra/kernels/doitgen.c | 105 +++++++++++++ .../polybench-syn-div/linear-algebra/kernels/mvt.c | 124 ++++++++++++++++ .../linear-algebra/solvers/Makefile | 3 + .../linear-algebra/solvers/cholesky.c | 129 ++++++++++++++++ .../linear-algebra/solvers/durbin.c | 98 +++++++++++++ .../polybench-syn-div/linear-algebra/solvers/lu.c | 116 +++++++++++++++ .../linear-algebra/solvers/ludcmp.c | 163 +++++++++++++++++++++ .../linear-algebra/solvers/trisolv.c | 97 ++++++++++++ benchmarks/polybench-syn-div/medley/Makefile | 3 + .../polybench-syn-div/medley/floyd-warshall.c | 91 ++++++++++++ benchmarks/polybench-syn-div/medley/nussinov.c | 111 ++++++++++++++ benchmarks/polybench-syn-div/poly.csv | 26 ++++ benchmarks/polybench-syn-div/quartus_synth.tcl | 35 +++++ benchmarks/polybench-syn-div/run-vericert.sh | 41 ++++++ benchmarks/polybench-syn-div/script.R | 29 ++++ benchmarks/polybench-syn-div/setup-syn-vericert.sh | 24 +++ benchmarks/polybench-syn-div/stencils/Makefile | 6 + benchmarks/polybench-syn-div/stencils/adi.c | 125 ++++++++++++++++ benchmarks/polybench-syn-div/stencils/fdtd-2d.c | 134 +++++++++++++++++ benchmarks/polybench-syn-div/stencils/heat-3d.c | 112 ++++++++++++++ benchmarks/polybench-syn-div/stencils/jacobi-1d.c | 101 +++++++++++++ benchmarks/polybench-syn-div/stencils/jacobi-2d.c | 108 ++++++++++++++ benchmarks/polybench-syn-div/stencils/seidel-2d.c | 92 ++++++++++++ benchmarks/polybench-syn-div/syn-remote.sh | 51 +++++++ 44 files changed, 3581 insertions(+) create mode 100644 benchmarks/polybench-syn-div/Makefile create mode 100644 benchmarks/polybench-syn-div/benchmark-list-master create mode 100644 benchmarks/polybench-syn-div/common.mk create mode 100644 benchmarks/polybench-syn-div/data-mining/Makefile create mode 100644 benchmarks/polybench-syn-div/data-mining/covariance.c create mode 100644 benchmarks/polybench-syn-div/exec.csv create mode 100644 benchmarks/polybench-syn-div/include/misc.h create mode 100644 benchmarks/polybench-syn-div/linear-algebra/blas/Makefile create mode 100644 benchmarks/polybench-syn-div/linear-algebra/blas/gemm.c create mode 100644 benchmarks/polybench-syn-div/linear-algebra/blas/gemver.c create mode 100644 benchmarks/polybench-syn-div/linear-algebra/blas/gesummv.c create mode 100644 benchmarks/polybench-syn-div/linear-algebra/blas/symm.c create mode 100644 benchmarks/polybench-syn-div/linear-algebra/blas/syr2k.c create mode 100644 benchmarks/polybench-syn-div/linear-algebra/blas/syrk.c create mode 100644 benchmarks/polybench-syn-div/linear-algebra/blas/trmm.c create mode 100644 benchmarks/polybench-syn-div/linear-algebra/kernels/2mm.c create mode 100644 benchmarks/polybench-syn-div/linear-algebra/kernels/3mm.c create mode 100644 benchmarks/polybench-syn-div/linear-algebra/kernels/Makefile create mode 100644 benchmarks/polybench-syn-div/linear-algebra/kernels/atas.c create mode 100644 benchmarks/polybench-syn-div/linear-algebra/kernels/bicg.c create mode 100644 benchmarks/polybench-syn-div/linear-algebra/kernels/doitgen.c create mode 100644 benchmarks/polybench-syn-div/linear-algebra/kernels/mvt.c create mode 100644 benchmarks/polybench-syn-div/linear-algebra/solvers/Makefile create mode 100644 benchmarks/polybench-syn-div/linear-algebra/solvers/cholesky.c create mode 100644 benchmarks/polybench-syn-div/linear-algebra/solvers/durbin.c create mode 100644 benchmarks/polybench-syn-div/linear-algebra/solvers/lu.c create mode 100644 benchmarks/polybench-syn-div/linear-algebra/solvers/ludcmp.c create mode 100644 benchmarks/polybench-syn-div/linear-algebra/solvers/trisolv.c create mode 100644 benchmarks/polybench-syn-div/medley/Makefile create mode 100644 benchmarks/polybench-syn-div/medley/floyd-warshall.c create mode 100644 benchmarks/polybench-syn-div/medley/nussinov.c create mode 100644 benchmarks/polybench-syn-div/poly.csv create mode 100644 benchmarks/polybench-syn-div/quartus_synth.tcl create mode 100755 benchmarks/polybench-syn-div/run-vericert.sh create mode 100644 benchmarks/polybench-syn-div/script.R create mode 100755 benchmarks/polybench-syn-div/setup-syn-vericert.sh create mode 100644 benchmarks/polybench-syn-div/stencils/Makefile create mode 100644 benchmarks/polybench-syn-div/stencils/adi.c create mode 100644 benchmarks/polybench-syn-div/stencils/fdtd-2d.c create mode 100644 benchmarks/polybench-syn-div/stencils/heat-3d.c create mode 100644 benchmarks/polybench-syn-div/stencils/jacobi-1d.c create mode 100644 benchmarks/polybench-syn-div/stencils/jacobi-2d.c create mode 100644 benchmarks/polybench-syn-div/stencils/seidel-2d.c create mode 100755 benchmarks/polybench-syn-div/syn-remote.sh (limited to 'benchmarks/polybench-syn-div') diff --git a/benchmarks/polybench-syn-div/Makefile b/benchmarks/polybench-syn-div/Makefile new file mode 100644 index 0000000..2c20246 --- /dev/null +++ b/benchmarks/polybench-syn-div/Makefile @@ -0,0 +1,15 @@ +all: + $(MAKE) -C stencils + $(MAKE) -C medley + $(MAKE) -C linear-algebra/blas + $(MAKE) -C linear-algebra/kernels + $(MAKE) -C linear-algebra/solvers + $(MAKE) -C data-mining + +clean: + $(MAKE) clean -C stencils + $(MAKE) clean -C medley + $(MAKE) clean -C linear-algebra/blas + $(MAKE) clean -C linear-algebra/kernels + $(MAKE) clean -C linear-algebra/solvers + $(MAKE) clean -C data-mining diff --git a/benchmarks/polybench-syn-div/benchmark-list-master b/benchmarks/polybench-syn-div/benchmark-list-master new file mode 100644 index 0000000..ef0d0d0 --- /dev/null +++ b/benchmarks/polybench-syn-div/benchmark-list-master @@ -0,0 +1,27 @@ +stencils/adi +stencils/heat-3d +stencils/fdtd-2d +stencils/jacobi-1d +stencils/seidel-2d +stencils/jacobi-2d +medley/nussinov +medley/floyd-warshall +linear-algebra/kernels/3mm +linear-algebra/kernels/2mm +linear-algebra/kernels/doitgen +linear-algebra/kernels/bicg +linear-algebra/kernels/mvt +linear-algebra/kernels/atas +linear-algebra/blas/syrk +linear-algebra/blas/gemver +linear-algebra/blas/symm +linear-algebra/blas/gesummv +linear-algebra/blas/gemm +linear-algebra/blas/trmm +linear-algebra/blas/syr2k +linear-algebra/solvers/cholesky +linear-algebra/solvers/trisolv +linear-algebra/solvers/lu +linear-algebra/solvers/ludcmp +linear-algebra/solvers/durbin +data-mining/covariance diff --git a/benchmarks/polybench-syn-div/common.mk b/benchmarks/polybench-syn-div/common.mk new file mode 100644 index 0000000..fbada0b --- /dev/null +++ b/benchmarks/polybench-syn-div/common.mk @@ -0,0 +1,33 @@ +VERICERT ?= vericert +VERICERT_OPTS ?= -DSYNTHESIS + +IVERILOG ?= iverilog +IVERILOG_OPTS ?= + +TARGETS ?= + +%.v: %.c + $(VERICERT) $(VERICERT_OPTS) $< -o $@ + +%.iver: %.v + $(IVERILOG) -o $@ $(IVERILOG_OPTS) $< + +%.gcc: %.c + $(CC) $(CFLAGS) $< -o $@ + +%: %.iver %.gcc + cp $< $@ + +all: $(TARGETS) + +clean: + rm -f *.iver + rm -f *.v + rm -f *.gcc + rm -f *.clog + rm -f *.tmp + rm -f $(TARGETS) + +.PRECIOUS: %.v %.gcc %.iver +.PHONY: all clean +.SUFFIXES: diff --git a/benchmarks/polybench-syn-div/data-mining/Makefile b/benchmarks/polybench-syn-div/data-mining/Makefile new file mode 100644 index 0000000..d4817a0 --- /dev/null +++ b/benchmarks/polybench-syn-div/data-mining/Makefile @@ -0,0 +1,3 @@ +TARGETS := covariance + +include ../common.mk diff --git a/benchmarks/polybench-syn-div/data-mining/covariance.c b/benchmarks/polybench-syn-div/data-mining/covariance.c new file mode 100644 index 0000000..b29a5bd --- /dev/null +++ b/benchmarks/polybench-syn-div/data-mining/covariance.c @@ -0,0 +1,113 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* covariance.c: this file is part of PolyBench/C */ + +#ifndef SYNTHESIS +#include +#endif + + +#define plus(i) i = i + ONE +static +void init_array (int m, int n, + int *float_n, + int data[ 32 + 0][28 + 0]) +{ + int i, j; + int ONE = 1; + + *float_n = (int)n; + + for (i = 0; i < 32; plus(i)) + for (j = 0; j < 28; plus(j)) + data[i][j] = ((int) i*j) / 28; +} + + + + +static +int print_array(int m, + int cov[ 28 + 0][28 + 0]) + +{ + int i, j; + int ONE = 1; + int res = 0; + for (i = 0; i < m; plus(i)) + for (j = 0; j < m; plus(j)) { + res ^= cov[i][j]; + } +#ifndef SYNTHESIS + printf("finished: %u\n", res); +#endif + return res; +} + + + + +static +void kernel_covariance(int m, int n, + int float_n, + int data[ 32 + 0][28 + 0], + int cov[ 28 + 0][28 + 0], + int mean[ 28 + 0]) +{ + int i, j, k; + int ONE = 1; + + for (j = 0; j < m; plus(j)) + { + mean[j] = 0; + for (i = 0; i < n; plus(i)) + mean[j] += data[i][j]; + mean[j] = mean[j] / float_n; + } + + for (i = 0; i < n; plus(i)) + for (j = 0; j < m; plus(j)) + data[i][j] -= mean[j]; + + for (i = 0; i < m; plus(i)) + for (j = i; j < m; plus(j)) + { + cov[i][j] = 0; + for (k = 0; k < n; plus(k)) + cov[i][j] += data[k][i] * data[k][j]; + cov[i][j] = cov[i][j] / (float_n - ONE); + cov[j][i] = cov[i][j]; + } + +} + + +int main() +{ + + int n = 32; + int m = 28; + + + int float_n; + int data[32 + 0][28 + 0]; + int mean[28 + 0]; + int cov[28 + 0][28 + 0]; + + init_array (m, n, &float_n, data); + + kernel_covariance (m, n, float_n, + data, + cov, + mean); + + return print_array(m, cov); + +} diff --git a/benchmarks/polybench-syn-div/exec.csv b/benchmarks/polybench-syn-div/exec.csv new file mode 100644 index 0000000..6ebeced --- /dev/null +++ b/benchmarks/polybench-syn-div/exec.csv @@ -0,0 +1,27 @@ +2mm,467612 +3mm,604582 +adi,1831462 +atas,101618 +bicg,130790 +cholesky,2575070 +covariance,340794 +doitgen,386782 +durbin,23832 +fdtd-2d,958412 +floyd-warshall,5414366 +gemm,406774 +gemver,193048 +gesummv,116556 +heat-3d,592770 +jacobi-1d,19996 +jacobi-2d,397200 +lu,2893146 +ludcmp,2641694 +mvt,148874 +nussinov,956490 +seidel-2d,942338 +symm,279832 +syr2k,525908 +syrk,338286 +trisolv,36050 +trmm,165828 diff --git a/benchmarks/polybench-syn-div/include/misc.h b/benchmarks/polybench-syn-div/include/misc.h new file mode 100644 index 0000000..664677c --- /dev/null +++ b/benchmarks/polybench-syn-div/include/misc.h @@ -0,0 +1,105 @@ +unsigned int modulo(unsigned int x, unsigned int y) +{ + unsigned int r0, q0, y0, y1; + + r0 = x; + q0 = 0; + y0 = y; + y1 = y; + do + { + y1 = 2 * y1; + } + while (y1 <= x); + do + { + y1 = y1 / 2; + q0 = 2 * q0; + if (r0 >= y1) + { + r0 = r0 - y1; + q0 = q0 + 1; + } + } + while ((int)y1 != (int)y0); + return r0; +} + +int smodulo(int N, int D) { + if (D < 0) { + if (N < 0) + return modulo(-N, -D); + else + return -modulo(N, -D); + } else { + if (N < 0) + return -modulo(-N, D); + else + return modulo(N, D); + } +} + +unsigned divider_fast(unsigned x, unsigned y) { + unsigned r0, q0, y0, y1; + + r0 = x; + q0 = 0; + y0 = y; + y1 = y; + do { + y1 = 2 * y1; + } while (y1 <= x); + do { + y1 /= 2; + q0 *= 2; + if (r0 >= y1) { + r0 -= y1; + q0++; + } + } while ((int)y1 != (int)y0); + return q0; +} + +unsigned divider(unsigned x, unsigned y) { + unsigned q0, acc; + q0 = 0; + acc = y; + + while (acc <= x) { + q0++; + acc += y; + } + + return q0; +} + +/* + * Signed division operation for faster frequency division. + */ +int sdivider(int N, int D) { + if (D < 0) { + if (N < 0) + return divider(-N, -D); + else + return -divider(N, -D); + } else { + if (N < 0) + return -divider(-N, D); + else + return divider(N, D); + } +} + +int sdivider_fast(int N, int D) { + if (D < 0) { + if (N < 0) + return divider_fast(-N, -D); + else + return -divider_fast(N, -D); + } else { + if (N < 0) + return -divider_fast(-N, D); + else + return divider_fast(N, D); + } +} diff --git a/benchmarks/polybench-syn-div/linear-algebra/blas/Makefile b/benchmarks/polybench-syn-div/linear-algebra/blas/Makefile new file mode 100644 index 0000000..e1f3b58 --- /dev/null +++ b/benchmarks/polybench-syn-div/linear-algebra/blas/Makefile @@ -0,0 +1,3 @@ +TARGETS := gemm gemver gesummv symm syr2k syrk trmm + +include ../../common.mk diff --git a/benchmarks/polybench-syn-div/linear-algebra/blas/gemm.c b/benchmarks/polybench-syn-div/linear-algebra/blas/gemm.c new file mode 100644 index 0000000..a2c507f --- /dev/null +++ b/benchmarks/polybench-syn-div/linear-algebra/blas/gemm.c @@ -0,0 +1,115 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* gemm.c: this file is part of PolyBench/C */ + +#ifndef SYNTHESIS + #include +#endif +#define plus(i) i = i + ONE + static +void init_array(int ni, int nj, int nk, + int *alpha, + int *beta, + int C[ 20 + 0][25 + 0], + int A[ 20 + 0][30 + 0], + int B[ 30 + 0][25 + 0]) +{ + int i, j; + int ONE = 1; + + *alpha = 2; + *beta = 2; + for (i = 0; i < ni; plus(i)) + for (j = 0; j < nj; plus(j)) + C[i][j] = (int) ((i*j+ONE) % ni) / ni; + for (i = 0; i < ni; plus(i)) + for (j = 0; j < nk; plus(j)) + A[i][j] = (int) (((i*(j+ONE)) % nk) / nk); + for (i = 0; i < nk; plus(i)) + for (j = 0; j < nj; plus(j)) + B[i][j] = (int) (((i*(j+ONE+ONE)) % nj) / nj); +} + + + + + static +int print_array(int ni, int nj, + int C[ 20 + 0][25 + 0]) +{ + int i, j; + int ONE = 1; + int res = 0; + for (i = 0; i < ni; plus(i)) + for (j = 0; j < nj; plus(j)) { + res ^= C[i][j]; + } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif + return res; +} + + static +void kernel_gemm(int ni, int nj, int nk, + int alpha, + int beta, + int C[ 20 + 0][25 + 0], + int A[ 20 + 0][30 + 0], + int B[ 30 + 0][25 + 0]) +{ + int i, j, k; + int ONE = 1; + + for (i = 0; i < ni; plus(i)) { + for (j = 0; j < nj; plus(j)) + C[i][j] *= beta; + for (k = 0; k < nk; plus(k)) { + for (j = 0; j < nj; plus(j)) + C[i][j] += alpha * A[i][k] * B[k][j]; + } + } + +} + + +int main() +{ + + int ni = 20; + int nj = 25; + int nk = 30; + + + int alpha; + int beta; + int C[20 + 0][25 + 0]; + int A[20 + 0][30 + 0]; + int B[30 + 0][25 + 0]; + + + init_array (ni, nj, nk, &alpha, &beta, + C, + A, + B); + + + kernel_gemm (ni, nj, nk, + alpha, beta, + C, + A, + B); + + + return + print_array(ni, nj, C); + + +} diff --git a/benchmarks/polybench-syn-div/linear-algebra/blas/gemver.c b/benchmarks/polybench-syn-div/linear-algebra/blas/gemver.c new file mode 100644 index 0000000..de8dd04 --- /dev/null +++ b/benchmarks/polybench-syn-div/linear-algebra/blas/gemver.c @@ -0,0 +1,155 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* gemver.c: this file is part of PolyBench/C */ + +#ifndef SYNTHESIS + #include +#endif +#define plus(i) i = i + ONE +static +void init_array (int n, + int *alpha, + int *beta, + int A[ 40 + 0][40 + 0], + int u1[ 40 + 0], + int v1[ 40 + 0], + int u2[ 40 + 0], + int v2[ 40 + 0], + int w[ 40 + 0], + int x[ 40 + 0], + int y[ 40 + 0], + int z[ 40 + 0]) +{ + int i, j; + int ONE = 1; + + *alpha = 3; + *beta = 2; + + int fn = (int)n; + + for (i = 0; i < n; plus(i)) + { + u1[i] = i; + u2[i] = ((i+ONE)/(fn*2)); + v1[i] = ((i+ONE)/(fn*4)); + v2[i] = ((i+ONE)/(fn*6)); + y[i] = ((i+ONE)/(fn*8)); + z[i] = ((i+ONE)/(fn*9)); + x[i] = 0; + w[i] = 0; + for (j = 0; j < n; plus(j)) + A[i][j] = (int) (((i*j) % n) / n); + } +} + + + + +static +int print_array(int n, + int w[ 40 + 0]) +{ + int i; + int ONE = 1; + int res = 0; + + for (i = 0; i < n; plus(i)) { + res ^= w[i]; + } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif + return res; +} + + + + +static +void kernel_gemver(int n, + int alpha, + int beta, + int A[ 40 + 0][40 + 0], + int u1[ 40 + 0], + int v1[ 40 + 0], + int u2[ 40 + 0], + int v2[ 40 + 0], + int w[ 40 + 0], + int x[ 40 + 0], + int y[ 40 + 0], + int z[ 40 + 0]) +{ + int i, j; + int ONE = 1; + + for (i = 0; i < n; plus(i)) + for (j = 0; j < n; plus(j)) + A[i][j] = A[i][j] + u1[i] * v1[j] + u2[i] * v2[j]; + + for (i = 0; i < n; plus(i)) + for (j = 0; j < n; plus(j)) + x[i] = x[i] + beta * A[j][i] * y[j]; + + for (i = 0; i < n; plus(i)) + x[i] = x[i] + z[i]; + + for (i = 0; i < n; plus(i)) + for (j = 0; j < n; plus(j)) + w[i] = w[i] + alpha * A[i][j] * x[j]; + +} + + +int main() +{ + + int n = 40; + + + int alpha; + int beta; + int A[40 + 0][40 + 0]; + int u1[40 + 0]; + int v1[40 + 0]; + int u2[40 + 0]; + int v2[40 + 0]; + int w[40 + 0]; + int x[40 + 0]; + int y[40 + 0]; + int z[40 + 0]; + + + + init_array (n, &alpha, &beta, + A, + u1, + v1, + u2, + v2, + w, + x, + y, + z); + + kernel_gemver (n, alpha, beta, + A, + u1, + v1, + u2, + v2, + w, + x, + y, + z); + + return print_array(n, w); + +} diff --git a/benchmarks/polybench-syn-div/linear-algebra/blas/gesummv.c b/benchmarks/polybench-syn-div/linear-algebra/blas/gesummv.c new file mode 100644 index 0000000..457d6a8 --- /dev/null +++ b/benchmarks/polybench-syn-div/linear-algebra/blas/gesummv.c @@ -0,0 +1,116 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* gesummv.c: this file is part of PolyBench/C */ + +#ifndef SYNTHESIS + #include +#endif + +#define plus(i) i = i + ONE + + static +void init_array(int n, + int *alpha, + int *beta, + int A[ 30 + 0][30 + 0], + int B[ 30 + 0][30 + 0], + int x[ 30 + 0]) +{ + int i, j; + int ONE = 1; + + *alpha = 3; + *beta = 2; + for (i = 0; i < n; plus(i)) + { + x[i] = (int) ((i % n) / n); + for (j = 0; j < n; plus(j)) { + A[i][j] = (int) (((i*j+ONE) % n) / n); + B[i][j] = (int) (((i*j+ONE+ONE) % n) / n); + } + } +} + + + static +int print_array(int n, + int y[ 30 + 0]) + +{ + int i; + int ONE = 1; + int res = 0; + + for (i = 0; i < n; plus(i)) { + res ^= y[i]; + } +#ifndef SYNTHESIS + printf("finished: %u\n", res); +#endif + return res; +} + + static +void kernel_gesummv(int n, + int alpha, + int beta, + int A[ 30 + 0][30 + 0], + int B[ 30 + 0][30 + 0], + int tmp[ 30 + 0], + int x[ 30 + 0], + int y[ 30 + 0]) +{ + int i, j; + int ONE = 1; + + for (i = 0; i < n; plus(i)) + { + tmp[i] = 0; + y[i] = 0; + for (j = 0; j < n; plus(j)) + { + tmp[i] = A[i][j] * x[j] + tmp[i]; + y[i] = B[i][j] * x[j] + y[i]; + } + y[i] = alpha * tmp[i] + beta * y[i]; + } +} + + +int main() +{ + + int n = 30; + + + int alpha; + int beta; + int A[30 + 0][30 + 0]; + int B[30 + 0][30 + 0]; + int tmp[30 + 0]; + int x[30 + 0]; + int y[30 + 0]; + + init_array (n, &alpha, &beta, + A, + B, + x); + + kernel_gesummv (n, alpha, beta, + A, + B, + tmp, + x, + y); + + + return print_array(n, y); + +} diff --git a/benchmarks/polybench-syn-div/linear-algebra/blas/symm.c b/benchmarks/polybench-syn-div/linear-algebra/blas/symm.c new file mode 100644 index 0000000..6c20b5b --- /dev/null +++ b/benchmarks/polybench-syn-div/linear-algebra/blas/symm.c @@ -0,0 +1,114 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* symm.c: this file is part of PolyBench/C */ + +#ifndef SYNTHESIS + #include +#endif +#define plus(i) i = i + ONE +static +void init_array(int m, int n, + int *alpha, + int *beta, + int C[ 20 + 0][30 + 0], + int A[ 20 + 0][20 + 0], + int B[ 20 + 0][30 + 0]) +{ + int i, j; + int ONE = 1; + int HUND = 100; + + *alpha = 3; + *beta = 2; + for (i = 0; i < m; plus(i)) + for (j = 0; j < n; plus(j)) { + C[i][j] = (int) (((i+j) % HUND) / m); + B[i][j] = (int) (((n+i-j) % HUND) / m); + } + for (i = 0; i < m; plus(i)) { + for (j = 0; j <=i; plus(j)) + A[i][j] = (int) (((i+j) % HUND) / m); + for (j = i+ONE; j < m; plus(j)) + A[i][j] = -999; + } +} + +static +int print_array(int m, int n, + int C[ 20 + 0][30 + 0]) +{ + int i, j; + int ONE = 1; + int res = 0; + + for (i = 0; i < m; plus(i)) + for (j = 0; j < n; plus(j)) { + res ^= C[i][j]; + } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif + return res; +} + + +static +void kernel_symm(int m, int n, + int alpha, + int beta, + int C[ 20 + 0][30 + 0], + int A[ 20 + 0][20 + 0], + int B[ 20 + 0][30 + 0]) +{ + int ONE = 1; + int i, j, k; + int temp2; + for (i = 0; i < m; plus(i)) + for (j = 0; j < n; plus(j) ) + { + temp2 = 0; + for (k = 0; k < i; plus(k)) { + C[k][j] += alpha*B[i][j] * A[i][k]; + temp2 += B[k][j] * A[i][k]; + } + C[i][j] = beta * C[i][j] + alpha*B[i][j] * A[i][i] + alpha * temp2; + } + +} + + +int main() +{ + + int m = 20; + int n = 30; + + int alpha; + int beta; + int C[20 + 0][30 + 0]; + int A[20 + 0][20 + 0]; + int B[20 + 0][30 + 0]; + + + init_array (m, n, &alpha, &beta, + C, + A, + B); + + kernel_symm (m, n, + alpha, beta, + C, + A, + B); + + return + print_array(m, n, C); + +} diff --git a/benchmarks/polybench-syn-div/linear-algebra/blas/syr2k.c b/benchmarks/polybench-syn-div/linear-algebra/blas/syr2k.c new file mode 100644 index 0000000..a1c0934 --- /dev/null +++ b/benchmarks/polybench-syn-div/linear-algebra/blas/syr2k.c @@ -0,0 +1,123 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* syr2k.c: this file is part of PolyBench/C */ + +#ifndef SYNTHESIS + #include +#endif +#define plus(i) i = i + ONE +static +void init_array(int n, int m, + int *alpha, + int *beta, + int C[ 30 + 0][30 + 0], + int A[ 30 + 0][20 + 0], + int B[ 30 + 0][20 + 0]) +{ + int i, j; + int ONE = 1; + + *alpha = 3; + *beta = 2; + for (i = 0; i < n; plus(i)) + for (j = 0; j < m; plus(j)) { + A[i][j] = (int) (((i*j+ONE) % n) / n); + B[i][j] = (int) (((i*j+ONE+ONE) % m) / m); + } + for (i = 0; i < n; plus(i)) + for (j = 0; j < n; plus(j)) { + C[i][j] = (int) (((i*j+4-ONE) % n) / m); + } +} + + + + +static +int print_array(int n, + int C[ 30 + 0][30 + 0]) +{ + int i, j; + int ONE = 1; + int res = 0; + + for (i = 0; i < n; plus(i)) + for (j = 0; j < n; plus(j)) { + res ^= C[i][j]; + } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif + return res; +} + + +static +void kernel_syr2k(int n, int m, + int alpha, + int beta, + int C[ 30 + 0][30 + 0], + int A[ 30 + 0][20 + 0], + int B[ 30 + 0][20 + 0]) +{ + int i, j, k; + int ONE = 1; + + for (i = 0; i < n; plus(i)) { + for (j = 0; j <= i; plus(j)) + C[i][j] *= beta; + for (k = 0; k < m; plus(k)) + for (j = 0; j <= i; plus(j)) + { + C[i][j] += A[j][k]*alpha*B[i][k] + B[j][k]*alpha*A[i][k]; + } + } + +} + + +int main() +{ + + int n = 30; + int m = 20; + + + int alpha; + int beta; + int C[30 + 0][30 + 0]; + int A[30 + 0][20 + 0]; + int B[30 + 0][20 + 0]; + + + init_array (n, m, &alpha, &beta, + C, + A, + B); + + + ; + + + kernel_syr2k (n, m, + alpha, beta, + C, + A, + B); + + + ; + ; + + + + return print_array(n, C); + +} diff --git a/benchmarks/polybench-syn-div/linear-algebra/blas/syrk.c b/benchmarks/polybench-syn-div/linear-algebra/blas/syrk.c new file mode 100644 index 0000000..46ae322 --- /dev/null +++ b/benchmarks/polybench-syn-div/linear-algebra/blas/syrk.c @@ -0,0 +1,109 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* syrk.c: this file is part of PolyBench/C */ + +#ifndef SYNTHESIS + #include +#endif +#define plus(i) i = i + ONE +static +void init_array(int n, int m, + int *alpha, + int *beta, + int C[ 30 + 0][30 + 0], + int A[ 30 + 0][20 + 0]) +{ + int i, j; + int ONE = 1; + + *alpha = 3; + *beta = 2; + for (i = 0; i < n; plus(i)) + for (j = 0; j < m; plus(j)) + A[i][j] = (int) (((i*j+ONE) % n) / n); + for (i = 0; i < n; plus(i)) + for (j = 0; j < n; plus(j)) + C[i][j] = (int) (((i*j+ONE+ONE) % m) / m); +} + + +static +int print_array(int n, + int C[ 30 + 0][30 + 0]) +{ + int i, j; + int ONE = 1; + int res = 0; + + for (i = 0; i < n; plus(i)) + for (j = 0; j < n; plus(j)) { + res ^= C[i][j]; + } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif + return res; +} + + + + +static +void kernel_syrk(int n, int m, + int alpha, + int beta, + int C[ 30 + 0][30 + 0], + int A[ 30 + 0][20 + 0]) +{ + int i, j, k; + int ONE = 1; + + for (i = 0; i < n; plus(i)) { + for (j = 0; j <= i; plus(j)) + C[i][j] *= beta; + for (k = 0; k < m; plus(k)) { + for (j = 0; j <= i; plus(j)) + C[i][j] += alpha * A[i][k] * A[j][k]; + } + } + +} + + +int main() +{ + + int n = 30; + int m = 20; + + + int alpha; + int beta; + int C[30 + 0][30 + 0]; + int A[30 + 0][20 + 0]; + + + init_array (n, m, &alpha, &beta, C, A); + + + ; + + + kernel_syrk (n, m, alpha, beta, C, A); + + + ; + ; + + + + return print_array(n, C); + +} diff --git a/benchmarks/polybench-syn-div/linear-algebra/blas/trmm.c b/benchmarks/polybench-syn-div/linear-algebra/blas/trmm.c new file mode 100644 index 0000000..3fdbc45 --- /dev/null +++ b/benchmarks/polybench-syn-div/linear-algebra/blas/trmm.c @@ -0,0 +1,99 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* trmm.c: this file is part of PolyBench/C */ + +#ifndef SYNTHESIS + #include +#endif +#define plus(i) i = i + ONE + static +void init_array(int m, int n, + int *alpha, + int A[ 20 + 0][20 + 0], + int B[ 20 + 0][30 + 0]) +{ + int i, j; + int ONE = 1; + + *alpha = 3; + for (i = 0; i < m; plus(i)) { + for (j = 0; j < i; plus(j)) { + A[i][j] = (int) (((i+j) % m) / m); + } + A[i][i] = 1; + for (j = 0; j < n; plus(j)) { + B[i][j] = (int)(((n+i-j) % n) / n); + } + } + +} + + + + + static +int print_array(int m, int n, + int B[ 20 + 0][30 + 0]) +{ + int i, j; + int ONE = 1; + int res = 0; + + for (i = 0; i < m; plus(i)) + for (j = 0; j < n; plus(j)) { + res ^= B[i][j]; + } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif + return res; +} + + + + + static +void kernel_trmm(int m, int n, + int alpha, + int A[ 20 + 0][20 + 0], + int B[ 20 + 0][30 + 0]) +{ + int i, j, k; + int ONE = 1; + for (i = 0; i < m; plus(i)) + for (j = 0; j < n; plus(j)) { + for (k = i+ONE; k < m; plus(k)) + B[i][j] += A[k][i] * B[k][j]; + B[i][j] = alpha * B[i][j]; + } + +} + + +int main() +{ + + int m = 20; + int n = 30; + + + int alpha; + int A[20 + 0][20 + 0]; + int B[20 + 0][30 + 0]; + + + init_array (m, n, &alpha, A, B); + + + kernel_trmm (m, n, alpha, A, B); + + return print_array(m, n, B); + +} diff --git a/benchmarks/polybench-syn-div/linear-algebra/kernels/2mm.c b/benchmarks/polybench-syn-div/linear-algebra/kernels/2mm.c new file mode 100644 index 0000000..0b6677f --- /dev/null +++ b/benchmarks/polybench-syn-div/linear-algebra/kernels/2mm.c @@ -0,0 +1,132 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* 2mm.c: this file is part of PolyBench/C */ + + +#ifndef SYNTHESIS + #include +#endif + +#define plus(i) i = i + ONE +static +void init_array(int ni, int nj, int nk, int nl, + int *alpha, + int *beta, + int A[ 16 + 0][22 + 0], + int B[ 22 + 0][18 + 0], + int C[ 18 + 0][24 + 0], + int D[ 16 + 0][24 + 0]) +{ + int i, j; + int ONE = 1; + + *alpha = 2; + *beta = 2; + for (i = 0; i < ni; plus(i)) + for (j = 0; j < nk; plus(j)) + A[i][j] = (int) (((i*j+ONE) % ni) / ni); + for (i = 0; i < nk; plus(i)) + for (j = 0; j < nj; plus(j)) + B[i][j] = (int) (((i*(j+ONE)) % nj) / nj); + for (i = 0; i < nj; plus(i)) + for (j = 0; j < nl; plus(j)) + C[i][j] = (int) (((i*(j+ONE+ONE+ONE)+ONE) % nl) / nl); + for (i = 0; i < ni; plus(i)) + for (j = 0; j < nl; plus(j)) + D[i][j] = (int) (((i*(j+ONE+ONE)) % nk) / nk); +} + +static +int print_array(int ni, int nl, + int D[ 16 + 0][24 + 0]) +{ + int i, j; + int ONE = 1; + int res = 0; + for (i = 0; i < ni; plus(i)) + for (j = 0; j < nl; plus(j)) { + res ^= D[i][j]; + } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif + return res; +} + + + + +static +void kernel_2mm(int ni, int nj, int nk, int nl, + int alpha, + int beta, + int tmp[ 16 + 0][18 + 0], + int A[ 16 + 0][22 + 0], + int B[ 22 + 0][18 + 0], + int C[ 18 + 0][24 + 0], + int D[ 16 + 0][24 + 0]) +{ + int ONE = 1; + int i, j, k; + + for (i = 0; i < ni; plus(i)) + for (j = 0; j < nj; plus(j)) + { + tmp[i][j] = 0; + for (k = 0; k < nk; plus(k)) + tmp[i][j] += alpha * A[i][k] * B[k][j]; + } + for (i = 0; i < ni; plus(i)) + for (j = 0; j < nl; plus(j)) + { + D[i][j] *= beta; + for (k = 0; k < nj; plus(k)) + D[i][j] += tmp[i][k] * C[k][j]; + } + +} + + +int main() +{ + + int ni = 16; + int nj = 18; + int nk = 22; + int nl = 24; + + int alpha; + int beta; + int tmp[16 + 0][18 + 0]; + int A[16 + 0][22 + 0]; + int B[22 + 0][18 + 0]; + int C[18 + 0][24 + 0]; + int D[16 + 0][24 + 0]; + + + init_array (ni, nj, nk, nl, &alpha, &beta, + A, + B, + C, + D); + + + kernel_2mm (ni, nj, nk, nl, + alpha, beta, + tmp, + A, + B, + C, + D); + + + return print_array(ni, nl, D); + +} diff --git a/benchmarks/polybench-syn-div/linear-algebra/kernels/3mm.c b/benchmarks/polybench-syn-div/linear-algebra/kernels/3mm.c new file mode 100644 index 0000000..d0b086b --- /dev/null +++ b/benchmarks/polybench-syn-div/linear-algebra/kernels/3mm.c @@ -0,0 +1,142 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* 3mm.c: this file is part of PolyBench/C */ + + +#ifndef SYNTHESIS + #include +#endif + +#define plus(i) i = i + ONE +static +void init_array(int ni, int nj, int nk, int nl, int nm, + int A[ 16 + 0][20 + 0], + int B[ 20 + 0][18 + 0], + int C[ 18 + 0][24 + 0], + int D[ 24 + 0][22 + 0]) +{ + int i, j; + int ONE = 1; + int TWO = 2; + int THREE = 3; + + for (i = 0; i < ni; plus(i)) + for (j = 0; j < nk; plus(j)) + A[i][j] = (int) (((i*j+ONE) % ni) / (5*ni)); + for (i = 0; i < nk; plus(i)) + for (j = 0; j < nj; plus(j)) + B[i][j] = (int) (((i*(j+ONE)+TWO) % nj) / (5*nj)); + for (i = 0; i < nj; plus(i)) + for (j = 0; j < nm; plus(j)) + C[i][j] = (int) (((i*(j+THREE)) % nl) / (5*nl)); + for (i = 0; i < nm; plus(i)) + for (j = 0; j < nl; plus(j)) + D[i][j] = (int) (((i*(j+TWO)+TWO) % nk) / (5*nk)); +} + + +static +int print_array(int ni, int nl, + int G[ 16 + 0][22 + 0]) +{ + int i, j; + int ONE = 1; + int res = 0; + + for (i = 0; i < ni; plus(i)) + for (j = 0; j < nl; plus(j)) { + res ^= G[i][j]; + } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif + return res; +} + + + + +static +void kernel_3mm(int ni, int nj, int nk, int nl, int nm, + int E[ 16 + 0][18 + 0], + int A[ 16 + 0][20 + 0], + int B[ 20 + 0][18 + 0], + int F[ 18 + 0][22 + 0], + int C[ 18 + 0][24 + 0], + int D[ 24 + 0][22 + 0], + int G[ 16 + 0][22 + 0]) +{ + int ONE = 1; + int i, j, k; + + for (i = 0; i < ni; plus(i)) + for (j = 0; j < nj; plus(j)) + { + E[i][j] = 0; + for (k = 0; k < nk; plus(k)) + E[i][j] += A[i][k] * B[k][j]; + } + + for (i = 0; i < nj; plus(i)) + for (j = 0; j < nl; plus(j)) + { + F[i][j] = 0; + for (k = 0; k < nm; plus(k)) + F[i][j] += C[i][k] * D[k][j]; + } + + for (i = 0; i < ni; plus(i)) + for (j = 0; j < nl; plus(j)) + { + G[i][j] = 0; + for (k = 0; k < nj; plus(k)) + G[i][j] += E[i][k] * F[k][j]; + } + +} + +int main() +{ + + int ni = 16; + int nj = 18; + int nk = 20; + int nl = 22; + int nm = 24; + + + int E[16 + 0][18 + 0]; + int A[16 + 0][20 + 0]; + int B[20 + 0][18 + 0]; + int F[18 + 0][22 + 0]; + int C[18 + 0][24 + 0]; + int D[24 + 0][22 + 0]; + int G[16 + 0][22 + 0]; + + + init_array (ni, nj, nk, nl, nm, + A, + B, + C, + D); + + kernel_3mm (ni, nj, nk, nl, nm, + E, + A, + B, + F, + C, + D, + G); + + + return print_array(ni, nl, G); + +} diff --git a/benchmarks/polybench-syn-div/linear-algebra/kernels/Makefile b/benchmarks/polybench-syn-div/linear-algebra/kernels/Makefile new file mode 100644 index 0000000..4b7f6e1 --- /dev/null +++ b/benchmarks/polybench-syn-div/linear-algebra/kernels/Makefile @@ -0,0 +1,3 @@ +TARGETS := 2mm 3mm atas bicg doitgen mvt + +include ../../common.mk diff --git a/benchmarks/polybench-syn-div/linear-algebra/kernels/atas.c b/benchmarks/polybench-syn-div/linear-algebra/kernels/atas.c new file mode 100644 index 0000000..970465b --- /dev/null +++ b/benchmarks/polybench-syn-div/linear-algebra/kernels/atas.c @@ -0,0 +1,103 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* atax.c: this file is part of PolyBench/C */ + +#include "../../include/misc.h" + +#ifndef SYNTHESIS + #include +#endif + +#define plus(i) i = i + ONE +static +void init_array (int m, int n, + int A[ 38 + 0][42 + 0], + int x[ 42 + 0]) +{ + int ONE = 1; + int i, j; + int fn; + fn = (int)n; + + for (i = 0; i < n; plus(i)) + x[i] = ONE + (i / fn); + for (i = 0; i < m; plus(i)) + for (j = 0; j < n; plus(j)) + A[i][j] = (int) (((i+j) % n) / (5*m)); +} + + +static +int print_array(int n, + int y[ 42 + 0]) + +{ + int i; + int ONE = 1; + int res = 0; + + for (i = 0; i < n; plus(i)) { + res ^= y[i]; + } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif + return res; +} + + +static +void kernel_atax(int m, int n, + int A[ 38 + 0][42 + 0], + int x[ 42 + 0], + int y[ 42 + 0], + int tmp[ 38 + 0]) +{ + int i, j; + int ONE = 1; + + for (i = 0; i < n; plus(i)) + y[i] = 0; + for (i = 0; i < m; plus(i)) + { + tmp[i] = 0; + for (j = 0; j < n; plus(j)) + tmp[i] = tmp[i] + A[i][j] * x[j]; + for (j = 0; j < n; plus(j)) + y[j] = y[j] + A[i][j] * tmp[i]; + } + +} + + +int main() +{ + + int m = 38; + int n = 42; + + + int A[38 + 0][42 + 0]; + int x[42 + 0]; + int y[42 + 0]; + int tmp[38 + 0]; + + init_array (m, n, A, x); + + kernel_atax (m, n, + A, + x, + y, + tmp); + + + return print_array(n, y); + +} diff --git a/benchmarks/polybench-syn-div/linear-algebra/kernels/bicg.c b/benchmarks/polybench-syn-div/linear-algebra/kernels/bicg.c new file mode 100644 index 0000000..4d1f9b6 --- /dev/null +++ b/benchmarks/polybench-syn-div/linear-algebra/kernels/bicg.c @@ -0,0 +1,120 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* bicg.c: this file is part of PolyBench/C */ + + +#ifndef SYNTHESIS + #include +#endif + +#define plus(i) i = i + ONE +static +void init_array (int m, int n, + int A[ 42 + 0][38 + 0], + int r[ 42 + 0], + int p[ 38 + 0]) +{ + int i, j; + int ONE = 1; + + for (i = 0; i < m; plus(i)) + p[i] = ((i % m) / m); + for (i = 0; i < n; plus(i)) { + r[i] = ((i % n) / n); + for (j = 0; j < m; plus(j)) + A[i][j] = (((i*(j+ONE)) % n) / n); + } +} + + + + +static +int print_array(int m, int n, + int s[ 38 + 0], + int q[ 42 + 0]) + +{ + int i; + int ONE = 1; + int res = 0; + + for (i = 0; i < m; plus(i)) { + res ^= s[i]; + } + for (i = 0; i < n; plus(i)) { + res ^= q[i]; + } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif + return res; +} + + + + +static +void kernel_bicg(int m, int n, + int A[ 42 + 0][38 + 0], + int s[ 38 + 0], + int q[ 42 + 0], + int p[ 38 + 0], + int r[ 42 + 0]) +{ + int i, j; + int ONE = 1; + + for (i = 0; i < m; plus(i)) + s[i] = 0; + for (i = 0; i < n; plus(i)) + { + q[i] = 0; + for (j = 0; j < m; plus(j)) + { + s[j] = s[j] + r[i] * A[i][j]; + q[i] = q[i] + A[i][j] * p[j]; + } + } + +} + + +int main() +{ + + int n = 42; + int m = 38; + + + int A[42 + 0][38 + 0]; + int s[38 + 0]; + int q[42 + 0]; + int p[38 + 0]; + int r[42 + 0]; + + + init_array (m, n, + A, + r, + p); + + kernel_bicg (m, n, + A, + s, + q, + p, + r); + + + return print_array(m, n, s, q); + + +} diff --git a/benchmarks/polybench-syn-div/linear-algebra/kernels/doitgen.c b/benchmarks/polybench-syn-div/linear-algebra/kernels/doitgen.c new file mode 100644 index 0000000..6eaef56 --- /dev/null +++ b/benchmarks/polybench-syn-div/linear-algebra/kernels/doitgen.c @@ -0,0 +1,105 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* doitgen.c: this file is part of PolyBench/C */ + +#ifndef SYNTHESIS + #include +#endif + +#define plus(i) i = i + ONE +static +void init_array(int nr, int nq, int np, + int A[ 10 + 0][8 + 0][12 + 0], + int C4[ 12 + 0][12 + 0]) +{ + int i, j, k; + int ONE = 1; + + for (i = 0; i < nr; plus(i)) + for (j = 0; j < nq; plus(j)) + for (k = 0; k < np; plus(k)) + A[i][j][k] = (int) (((i*j + k) % np) / np); + for (i = 0; i < np; plus(i)) + for (j = 0; j < np; plus(j)) + C4[i][j] = (int) (((i*j) % np) / np); +} + + +static +int print_array(int nr, int nq, int np, + int A[ 10 + 0][8 + 0][12 + 0]) +{ + int i, j, k; + int ONE = 1; + int res = 0; + + for (i = 0; i < nr; plus(i)) + for (j = 0; j < nq; plus(j)) + for (k = 0; k < np; plus(k)) { + res ^= A[i][j][k]; + } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif + return res; +} + + + + +void kernel_doitgen(int nr, int nq, int np, + int A[ 10 + 0][8 + 0][12 + 0], + int C4[ 12 + 0][12 + 0], + int sum[ 12 + 0]) +{ + int r, q, p, s; + int ONE = 1; + + for (r = 0; r < nr; plus(r)) + for (q = 0; q < nq; plus(q)) { + for (p = 0; p < np; plus(p)) { + sum[p] = 0; + for (s = 0; s < np; plus(s)) + sum[p] += A[r][q][s] * C4[s][p]; + } + for (p = 0; p < np; plus(p)) + A[r][q][p] = sum[p]; + } + +} + + +int main() +{ + + int nr = 10; + int nq = 8; + int np = 12; + + + int A[10 + 0][8 + 0][12 + 0]; + int sum[12 + 0]; + int C4[12 + 0][12 + 0]; + + + init_array (nr, nq, np, + A, + C4); + + + kernel_doitgen (nr, nq, np, + A, + C4, + sum); + + + + return print_array(nr, nq, np, A); +} diff --git a/benchmarks/polybench-syn-div/linear-algebra/kernels/mvt.c b/benchmarks/polybench-syn-div/linear-algebra/kernels/mvt.c new file mode 100644 index 0000000..4548ca5 --- /dev/null +++ b/benchmarks/polybench-syn-div/linear-algebra/kernels/mvt.c @@ -0,0 +1,124 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* mvt.c: this file is part of PolyBench/C */ + +#include "../../include/misc.h" + +#ifndef SYNTHESIS + #include +#endif + +#define plus(i) i = i + ONE + +static +void init_array(int n, + int x1[ 40 + 0], + int x2[ 40 + 0], + int y_1[ 40 + 0], + int y_2[ 40 + 0], + int A[ 40 + 0][40 + 0]) +{ + int i, j; + int ONE = 1; + int THREE = 3; + + for (i = 0; i < n; plus(i)) + { + x1[i] = (int) ((i % n) / n); + x2[i] = (int) (((i + ONE) % n) / n); + y_1[i] = (int) (((i + THREE) % n) / n); + y_2[i] = (int) (((i + 4) % n) / n); + for (j = 0; j < n; plus(j)) + A[i][j] = (int) (((i*j) % n) / n); + } +} + + + + + static +int print_array(int n, + int x1[ 40 + 0], + int x2[ 40 + 0]) + +{ + int i; + int ONE = 1; + int res = 0; + + for (i = 0; i < n; plus(i)) { + res ^= x1[i]; + } + + for (i = 0; i < n; plus(i)) { + res ^= x2[i]; + } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif + return res; +} + + + + +static +void kernel_mvt(int n, + int x1[ 40 + 0], + int x2[ 40 + 0], + int y_1[ 40 + 0], + int y_2[ 40 + 0], + int A[ 40 + 0][40 + 0]) +{ + int i, j; + int ONE = 1; + + for (i = 0; i < n; plus(i)) + for (j = 0; j < n; plus(j)) + x1[i] = x1[i] + A[i][j] * y_1[j]; + for (i = 0; i < n; plus(i)) + for (j = 0; j < n; plus(j)) + x2[i] = x2[i] + A[j][i] * y_2[j]; + +} + + +int main() +{ + + int n = 40; + + + int A[40 + 0][40 + 0]; + int x1[40 + 0]; + int x2[40 + 0]; + int y_1[40 + 0]; + int y_2[40 + 0]; + + + + init_array (n, + x1, + x2, + y_1, + y_2, + A); + + + kernel_mvt (n, + x1, + x2, + y_1, + y_2, + A); + + return print_array(n, x1, x2); + +} diff --git a/benchmarks/polybench-syn-div/linear-algebra/solvers/Makefile b/benchmarks/polybench-syn-div/linear-algebra/solvers/Makefile new file mode 100644 index 0000000..146620b --- /dev/null +++ b/benchmarks/polybench-syn-div/linear-algebra/solvers/Makefile @@ -0,0 +1,3 @@ +TARGETS := cholesky durbin lu ludcmp trisolv + +include ../../common.mk diff --git a/benchmarks/polybench-syn-div/linear-algebra/solvers/cholesky.c b/benchmarks/polybench-syn-div/linear-algebra/solvers/cholesky.c new file mode 100644 index 0000000..5f10ab9 --- /dev/null +++ b/benchmarks/polybench-syn-div/linear-algebra/solvers/cholesky.c @@ -0,0 +1,129 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* cholesky.c: this file is part of PolyBench/C */ + +#include "../../include/misc.h" + +#ifndef SYNTHESIS +#include +#endif + +# define SQRT_FUN(x) sqrtf(x) + +#define plus(i) i = i + ONE +static +void init_array(int n, + int A[40][40]) +{ + int i, j; + int ONE = 1; + + for (i = 0; i < n; plus(i)) + { + for (j = 0; j <= i; plus(j)) + A[i][j] = (int)(((-j) % n) / n) + ONE; + for (j = i + ONE; j < n; plus(j)) { + A[i][j] = 0; + } + A[i][i] = 1; + } + + + int r,s,t; + int B[40][40]; + for (r = 0; r < n; ++r) + for (s = 0; s < n; ++s) + B[r][s] = 0; + for (t = 0; t < n; ++t) + for (r = 0; r < n; ++r) + for (s = 0; s < n; ++s) + B[r][s] += A[r][t] * A[s][t]; + for (r = 0; r < n; ++r) + for (s = 0; s < n; ++s) + A[r][s] = B[r][s]; + +} + + + + +static +int check_array(int n, + int A[40][40]) + +{ + int res = 0; + int ONE = 1; + int i, j; + + for (i = 0; i < n; plus(i)) + for (j = 0; j <= i; plus(j)) { + if(A[i][j]!=0) res = 1; + } + #ifndef SYNTHESIS + printf("finished: %u\n", res); + #endif + + return res; +} + + + + +static +void kernel_cholesky(int n, + int A[40][40]) +{ + int i, j, k; + int ONE = 1; + + for (i = 0; i < n; plus(i)) { + + for (j = 0; j < i; plus(j)) { + for (k = 0; k < j; plus(k)) { + A[i][j] -= A[i][k] * A[j][k]; + } + A[i][j] = (A[i][j] / A[j][j]); + } + + for (k = 0; k < i; plus(k)) { + A[i][i] -= A[i][k] * A[i][k]; + } + int sq = 0; int val = 0; int cmp = A[i][i]; + while(sq <= cmp) { + val = val + ONE; + sq = val * val; + } + A[i][i] = val; + } + +} + + +int main() +{ + + int n = 40; + + + int A[40][40]; + + + init_array (n, A); + + + kernel_cholesky (n, A); + + + return check_array(n, A); + + + return 0; +} diff --git a/benchmarks/polybench-syn-div/linear-algebra/solvers/durbin.c b/benchmarks/polybench-syn-div/linear-algebra/solvers/durbin.c new file mode 100644 index 0000000..5646e6e --- /dev/null +++ b/benchmarks/polybench-syn-div/linear-algebra/solvers/durbin.c @@ -0,0 +1,98 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* durbin.c: this file is part of PolyBench/C */ + +#ifndef SYNTHESIS +#include +#endif + +#define plus(i) i = i + ONE +/* Include polybench common header. */ +static +void init_array (int n, + int r[ 40 + 0]) +{ + int ONE = 1; + int i; + + for (i = 0; i < n; plus(i)) + { + r[i] = (n+ONE-i); + } +} + + + +static +int print_array(int n, + int y[ 40 + 0]) + +{ + int ONE = 1; + int i; + int res = 0; + + for (i = 0; i < n; plus(i)) { + res ^= y[i]; + } + +#ifndef SYNTHESIS + printf("finished: %u\n", res); +#endif + + return res; +} + +static +void kernel_durbin(int n, + int r[ 40 + 0], + int y[ 40 + 0]) +{ + int z[40]; + int alpha; + int beta; + int sum; + + int ONE = 1; + int i,k; + y[0] = -r[0]; + beta = 1; + alpha = -r[0]; + + for (k = 1; k < n; plus(k)) { + beta = (ONE-alpha*alpha)*beta; + sum = 0; + for (i=0; i + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* lu.c: this file is part of PolyBench/C */ + +//#include +//#include +//#include +//#include + +#ifndef SYNTHESIS +#include +#endif + +#define plus(i) i = i + ONE + +static +void init_array (int n, + int A[40][40]) +{ + int ONE = 1; + int i, j; + + for (i = 0; i < n; plus(i)) + { + for (j = 0; j <= i; plus(j)) + A[i][j] = (((-j) % n) / n) + ONE; + for (j = i+1; j < n; plus(j)) { + A[i][j] = 0; + } + A[i][i] = 1; + } + + + + int r,s,t; + int B[40][40]; // B = (int(*)[40 + 0][40 + 0])polybench_alloc_data ((40 + 0) * (40 + 0), sizeof(int));; + for (r = 0; r < n; plus(r)) + for (s = 0; s < n; plus(s)) + B[r][s] = 0; + for (t = 0; t < n; plus(t)) + for (r = 0; r < n; plus(r)) + for (s = 0; s < n; plus(s)) + B[r][s] += A[r][t] * A[s][t]; + for (r = 0; r < n; plus(r)) + for (s = 0; s < n; plus(s)) + A[r][s] = B[r][s]; + //free((void*)B);; + +} + +static +void kernel_lu(int n, + int A[ 40][40]) +{ + int i, j, k; + int ONE = 1; + + for (i = 0; i < n; plus(i)) { + for (j = 0; j + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* ludcmp.c: this file is part of PolyBench/C */ + +#ifndef SYNTHESIS +#include +#endif + +#define plus(i) i = i + ONE + + static +void init_array (int n, + int A[ 40 + 0][40 + 0], + int b[ 40 + 0], + int x[ 40 + 0], + int y[ 40 + 0]) +{ + int i, j; + int ONE = 1; + int fn = (int)n; + + for (i = 0; i < n; plus(i)) + { + x[i] = 0; + y[i] = 0; + b[i] = ((i+1) / (fn*2)) + 4; + } + + for (i = 0; i < n; plus(i)) + { + for (j = 0; j <= i; plus(j)) + A[i][j] = (int)(((-j) % n) / n) + 1; + for (j = i+ONE; j < n; plus(j)) { + A[i][j] = 0; + } + A[i][i] = 1; + } + + + + int r,s,t; + int B[40 + 0][40 + 0]; + for (r = 0; r < n; plus(r)) + for (s = 0; s < n; plus(s)) + B[r][s] = 0; + for (t = 0; t < n; plus(t)) + for (r = 0; r < n; plus(r)) + for (s = 0; s < n; plus(s)) + B[r][s] += A[r][t] * A[s][t]; + for (r = 0; r < n; plus(r)) + for (s = 0; s < n; plus(s)) + A[r][s] = B[r][s]; + +} + + + + + static +int check_array(int n, + int x[ 40 + 0]) + +{ + int i; + int ONE = 1; + int res = 0; + + for (i = 0; i < n; plus(i)) { + res ^= x[i]; + } +#ifndef SYNTHESIS + printf("finished: %u\n", res); +#endif + return res; +} + + + + + static +void kernel_ludcmp(int n, + int A[ 40 + 0][40 + 0], + int b[ 40 + 0], + int x[ 40 + 0], + int y[ 40 + 0]) +{ + int i, j, k; + int ONE = 1; + + int w; + + for (i = 0; i < n; plus(i)) { + for (j = 0; j =0; i=i-ONE) { + w = y[i]; + for (j = i+ONE; j < n; plus(j)) + w -= A[i][j] * x[j]; + x[i] = (w / A[i][i]); + } + +} + + +int main() +{ + + int n = 40; + + + int A[40 + 0][40 + 0]; + int b[40 + 0]; + int x[40 + 0]; + int y[40 + 0]; + + + + init_array (n, + A, + b, + x, + y); + + + kernel_ludcmp (n, + A, + b, + x, + y); + + return check_array(n, x); + + + return 0; +} diff --git a/benchmarks/polybench-syn-div/linear-algebra/solvers/trisolv.c b/benchmarks/polybench-syn-div/linear-algebra/solvers/trisolv.c new file mode 100644 index 0000000..f426853 --- /dev/null +++ b/benchmarks/polybench-syn-div/linear-algebra/solvers/trisolv.c @@ -0,0 +1,97 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* trisolv.c: this file is part of PolyBench/C */ + +#ifndef SYNTHESIS +#include +#endif + +#define plus(i) i = i + ONE +static +void init_array(int n, + int L[ 40 ][40 ], + int x[ 40 ], + int b[ 40 ]) +{ + int i, j; + int ONE = 1; + + for (i = 0; i < n; plus(i)) + { + x[i] = -999; + b[i] = i ; + for (j = 0; j <= i; plus(j)) + L[i][j] = (int) (((i+n-j+ONE)*(ONE+ONE)) / n); + } +} + + + + +static +int check_array(int n, + int x[ 40]) + +{ + int i; + int res = 0; + int ONE = 1; + for (i = 0; i < n; plus(i)) { + res ^= x[i]; + } + +#ifndef SYNTHESIS + printf("finished: %u\n", res); +#endif + return res; +} + + + + +static +void kernel_trisolv(int n, + int L[ 40 + 0][40 + 0], + int x[ 40 + 0], + int b[ 40 + 0]) +{ + int i, j; + int ONE = 1; + + for (i = 0; i < n; plus(i)) + { + x[i] = b[i]; + for (j = 0; j + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* floyd-warshall.c: this file is part of PolyBench/C */ + +#ifndef SYNTHESIS + #include +#endif + +#define plus(i) i = i + ONE +static +void init_array (int n, + int path[ 60 + 0][60 + 0]) +{ + int i, j; + int ONE = 1; + + for (i = 0; i < n; plus(i)) + for (j = 0; j < n; plus(j)) { + path[i][j] = i*(j % 7)+ONE; + //if (((i+j)%13 == ZERO || (i+j)%7== ZERO || (i+j)%11 == ZERO ) != 0 ) + if(((((i+j) % 13) == (int)0 || ((i+j) % 7) == (int)0)!=0 || ((i+j) % 11) == (int)0 ) != 0) + path[i][j] = 999; + } +} + + + + +static +int print_array(int n, + int path[ 60 + 0][60 + 0]) + +{ + int i, j; + int res = 0; + int ONE = 1; + + for (i = 0; i < n; plus(i)) + for (j = 0; j < n; plus(j)) { + res ^= path[i][j]; + } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif + return res; +} + + + + +static +void kernel_floyd_warshall(int n, + int path[ 60 + 0][60 + 0]) +{ + int i, j, k; + int ONE = 1; + + for (k = 0; k < n; plus(k)) + { + for(i = 0; i < n; plus(i)) + for (j = 0; j < n; plus(j)) + path[i][j] = path[i][j] < path[i][k] + path[k][j] ? + path[i][j] : path[i][k] + path[k][j]; + } + +} + + +int main() +{ + + int n = 60; + + + int path[60 + 0][60 + 0]; + + init_array (n, path); + + kernel_floyd_warshall (n, path); + + return print_array(n, path); + + return 0; +} diff --git a/benchmarks/polybench-syn-div/medley/nussinov.c b/benchmarks/polybench-syn-div/medley/nussinov.c new file mode 100644 index 0000000..e2e06d3 --- /dev/null +++ b/benchmarks/polybench-syn-div/medley/nussinov.c @@ -0,0 +1,111 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* nussinov.c: this file is part of PolyBench/C */ + +typedef int base; + +#ifndef SYNTHESIS + #include +#endif + +#define plus(i) i = i + ONE +static +void init_array (int n, + base seq[ 60 + 0], + int table[ 60 + 0][60 + 0]) +{ + int i, j; + int ONE = 1; + int FOUR = 4; + + + for (i=0; i = ZERO; i=i-ONE) { + for (j=i+ONE; j=ZERO) + table[i][j] = ((table[i][j] >= table[i][j-ONE]) ? table[i][j] : table[i][j-ONE]); + if (i+ONE= table[i+ONE][j]) ? table[i][j] : table[i+ONE][j]); + + if ((j-ONE>=ZERO && i+ONE= table[i+ONE][j-ONE]+(((seq[i])+(seq[j])) == THREE ? ONE : ZERO)) ? table[i][j] : table[i+ONE][j-ONE]+(((seq[i])+(seq[j])) == THREE ? ONE : ZERO)); + else + table[i][j] = ((table[i][j] >= table[i+ONE][j-ONE]) ? table[i][j] : table[i+ONE][j-ONE]); + } + + for (k=i+ONE; k= table[i][k] + table[k+ONE][j]) ? table[i][j] : table[i][k] + table[k+ONE][j]); + } + } + } + +} + + +int main() +{ + + int n = 60; + + + base (seq)[60 + 0]; + int (table)[60 + 0][60 + 0]; + + + init_array (n, seq, table); + + kernel_nussinov (n, seq, table); + + return print_array(n, table); + +} diff --git a/benchmarks/polybench-syn-div/poly.csv b/benchmarks/polybench-syn-div/poly.csv new file mode 100644 index 0000000..fe71983 --- /dev/null +++ b/benchmarks/polybench-syn-div/poly.csv @@ -0,0 +1,26 @@ +benchmark,legupcycles,legupfreqMHz,leguplogicutilisation,legupregs,leguprams,legupdsps,legupcomptime,vericertcycles,vericertfreqMHz,vericertlogicutilisation,vericertregs,vericertrams,vericertdsps,vericertcomptime +durbin,15106,188.61,2509,4008,0,8,4.77,19852,199.2,3027,6168,0,8,0.077 +lu,482766,244.62,3116,4593,0,10,4.72,2634766,92.97,54806,106037,0,6,0.097 +ludcmp,470843,249.69,3605,5397,0,15,4.87,2401354,83.52,57145,111408,0,10,0.132 +trisolv,35382,213.9,2412,3749,0,3,4.73,33550,112.59,28101,55109,0,2,0.086 +2mm,60088,226.5,1114,1936,0,7,4.80,427098,116.9,32600,63212,0,18,0.136 +3mm,204195,188.96,4210,4801,0,43,4.88,539430,97.13,45073,89719,0,18,0.147 +atas,126288,193.24,3026,3719,0,10,4.80,92000,130.41,28603,56646,0,6,0.069 +bicg,11907,303.4,308,537,0,6,4.78,121134,122.74,30091,58799,0,8,0.097 +mvt,16806,384.47,372,597,0,4,4.79,139194,119.93,30753,60450,0,6,0.130 +doitgen,57199,252.14,909,1402,0,2,5.05,350302,126.18,19898,38461,0,4,0.105 +symm,64903,284.41,2155,3170,0,10,4.63,248930,113.92,27693,54514,0,14,0.115 +syrk,57395,278.01,598,976,0,2,4.73,309018,87.15,76889,57816,0,8,0.094 +syr2k,125705,240.85,3149,3679,0,6,4.85,478040,78.6,120116,82032,0,12,0.116 +trmm,41432,281.61,610,990,0,4,4.71,147528,105.61,64031,40502,0,4,0.089 +gemm,83676,192.68,1029,1544,0,35,4.79,360772,121.61,31853,62126,0,16,0.104 +gemver,28087,303.49,1854,2380,0,8,4.68,175326,107.27,32615,64118,0,14,0.099 +gesummv,6634,310.46,298,504,0,4,4.77,111094,79.97,113876,72908,0,10,0.101 +covariance,109992,245.16,2098,3096,0,5,4.77,297450,110.57,28729,56660,0,4,0.083 +fdtd-2d,214153,262.61,2736,3801,0,2,4.73,831912,108.23,31333,61421,0,6,0.116 +heat-3d,41059,115.54,3132,2910,0,60,4.92,555930,110.42,33915,67273,0,9,0.181 +jacobi-1d,6914,386.25,1355,1885,0,0,4.72,16606,277.93,1636,3305,0,0,0.071 +jacobi-2d,84609,240.79,2347,3185,0,2,4.81,357100,113.53,30393,59782,0,4,0.079 +seidel-2d,345294,232.4,2128,3337,0,2,4.68,875758,127.99,26948,53133,0,2,0.091 +floyd-warshall,1238764,235.52,1869,2367,0,2,4.71,4762766,109.4,59859,118101,0,2,0.094 +nussinov,216467,273.07,1078,1431,0,2,4.79,837958,90.73,60663,119303,0,0,0.080 diff --git a/benchmarks/polybench-syn-div/quartus_synth.tcl b/benchmarks/polybench-syn-div/quartus_synth.tcl new file mode 100644 index 0000000..6edbf0c --- /dev/null +++ b/benchmarks/polybench-syn-div/quartus_synth.tcl @@ -0,0 +1,35 @@ +# PRiME pre-KAPow kernel flow +# Performs pre-KAPow run steps for instrumenting arbitrary Verilog for power monitoring +# James Davis, 2015 + +load_package flow + +project_new -overwrite syn +set_global_assignment -name FAMILY "Arria 10" +set_global_assignment -name DEVICE 10AX115H4F34E3LG +set_global_assignment -name SYSTEMVERILOG_FILE top.v +set_global_assignment -name TOP_LEVEL_ENTITY main +#set_global_assignment -name SDC_FILE syn.sdc +#set_global_assignment -name auto_resource_sharing on +#set_global_assignment -name enable_state_machine_inference on +#set_global_assignment -name optimization_technique area +#set_global_assignment -name synthesis_effort fast +#set_global_assignment -name AUTO_RAM_RECOGNITION on +#set_global_assignment -name remove_duplicate_registers on +#set_instance_assignment -name RAMSTYLE_ATTRIBUTE LOGIC -to ram + +execute_module -tool map + +execute_module -tool fit + +execute_module -tool sta + +#execute_module -tool eda -args "--simulation --tool=vcs" + +# set_global_assignment -name POWER_OUTPUT_SAF_NAME ${kernel}.asf +# set_global_assignment -name POWER_DEFAULT_INPUT_IO_TOGGLE_RATE "12.5 %" +# set_global_assignment -name POWER_REPORT_SIGNAL_ACTIVITY ON +# set_global_assignment -name POWER_REPORT_POWER_DISSIPATION ON +# execute_module -tool pow + +project_close diff --git a/benchmarks/polybench-syn-div/run-vericert.sh b/benchmarks/polybench-syn-div/run-vericert.sh new file mode 100755 index 0000000..6cf4cd9 --- /dev/null +++ b/benchmarks/polybench-syn-div/run-vericert.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +rm exec.csv + +top=$(pwd) + #set up +while read benchmark ; do + echo "Running "$benchmark + ./$benchmark.gcc > $benchmark.clog + cresult=$(cat $benchmark.clog | cut -d' ' -f2) + echo "C output: "$cresult + ./$benchmark.iver > $benchmark.tmp + veriresult=$(tail -1 $benchmark.tmp | cut -d' ' -f2) + cycles=$(tail -2 $benchmark.tmp | head -1 | tr -s ' ' | cut -d' ' -f2) + echo "Verilog output: "$veriresult + + #Undefined checks + if test -z $veriresult + then + echo "FAIL: Verilog returned nothing" + #exit 0 + fi + + # Don't care checks + if [ $veriresult == "x" ] + then + echo "FAIL: Verilog returned don't cares" + #exit 0 + fi + + # unequal result check + if [ $cresult -ne $veriresult ] + then + echo "FAIL: Verilog and C output do not match!" + #exit 0 + else + echo "PASS" + fi + name=$(echo $benchmark | awk -v FS="/" '{print $NF}') + echo $name","$cycles >> exec.csv +done < benchmark-list-master diff --git a/benchmarks/polybench-syn-div/script.R b/benchmarks/polybench-syn-div/script.R new file mode 100644 index 0000000..0be16da --- /dev/null +++ b/benchmarks/polybench-syn-div/script.R @@ -0,0 +1,29 @@ +library("psych") + +data = read.csv("poly.csv", header=TRUE) +leguptime = (data$legupcycles/data$legupfreqMHz) +veritime = data$vericertcycles/data$vericertfreqMHz +print(lm(veritime ~ leguptime)) +leguputil = data$leguplogicutilisation/427200*100 +veriutil = data$vericertlogicutilisation/427200*100 +print(lm (veriutil ~ leguputil)) +legupct = data$legupcomptime +verict = data$vericertcomptime +print(lm ( verict ~ legupct )) + +cycleslowdown=data$vericertcycles/data$legupcycles + +print("Cycle count slow down") +print(geometric.mean(cycleslowdown)) +print("Wall clock slow down") +print(geometric.mean(veritime/leguptime)) +print("Area overhead") +print(geometric.mean(veriutil/leguputil)) +print("Compilation time speedup") +print(geometric.mean(legupct/verict)) +print("LegUp RAM use") +print(geometric.mean(data$legupregs)) +print("Vericert RAM use") +print(geometric.mean(data$vericertregs)) +print("Area overhead") +print(geometric.mean(data$vericertregs/data$legupregs)) diff --git a/benchmarks/polybench-syn-div/setup-syn-vericert.sh b/benchmarks/polybench-syn-div/setup-syn-vericert.sh new file mode 100755 index 0000000..22356f7 --- /dev/null +++ b/benchmarks/polybench-syn-div/setup-syn-vericert.sh @@ -0,0 +1,24 @@ +#! /bin/bash + +top=$(pwd) + #set up + basedir=poly-syn + sshhost=$1 + ssh $sshhost "cd ~; rm -r $basedir" + ssh $sshhost "cd ~; mkdir $basedir" + scp quartus_synth.tcl $sshhost:$basedir + scp syn-remote.sh $sshhost:$basedir + rm syn-list + + while read benchmark ; + do + echo "Copying "$benchmark" over" + name=$(echo $benchmark | awk -v FS="/" '{print $NF}') + echo "Name: "$name + benchdir="~/$basedir/$name" + scp $benchmark.v $sshhost:~/$basedir + echo $name >> syn-list + done < benchmark-list-master + + # copy list over + scp syn-list $sshhost:$basedir diff --git a/benchmarks/polybench-syn-div/stencils/Makefile b/benchmarks/polybench-syn-div/stencils/Makefile new file mode 100644 index 0000000..d2e1c9b --- /dev/null +++ b/benchmarks/polybench-syn-div/stencils/Makefile @@ -0,0 +1,6 @@ +TARGETS := adi fdtd-2d heat-3d jacobi-1d jacobi-2d seidel-2d + +include ../common.mk + +adi.v: adi.c + $(VERICERT) $(VERICERT_OPTS) -O0 -finline $< -o $@ diff --git a/benchmarks/polybench-syn-div/stencils/adi.c b/benchmarks/polybench-syn-div/stencils/adi.c new file mode 100644 index 0000000..9fa4f2a --- /dev/null +++ b/benchmarks/polybench-syn-div/stencils/adi.c @@ -0,0 +1,125 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* adi.c: this file is part of PolyBench/C */ + +#ifndef SYNTHESIS +#include +#endif + +static +void init_array (int n, int u[ 20 + 0][20 + 0]) +{ + int i, j; + + for (i = 0; i < n; i++) + for (j = 0; j < n; j++) + { + u[i][j] = (((int)(i + n-j)) / n); + } +} + + + + +static +int print_array(int n, int u[ 20 + 0][20 + 0]) +{ + int i, j; + int res = 0; + + for (i = 0; i < n; i++) + for (j = 0; j < n; j++) { + res ^= u[i][j]; + } +#ifndef SYNTHESIS + printf("finished: %u\n", res); +#endif + + return res; +} +static +void kernel_adi(int tsteps, int n, + int u[ 20 + 0][20 + 0], + int v[ 20 + 0][20 + 0], + int p[ 20 + 0][20 + 0], + int q[ 20 + 0][20 + 0]) +{ + int t, i, j; + int B1, B2; + int mul1, mul2; + int a, b, c, d, e, f; + + B1 = 2; + B2 = 1; + mul1 = divider(B1 * n * n, tsteps); + mul2 = divider(B2 * n * n, tsteps); + + a = -(sdivider(mul1,2)); + b = 1+mul1; + c = a; + d = -(sdivider(mul2,2)); + e = 1+mul2; + f = d; + int ZERO = 0; + + for (t=1; t<=tsteps; t++) { + + for (i=1; i=1; j--) { + v[j][i] = p[i][j] * v[j+1][i] + q[i][j]; + } + } + + for (i=1; i=1; j--) { + u[i][j] = p[i][j] * u[i][j+1] + q[i][j]; + } + } + } +} + +int main() +{ + + int n = 20; + int tsteps = 20; + + + int u[20 + 0][20 + 0]; + int v[20 + 0][20 + 0]; + int p[20 + 0][20 + 0]; + int q[20 + 0][20 + 0]; + + + + init_array (n, u); + + kernel_adi (tsteps, n, u, v, p, q); + + return print_array(n, u); + +} diff --git a/benchmarks/polybench-syn-div/stencils/fdtd-2d.c b/benchmarks/polybench-syn-div/stencils/fdtd-2d.c new file mode 100644 index 0000000..2c5cdb2 --- /dev/null +++ b/benchmarks/polybench-syn-div/stencils/fdtd-2d.c @@ -0,0 +1,134 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* fdtd-2d.c: this file is part of PolyBench/C */ + +#ifndef SYNTHESIS +#include +#endif + +#define plus(i) i = i + ONE +static +void init_array (int tmax, + int nx, + int ny, + int ex[ 20 + 0][30 + 0], + int ey[ 20 + 0][30 + 0], + int hz[ 20 + 0][30 + 0], + int _fict_[ 20 + 0]) +{ + int i, j; + int ONE = 1; + + for (i = 0; i < tmax; plus(i)) + _fict_[i] = (int) i; + for (i = 0; i < nx; plus(i)) + for (j = 0; j < ny; plus(j)) + { + ex[i][j] = ((i*(j+1)) / nx); + ey[i][j] = ((i*(j+2)) / ny); + hz[i][j] = ((i*(j+3)) / nx); + } + +} + + + + +static +int print_array(int nx, + int ny, + int ex[ 20 + 0][30 + 0], + int ey[ 20 + 0][30 + 0], + int hz[ 20 + 0][30 + 0]) +{ + int i, j; + int res = 0; + int ONE = 1; + + for (i = 0; i < nx; plus(i)) + for (j = 0; j < ny; plus(j)) { + res ^= ex[i][j]; + } + for (i = 0; i < nx; plus(i)) + for (j = 0; j < ny; plus(j)) { + res ^= ey[i][j]; + } + for (i = 0; i < nx; plus(i)) + for (j = 0; j < ny; plus(j)) { + res ^= hz[i][j]; + } + +#ifndef SYNTHESIS + printf("finished: %u\n", res); +#endif + + return res; +} + + +static +void kernel_fdtd_2d(int tmax, + int nx, + int ny, + int ex[ 20 + 0][30 + 0], + int ey[ 20 + 0][30 + 0], + int hz[ 20 + 0][30 + 0], + int _fict_[ 20 + 0]) +{ + int t, i, j; + int ONE = 1; + + for(t = 0; t < tmax; t=t+ONE) + { + for (j = 0; j < ny; plus(j)) + ey[0][j] = _fict_[t]; + for (i = 1; i < nx; plus(i)) + for (j = 0; j < ny; plus(j)) + ey[i][j] = ey[i][j] - ((hz[i][j]-((hz[i-ONE][j])>>1))); + for (i = 0; i < nx; plus(i)) + for (j = 1; j < ny; plus(j)) + ex[i][j] = ex[i][j] - ((hz[i][j]-((hz[i][j-ONE])>>1))); + for (i = 0; i < nx - ONE; plus(i)) + for (j = 0; j < ny - ONE; plus(j)){ + int tmp = (ex[i][j+ONE] - ex[i][j] + + ey[i+ONE][j] - ey[i][j]); + hz[i][j] = hz[i][j] - (tmp >> 1) - (tmp >> 2); + } + } + +} + + +int main() +{ + + int tmax = 20; + int nx = 20; + int ny = 30; + + + int ex[20 + 0][30 + 0]; + int ey[20 + 0][30 + 0]; + int hz[20 + 0][30 + 0]; + int _fict_[20 + 0]; + + init_array (tmax, nx, ny, + ex, + ey, + hz, + _fict_); + kernel_fdtd_2d (tmax, nx, ny, + ex, + ey, + hz, + _fict_); + + return print_array(nx, ny, ex, ey, hz); +} diff --git a/benchmarks/polybench-syn-div/stencils/heat-3d.c b/benchmarks/polybench-syn-div/stencils/heat-3d.c new file mode 100644 index 0000000..f93082e --- /dev/null +++ b/benchmarks/polybench-syn-div/stencils/heat-3d.c @@ -0,0 +1,112 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* heat-3d.c: this file is part of PolyBench/C */ + +#include "../include/misc.h" + +#ifndef SYNTHESIS +#include +#endif + +#define plus(i) i = i + ONE +static +void init_array (int n, + int A[ 10 + 0][10 + 0][10 + 0], + int B[ 10 + 0][10 + 0][10 + 0]) +{ + int i, j, k; + int ONE = 1; + + for (i = 0; i < n; plus(i)) + for (j = 0; j < n; plus(j)) + for (k = 0; k < n; plus(k)) + A[i][j][k] = B[i][j][k] = (int) (i + j + (n-k))* (10 / n); +} + + + + +static +int print_array(int n, + int A[ 10 + 0][10 + 0][10 + 0]) + +{ + int i, j, k; + int ONE = 1; + int res = 0; + + for (i = 0; i < n; plus(i)) + for (j = 0; j < n; plus(j)) + for (k = 0; k < n; plus(k)) { + res ^= A[i][j][k]; + } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif + return res; +} + + + + +static +void kernel_heat_3d(int tsteps, + int n, + int A[ 10 + 0][10 + 0][10 + 0], + int B[ 10 + 0][10 + 0][10 + 0]) +{ + int t, i, j, k; + int ONE = 1; + int TWO = 2; + + for (t = 1; t <= 5; plus(t)) { + for (i = 1; i < n-ONE; plus(i)) { + for (j = 1; j < n-ONE; plus(j)) { + for (k = 1; k < n-ONE; plus(k)) { + B[i][j][k] = ((A[i+ONE][j][k] - TWO * A[i][j][k] + A[i-ONE][j][k]) >> 4) + + ((A[i][j+ONE][k] - TWO * A[i][j][k] + A[i][j-ONE][k]) >> 4) + + ((A[i][j][k+ONE] - TWO * A[i][j][k] + A[i][j][k-ONE]) >> 4) + + A[i][j][k] + ; + } + } + } + for (i = 1; i < n-ONE; plus(i)) { + for (j = 1; j < n-ONE; plus(j)) { + for (k = 1; k < n-ONE; plus(k)) { + A[i][j][k] = ((B[i+ONE][j][k] - TWO * B[i][j][k] + B[i-ONE][j][k]) >> 4 ) + + ((B[i][j+ONE][k] - TWO * B[i][j][k] + B[i][j-ONE][k]) >> 4 ) + + ((B[i][j][k+ONE] - TWO * B[i][j][k] + B[i][j][k-ONE]) >> 4 ) + + B[i][j][k]; + //; + } + } + } + } +} + + +int main() +{ + + int n = 10; + int tsteps = 20; + + + int A[10 + 0][10 + 0][10 + 0]; + int B[10 + 0][10 + 0][10 + 0]; + + init_array (n, A, B); + + kernel_heat_3d (tsteps, n, A, B); + + return print_array(n, A); + +} diff --git a/benchmarks/polybench-syn-div/stencils/jacobi-1d.c b/benchmarks/polybench-syn-div/stencils/jacobi-1d.c new file mode 100644 index 0000000..993773e --- /dev/null +++ b/benchmarks/polybench-syn-div/stencils/jacobi-1d.c @@ -0,0 +1,101 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* jacobi-1d.c: this file is part of PolyBench/C */ + +#ifndef SYNTHESIS +#include +#endif + +#define plus(i) i = i + ONE +static +void init_array (int n, + int A[ 30 + 0], + int B[ 30 + 0]) +{ + int i; + int ONE = 1; + int TWO = 2; + int THREE = 3; + + for (i = 0; i < n; plus(i)) + { + A[i] = (((int) i+TWO) / n); + B[i] = (((int) i+THREE) / n); + } +} + + + + +static +int print_array(int n, + int A[ 30 + 0]) + +{ + int i; + int ONE = 1; + int res = 0; + + for (i = 0; i < n; plus(i)) + { + res ^= A[i]; + } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif + return res; +} + + + + +static +void kernel_jacobi_1d(int tsteps, + int n, + int A[ 30 + 0], + int B[ 30 + 0]) +{ + int t, i; + int ONE = 1; + + for (t = 0; t < tsteps; plus(t)) + { + for (i = 1; i < n - ONE; plus(i)){ + B[i] = (A[i-ONE] + A[i] + A[i + ONE]); + B[i] = B[i] >> 2; + } + for (i = 1; i < n - ONE; plus(i)){ + A[i] = (B[i-ONE] + B[i] + B[i + ONE]); + A[i] = A[i] >> 2; + } + } + +} + + +int main() +{ + + int n = 30; + int tsteps = 20; + + + int A[30 + 0]; + int B[30 + 0]; + + + + init_array (n, A, B); + + kernel_jacobi_1d(tsteps, n, A, B); + + return print_array(n, A); + +} diff --git a/benchmarks/polybench-syn-div/stencils/jacobi-2d.c b/benchmarks/polybench-syn-div/stencils/jacobi-2d.c new file mode 100644 index 0000000..bb6afec --- /dev/null +++ b/benchmarks/polybench-syn-div/stencils/jacobi-2d.c @@ -0,0 +1,108 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* jacobi-2d.c: this file is part of PolyBench/C */ + +#include "../include/misc.h" + +#ifndef SYNTHESIS +#include +#endif + + +#define plus(i) i = i + ONE +static +void init_array (int n, + int A[ 30 + 0][30 + 0], + int B[ 30 + 0][30 + 0]) +{ + int i, j; + int ONE = 1; + int TWO = 2; + int THREE = 3; + + for (i = 0; i < n; plus(i)) + for (j = 0; j < n; plus(j)) + { + A[i][j] = (((int) i*(j+TWO) + TWO) / n); + B[i][j] = (((int) i*(j+THREE) + THREE) / n); + } +} + + + + +static +int print_array(int n, + int A[ 30 + 0][30 + 0]) + +{ + int i, j; + int ONE = 1; + int res = 0; + + for (i = 0; i < n; plus(i)) + for (j = 0; j < n; plus(j)) { + res ^= A[i][j]; + } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif + return res; +} + + + + +static +void kernel_jacobi_2d(int tsteps, + int n, + int A[ 30 + 0][30 + 0], + int B[ 30 + 0][30 + 0]) +{ + int t, i, j; + int ONE = 1; + int TWO = 2; + + for (t = 0; t < tsteps; plus(t)) + { + for (i = 1; i < n - ONE; plus(i)) + for (j = 1; j < n - ONE; plus(j)){ + B[i][j] = (A[i][j] + A[i][j-ONE] + A[i][ONE+j] + A[ONE+i][j] + A[i-ONE][j]); + B[i][j] = B[i][j] >> TWO; + } + for (i = 1; i < n - ONE; plus(i)) + for (j = 1; j < n - ONE; plus(j)){ + A[i][j] = (B[i][j] + B[i][j-ONE] + B[i][ONE+j] + B[ONE+i][j] + B[i-ONE][j]); + A[i][j] = A[i][j] >> TWO; + } + } + +} + + +int main() +{ + + int n = 30; + int tsteps = 5; + + + int A[30 + 0][30 + 0]; + int B[30 + 0][30 + 0]; + + + + init_array (n, A, B); + + kernel_jacobi_2d(tsteps, n, A, B); + + return print_array(n, A); + +} diff --git a/benchmarks/polybench-syn-div/stencils/seidel-2d.c b/benchmarks/polybench-syn-div/stencils/seidel-2d.c new file mode 100644 index 0000000..4a3b1ac --- /dev/null +++ b/benchmarks/polybench-syn-div/stencils/seidel-2d.c @@ -0,0 +1,92 @@ +/** + * This version is stamped on May 10, 2016 + * + * Contact: + * Louis-Noel Pouchet + * Tomofumi Yuki + * + * Web address: http://polybench.sourceforge.net + */ +/* seidel-2d.c: this file is part of PolyBench/C */ + +#include "../include/misc.h" + +#ifndef SYNTHESIS +#include +#endif + +#define plus(i) i = i + ONE +static +void init_array (int n, + int A[ 40 + 0][40 + 0]) +{ + int i, j; + int ONE = 1; + int TWO = 2; + + for (i = 0; i < n; plus(i)) + for (j = 0; j < n; plus(j)) + A[i][j] = (((int) i*(j+TWO) + TWO) / n); +} + + + + +static +int print_array(int n, + int A[ 40 + 0][40 + 0]) + +{ + int i, j; + int ONE = 1; + int res = 0; + + for (i = 0; i < n; plus(i)) + for (j = 0; j < n; plus(j)) { + res ^= A[i][j]; + } +#ifndef SYNTHESIS + printf("finished %u\n", res); +#endif + return res; +} + + + + +static +void kernel_seidel_2d(int tsteps, + int n, + int A[ 40 + 0][40 + 0]) +{ + int t, i, j; + int ONE = 1; + int TWO = 2; + int NINE = 9; + + for (t = 0; t <= tsteps - ONE; plus(t)) + for (i = ONE; i<= n - TWO; plus(i)) + for (j = ONE; j <= n - TWO; plus(j)) + A[i][j] = ((A[i-ONE][j-ONE] + A[i-ONE][j] + A[i-ONE][j+ONE] + + A[i][j-ONE] + A[i][j] + A[i][j+ONE] + + A[i+ONE][j-ONE] + A[i+ONE][j] + A[i+ONE][j+ONE]) / NINE); + +} + + +int main() +{ + + int n = 40; + int tsteps = 5; + + + int A[40 + 0][40 + 0]; + + init_array (n, A); + + kernel_seidel_2d (tsteps, n, A); + + return print_array(n, A); + +} diff --git a/benchmarks/polybench-syn-div/syn-remote.sh b/benchmarks/polybench-syn-div/syn-remote.sh new file mode 100755 index 0000000..879db2e --- /dev/null +++ b/benchmarks/polybench-syn-div/syn-remote.sh @@ -0,0 +1,51 @@ +#! /bin/bash + +#setup +while read benchmark ; +do +echo "Setting up "$benchmark +rm -r $benchmark +mkdir $benchmark +cp $benchmark.v $benchmark/top.v + +done < syn-list + +#synthesis + +count=0 +while read benchmark ; + +do +echo "Synthesising "$benchmark +cd $benchmark +quartus_sh -t ../quartus_synth.tcl & +let "count=count+1" +cd .. + +if [ $count -eq 4 ] +then +echo "I am here" +wait +count=0 +fi + +done < syn-list + +if [ $count -lt 4 ] +then +wait +fi + +#extract +while read benchmark ; do + cd $benchmark + echo $(pwd) + freq=$(grep MHz syn.sta.rpt | tail -2 | head -1 | awk '{print $2}') + lut=$(sed -n -e 8p syn.fit.summary | awk '{print $6}' | sed 's/,//g') + regs=$(sed -n -e 9p syn.fit.summary | awk '{print $4}') + bram=$(sed -n -e 13p syn.fit.summary | awk '{print $5}') + dsp=$(sed -n -e 14p syn.fit.summary | awk '{print $5}') + cd .. + echo $benchmark","$freq","$lut","$regs","$bram","$dsp >> results +done < syn-list + -- cgit From c4853aa99ad65d0fa6f014df1f52c62bc2b6fd31 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sun, 11 Jul 2021 01:34:00 +0200 Subject: Fix some more of the benchmarks --- .../polybench-syn-div/data-mining/covariance.c | 2 +- benchmarks/polybench-syn-div/exec.csv | 34 +++++----------------- benchmarks/polybench-syn-div/medley/Makefile | 3 ++ .../polybench-syn-div/medley/floyd-warshall.c | 4 +-- benchmarks/polybench-syn-div/stencils/adi.c | 16 +++++----- 5 files changed, 21 insertions(+), 38 deletions(-) (limited to 'benchmarks/polybench-syn-div') diff --git a/benchmarks/polybench-syn-div/data-mining/covariance.c b/benchmarks/polybench-syn-div/data-mining/covariance.c index b29a5bd..88de67e 100644 --- a/benchmarks/polybench-syn-div/data-mining/covariance.c +++ b/benchmarks/polybench-syn-div/data-mining/covariance.c @@ -27,7 +27,7 @@ void init_array (int m, int n, for (i = 0; i < 32; plus(i)) for (j = 0; j < 28; plus(j)) - data[i][j] = ((int) i*j) / 28; + data[i][j] = ((int) i*j) / (27+ONE); } diff --git a/benchmarks/polybench-syn-div/exec.csv b/benchmarks/polybench-syn-div/exec.csv index 6ebeced..8d1f5da 100644 --- a/benchmarks/polybench-syn-div/exec.csv +++ b/benchmarks/polybench-syn-div/exec.csv @@ -1,27 +1,7 @@ -2mm,467612 -3mm,604582 -adi,1831462 -atas,101618 -bicg,130790 -cholesky,2575070 -covariance,340794 -doitgen,386782 -durbin,23832 -fdtd-2d,958412 -floyd-warshall,5414366 -gemm,406774 -gemver,193048 -gesummv,116556 -heat-3d,592770 -jacobi-1d,19996 -jacobi-2d,397200 -lu,2893146 -ludcmp,2641694 -mvt,148874 -nussinov,956490 -seidel-2d,942338 -symm,279832 -syr2k,525908 -syrk,338286 -trisolv,36050 -trmm,165828 +adi,1422354 +heat-3d,580770 +fdtd-2d,901430 +jacobi-1d,19622 +seidel-2d,664780 +jacobi-2d,344072 +nussinov,954402 diff --git a/benchmarks/polybench-syn-div/medley/Makefile b/benchmarks/polybench-syn-div/medley/Makefile index 816a0ce..01da9de 100644 --- a/benchmarks/polybench-syn-div/medley/Makefile +++ b/benchmarks/polybench-syn-div/medley/Makefile @@ -1,3 +1,6 @@ TARGETS := floyd-warshall nussinov include ../common.mk + +floyd-warshall.v: floyd-warshall.c + $(VERICERT) $(VERICERT_OPTS) -O0 -finline $< -o $@ diff --git a/benchmarks/polybench-syn-div/medley/floyd-warshall.c b/benchmarks/polybench-syn-div/medley/floyd-warshall.c index 74d5c9b..776d95a 100644 --- a/benchmarks/polybench-syn-div/medley/floyd-warshall.c +++ b/benchmarks/polybench-syn-div/medley/floyd-warshall.c @@ -23,9 +23,9 @@ void init_array (int n, for (i = 0; i < n; plus(i)) for (j = 0; j < n; plus(j)) { - path[i][j] = i*(j % 7)+ONE; + path[i][j] = i*(j % (ONE+6))+ONE; //if (((i+j)%13 == ZERO || (i+j)%7== ZERO || (i+j)%11 == ZERO ) != 0 ) - if(((((i+j) % 13) == (int)0 || ((i+j) % 7) == (int)0)!=0 || ((i+j) % 11) == (int)0 ) != 0) + if(((((i+j) % (12+ONE)) == (int)0 || ((i+j) % (ONE+6)) == (int)0)!=0 || ((i+j) % (10+ONE)) == (int)0 ) != 0) path[i][j] = 999; } } diff --git a/benchmarks/polybench-syn-div/stencils/adi.c b/benchmarks/polybench-syn-div/stencils/adi.c index 9fa4f2a..be2b766 100644 --- a/benchmarks/polybench-syn-div/stencils/adi.c +++ b/benchmarks/polybench-syn-div/stencils/adi.c @@ -58,13 +58,13 @@ void kernel_adi(int tsteps, int n, B1 = 2; B2 = 1; - mul1 = divider(B1 * n * n, tsteps); - mul2 = divider(B2 * n * n, tsteps); + mul1 = ((B1 * n * n) / tsteps); + mul2 = ((B2 * n * n) /tsteps); - a = -(sdivider(mul1,2)); + a = -((mul1 / 2)); b = 1+mul1; c = a; - d = -(sdivider(mul2,2)); + d = -((mul2 / 2)); e = 1+mul2; f = d; int ZERO = 0; @@ -76,8 +76,8 @@ void kernel_adi(int tsteps, int n, p[i][ZERO] = 0; q[i][ZERO] = v[ZERO][i]; for (j=1; j=1; j--) { -- cgit From c73f4e44c96310540434d0b9cc81e969c6430b90 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sun, 11 Jul 2021 14:12:50 +0200 Subject: Fix the small test bench for Vericert --- benchmarks/polybench-syn-div/exec.csv | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'benchmarks/polybench-syn-div') diff --git a/benchmarks/polybench-syn-div/exec.csv b/benchmarks/polybench-syn-div/exec.csv index 8d1f5da..e28109b 100644 --- a/benchmarks/polybench-syn-div/exec.csv +++ b/benchmarks/polybench-syn-div/exec.csv @@ -5,3 +5,23 @@ jacobi-1d,19622 seidel-2d,664780 jacobi-2d,344072 nussinov,954402 +floyd-warshall,5373798 +3mm,536114 +2mm,404478 +doitgen,351988 +bicg,53916 +mvt,70204 +atas,58424 +syrk,271816 +gemver,117394 +symm,240172 +gesummv,37700 +gemm,328104 +trmm,144688 +syr2k,436520 +cholesky,2535686 +trisolv,25192 +lu,2853646 +ludcmp,2601382 +durbin,22974 +covariance,288392 -- cgit