Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
73090f83
Commit
73090f83
authored
8 years ago
by
James Willis
Browse files
Options
Downloads
Patches
Plain Diff
Used new mask type in runner_dopair1_density_vec and fixed bug in benchmarkInteractions.c
parent
3b6b4f56
No related branches found
No related tags found
1 merge request
!406
Doself2 vectorisation
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/runner_doiact_vec.c
+4
-4
4 additions, 4 deletions
src/runner_doiact_vec.c
src/vector.h
+2
-0
2 additions, 0 deletions
src/vector.h
tests/benchmarkInteractions.c
+1
-1
1 addition, 1 deletion
tests/benchmarkInteractions.c
with
7 additions
and
5 deletions
src/runner_doiact_vec.c
+
4
−
4
View file @
73090f83
...
@@ -1283,10 +1283,10 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
...
@@ -1283,10 +1283,10 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
int
doi_mask
;
int
doi_mask
;
/* Form r2 < hig2 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. */
/* 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 there are any interactions perform them. */
if
(
doi_mask
)
if
(
doi_mask
)
...
@@ -1410,10 +1410,10 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
...
@@ -1410,10 +1410,10 @@ void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
int
doj_mask
;
int
doj_mask
;
/* Form r2 < hig2 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. */
/* 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 there are any interactions perform them. */
if
(
doj_mask
)
if
(
doj_mask
)
...
...
This diff is collapsed.
Click to expand it.
src/vector.h
+
2
−
0
View file @
73090f83
...
@@ -78,6 +78,7 @@
...
@@ -78,6 +78,7 @@
#define vec_cmp_lte(a, b) _mm512_cmp_ps_mask(a, b, _CMP_LE_OQ)
#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_gte(a, b) _mm512_cmp_ps_mask(a, b, _CMP_GE_OQ)
#define vec_cmp_result(a) a
#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_and(a, b) _mm512_and_ps(a, b)
#define vec_mask_and(a, b) a & b
#define vec_mask_and(a, b) a & b
#define vec_init_mask(mask) mask = 0xFFFF
#define vec_init_mask(mask) mask = 0xFFFF
...
@@ -167,6 +168,7 @@
...
@@ -167,6 +168,7 @@
#define vec_cmp_lte(a, b) _mm256_cmp_ps(a, b, _CMP_LE_OQ)
#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_gte(a, b) _mm256_cmp_ps(a, b, _CMP_GE_OQ)
#define vec_cmp_result(a) _mm256_movemask_ps(a)
#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_and(a, b) _mm256_and_ps(a, b)
#define vec_mask_and(a, b) _mm256_and_ps(a.v, b.v)
#define vec_mask_and(a, b) _mm256_and_ps(a.v, b.v)
#define vec_init_mask(mask) mask.m = vec_setint1(0xFFFFFFFF)
#define vec_init_mask(mask) mask.m = vec_setint1(0xFFFFFFFF)
...
...
This diff is collapsed.
Click to expand it.
tests/benchmarkInteractions.c
+
1
−
1
View file @
73090f83
...
@@ -388,7 +388,7 @@ void test_interactions(struct part test_part, struct part *parts, size_t count,
...
@@ -388,7 +388,7 @@ void test_interactions(struct part test_part, struct part *parts, size_t count,
hi_inv_vec
=
vec_reciprocal
(
hi_vec
);
hi_inv_vec
=
vec_reciprocal
(
hi_vec
);
mask_
vec_
t
mask
,
mask2
;
mask_t
mask
,
mask2
;
vec_init_mask
(
mask
);
vec_init_mask
(
mask
);
vec_init_mask
(
mask2
);
vec_init_mask
(
mask2
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment