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
3d98a96f
Commit
3d98a96f
authored
Sep 25, 2012
by
Peter Eastman
Browse files
Fixed bug when using multiple Contexts at once
parent
1cb85ba3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
platforms/cuda2/src/CudaKernels.cpp
platforms/cuda2/src/CudaKernels.cpp
+4
-0
No files found.
platforms/cuda2/src/CudaKernels.cpp
View file @
3d98a96f
...
...
@@ -5007,6 +5007,7 @@ void CudaApplyAndersenThermostatKernel::initialize(const System& system, const A
}
void
CudaApplyAndersenThermostatKernel
::
execute
(
ContextImpl
&
context
)
{
cu
.
setAsCurrent
();
float
frequency
=
(
float
)
context
.
getParameter
(
AndersenThermostat
::
CollisionFrequency
());
float
kT
=
(
float
)
(
BOLTZ
*
context
.
getParameter
(
AndersenThermostat
::
Temperature
()));
int
randomIndex
=
cu
.
getIntegrationUtilities
().
prepareRandomNumbers
(
cu
.
getPaddedNumAtoms
());
...
...
@@ -5033,6 +5034,7 @@ void CudaApplyMonteCarloBarostatKernel::initialize(const System& system, const M
}
void
CudaApplyMonteCarloBarostatKernel
::
scaleCoordinates
(
ContextImpl
&
context
,
double
scale
)
{
cu
.
setAsCurrent
();
if
(
!
hasInitializedKernels
)
{
hasInitializedKernels
=
true
;
...
...
@@ -5073,6 +5075,7 @@ void CudaApplyMonteCarloBarostatKernel::scaleCoordinates(ContextImpl& context, d
}
void
CudaApplyMonteCarloBarostatKernel
::
restoreCoordinates
(
ContextImpl
&
context
)
{
cu
.
setAsCurrent
();
int
bytesToCopy
=
cu
.
getPosq
().
getSize
()
*
(
cu
.
getUseDoublePrecision
()
?
sizeof
(
double4
)
:
sizeof
(
float4
));
CUresult
result
=
cuMemcpyDtoD
(
cu
.
getPosq
().
getDevicePointer
(),
savedPositions
->
getDevicePointer
(),
bytesToCopy
);
if
(
result
!=
CUDA_SUCCESS
)
{
...
...
@@ -5137,6 +5140,7 @@ void CudaRemoveCMMotionKernel::initialize(const System& system, const CMMotionRe
}
void
CudaRemoveCMMotionKernel
::
execute
(
ContextImpl
&
context
)
{
cu
.
setAsCurrent
();
int
numAtoms
=
cu
.
getNumAtoms
();
void
*
args
[]
=
{
&
numAtoms
,
&
cu
.
getVelm
().
getDevicePointer
(),
&
cmMomentum
->
getDevicePointer
()};
cu
.
executeKernel
(
kernel1
,
args
,
cu
.
getNumAtoms
(),
cu
.
ThreadBlockSize
,
cu
.
ThreadBlockSize
*
sizeof
(
float4
));
...
...
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