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
7e249423
Commit
7e249423
authored
Sep 07, 2017
by
James Willis
Browse files
Merge branch 'fix_pairs' of gitlab.cosma.dur.ac.uk:swift/swiftsim into fix_pairs
parents
643dcebd
7d4ad551
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/gravity_cache.h
View file @
7e249423
...
...
@@ -131,7 +131,7 @@ static INLINE void gravity_cache_init(struct gravity_cache *c, int count) {
*/
__attribute__
((
always_inline
))
INLINE
void
gravity_cache_populate
(
struct
gravity_cache
*
c
,
const
struct
gpart
*
restrict
gparts
,
int
gcount
,
int
gcount_padded
,
const
double
shift
[
3
])
{
int
gcount_padded
,
const
double
shift
[
3
]
,
const
struct
cell
*
cell
)
{
/* Make the compiler understand we are in happy vectorization land */
float
*
restrict
x
=
c
->
x
;
...
...
@@ -161,9 +161,9 @@ __attribute__((always_inline)) INLINE void gravity_cache_populate(
/* Pad the caches */
for
(
int
i
=
gcount
;
i
<
gcount_padded
;
++
i
)
{
x
[
i
]
=
0
.
f
;
y
[
i
]
=
0
.
f
;
z
[
i
]
=
0
.
f
;
x
[
i
]
=
-
3
.
f
*
cell
->
width
[
0
]
;
y
[
i
]
=
-
3
.
f
*
cell
->
width
[
0
]
;
z
[
i
]
=
-
3
.
f
*
cell
->
width
[
0
]
;
epsilon
[
i
]
=
0
.
f
;
m
[
i
]
=
0
.
f
;
}
...
...
src/runner_doiact_grav.h
View file @
7e249423
...
...
@@ -194,9 +194,9 @@ void runner_dopair_grav_pp_full(struct runner *r, struct cell *ci,
/* Fill the caches */
gravity_cache_populate
(
ci_cache
,
gparts_i
,
gcount_i
,
gcount_padded_i
,
loc_mean
);
loc_mean
,
ci
);
gravity_cache_populate
(
cj_cache
,
gparts_j
,
gcount_j
,
gcount_padded_j
,
loc_mean
);
loc_mean
,
cj
);
/* Ok... Here we go ! */
...
...
@@ -542,9 +542,9 @@ void runner_dopair_grav_pp_truncated(struct runner *r, struct cell *ci,
/* Fill the caches */
gravity_cache_populate
(
ci_cache
,
gparts_i
,
gcount_i
,
gcount_padded_i
,
loc_mean
);
loc_mean
,
ci
);
gravity_cache_populate
(
cj_cache
,
gparts_j
,
gcount_j
,
gcount_padded_j
,
loc_mean
);
loc_mean
,
cj
);
/* Ok... Here we go ! */
...
...
@@ -941,7 +941,7 @@ void runner_doself_grav_pp_full(struct runner *r, struct cell *c) {
/* Computed the padded counts */
const
int
gcount_padded
=
gcount
-
(
gcount
%
VEC_SIZE
)
+
VEC_SIZE
;
gravity_cache_populate
(
ci_cache
,
gparts
,
gcount
,
gcount_padded
,
loc
);
gravity_cache_populate
(
ci_cache
,
gparts
,
gcount
,
gcount_padded
,
loc
,
c
);
/* Ok... Here we go ! */
...
...
@@ -1155,7 +1155,7 @@ void runner_doself_grav_pp_truncated(struct runner *r, struct cell *c) {
/* Computed the padded counts */
const
int
gcount_padded
=
gcount
-
(
gcount
%
VEC_SIZE
)
+
VEC_SIZE
;
gravity_cache_populate
(
ci_cache
,
gparts
,
gcount
,
gcount_padded
,
loc
);
gravity_cache_populate
(
ci_cache
,
gparts
,
gcount
,
gcount_padded
,
loc
,
c
);
/* Ok... Here we go ! */
...
...
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