From 95861dbef966e2cb612b303615681fc29c3acd3d Mon Sep 17 00:00:00 2001 From: Nadesh Ramanathan Date: Wed, 11 Nov 2020 19:47:42 +0000 Subject: polybench edits --- benchmarks/polybench-syn/linear-algebra/kernels/3mm.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'benchmarks/polybench-syn/linear-algebra/kernels/3mm.c') diff --git a/benchmarks/polybench-syn/linear-algebra/kernels/3mm.c b/benchmarks/polybench-syn/linear-algebra/kernels/3mm.c index e565fb5..2905719 100644 --- a/benchmarks/polybench-syn/linear-algebra/kernels/3mm.c +++ b/benchmarks/polybench-syn/linear-algebra/kernels/3mm.c @@ -9,6 +9,9 @@ */ /* 3mm.c: this file is part of PolyBench/C */ + +#include "../../include/misc.h" + #define plus(i) i = i + ONE static void init_array(int ni, int nj, int nk, int nl, int nm, @@ -21,25 +24,22 @@ void init_array(int ni, int nj, int nk, int nl, int nm, int ONE = 1; int TWO = 2; int THREE = 3; - int FIVE = 5; for (i = 0; i < ni; plus(i)) for (j = 0; j < nk; plus(j)) - A[i][j] = (int) ((i*j+ONE) % ni) / (5*ni); + A[i][j] = (int) divider(smodulo((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); + B[i][j] = (int) divider(smodulo((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); + C[i][j] = (int) divider(smodulo(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); + D[i][j] = (int) divider(smodulo((i*(j+TWO)+TWO), nk), (5*nk)); } - - static int print_array(int ni, int nl, int G[ 16 + 0][22 + 0]) @@ -71,8 +71,6 @@ void kernel_3mm(int ni, int nj, int nk, int nl, int nm, int ONE = 1; int i, j, k; -#pragma scop - for (i = 0; i < ni; plus(i)) for (j = 0; j < nj; plus(j)) { @@ -96,11 +94,9 @@ void kernel_3mm(int ni, int nj, int nk, int nl, int nm, for (k = 0; k < nj; plus(k)) G[i][j] += E[i][k] * F[k][j]; } -#pragma endscop } - int main() { -- cgit