diff --git a/src/impl/mpi_line.c b/src/impl/mpi_line.c index d4f05cb..cd77e30 100644 --- a/src/impl/mpi_line.c +++ b/src/impl/mpi_line.c @@ -67,7 +67,7 @@ float *compute_jacobi(int rank, int numprocs, int n, float init_value, float thr for (i = 1; i <= rows; i++) { for (j = 1; j <= n; j++) { new_value = 0.25 * (x[IDX(nb, i - 1, j)] + x[IDX(nb, i, j + 1)] + x[IDX(nb, i + 1, j)] + x[IDX(nb, i, j - 1)]); - max_diff = (float) fmax(max_diff, fabs(new_value - x[IDX(nb, i, j)])); + max_diff = (float) fmaxf(max_diff, fabs(new_value - x[IDX(nb, i, j)])); new_x[IDX(nb, i, j)] = new_value; } } diff --git a/src/impl/mpi_line_async.c b/src/impl/mpi_line_async.c index a7e21f3..5ace001 100644 --- a/src/impl/mpi_line_async.c +++ b/src/impl/mpi_line_async.c @@ -77,7 +77,7 @@ float *compute_jacobi(int rank, int numprocs, int n, float init_value, float thr for (i = 1; i <= rows; i++) { for (j = 1; j <= n; j++) { new_value = 0.25 * (x[IDX(nb, i - 1, j)] + x[IDX(nb, i, j + 1)] + x[IDX(nb, i + 1, j)] + x[IDX(nb, i, j - 1)]); - max_diff = (float) fmax(max_diff, fabs(new_value - x[IDX(nb, i, j)])); + max_diff = (float) fmaxf(max_diff, fabs(new_value - x[IDX(nb, i, j)])); new_x[IDX(nb, i, j)] = new_value; } } diff --git a/src/impl/omp.c b/src/impl/omp.c index b88fa14..0621942 100644 --- a/src/impl/omp.c +++ b/src/impl/omp.c @@ -45,7 +45,7 @@ float *compute_jacobi(int n, float init_value, float threshold, borders b, int * for (i = 1; i <= n; i++) { for (j = 1; j <= n; j++) { new_value = 0.25 * (x[IDX(nb, i - 1, j)] + x[IDX(nb, i, j + 1)] + x[IDX(nb, i + 1, j)] + x[IDX(nb, i, j - 1)]); - max_diff = (float) fmax(max_diff, fabs(new_value - x[IDX(nb, i, j)])); + max_diff = (float) fmaxf(max_diff, fabs(new_value - x[IDX(nb, i, j)])); new_x[IDX(nb, i, j)] = new_value; } } diff --git a/src/impl/sequential.c b/src/impl/sequential.c index 81b8259..4ed366d 100644 --- a/src/impl/sequential.c +++ b/src/impl/sequential.c @@ -42,7 +42,7 @@ float *compute_jacobi(int n, float init_value, float threshold, borders b, int * for (i = 1; i <= n; i++) { for (j = 1; j <= n; j++) { new_value = 0.25 * (x[IDX(nb, i - 1, j)] + x[IDX(nb, i, j + 1)] + x[IDX(nb, i + 1, j)] + x[IDX(nb, i, j - 1)]); - max_diff = (float) fmax(max_diff, fabs(new_value - x[IDX(nb, i, j)])); + max_diff = (float) fmaxf(max_diff, fabs(new_value - x[IDX(nb, i, j)])); new_x[IDX(nb, i, j)] = new_value; } } diff --git a/src/impl/sse.c b/src/impl/sse.c index 45300f4..6278eb6 100644 --- a/src/impl/sse.c +++ b/src/impl/sse.c @@ -59,12 +59,12 @@ float *compute_jacobi(int n, float init_value, float threshold, borders b, int * diff_vec = _mm_sub_ps(diff_vec, tmp_vec); _mm_storeu_ps(diffs, diff_vec); for (k = 0; k < 4; k++) { - max_diff = (float) fmax(max_diff, fabs(diffs[k])); + max_diff = (float) fmaxf(max_diff, fabs(diffs[k])); } } for (j = n_mult; j <= n; j++) { new_value = 0.25 * (x[IDX(nb, i - 1, j)] + x[IDX(nb, i, j + 1)] + x[IDX(nb, i + 1, j)] + x[IDX(nb, i, j - 1)]); - max_diff = (float) fmax(max_diff, fabs(new_value - x[IDX(nb, i, j)])); + max_diff = (float) fmaxf(max_diff, fabs(new_value - x[IDX(nb, i, j)])); new_x[IDX(nb, i, j)] = new_value; } }