Skip to content
Snippets Groups Projects
Commit fd3d64a8 authored by James Willis's avatar James Willis
Browse files

Renamed cache_read_two_cells_sorted_2 -> cache_read_two_partial_cells_sorted.

parent 08de60bd
No related branches found
No related tags found
1 merge request!320Dopair1 vectorisation merge
...@@ -359,25 +359,23 @@ __attribute__((always_inline)) INLINE void cache_read_two_cells_sorted( ...@@ -359,25 +359,23 @@ __attribute__((always_inline)) INLINE void cache_read_two_cells_sorted(
* @param last_pj The last particle in cell cj that is in range. * @param last_pj The last particle in cell cj that is in range.
* @param num_vec_proc Number of vectors that will be used to process the interaction. * @param num_vec_proc Number of vectors that will be used to process the interaction.
*/ */
__attribute__((always_inline)) INLINE void cache_read_two_cells_sorted_2( __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted(
const struct cell *const ci, const struct cell *const cj, struct cache *const ci_cache, struct cache *const cj_cache, const struct entry *restrict sort_i, const struct entry *restrict sort_j, const double *const shift, int *first_pi, int *last_pj, const int num_vec_proc) { const struct cell *const ci, const struct cell *const cj, struct cache *const ci_cache, struct cache *const cj_cache, const struct entry *restrict sort_i, const struct entry *restrict sort_j, const double *const shift, int *first_pi, int *last_pj, const int num_vec_proc) {
int idx, ci_cache_idx; int idx, ci_cache_idx;
/* Pad number of particles read to the vector size. */ /* Pad number of particles read to the vector size. */
int rem = (ci->count - *first_pi) % (num_vec_proc * VEC_SIZE); int rem = (ci->count - *first_pi) % (num_vec_proc * VEC_SIZE);
if (rem != 0) { if (rem != 0) {
int pad = (num_vec_proc * VEC_SIZE) - rem; int pad = (num_vec_proc * VEC_SIZE) - rem;
if (*first_pi - pad >= 0) if (*first_pi - pad >= 0) *first_pi -= pad;
*first_pi -= pad;
} }
rem = *last_pj % (num_vec_proc * VEC_SIZE); rem = *last_pj % (num_vec_proc * VEC_SIZE);
if (rem != 0) { if (rem != 0) {
int pad = (num_vec_proc * VEC_SIZE) - rem; int pad = (num_vec_proc * VEC_SIZE) - rem;
if (*last_pj + pad < cj->count) if (*last_pj + pad < cj->count) *last_pj += pad;
*last_pj += pad;
} }
int first_pi_align = *first_pi; int first_pi_align = *first_pi;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment