diff --git a/src/cache.h b/src/cache.h index 173884591a44a6a6a6e85953a6a5f7d2b3d77238..c41e11c34246ef0de93bb1ae7500277aab555b9e 100644 --- a/src/cache.h +++ b/src/cache.h @@ -253,9 +253,9 @@ __attribute__((always_inline)) INLINE void cache_read_particles_subset( /* The cell is on the right so read the particles * into the cache from the start of the cell. */ if (!flipped) { - int rem = (*last_pi + 1) % VEC_SIZE; + const int rem = (*last_pi + 1) % VEC_SIZE; if (rem != 0) { - int pad = VEC_SIZE - rem; + const int pad = VEC_SIZE - rem; /* Increase last_pi if there are particles in the cell left to read. */ if (*last_pi + pad < ci->count) *last_pi += pad; @@ -299,15 +299,15 @@ __attribute__((always_inline)) INLINE void cache_read_particles_subset( /* The cell is on the left so read the particles * into the cache from the end of the cell. */ else { - int rem = (ci->count - *first_pi) % VEC_SIZE; + const int rem = (ci->count - *first_pi) % VEC_SIZE; if (rem != 0) { - int pad = VEC_SIZE - rem; + const int pad = VEC_SIZE - rem; /* Decrease first_pi if there are particles in the cell left to read. */ if (*first_pi - pad >= 0) *first_pi -= pad; } - int ci_cache_count = ci->count - *first_pi; + const int ci_cache_count = ci->count - *first_pi; /* Shift the particles positions to a local frame so single precision can be * used instead of double precision. */ diff --git a/src/runner_doiact_vec.c b/src/runner_doiact_vec.c index 6e137f7d3ebabb30fe55e19d712df0729501b639..1a018da162b552b80604af888c624dd50e09afdd 100644 --- a/src/runner_doiact_vec.c +++ b/src/runner_doiact_vec.c @@ -262,7 +262,7 @@ __attribute__((always_inline)) INLINE static void storeInteractions( * @param active_ci Is any particle in cell ci active? * @param active_cj Is any particle in cell cj active? */ -__attribute__((always_inline)) INLINE static void populate_max_index( +__attribute__((always_inline)) INLINE static void populate_max_index_density( const struct cell *ci, const struct cell *cj, const struct entry *restrict sort_i, const struct entry *restrict sort_j, const float dx_max, const float rshift, const double hi_max, @@ -1390,7 +1390,7 @@ __attribute__((always_inline)) INLINE void runner_dopair1_density_vec( /* Find particles maximum index into cj, max_index_i[] and ci, max_index_j[]. * Also find the first pi that interacts with any particle in cj and the last * pj that interacts with any particle in ci. */ - populate_max_index(ci, cj, sort_i, sort_j, dx_max, rshift, hi_max, hj_max, + populate_max_index_density(ci, cj, sort_i, sort_j, dx_max, rshift, hi_max, hj_max, di_max, dj_min, max_index_i, max_index_j, &first_pi, &last_pj, max_active_bin, active_ci, active_cj);