Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Hercules
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
llvm
Hercules
Merge requests
!199
Fix type layout
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Fix type layout
better_layout
into
main
Overview
0
Commits
6
Pipelines
6
Changes
4
Merged
rarbore2
requested to merge
better_layout
into
main
3 weeks ago
Overview
0
Commits
6
Pipelines
6
Changes
1
Expand
Make sure all elements in nested array are aligned.
Update
AlignedSlice
in CFD.
Edited
3 weeks ago
by
rarbore2
0
0
Merge request reports
Compare
version 4
version 5
d71ec87a
3 weeks ago
version 4
5cee37ad
3 weeks ago
version 3
9a58de9e
3 weeks ago
version 2
790b50d7
3 weeks ago
version 1
2b2b2ea5
3 weeks ago
main (base)
and
version 5
latest version
eeee9868
6 commits,
3 weeks ago
version 5
d71ec87a
5 commits,
3 weeks ago
version 4
5cee37ad
4 commits,
3 weeks ago
version 3
9a58de9e
3 commits,
3 weeks ago
version 2
790b50d7
2 commits,
3 weeks ago
version 1
2b2b2ea5
1 commit,
3 weeks ago
Show latest version
1 file
+
5
−
5
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
juno_samples/rodinia/cfd/src/setup.rs
+
5
−
5
Options
@@ -20,11 +20,11 @@ pub const VAR_DENSITY_ENERGY: usize = VAR_MOMENTUM + NDIM;
pub
const
NVAR
:
usize
=
VAR_DENSITY_ENERGY
+
1
;
pub
const
deg_angle_of_attack
:
f32
=
0.0
;
#[repr(align(
32
))]
struct
Alignment
([
u8
;
32
]);
#[repr(align(
64
))]
struct
Alignment
([
u8
;
64
]);
// An aligned slice is stored as a boxed slice and an offset number of elements
// that we skip over to get the desired alignment (of
32
bytes)
// that we skip over to get the desired alignment (of
64
bytes)
pub
struct
AlignedSlice
<
T
>
{
slice
:
Box
<
[
T
]
>
,
offset
:
usize
,
@@ -37,8 +37,8 @@ where
{
pub
fn
of_len
(
len
:
usize
)
->
Self
{
// The maximum number of elements that may be waisted in getting the alignment we need is
// (
32
- alignment of T) / size of T
let
extra_elements
=
(
32
-
std
::
mem
::
align_of
::
<
T
>
())
/
std
::
mem
::
size_of
::
<
T
>
();
// (
64
- alignment of T) / size of T
let
extra_elements
=
(
64
-
std
::
mem
::
align_of
::
<
T
>
())
/
std
::
mem
::
size_of
::
<
T
>
();
let
slice
:
Box
<
[
T
]
>
=
(
0
..
len
+
extra_elements
)
.map
(|
_
|
Default
::
default
())
.collect
();
Loading