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
cd1223df
Commit
cd1223df
authored
Feb 04, 2011
by
Peter Eastman
Browse files
Initialize the positions and velocities of padding atoms to avoid the possibility of NaNs.
parent
b3ee3b69
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
platforms/opencl/src/OpenCLKernels.cpp
platforms/opencl/src/OpenCLKernels.cpp
+4
-0
No files found.
platforms/opencl/src/OpenCLKernels.cpp
View file @
cd1223df
...
@@ -131,6 +131,8 @@ void OpenCLUpdateStateDataKernel::setPositions(ContextImpl& context, const std::
...
@@ -131,6 +131,8 @@ void OpenCLUpdateStateDataKernel::setPositions(ContextImpl& context, const std::
pos
.
y
=
(
cl_float
)
p
[
1
];
pos
.
y
=
(
cl_float
)
p
[
1
];
pos
.
z
=
(
cl_float
)
p
[
2
];
pos
.
z
=
(
cl_float
)
p
[
2
];
}
}
for
(
int
i
=
numParticles
;
i
<
cl
.
getPaddedNumAtoms
();
i
++
)
posq
[
i
]
=
mm_float4
(
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
);
posq
.
upload
();
posq
.
upload
();
for
(
int
i
=
0
;
i
<
(
int
)
cl
.
getPosCellOffsets
().
size
();
i
++
)
for
(
int
i
=
0
;
i
<
(
int
)
cl
.
getPosCellOffsets
().
size
();
i
++
)
cl
.
getPosCellOffsets
()[
i
]
=
mm_int4
(
0
,
0
,
0
,
0
);
cl
.
getPosCellOffsets
()[
i
]
=
mm_int4
(
0
,
0
,
0
,
0
);
...
@@ -159,6 +161,8 @@ void OpenCLUpdateStateDataKernel::setVelocities(ContextImpl& context, const std:
...
@@ -159,6 +161,8 @@ void OpenCLUpdateStateDataKernel::setVelocities(ContextImpl& context, const std:
vel
.
y
=
(
cl_float
)
p
[
1
];
vel
.
y
=
(
cl_float
)
p
[
1
];
vel
.
z
=
(
cl_float
)
p
[
2
];
vel
.
z
=
(
cl_float
)
p
[
2
];
}
}
for
(
int
i
=
numParticles
;
i
<
cl
.
getPaddedNumAtoms
();
i
++
)
velm
[
i
]
=
mm_float4
(
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
);
velm
.
upload
();
velm
.
upload
();
}
}
...
...
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