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
58b06679
Commit
58b06679
authored
7 years ago
by
James Willis
Browse files
Options
Downloads
Patches
Plain Diff
Rename alignment macro.
parent
790b9ed9
No related branches found
No related tags found
1 merge request
!404
Cache auto vec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/align.h
+2
-2
2 additions, 2 deletions
src/align.h
src/cache.h
+24
-48
24 additions, 48 deletions
src/cache.h
with
26 additions
and
50 deletions
src/align.h
+
2
−
2
View file @
58b06679
...
...
@@ -70,8 +70,8 @@
* @param type Type of array
* @param alignment The alignment in bytes of the array.
*/
#define swift_
align_and_restrict_information(
array, ptr,
type,
alignment) \
type *restrict array = ptr;
\
#define swift_
declare_aligned_ptr(type,
array, ptr, alignment) \
type *restrict array = ptr; \
swift_align_information(array, alignment);
/**
...
...
This diff is collapsed.
Click to expand it.
src/cache.h
+
24
−
48
View file @
58b06679
...
...
@@ -159,22 +159,14 @@ __attribute__((always_inline)) INLINE void cache_read_particles(
/* Let the compiler know that the data is aligned and create pointers to the
* arrays inside the cache. */
swift_align_and_restrict_information
(
x
,
ci_cache
->
x
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_align_and_restrict_information
(
y
,
ci_cache
->
y
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_align_and_restrict_information
(
z
,
ci_cache
->
z
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_align_and_restrict_information
(
h
,
ci_cache
->
h
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_align_and_restrict_information
(
m
,
ci_cache
->
m
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_align_and_restrict_information
(
vx
,
ci_cache
->
vx
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_align_and_restrict_information
(
vy
,
ci_cache
->
vy
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_align_and_restrict_information
(
vz
,
ci_cache
->
vz
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
x
,
ci_cache
->
x
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
y
,
ci_cache
->
y
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
z
,
ci_cache
->
z
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
h
,
ci_cache
->
h
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
m
,
ci_cache
->
m
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
vx
,
ci_cache
->
vx
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
vy
,
ci_cache
->
vy
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
vz
,
ci_cache
->
vz
,
SWIFT_CACHE_ALIGNMENT
);
const
struct
part
*
restrict
parts
=
ci
->
parts
;
double
loc
[
3
];
...
...
@@ -250,22 +242,14 @@ __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted(
/* Let the compiler know that the data is aligned and create pointers to the
* arrays inside the cache. */
swift_align_and_restrict_information
(
x
,
ci_cache
->
x
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_align_and_restrict_information
(
y
,
ci_cache
->
y
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_align_and_restrict_information
(
z
,
ci_cache
->
z
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_align_and_restrict_information
(
h
,
ci_cache
->
h
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_align_and_restrict_information
(
m
,
ci_cache
->
m
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_align_and_restrict_information
(
vx
,
ci_cache
->
vx
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_align_and_restrict_information
(
vy
,
ci_cache
->
vy
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_align_and_restrict_information
(
vz
,
ci_cache
->
vz
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
x
,
ci_cache
->
x
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
y
,
ci_cache
->
y
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
z
,
ci_cache
->
z
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
h
,
ci_cache
->
h
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
m
,
ci_cache
->
m
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
vx
,
ci_cache
->
vx
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
vy
,
ci_cache
->
vy
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
vz
,
ci_cache
->
vz
,
SWIFT_CACHE_ALIGNMENT
);
int
ci_cache_count
=
ci
->
count
-
first_pi_align
;
/* Shift the particles positions to a local frame (ci frame) so single
...
...
@@ -305,22 +289,14 @@ __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted(
/* Let the compiler know that the data is aligned and create pointers to the
* arrays inside the cache. */
swift_align_and_restrict_information
(
xj
,
cj_cache
->
x
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_align_and_restrict_information
(
yj
,
cj_cache
->
y
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_align_and_restrict_information
(
zj
,
cj_cache
->
z
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_align_and_restrict_information
(
hj
,
cj_cache
->
h
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_align_and_restrict_information
(
mj
,
cj_cache
->
m
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_align_and_restrict_information
(
vxj
,
cj_cache
->
vx
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_align_and_restrict_information
(
vyj
,
cj_cache
->
vy
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_align_and_restrict_information
(
vzj
,
cj_cache
->
vz
,
float
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
xj
,
cj_cache
->
x
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
yj
,
cj_cache
->
y
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
zj
,
cj_cache
->
z
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
hj
,
cj_cache
->
h
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
mj
,
cj_cache
->
m
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
vxj
,
cj_cache
->
vx
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
vyj
,
cj_cache
->
vy
,
SWIFT_CACHE_ALIGNMENT
);
swift_declare_aligned_ptr
(
float
,
vzj
,
cj_cache
->
vz
,
SWIFT_CACHE_ALIGNMENT
);
for
(
int
i
=
0
;
i
<=
last_pj_align
;
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