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
3e38c007
Commit
3e38c007
authored
8 years ago
by
James Willis
Browse files
Options
Downloads
Patches
Plain Diff
Combine interaction masks as integers instead of vectors. Better performance.
parent
8f26292e
No related branches found
No related tags found
1 merge request
!406
Doself2 vectorisation
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/runner_doiact_vec.c
+10
-8
10 additions, 8 deletions
src/runner_doiact_vec.c
with
10 additions
and
8 deletions
src/runner_doiact_vec.c
+
10
−
8
View file @
3e38c007
...
@@ -1104,7 +1104,6 @@ __attribute__((always_inline)) INLINE void runner_doself2_force_vec(
...
@@ -1104,7 +1104,6 @@ __attribute__((always_inline)) INLINE void runner_doself2_force_vec(
VEC_HADD
(
a_hydro_ySum
,
pi
->
a_hydro
[
1
]);
VEC_HADD
(
a_hydro_ySum
,
pi
->
a_hydro
[
1
]);
VEC_HADD
(
a_hydro_zSum
,
pi
->
a_hydro
[
2
]);
VEC_HADD
(
a_hydro_zSum
,
pi
->
a_hydro
[
2
]);
VEC_HADD
(
h_dtSum
,
pi
->
force
.
h_dt
);
VEC_HADD
(
h_dtSum
,
pi
->
force
.
h_dt
);
/* TODO: Implement a horizontal max of a vector. */
for
(
int
k
=
0
;
k
<
VEC_SIZE
;
k
++
)
for
(
int
k
=
0
;
k
<
VEC_SIZE
;
k
++
)
pi
->
force
.
v_sig
=
max
(
pi
->
force
.
v_sig
,
v_sigSum
.
f
[
k
]);
pi
->
force
.
v_sig
=
max
(
pi
->
force
.
v_sig
,
v_sigSum
.
f
[
k
]);
VEC_HADD
(
entropy_dtSum
,
pi
->
entropy_dt
);
VEC_HADD
(
entropy_dtSum
,
pi
->
entropy_dt
);
...
@@ -1373,7 +1372,6 @@ __attribute__((always_inline)) INLINE void runner_doself2_force_vec_2(
...
@@ -1373,7 +1372,6 @@ __attribute__((always_inline)) INLINE void runner_doself2_force_vec_2(
VEC_HADD
(
a_hydro_ySum
,
pi
->
a_hydro
[
1
]);
VEC_HADD
(
a_hydro_ySum
,
pi
->
a_hydro
[
1
]);
VEC_HADD
(
a_hydro_zSum
,
pi
->
a_hydro
[
2
]);
VEC_HADD
(
a_hydro_zSum
,
pi
->
a_hydro
[
2
]);
VEC_HADD
(
h_dtSum
,
pi
->
force
.
h_dt
);
VEC_HADD
(
h_dtSum
,
pi
->
force
.
h_dt
);
/* TODO: Implement a horizontal max of a vector. */
for
(
int
k
=
0
;
k
<
VEC_SIZE
;
k
++
)
for
(
int
k
=
0
;
k
<
VEC_SIZE
;
k
++
)
pi
->
force
.
v_sig
=
max
(
pi
->
force
.
v_sig
,
v_sigSum
.
f
[
k
]);
pi
->
force
.
v_sig
=
max
(
pi
->
force
.
v_sig
,
v_sigSum
.
f
[
k
]);
VEC_HADD
(
entropy_dtSum
,
pi
->
entropy_dt
);
VEC_HADD
(
entropy_dtSum
,
pi
->
entropy_dt
);
...
@@ -1400,7 +1398,7 @@ __attribute__((always_inline)) INLINE void runner_doself2_force_vec_3(
...
@@ -1400,7 +1398,7 @@ __attribute__((always_inline)) INLINE void runner_doself2_force_vec_3(
int
doi_mask
;
int
doi_mask
;
struct
part
*
restrict
pi
;
struct
part
*
restrict
pi
;
int
count_align
;
int
count_align
;
int
num_vec_proc
=
1
;
//NUM_VEC_PROC;
const
int
num_vec_proc
=
1
;
//NUM_VEC_PROC;
struct
part
*
restrict
parts
=
c
->
parts
;
struct
part
*
restrict
parts
=
c
->
parts
;
const
int
count
=
c
->
count
;
const
int
count
=
c
->
count
;
...
@@ -1532,18 +1530,22 @@ __attribute__((always_inline)) INLINE void runner_doself2_force_vec_3(
...
@@ -1532,18 +1530,22 @@ __attribute__((always_inline)) INLINE void runner_doself2_force_vec_3(
doi_mask2
=
doi_mask2
&
doi_mask2_check
;
doi_mask2
=
doi_mask2
&
doi_mask2_check
;
#else
#else
vector
v_doi_mask
,
v_doi_mask_check
,
v_doi_N3_mask
;
vector
v_doi_mask
,
v_doi_mask_
self_
check
,
v_doi_N3_mask
;
/* Form r2 > 0 mask, r2 < hig2 mask and r2 < hjg2 mask. */
/* Form r2 > 0 mask, r2 < hig2 mask and r2 < hjg2 mask. */
v_doi_mask_check
.
v
=
vec_cmp_gt
(
v_r2
.
v
,
vec_setzero
());
v_doi_mask_
self_
check
.
v
=
vec_cmp_gt
(
v_r2
.
v
,
vec_setzero
());
v_doi_mask
.
v
=
vec_cmp_lt
(
v_r2
.
v
,
v_hig2
.
v
);
v_doi_mask
.
v
=
vec_cmp_lt
(
v_r2
.
v
,
v_hig2
.
v
);
v_doi_N3_mask
.
v
=
vec_cmp_lt
(
v_r2
.
v
,
hjg2
.
v
);
v_doi_N3_mask
.
v
=
vec_cmp_lt
(
v_r2
.
v
,
hjg2
.
v
);
v_doi_mask
.
v
=
vec_and
(
vec_add
(
v_doi_mask
.
v
,
v_doi_N3_mask
.
v
),
v_doi_mask_check
.
v
);
/* Form integer masks. */
int
doi_mask_self_check
,
doi_N3_mask
;
/* Combine two masks and form integer mask. */
doi_mask_self_check
=
vec_cmp_result
(
v_doi_mask_self_check
.
v
);
doi_N3_mask
=
vec_cmp_result
(
v_doi_N3_mask
.
v
);
doi_mask
=
vec_cmp_result
(
v_doi_mask
.
v
);
doi_mask
=
vec_cmp_result
(
v_doi_mask
.
v
);
/* Combine all 3 masks. */
doi_mask
=
(
doi_mask
|
doi_N3_mask
)
&
doi_mask_self_check
;
#endif
/* HAVE_AVX512_F */
#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
...
...
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