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
f082cf80
Commit
f082cf80
authored
7 years ago
by
James Willis
Browse files
Options
Downloads
Patches
Plain Diff
Renaming and adding const.
parent
6b95efcd
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!480
Dopair subset vec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/cache.h
+5
-5
5 additions, 5 deletions
src/cache.h
src/runner_doiact_vec.c
+2
-2
2 additions, 2 deletions
src/runner_doiact_vec.c
with
7 additions
and
7 deletions
src/cache.h
+
5
−
5
View file @
f082cf80
...
...
@@ -253,9 +253,9 @@ __attribute__((always_inline)) INLINE void cache_read_particles_subset(
/* The cell is on the right so read the particles
* into the cache from the start of the cell. */
if
(
!
flipped
)
{
int
rem
=
(
*
last_pi
+
1
)
%
VEC_SIZE
;
const
int
rem
=
(
*
last_pi
+
1
)
%
VEC_SIZE
;
if
(
rem
!=
0
)
{
int
pad
=
VEC_SIZE
-
rem
;
const
int
pad
=
VEC_SIZE
-
rem
;
/* Increase last_pi if there are particles in the cell left to read. */
if
(
*
last_pi
+
pad
<
ci
->
count
)
*
last_pi
+=
pad
;
...
...
@@ -299,15 +299,15 @@ __attribute__((always_inline)) INLINE void cache_read_particles_subset(
/* The cell is on the left so read the particles
* into the cache from the end of the cell. */
else
{
int
rem
=
(
ci
->
count
-
*
first_pi
)
%
VEC_SIZE
;
const
int
rem
=
(
ci
->
count
-
*
first_pi
)
%
VEC_SIZE
;
if
(
rem
!=
0
)
{
int
pad
=
VEC_SIZE
-
rem
;
const
int
pad
=
VEC_SIZE
-
rem
;
/* Decrease first_pi if there are particles in the cell left to read. */
if
(
*
first_pi
-
pad
>=
0
)
*
first_pi
-=
pad
;
}
int
ci_cache_count
=
ci
->
count
-
*
first_pi
;
const
int
ci_cache_count
=
ci
->
count
-
*
first_pi
;
/* Shift the particles positions to a local frame so single precision can be
* used instead of double precision. */
...
...
This diff is collapsed.
Click to expand it.
src/runner_doiact_vec.c
+
2
−
2
View file @
f082cf80
...
...
@@ -262,7 +262,7 @@ __attribute__((always_inline)) INLINE static void storeInteractions(
* @param active_ci Is any particle in cell ci active?
* @param active_cj Is any particle in cell cj active?
*/
__attribute__
((
always_inline
))
INLINE
static
void
populate_max_index
(
__attribute__
((
always_inline
))
INLINE
static
void
populate_max_index
_density
(
const
struct
cell
*
ci
,
const
struct
cell
*
cj
,
const
struct
entry
*
restrict
sort_i
,
const
struct
entry
*
restrict
sort_j
,
const
float
dx_max
,
const
float
rshift
,
const
double
hi_max
,
...
...
@@ -1390,7 +1390,7 @@ __attribute__((always_inline)) INLINE void runner_dopair1_density_vec(
/* Find particles maximum index into cj, max_index_i[] and ci, max_index_j[].
* Also find the first pi that interacts with any particle in cj and the last
* pj that interacts with any particle in ci. */
populate_max_index
(
ci
,
cj
,
sort_i
,
sort_j
,
dx_max
,
rshift
,
hi_max
,
hj_max
,
populate_max_index
_density
(
ci
,
cj
,
sort_i
,
sort_j
,
dx_max
,
rshift
,
hi_max
,
hj_max
,
di_max
,
dj_min
,
max_index_i
,
max_index_j
,
&
first_pi
,
&
last_pj
,
max_active_bin
,
active_ci
,
active_cj
);
...
...
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