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
3bcdf6eb
Commit
3bcdf6eb
authored
8 years ago
by
James Willis
Browse files
Options
Downloads
Patches
Plain Diff
Removed cache structure needed for auto-vectorisation.
parent
fd3d64a8
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!320
Dopair1 vectorisation merge
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cache.h
+0
-93
0 additions, 93 deletions
src/cache.h
with
0 additions
and
93 deletions
src/cache.h
+
0
−
93
View file @
3bcdf6eb
...
@@ -39,28 +39,6 @@
...
@@ -39,28 +39,6 @@
* properties required for density/force calculations.*/
* properties required for density/force calculations.*/
struct
cache
{
struct
cache
{
#ifdef DOPAIR1_AUTO_VEC
float
x
[
MAX_NO_OF_PARTS
]
__attribute__
((
aligned
(
sizeof
(
float
)
*
VEC_SIZE
)));
/* x position*/
float
y
[
MAX_NO_OF_PARTS
]
__attribute__
((
aligned
(
sizeof
(
float
)
*
VEC_SIZE
)));
/* y position*/
float
z
[
MAX_NO_OF_PARTS
]
__attribute__
((
aligned
(
sizeof
(
float
)
*
VEC_SIZE
)));
/* z position*/
float
m
[
MAX_NO_OF_PARTS
]
__attribute__
((
aligned
(
sizeof
(
float
)
*
VEC_SIZE
)));
/* Mass */
float
vx
[
MAX_NO_OF_PARTS
]
__attribute__
((
aligned
(
sizeof
(
float
)
*
VEC_SIZE
)));
/* x velocity */
float
vy
[
MAX_NO_OF_PARTS
]
__attribute__
((
aligned
(
sizeof
(
float
)
*
VEC_SIZE
)));
/* y velocity */
float
vz
[
MAX_NO_OF_PARTS
]
__attribute__
((
aligned
(
sizeof
(
float
)
*
VEC_SIZE
)));
/* z velocity */
float
h
[
MAX_NO_OF_PARTS
]
__attribute__
((
aligned
(
sizeof
(
float
)
*
VEC_SIZE
)));
/* Smoothing length */
/*Cached arrays to hold particle updates*/
float
rho
[
MAX_NO_OF_PARTS
]
__attribute__
((
aligned
(
sizeof
(
float
)
*
VEC_SIZE
)));
/* Density */
float
rho_dh
[
MAX_NO_OF_PARTS
]
__attribute__
((
aligned
(
sizeof
(
float
)
*
VEC_SIZE
)));
/* Density gradient */
float
wcount
[
MAX_NO_OF_PARTS
]
__attribute__
((
aligned
(
sizeof
(
float
)
*
VEC_SIZE
)));
/* No. of contributions*/
float
wcount_dh
[
MAX_NO_OF_PARTS
]
__attribute__
((
aligned
(
sizeof
(
float
)
*
VEC_SIZE
)));
/* Mass */
float
div_v
[
MAX_NO_OF_PARTS
]
__attribute__
((
aligned
(
sizeof
(
float
)
*
VEC_SIZE
)));
/* Velocity divergence */
float
curl_vx
[
MAX_NO_OF_PARTS
]
__attribute__
((
aligned
(
sizeof
(
float
)
*
VEC_SIZE
)));
/* Velocity curl x */
float
curl_vy
[
MAX_NO_OF_PARTS
]
__attribute__
((
aligned
(
sizeof
(
float
)
*
VEC_SIZE
)));
/* Velocity curl y */
float
curl_vz
[
MAX_NO_OF_PARTS
]
__attribute__
((
aligned
(
sizeof
(
float
)
*
VEC_SIZE
)));
/* Velocity curl z */
int
count
;
#else
/* Particle x position. */
/* Particle x position. */
float
*
restrict
x
__attribute__
((
aligned
(
CACHE_ALIGN
)));
float
*
restrict
x
__attribute__
((
aligned
(
CACHE_ALIGN
)));
...
@@ -91,13 +69,8 @@ struct cache {
...
@@ -91,13 +69,8 @@ struct cache {
/* Cache size. */
/* Cache size. */
int
count
;
int
count
;
#endif
};
};
#ifdef DOPAIR1_AUTO_VEC
struct
cache
ci_cache
,
cj_cache
;
#endif
/* Secondary cache struct to hold a list of interactions between two
/* Secondary cache struct to hold a list of interactions between two
* particles.*/
* particles.*/
struct
c2_cache
{
struct
c2_cache
{
...
@@ -260,17 +233,6 @@ __attribute__((always_inline)) INLINE void cache_read_cell_sorted(
...
@@ -260,17 +233,6 @@ __attribute__((always_inline)) INLINE void cache_read_cell_sorted(
ci_cache
->
vx
[
i
]
=
ci
->
parts
[
idx
].
v
[
0
];
ci_cache
->
vx
[
i
]
=
ci
->
parts
[
idx
].
v
[
0
];
ci_cache
->
vy
[
i
]
=
ci
->
parts
[
idx
].
v
[
1
];
ci_cache
->
vy
[
i
]
=
ci
->
parts
[
idx
].
v
[
1
];
ci_cache
->
vz
[
i
]
=
ci
->
parts
[
idx
].
v
[
2
];
ci_cache
->
vz
[
i
]
=
ci
->
parts
[
idx
].
v
[
2
];
#ifdef DOPAIR1_AUTO_VEC
ci_cache
->
rho
[
i
]
=
0
.
0
f
;
ci_cache
->
rho_dh
[
i
]
=
0
.
0
f
;
ci_cache
->
wcount
[
i
]
=
0
.
0
f
;
ci_cache
->
wcount_dh
[
i
]
=
0
.
0
f
;
ci_cache
->
div_v
[
i
]
=
0
.
0
f
;
ci_cache
->
curl_vx
[
i
]
=
0
.
0
f
;
ci_cache
->
curl_vy
[
i
]
=
0
.
0
f
;
ci_cache
->
curl_vz
[
i
]
=
0
.
0
f
;
#endif
}
}
}
}
...
@@ -305,17 +267,6 @@ __attribute__((always_inline)) INLINE void cache_read_two_cells_sorted(
...
@@ -305,17 +267,6 @@ __attribute__((always_inline)) INLINE void cache_read_two_cells_sorted(
ci_cache
->
vx
[
i
]
=
ci
->
parts
[
idx
].
v
[
0
];
ci_cache
->
vx
[
i
]
=
ci
->
parts
[
idx
].
v
[
0
];
ci_cache
->
vy
[
i
]
=
ci
->
parts
[
idx
].
v
[
1
];
ci_cache
->
vy
[
i
]
=
ci
->
parts
[
idx
].
v
[
1
];
ci_cache
->
vz
[
i
]
=
ci
->
parts
[
idx
].
v
[
2
];
ci_cache
->
vz
[
i
]
=
ci
->
parts
[
idx
].
v
[
2
];
#ifdef DOPAIR1_AUTO_VEC
ci_cache
->
rho
[
i
]
=
0
.
0
f
;
ci_cache
->
rho_dh
[
i
]
=
0
.
0
f
;
ci_cache
->
wcount
[
i
]
=
0
.
0
f
;
ci_cache
->
wcount_dh
[
i
]
=
0
.
0
f
;
ci_cache
->
div_v
[
i
]
=
0
.
0
f
;
ci_cache
->
curl_vx
[
i
]
=
0
.
0
f
;
ci_cache
->
curl_vy
[
i
]
=
0
.
0
f
;
ci_cache
->
curl_vz
[
i
]
=
0
.
0
f
;
#endif
}
}
#if defined(WITH_VECTORIZATION) && defined(__ICC)
#if defined(WITH_VECTORIZATION) && defined(__ICC)
...
@@ -332,16 +283,6 @@ __attribute__((always_inline)) INLINE void cache_read_two_cells_sorted(
...
@@ -332,16 +283,6 @@ __attribute__((always_inline)) INLINE void cache_read_two_cells_sorted(
cj_cache
->
vx
[
i
]
=
cj
->
parts
[
idx
].
v
[
0
];
cj_cache
->
vx
[
i
]
=
cj
->
parts
[
idx
].
v
[
0
];
cj_cache
->
vy
[
i
]
=
cj
->
parts
[
idx
].
v
[
1
];
cj_cache
->
vy
[
i
]
=
cj
->
parts
[
idx
].
v
[
1
];
cj_cache
->
vz
[
i
]
=
cj
->
parts
[
idx
].
v
[
2
];
cj_cache
->
vz
[
i
]
=
cj
->
parts
[
idx
].
v
[
2
];
#ifdef DOPAIR1_AUTO_VEC
cj_cache
->
rho
[
i
]
=
0
.
0
f
;
cj_cache
->
rho_dh
[
i
]
=
0
.
0
f
;
cj_cache
->
wcount
[
i
]
=
0
.
0
f
;
cj_cache
->
wcount_dh
[
i
]
=
0
.
0
f
;
cj_cache
->
div_v
[
i
]
=
0
.
0
f
;
cj_cache
->
curl_vx
[
i
]
=
0
.
0
f
;
cj_cache
->
curl_vy
[
i
]
=
0
.
0
f
;
cj_cache
->
curl_vz
[
i
]
=
0
.
0
f
;
#endif
}
}
}
}
...
@@ -418,40 +359,6 @@ __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted(
...
@@ -418,40 +359,6 @@ __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted(
}
}
}
}
__attribute__
((
always_inline
))
INLINE
static
void
cache_write_sorted_particles
(
const
struct
cache
*
const
ci_cache
,
const
struct
cache
*
const
cj_cache
,
const
struct
cell
*
const
ci
,
const
struct
cell
*
const
cj
,
const
struct
entry
*
restrict
sort_i
,
const
struct
entry
*
restrict
sort_j
)
{
#ifdef DOPAIR1_AUTO_VEC
struct
part
*
restrict
pi
,
*
restrict
pj
;
int
idx
=
0
;
for
(
int
i
=
0
;
i
<
ci
->
count
;
i
++
)
{
idx
=
sort_i
[
i
].
i
;
pi
=
&
ci
->
parts
[
idx
];
pi
->
rho
+=
ci_cache
->
rho
[
i
];
pi
->
density
.
rho_dh
+=
ci_cache
->
rho_dh
[
i
];
pi
->
density
.
wcount
+=
ci_cache
->
wcount
[
i
];
pi
->
density
.
wcount_dh
+=
ci_cache
->
wcount_dh
[
i
];
pi
->
density
.
div_v
+=
ci_cache
->
div_v
[
i
];
pi
->
density
.
rot_v
[
0
]
+=
ci_cache
->
curl_vx
[
i
];
pi
->
density
.
rot_v
[
1
]
+=
ci_cache
->
curl_vy
[
i
];
pi
->
density
.
rot_v
[
2
]
+=
ci_cache
->
curl_vz
[
i
];
}
for
(
int
i
=
0
;
i
<
cj
->
count
;
i
++
)
{
idx
=
sort_j
[
i
].
i
;
pj
=
&
cj
->
parts
[
idx
];
pj
->
rho
+=
cj_cache
->
rho
[
i
];
pj
->
density
.
rho_dh
+=
cj_cache
->
rho_dh
[
i
];
pj
->
density
.
wcount
+=
cj_cache
->
wcount
[
i
];
pj
->
density
.
wcount_dh
+=
cj_cache
->
wcount_dh
[
i
];
pj
->
density
.
div_v
+=
cj_cache
->
div_v
[
i
];
pj
->
density
.
rot_v
[
0
]
+=
cj_cache
->
curl_vx
[
i
];
pj
->
density
.
rot_v
[
1
]
+=
cj_cache
->
curl_vy
[
i
];
pj
->
density
.
rot_v
[
2
]
+=
cj_cache
->
curl_vz
[
i
];
}
#endif
}
/* @brief Clean the memory allocated by a #cache object.
/* @brief Clean the memory allocated by a #cache object.
*
*
* @param c The #cache to clean.
* @param c The #cache to clean.
...
...
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