From f21f8ed249030032f4b0a99c0fcd7e210ddb2e1b Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sat, 10 Jul 2021 21:06:31 +0200 Subject: Add more documentation and clean up benchmarks --- .../polybench-syn/linear-algebra/blas/Makefile | 3 + .../linear-algebra/blas/trmm.preproc.c | 144 --------------------- .../polybench-syn/linear-algebra/kernels/Makefile | 3 + .../polybench-syn/linear-algebra/solvers/Makefile | 3 + 4 files changed, 9 insertions(+), 144 deletions(-) create mode 100644 benchmarks/polybench-syn/linear-algebra/blas/Makefile delete mode 100644 benchmarks/polybench-syn/linear-algebra/blas/trmm.preproc.c create mode 100644 benchmarks/polybench-syn/linear-algebra/kernels/Makefile create mode 100644 benchmarks/polybench-syn/linear-algebra/solvers/Makefile (limited to 'benchmarks/polybench-syn/linear-algebra') diff --git a/benchmarks/polybench-syn/linear-algebra/blas/Makefile b/benchmarks/polybench-syn/linear-algebra/blas/Makefile new file mode 100644 index 0000000..5c6d300 --- /dev/null +++ b/benchmarks/polybench-syn/linear-algebra/blas/Makefile @@ -0,0 +1,3 @@ +all: gemm gemver gesummv symm syr2k syrk trmm + +include ../common.mk diff --git a/benchmarks/polybench-syn/linear-algebra/blas/trmm.preproc.c b/benchmarks/polybench-syn/linear-algebra/blas/trmm.preproc.c deleted file mode 100644 index 9b8edfe..0000000 --- a/benchmarks/polybench-syn/linear-algebra/blas/trmm.preproc.c +++ /dev/null @@ -1,144 +0,0 @@ -/** - * 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 */ - -#include -#include -#include -#include - -/* Include polybench common header. */ -#include -# 1 "trmm.c" -# 1 "" 1 -# 1 "" 3 -# 362 "" 3 -# 1 "" 1 -# 1 "" 2 -# 1 "trmm.c" 2 -# 1 "utilities/polybench.h" 1 -# 30 "utilities/polybench.h" -# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h" 1 3 4 -# 31 "utilities/polybench.h" 2 -# 231 "utilities/polybench.h" -extern void* polybench_alloc_data(unsigned long long int n, int elt_size); -extern void polybench_free_data(void* ptr); - - - - -extern void polybench_flush_cache(); -extern void polybench_prepare_instruments(); -# 2 "trmm.c" 2 - - -# 1 "./linear-algebra/blas/trmm/trmm.h" 1 -# 5 "trmm.c" 2 - - - -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; - - *alpha = 1.5; - for (i = 0; i < m; i++) { - for (j = 0; j < i; j++) { - A[i][j] = (int)((i+j) % m)/m; - } - A[i][i] = 1.0; - for (j = 0; j < n; j++) { - B[i][j] = (int)((n+(i-j)) % n)/n; - } - } - -} - - - - -static -void print_array(int m, int n, - int B[ 20 + 0][30 + 0]) -{ - int i, j; - - fprintf(stderr, "==BEGIN DUMP_ARRAYS==\n"); - fprintf(stderr, "begin dump: %s", "B"); - for (i = 0; i < m; i++) - for (j = 0; j < n; j++) { - if ((i * m + j) % 20 == 0) fprintf (stderr, "\n"); - fprintf (stderr, "%d ", B[i][j]); - } - fprintf(stderr, "\nend dump: %s\n", "B"); - fprintf(stderr, "==END DUMP_ARRAYS==\n"); -} - - - - -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; -# 68 "trmm.c" -#pragma scop - for (i = 0; i < m; i++) - for (j = 0; j < n; j++) { - for (k = i+1; k < m; k++) - B[i][j] += A[k][i] * B[k][j]; - B[i][j] = alpha * B[i][j]; - } -#pragma endscop - -} - - -int main(int argc, char** argv) -{ - - int m = 20; - int n = 30; - - - int alpha; - int (*A)[20 + 0][20 + 0]; A = (int(*)[20 + 0][20 + 0])polybench_alloc_data ((20 + 0) * (20 + 0), sizeof(int));; - int (*B)[20 + 0][30 + 0]; B = (int(*)[20 + 0][30 + 0])polybench_alloc_data ((20 + 0) * (30 + 0), sizeof(int));; - - - init_array (m, n, &alpha, *A, *B); - - - ; - - - kernel_trmm (m, n, alpha, *A, *B); - - - ; - ; - - - - if (argc > 42 && ! strcmp(argv[0], "")) print_array(m, n, *B); - - - free((void*)A);; - free((void*)B);; - - return 0; -} diff --git a/benchmarks/polybench-syn/linear-algebra/kernels/Makefile b/benchmarks/polybench-syn/linear-algebra/kernels/Makefile new file mode 100644 index 0000000..ff59d0f --- /dev/null +++ b/benchmarks/polybench-syn/linear-algebra/kernels/Makefile @@ -0,0 +1,3 @@ +all: 2mm 3mm atas bicg doitgen mvt + +include ../common.mk diff --git a/benchmarks/polybench-syn/linear-algebra/solvers/Makefile b/benchmarks/polybench-syn/linear-algebra/solvers/Makefile new file mode 100644 index 0000000..d466d15 --- /dev/null +++ b/benchmarks/polybench-syn/linear-algebra/solvers/Makefile @@ -0,0 +1,3 @@ +all: cholesky durbin lu ludcmp trisolv + +include ../common.mk -- cgit From 6797b6b0472e87c1ef5edb84f81a16b73577f754 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sat, 10 Jul 2021 21:12:37 +0200 Subject: Fix Makefiles slightly --- benchmarks/polybench-syn/linear-algebra/blas/Makefile | 2 +- benchmarks/polybench-syn/linear-algebra/kernels/Makefile | 2 +- benchmarks/polybench-syn/linear-algebra/solvers/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'benchmarks/polybench-syn/linear-algebra') diff --git a/benchmarks/polybench-syn/linear-algebra/blas/Makefile b/benchmarks/polybench-syn/linear-algebra/blas/Makefile index 5c6d300..5cd6a49 100644 --- a/benchmarks/polybench-syn/linear-algebra/blas/Makefile +++ b/benchmarks/polybench-syn/linear-algebra/blas/Makefile @@ -1,3 +1,3 @@ -all: gemm gemver gesummv symm syr2k syrk trmm +TARGETS := gemm gemver gesummv symm syr2k syrk trmm include ../common.mk diff --git a/benchmarks/polybench-syn/linear-algebra/kernels/Makefile b/benchmarks/polybench-syn/linear-algebra/kernels/Makefile index ff59d0f..815b9a0 100644 --- a/benchmarks/polybench-syn/linear-algebra/kernels/Makefile +++ b/benchmarks/polybench-syn/linear-algebra/kernels/Makefile @@ -1,3 +1,3 @@ -all: 2mm 3mm atas bicg doitgen mvt +TARGETS := 2mm 3mm atas bicg doitgen mvt include ../common.mk diff --git a/benchmarks/polybench-syn/linear-algebra/solvers/Makefile b/benchmarks/polybench-syn/linear-algebra/solvers/Makefile index d466d15..b396027 100644 --- a/benchmarks/polybench-syn/linear-algebra/solvers/Makefile +++ b/benchmarks/polybench-syn/linear-algebra/solvers/Makefile @@ -1,3 +1,3 @@ -all: cholesky durbin lu ludcmp trisolv +TARGETS := cholesky durbin lu ludcmp trisolv include ../common.mk -- cgit From f46b0cd924705dcb4817129bb0504767c2225c20 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sat, 10 Jul 2021 21:21:06 +0200 Subject: Fix makefiles and add a parent makefile --- benchmarks/polybench-syn/linear-algebra/blas/Makefile | 2 +- benchmarks/polybench-syn/linear-algebra/kernels/Makefile | 2 +- benchmarks/polybench-syn/linear-algebra/solvers/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'benchmarks/polybench-syn/linear-algebra') diff --git a/benchmarks/polybench-syn/linear-algebra/blas/Makefile b/benchmarks/polybench-syn/linear-algebra/blas/Makefile index 5cd6a49..e1f3b58 100644 --- a/benchmarks/polybench-syn/linear-algebra/blas/Makefile +++ b/benchmarks/polybench-syn/linear-algebra/blas/Makefile @@ -1,3 +1,3 @@ TARGETS := gemm gemver gesummv symm syr2k syrk trmm -include ../common.mk +include ../../common.mk diff --git a/benchmarks/polybench-syn/linear-algebra/kernels/Makefile b/benchmarks/polybench-syn/linear-algebra/kernels/Makefile index 815b9a0..4b7f6e1 100644 --- a/benchmarks/polybench-syn/linear-algebra/kernels/Makefile +++ b/benchmarks/polybench-syn/linear-algebra/kernels/Makefile @@ -1,3 +1,3 @@ TARGETS := 2mm 3mm atas bicg doitgen mvt -include ../common.mk +include ../../common.mk diff --git a/benchmarks/polybench-syn/linear-algebra/solvers/Makefile b/benchmarks/polybench-syn/linear-algebra/solvers/Makefile index b396027..146620b 100644 --- a/benchmarks/polybench-syn/linear-algebra/solvers/Makefile +++ b/benchmarks/polybench-syn/linear-algebra/solvers/Makefile @@ -1,3 +1,3 @@ TARGETS := cholesky durbin lu ludcmp trisolv -include ../common.mk +include ../../common.mk -- cgit