Commit b20734aa authored by James Willis's avatar James Willis
Browse files

Use only one vector to process interactions by default.

parent 8cf40a42
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#define IACT runner_iact_nonsym_density #define IACT runner_iact_nonsym_density
#define IACT_VEC runner_iact_nonsym_2_vec_density #define IACT_VEC runner_iact_nonsym_2_vec_density
#define IACT_NAME "test_nonsym_density" #define IACT_NAME "test_nonsym_density"
#define NUM_VEC_PROC_INT 2
#endif #endif
#ifdef SYM_DENSITY #ifdef SYM_DENSITY
...@@ -53,8 +54,9 @@ ...@@ -53,8 +54,9 @@
#ifndef IACT #ifndef IACT
#define IACT runner_iact_nonsym_density #define IACT runner_iact_nonsym_density
#define IACT_VEC runner_iact_nonsym_2_vec_density #define IACT_VEC runner_iact_nonsym_1_vec_density
#define IACT_NAME "test_nonsym_density" #define IACT_NAME "test_nonsym_density"
#define NUM_VEC_PROC_INT 1
#endif #endif
/** /**
...@@ -368,9 +370,10 @@ void test_interactions(struct part test_part, struct part *parts, size_t count, ...@@ -368,9 +370,10 @@ void test_interactions(struct part test_part, struct part *parts, size_t count,
/* Perform vector interaction. */ /* Perform vector interaction. */
#ifdef WITH_VECTORIZATION #ifdef WITH_VECTORIZATION
vector hi_vec, hi_inv_vec, vix_vec, viy_vec, viz_vec, mask, mask2; vector hi_vec, hi_inv_vec, vix_vec, viy_vec, viz_vec;
vector rhoSum, rho_dhSum, wcountSum, wcount_dhSum, div_vSum, curlvxSum, vector rhoSum, rho_dhSum, wcountSum, wcount_dhSum, div_vSum, curlvxSum,
curlvySum, curlvzSum; curlvySum, curlvzSum;
mask_t mask, mask2;
rhoSum.v = vec_set1(0.f); rhoSum.v = vec_set1(0.f);
rho_dhSum.v = vec_set1(0.f); rho_dhSum.v = vec_set1(0.f);
...@@ -387,28 +390,32 @@ void test_interactions(struct part test_part, struct part *parts, size_t count, ...@@ -387,28 +390,32 @@ void test_interactions(struct part test_part, struct part *parts, size_t count,
viz_vec.v = vec_load(&vizq[0]); viz_vec.v = vec_load(&vizq[0]);
hi_inv_vec = vec_reciprocal(hi_vec); hi_inv_vec = vec_reciprocal(hi_vec);
mask.m = vec_setint1(0xFFFFFFFF); vec_init_mask(mask);
mask2.m = vec_setint1(0xFFFFFFFF); vec_init_mask(mask2);
#ifdef HAVE_AVX512_F
KNL_MASK_16 knl_mask, knl_mask2;
knl_mask = 0xFFFF;
knl_mask2 = 0xFFFF;
#endif
const ticks vec_tic = getticks(); const ticks vec_tic = getticks();
for (size_t i = 0; i < count; i += 2 * VEC_SIZE) { for (size_t i = 0; i < count; i += NUM_VEC_PROC_INT * VEC_SIZE) {
/* Interleave two vectors for interaction. */
#if (NUM_VEC_PROC_INT == 2)
IACT_VEC(&(r2q[i]), &(dxq[i]), &(dyq[i]), &(dzq[i]), (hi_inv_vec), IACT_VEC(&(r2q[i]), &(dxq[i]), &(dyq[i]), &(dzq[i]), (hi_inv_vec),
(vix_vec), (viy_vec), (viz_vec), &(vjxq[i]), &(vjyq[i]), (vix_vec), (viy_vec), (viz_vec), &(vjxq[i]), &(vjyq[i]),
&(vjzq[i]), &(mjq[i]), &rhoSum, &rho_dhSum, &wcountSum, &(vjzq[i]), &(mjq[i]), &rhoSum, &rho_dhSum, &wcountSum,
&wcount_dhSum, &div_vSum, &curlvxSum, &curlvySum, &curlvzSum, &wcount_dhSum, &div_vSum, &curlvxSum, &curlvySum, &curlvzSum,
mask, mask2, mask, mask2, 0);
#ifdef HAVE_AVX512_F #else /* Only use one vector for interaction. */
knl_mask, knl_mask2); vector r2, dx, dy, dz;
#else r2.v = vec_load(&(r2q[i]));
0, 0); dx.v = vec_load(&(dxq[i]));
dy.v = vec_load(&(dyq[i]));
dz.v = vec_load(&(dzq[i]));
IACT_VEC(&r2, &dx, &dy, &dz, (hi_inv_vec),
(vix_vec), (viy_vec), (viz_vec), &(vjxq[i]), &(vjyq[i]),
&(vjzq[i]), &(mjq[i]), &rhoSum, &rho_dhSum, &wcountSum,
&wcount_dhSum, &div_vSum, &curlvxSum, &curlvySum, &curlvzSum,
mask);
#endif #endif
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment