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
72911669
Commit
72911669
authored
7 years ago
by
James Willis
Browse files
Options
Downloads
Patches
Plain Diff
Comments. Moved debugging to SWIFT_DEBUG_CHECKS.
parent
0f532a4e
No related branches found
No related tags found
1 merge request
!445
Doself subset vec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/runner_doiact_vec.c
+16
-21
16 additions, 21 deletions
src/runner_doiact_vec.c
with
16 additions
and
21 deletions
src/runner_doiact_vec.c
+
16
−
21
View file @
72911669
...
...
@@ -581,28 +581,30 @@ __attribute__((always_inline)) INLINE void runner_doself1_density_vec(
#endif
/* WITH_VECTORIZATION */
}
/**
* @brief Compute the interactions between a cell pair, but only for the
* given indices in ci. (Vectorised)
*
* @param r The #runner.
* @param c The first #cell.
* @param parts The #part to interact.
* @param ind The list of indices of particles in @c c to interact with.
* @param pi_count The number of particles in @c ind.
*/
__attribute__
((
always_inline
))
INLINE
void
runner_doself_subset_density_vec
(
struct
runner
*
r
,
struct
cell
*
restrict
c
,
struct
part
*
restrict
parts
,
int
*
restrict
ind
,
int
pi_count
)
{
#ifdef WITH_VECTORIZATION
const
struct
engine
*
e
=
r
->
e
;
struct
part
*
restrict
pi
;
int
count_align
;
int
num_vec_proc
=
NUM_VEC_PROC
;
//struct part *restrict parts = c->parts;
const
int
count
=
c
->
count
;
const
timebin_t
max_active_bin
=
e
->
max_active_bin
;
vector
v_hi
,
v_vix
,
v_viy
,
v_viz
,
v_hig2
,
v_r2
;
TIMER_TIC
if
(
!
cell_is_active
(
c
,
e
))
return
;
if
(
!
cell_are_part_drifted
(
c
,
e
))
error
(
"Interacting undrifted cell."
);
/* Get the particle cache from the runner and re-allocate
* the cache if it is not big enough for the cell. */
struct
cache
*
restrict
cell_cache
=
&
r
->
ci_cache
;
...
...
@@ -618,7 +620,7 @@ __attribute__((always_inline)) INLINE void runner_doself_subset_density_vec(
struct
c2_cache
int_cache
;
int
icount
=
0
,
icount_align
=
0
;
/* Loop over the particles in the
cell
. */
/* Loop over the
subset of
particles in the
parts that need updating
. */
for
(
int
pid
=
0
;
pid
<
pi_count
;
pid
++
)
{
const
int
pi_index
=
ind
[
pid
];
...
...
@@ -626,23 +628,16 @@ __attribute__((always_inline)) INLINE void runner_doself_subset_density_vec(
/* Get a pointer to the ith particle. */
pi
=
&
parts
[
pi_index
];
/* Is the ith particle active? */
if
(
!
part_is_active_no_debug
(
pi
,
max_active_bin
))
continue
;
#ifdef SWIFT_DEBUG_CHECKS
const
struct
engine
*
e
=
r
->
e
;
if
(
!
part_is_active
(
pi
,
e
))
error
(
"Inactive particle in subset function!"
);
#endif
vector
pix
,
piy
,
piz
;
//const float hi = cell_cache->h[pi_index];
const
float
hi
=
pi
->
h
;
/* Fill particle pi vectors. */
//pix.v = vec_set1(cell_cache->x[pi_index]);
//piy.v = vec_set1(cell_cache->y[pi_index]);
//piz.v = vec_set1(cell_cache->z[pi_index]);
//v_hi.v = vec_set1(hi);
//v_vix.v = vec_set1(cell_cache->vx[pi_index]);
//v_viy.v = vec_set1(cell_cache->vy[pi_index]);
//v_viz.v = vec_set1(cell_cache->vz[pi_index]);
pix
.
v
=
vec_set1
(
pi
->
x
[
0
]
-
c
->
loc
[
0
]);
piy
.
v
=
vec_set1
(
pi
->
x
[
1
]
-
c
->
loc
[
1
]);
piz
.
v
=
vec_set1
(
pi
->
x
[
2
]
-
c
->
loc
[
2
]);
...
...
@@ -803,7 +798,7 @@ __attribute__((always_inline)) INLINE void runner_doself_subset_density_vec(
icount
=
0
;
}
/* loop over all particles. */
TIMER_TOC
(
timer_doself_
density
);
TIMER_TOC
(
timer_doself_
subset
);
#endif
/* WITH_VECTORIZATION */
}
...
...
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