diff --git a/OpenMP/linear-algebra/kernels/atax/atax.c b/OpenMP/linear-algebra/kernels/atax/atax.c index efe9ded..51f2d4b 100644 --- a/OpenMP/linear-algebra/kernels/atax/atax.c +++ b/OpenMP/linear-algebra/kernels/atax/atax.c @@ -24,8 +24,11 @@ static void init_array(int nx, int ny, { int i, j; + // TODO: Optimizable loop, every task has no dependencies on the other ones for (i = 0; i < ny; i++) x[i] = i * M_PI; + + // TODO: Optimizable loop, every task has no dependencies on the other ones for (i = 0; i < nx; i++) for (j = 0; j < ny; j++) A[i][j] = ((DATA_TYPE)i * (j + 1)) / nx; @@ -39,6 +42,8 @@ static void print_array(int nx, { int i; + // Cannot optimize this: prints have to be dependent on each other to make sense! + for (i = 0; i < nx; i++) { fprintf(stderr, DATA_PRINTF_MODIFIER, y[i]); @@ -58,11 +63,18 @@ static void kernel_atax(int nx, int ny, { int i, j; + // TODO: Optimizable loop, no dependencies for (i = 0; i < _PB_NY; i++) y[i] = 0; + + // TODO: Optimizable loop, no dependencies + // actually tmp[i] could be a local variable + for (i = 0; i < _PB_NX; i++) + tmp[i] = 0; + + // TODO: what do we do here? for (i = 0; i < _PB_NX; i++) { - tmp[i] = 0; for (j = 0; j < _PB_NY; j++) tmp[i] = tmp[i] + A[i][j] * x[j]; for (j = 0; j < _PB_NY; j++)