Commit 73090f83 authored by James Willis's avatar James Willis
Browse files

Used new mask type in runner_dopair1_density_vec and fixed bug in benchmarkInteractions.c

parent 3b6b4f56
......@@ -1283,10 +1283,10 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
int doi_mask;
/* Form r2 < hig2 mask. */
v_doi_mask.v = vec_cmp_lt(v_r2.v, v_hig2.v);
vec_create_mask(v_doi_mask, vec_cmp_lt(v_r2.v, v_hig2.v));
/* Form integer mask. */
doi_mask = vec_cmp_result(v_doi_mask.v);
doi_mask = vec_form_int_mask(v_doi_mask);
/* If there are any interactions perform them. */
if (doi_mask)
......@@ -1410,10 +1410,10 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
int doj_mask;
/* Form r2 < hig2 mask. */
v_doj_mask.v = vec_cmp_lt(v_r2.v, v_hjg2.v);
vec_create_mask(v_doj_mask, vec_cmp_lt(v_r2.v, v_hjg2.v));
/* Form integer mask. */
doj_mask = vec_cmp_result(v_doj_mask.v);
doj_mask = vec_form_int_mask(v_doj_mask);
/* If there are any interactions perform them. */
if (doj_mask)
......
......@@ -78,6 +78,7 @@
#define vec_cmp_lte(a, b) _mm512_cmp_ps_mask(a, b, _CMP_LE_OQ)
#define vec_cmp_gte(a, b) _mm512_cmp_ps_mask(a, b, _CMP_GE_OQ)
#define vec_cmp_result(a) a
#define vec_form_int_mask(a) a
#define vec_and(a, b) _mm512_and_ps(a, b)
#define vec_mask_and(a, b) a & b
#define vec_init_mask(mask) mask = 0xFFFF
......@@ -167,6 +168,7 @@
#define vec_cmp_lte(a, b) _mm256_cmp_ps(a, b, _CMP_LE_OQ)
#define vec_cmp_gte(a, b) _mm256_cmp_ps(a, b, _CMP_GE_OQ)
#define vec_cmp_result(a) _mm256_movemask_ps(a)
#define vec_form_int_mask(a) _mm256_movemask_ps(a.v)
#define vec_and(a, b) _mm256_and_ps(a, b)
#define vec_mask_and(a, b) _mm256_and_ps(a.v, b.v)
#define vec_init_mask(mask) mask.m = vec_setint1(0xFFFFFFFF)
......
......@@ -388,7 +388,7 @@ void test_interactions(struct part test_part, struct part *parts, size_t count,
hi_inv_vec = vec_reciprocal(hi_vec);
mask_vec_t mask, mask2;
mask_t mask, mask2;
vec_init_mask(mask);
vec_init_mask(mask2);
......
Markdown is supported
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