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
ed2260b9
Commit
ed2260b9
authored
8 years ago
by
James Willis
Browse files
Options
Downloads
Patches
Plain Diff
Force alignment in vectorised loops.
parent
ca6a8f54
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
+3
-9
3 additions, 9 deletions
src/cache.h
with
3 additions
and
9 deletions
src/cache.h
+
3
−
9
View file @
ed2260b9
...
@@ -157,9 +157,7 @@ __attribute__((always_inline)) INLINE void cache_read_particles(
...
@@ -157,9 +157,7 @@ __attribute__((always_inline)) INLINE void cache_read_particles(
/* Shift the particles positions to a local frame so single precision can be
/* Shift the particles positions to a local frame so single precision can be
* used instead of double precision. */
* used instead of double precision. */
#if defined(WITH_VECTORIZATION) && defined(__ICC)
#if defined(WITH_VECTORIZATION) && defined(__ICC)
#pragma simd
#pragma vector aligned
#elif defined(WITH_VECTORIZATION)
#pragma omp simd
#endif
#endif
for
(
int
i
=
0
;
i
<
ci
->
count
;
i
++
)
{
for
(
int
i
=
0
;
i
<
ci
->
count
;
i
++
)
{
ci_cache
->
x
[
i
]
=
ci
->
parts
[
i
].
x
[
0
]
-
ci
->
loc
[
0
];
ci_cache
->
x
[
i
]
=
ci
->
parts
[
i
].
x
[
0
]
-
ci
->
loc
[
0
];
...
@@ -352,9 +350,7 @@ __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted(
...
@@ -352,9 +350,7 @@ __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted(
* used instead of double precision. Also shift the cell ci, particles positions
* used instead of double precision. Also shift the cell ci, particles positions
* due to BCs but leave cell cj. */
* due to BCs but leave cell cj. */
#if defined(WITH_VECTORIZATION) && defined(__ICC)
#if defined(WITH_VECTORIZATION) && defined(__ICC)
#pragma simd
#pragma vector aligned
#elif defined(WITH_VECTORIZATION)
#pragma omp simd
#endif
#endif
for
(
int
i
=
first_pi_align
;
i
<
ci
->
count
;
i
++
)
{
for
(
int
i
=
first_pi_align
;
i
<
ci
->
count
;
i
++
)
{
/* Make sure ci_cache is filled from the first element. */
/* Make sure ci_cache is filled from the first element. */
...
@@ -378,9 +374,7 @@ __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted(
...
@@ -378,9 +374,7 @@ __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted(
ci_cache
->
x
[
i
]
=
fake_pix
;
ci_cache
->
x
[
i
]
=
fake_pix
;
#if defined(WITH_VECTORIZATION) && defined(__ICC)
#if defined(WITH_VECTORIZATION) && defined(__ICC)
#pragma simd
#pragma vector aligned
#elif defined(WITH_VECTORIZATION)
#pragma omp simd
#endif
#endif
for
(
int
i
=
0
;
i
<=
last_pj_align
;
i
++
)
{
for
(
int
i
=
0
;
i
<=
last_pj_align
;
i
++
)
{
idx
=
sort_j
[
i
].
i
;
idx
=
sort_j
[
i
].
i
;
...
...
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