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
7d659d79
Commit
7d659d79
authored
Jul 01, 2015
by
Robert McGibbon
Browse files
Fix MSVC2010 segfault
parent
9fcc3183
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
plugins/cpupme/src/CpuPmeKernels.cpp
plugins/cpupme/src/CpuPmeKernels.cpp
+4
-3
No files found.
plugins/cpupme/src/CpuPmeKernels.cpp
View file @
7d659d79
...
@@ -59,13 +59,14 @@ static void spreadCharge(int start, int end, float* posq, float* grid, int gridx
...
@@ -59,13 +59,14 @@ static void spreadCharge(int start, int end, float* posq, float* grid, int gridx
ivec4
gridSizeInt
(
gridx
,
gridy
,
gridz
,
0
);
ivec4
gridSizeInt
(
gridx
,
gridy
,
gridz
,
0
);
fvec4
one
(
1
);
fvec4
one
(
1
);
fvec4
scale
(
1.0
f
/
(
PME_ORDER
-
1
));
fvec4
scale
(
1.0
f
/
(
PME_ORDER
-
1
));
float
posInBox
[
4
]
=
{
0
,
0
,
0
,
0
};
const
float
epsilonFactor
=
sqrt
(
ONE_4PI_EPS0
);
const
float
epsilonFactor
=
sqrt
(
ONE_4PI_EPS0
);
memset
(
grid
,
0
,
sizeof
(
float
)
*
gridx
*
gridy
*
gridz
);
memset
(
grid
,
0
,
sizeof
(
float
)
*
gridx
*
gridy
*
gridz
);
for
(
int
i
=
start
;
i
<
end
;
i
++
)
{
for
(
int
i
=
start
;
i
<
end
;
i
++
)
{
// Find the position relative to the nearest grid point.
// Find the position relative to the nearest grid point.
fvec4
pos
(
&
posq
[
4
*
i
]);
fvec4
pos
(
&
posq
[
4
*
i
]);
float
posInBox
[
4
];
(
pos
-
boxSize
*
floor
(
pos
*
invBoxSize
)).
store
(
posInBox
);
(
pos
-
boxSize
*
floor
(
pos
*
invBoxSize
)).
store
(
posInBox
);
fvec4
t
=
posInBox
[
0
]
*
recipBoxVec0
+
posInBox
[
1
]
*
recipBoxVec1
+
posInBox
[
2
]
*
recipBoxVec2
;
fvec4
t
=
posInBox
[
0
]
*
recipBoxVec0
+
posInBox
[
1
]
*
recipBoxVec1
+
posInBox
[
2
]
*
recipBoxVec2
;
t
=
(
t
-
floor
(
t
))
*
gridSize
;
t
=
(
t
-
floor
(
t
))
*
gridSize
;
...
@@ -74,7 +75,7 @@ static void spreadCharge(int start, int end, float* posq, float* grid, int gridx
...
@@ -74,7 +75,7 @@ static void spreadCharge(int start, int end, float* posq, float* grid, int gridx
ivec4
gridIndex
=
ti
-
(
gridSizeInt
&
ti
==
gridSizeInt
);
ivec4
gridIndex
=
ti
-
(
gridSizeInt
&
ti
==
gridSizeInt
);
// Compute the B-spline coefficients.
// Compute the B-spline coefficients.
fvec4
data
[
PME_ORDER
];
fvec4
data
[
PME_ORDER
];
data
[
PME_ORDER
-
1
]
=
0.0
f
;
data
[
PME_ORDER
-
1
]
=
0.0
f
;
data
[
1
]
=
dr
;
data
[
1
]
=
dr
;
...
...
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