Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
caea34d3
Commit
caea34d3
authored
May 19, 2017
by
James Willis
Browse files
Used mask_t type in runner_doself2_force_vec and fixed bug with benchmarkInteractions.
parent
d15616f9
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/runner_doiact_vec.c
View file @
caea34d3
...
@@ -736,6 +736,7 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec(
...
@@ -736,6 +736,7 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec(
vec_create_mask
(
v_doi_mask2_check
,
vec_cmp_gt
(
v_r2_2
.
v
,
vec_setzero
()));
vec_create_mask
(
v_doi_mask2_check
,
vec_cmp_gt
(
v_r2_2
.
v
,
vec_setzero
()));
vec_create_mask
(
v_doi_mask2
,
vec_cmp_lt
(
v_r2_2
.
v
,
v_hig2
.
v
));
vec_create_mask
(
v_doi_mask2
,
vec_cmp_lt
(
v_r2_2
.
v
,
v_hig2
.
v
));
/*TODO: Convert vector masks to integers before and operation. */
/* Combine the two masks and form an integer mask. */
/* Combine the two masks and form an integer mask. */
doi_mask
=
vec_cmp_result
(
vec_mask_and
(
v_doi_mask
,
v_doi_mask_check
));
doi_mask
=
vec_cmp_result
(
vec_mask_and
(
v_doi_mask
,
v_doi_mask_check
));
doi_mask2
=
vec_cmp_result
(
vec_mask_and
(
v_doi_mask2
,
v_doi_mask2_check
));
doi_mask2
=
vec_cmp_result
(
vec_mask_and
(
v_doi_mask2
,
v_doi_mask2_check
));
...
@@ -941,40 +942,23 @@ __attribute__((always_inline)) INLINE void runner_doself2_force_vec(
...
@@ -941,40 +942,23 @@ __attribute__((always_inline)) INLINE void runner_doself2_force_vec(
v_r2
.
v
=
vec_fma
(
v_dz_tmp
.
v
,
v_dz_tmp
.
v
,
v_r2
.
v
);
v_r2
.
v
=
vec_fma
(
v_dz_tmp
.
v
,
v_dz_tmp
.
v
,
v_r2
.
v
);
/* Form r2 > 0 mask, r2 < hig2 mask and r2 < hjg2 mask. */
/* Form r2 > 0 mask, r2 < hig2 mask and r2 < hjg2 mask. */
#ifdef HAVE_AVX512_F
mask_t
v_doi_mask
,
v_doi_mask_self_check
;
KNL_MASK_16
doi_mask
,
doi_mask_self_check
;
int
doi_mask
,
doi_mask_self_check
;
/* Form r2 > 0 mask.*/
doi_mask_self_check
=
vec_cmp_gt
(
v_r2
.
v
,
vec_setzero
());
/* Form a mask from r2 < hig2 mask and r2 < hjg2 mask. */
vector
v_h2
;
v_h2
.
v
=
vec_fmax
(
v_hig2
.
v
,
hjg2
.
v
);
doi_mask
=
vec_cmp_lt
(
v_r2
.
v
,
v_h2
.
v
);
/* Combine all 3 masks. */
doi_mask
=
doi_mask
&
doi_mask_self_check
;
#else
vector
v_doi_mask
,
v_doi_mask_self_check
;
/* Form r2 > 0 mask.*/
/* Form r2 > 0 mask.*/
v_doi_mask_self_check
.
v
=
vec_cmp_gt
(
v_r2
.
v
,
vec_setzero
());
vec_create_mask
(
v_doi_mask_self_check
,
vec_cmp_gt
(
v_r2
.
v
,
vec_setzero
())
)
;
/* Form a mask from r2 < hig2 mask and r2 < hjg2 mask. */
/* Form a mask from r2 < hig2 mask and r2 < hjg2 mask. */
vector
v_h2
;
vector
v_h2
;
v_h2
.
v
=
vec_fmax
(
v_hig2
.
v
,
hjg2
.
v
);
v_h2
.
v
=
vec_fmax
(
v_hig2
.
v
,
hjg2
.
v
);
v_doi_mask
.
v
=
vec_cmp_lt
(
v_r2
.
v
,
v_h2
.
v
);
vec_create_mask
(
v_doi_mask
,
vec_cmp_lt
(
v_r2
.
v
,
v_h2
.
v
)
)
;
/* Form integer masks. */
/* Form integer masks. */
int
doi_mask
,
doi_mask_self_check
;
doi_mask_self_check
=
vec_form_int_mask
(
v_doi_mask_self_check
);
doi_mask_self_check
=
vec_cmp_result
(
v_doi_mask_self_check
.
v
);
doi_mask
=
vec_form_int_mask
(
v_doi_mask
);
doi_mask
=
vec_cmp_result
(
v_doi_mask
.
v
);
/* Combine all 3 masks. */
/* Combine all 3 masks. */
doi_mask
=
doi_mask
&
doi_mask_self_check
;
doi_mask
=
doi_mask
&
doi_mask_self_check
;
#endif
/* HAVE_AVX512_F */
/* If there are any interactions left pack interaction values into c2
/* If there are any interactions left pack interaction values into c2
* cache. */
* cache. */
...
...
tests/benchmarkInteractions.c
View file @
caea34d3
...
@@ -400,7 +400,7 @@ void test_interactions(struct part test_part, struct part *parts, size_t count,
...
@@ -400,7 +400,7 @@ void test_interactions(struct part test_part, struct part *parts, size_t count,
(
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
);
}
}
VEC_HADD
(
rhoSum
,
piq
[
0
]
->
rho
);
VEC_HADD
(
rhoSum
,
piq
[
0
]
->
rho
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment