Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
64b0a6c8
Commit
64b0a6c8
authored
Jan 06, 2014
by
peastman
Browse files
Ensure SFMT data array is correctly aligned
parent
2e83bfc8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
libraries/sfmt/src/SFMT.cpp
libraries/sfmt/src/SFMT.cpp
+6
-1
No files found.
libraries/sfmt/src/SFMT.cpp
View file @
64b0a6c8
...
@@ -90,8 +90,10 @@ namespace OpenMM_SFMT {
...
@@ -90,8 +90,10 @@ namespace OpenMM_SFMT {
class
SFMTData
{
class
SFMTData
{
public:
public:
/** Possibly incorrectly aligned memory for internal state array */
char
baseData
[(
N
+
1
)
*
sizeof
(
w128_t
)];
/** the 128-bit internal state array */
/** the 128-bit internal state array */
w128_t
sfmt
[
N
]
;
w128_t
*
sfmt
;
/** the 32bit integer pointer to the 128-bit internal state array */
/** the 32bit integer pointer to the 128-bit internal state array */
uint32_t
*
psfmt32
;
uint32_t
*
psfmt32
;
#if !defined(BIG_ENDIAN64) || defined(ONLY64)
#if !defined(BIG_ENDIAN64) || defined(ONLY64)
...
@@ -106,6 +108,9 @@ public:
...
@@ -106,6 +108,9 @@ public:
/** a parity check vector which certificate the period of 2^{MEXP} */
/** a parity check vector which certificate the period of 2^{MEXP} */
uint32_t
parity
[
4
];
uint32_t
parity
[
4
];
SFMTData
()
{
SFMTData
()
{
char
*
offsetData
=
baseData
+
15
;
offsetData
-=
(
long
long
)
offsetData
&
0xF
;
sfmt
=
(
w128_t
*
)
offsetData
;
psfmt32
=
&
sfmt
[
0
].
u
[
0
];
psfmt32
=
&
sfmt
[
0
].
u
[
0
];
#if !defined(BIG_ENDIAN64) || defined(ONLY64)
#if !defined(BIG_ENDIAN64) || defined(ONLY64)
psfmt64
=
(
uint64_t
*
)
&
sfmt
[
0
].
u
[
0
];
psfmt64
=
(
uint64_t
*
)
&
sfmt
[
0
].
u
[
0
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment