From 0eb63cb6842c4e46f015fc08be5d7b7862a8b47c Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 17 Nov 2022 01:57:13 +0100 Subject: [PATCH] `init_array`: Format second for loop --- OpenMP/linear-algebra/kernels/atax/atax.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OpenMP/linear-algebra/kernels/atax/atax.c b/OpenMP/linear-algebra/kernels/atax/atax.c index c214da2..385de63 100644 --- a/OpenMP/linear-algebra/kernels/atax/atax.c +++ b/OpenMP/linear-algebra/kernels/atax/atax.c @@ -32,9 +32,11 @@ static void init_array(int nx, int ny, /// Initialize the `A` matrix with [something?] #pragma omp parallel for num_threads(THREAD_COUNT) schedule(static) - for (i = 0; i < nx; i++) - for (j = 0; j < ny; j++) + for (i = 0; i < nx; i++) { + for (j = 0; j < ny; j++) { A[i][j] = ((DATA_TYPE)i * (j + 1)) / nx; + } + } } /* DCE code. Must scan the entire live-out data.