Skip to content
Snippets Groups Projects
Commit ee0973f1 authored by gkusoglu's avatar gkusoglu
Browse files

trying optimize 2mm

parent 8da999e0
Branches
No related merge requests found
#!/bin/bash
rm $1 > /dev/null 2>&1
gcc -O3 -march=native -fopenmp -I ../utilities ../utilities/polybench.c $1.c -DPOLYBENCH_TIME -D$2_DATASET -o $1 -lm
if [[ $3 == "yes" ]] ; then
gcc -O3 -march=native -fopenmp -I ../utilities ../utilities/polybench.c $1.c -DPOLYBENCH_TIME -D$2_DATASET -o $1 -lm
else
gcc -O3 -march=native -I ../utilities ../utilities/polybench.c $1.c -DPOLYBENCH_TIME -D$2_DATASET -o $1 -lm
fi
for i in {0..999}
do
......
......@@ -86,11 +86,12 @@ void kernel_2mm(int ni, int nj, int nk, int nl,
#pragma scop
/* D := alpha*A*B*C + beta*D */
#pragma omp parallel
{
#pragma omp for schedule(static)
for (i = 0; i < _PB_NI; i++)
for (j = 0; j < _PB_NJ; j++)
tmp[i][j] = SCALAR_VAL(0.0);
#pragma omp for schedule(static)
for (i = 0; i < _PB_NI; i++)
for (k = 0; k < _PB_NK; ++k)
......@@ -101,12 +102,12 @@ void kernel_2mm(int ni, int nj, int nk, int nl,
for (i = 0; i < _PB_NI; i++)
for (j = 0; j < _PB_NL; j++)
D[i][j] *= beta;
#pragma omp for schedule(static)
for (i = 0; i < _PB_NI; i++)
for (k = 0; k < _PB_NJ; ++k)
for (j = 0; j < _PB_NL; j++)
D[i][j] += tmp[i][k] * C[k][j];
}
#pragma endscop
}
......
#!/bin/bash
rm $1 > /dev/null 2>&1
rm $2 > /dev/null 2>&1
gcc -O3 -march=native -fopenmp -I ../utilities ../utilities/polybench.c $1.c -DPOLYBENCH_DUMP_ARRAYS -D$3_DATASET -o $1 -lm
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment