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
9fd73edf
Commit
9fd73edf
authored
Oct 12, 2012
by
Peter Eastman
Browse files
Fixed compilation errors and warnings on Windows
parent
65c389ff
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
38 additions
and
38 deletions
+38
-38
openmmapi/include/openmm/System.h
openmmapi/include/openmm/System.h
+1
-1
openmmapi/include/openmm/internal/AssertionUtilities.h
openmmapi/include/openmm/internal/AssertionUtilities.h
+1
-1
openmmapi/src/System.cpp
openmmapi/src/System.cpp
+2
-2
platforms/opencl/src/OpenCLArray.h
platforms/opencl/src/OpenCLArray.h
+2
-1
platforms/opencl/src/OpenCLBondedUtilities.cpp
platforms/opencl/src/OpenCLBondedUtilities.cpp
+3
-3
platforms/opencl/src/OpenCLContext.cpp
platforms/opencl/src/OpenCLContext.cpp
+1
-1
platforms/opencl/src/OpenCLKernels.cpp
platforms/opencl/src/OpenCLKernels.cpp
+3
-3
platforms/opencl/tests/TestOpenCLCustomBondForce.cpp
platforms/opencl/tests/TestOpenCLCustomBondForce.cpp
+1
-2
platforms/opencl/tests/TestOpenCLFFT.cpp
platforms/opencl/tests/TestOpenCLFFT.cpp
+1
-1
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceVdwForce.cpp
.../reference/src/SimTKReference/AmoebaReferenceVdwForce.cpp
+2
-2
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaVdwForce.cpp
...platforms/reference/tests/TestReferenceAmoebaVdwForce.cpp
+2
-2
plugins/rpmd/platforms/opencl/src/OpenCLRpmdKernels.cpp
plugins/rpmd/platforms/opencl/src/OpenCLRpmdKernels.cpp
+8
-8
serialization/tests/TestSerializeCustomAngleForce.cpp
serialization/tests/TestSerializeCustomAngleForce.cpp
+1
-1
serialization/tests/TestSerializeCustomBondForce.cpp
serialization/tests/TestSerializeCustomBondForce.cpp
+1
-1
serialization/tests/TestSerializeCustomExternalForce.cpp
serialization/tests/TestSerializeCustomExternalForce.cpp
+1
-1
serialization/tests/TestSerializeCustomGBForce.cpp
serialization/tests/TestSerializeCustomGBForce.cpp
+2
-2
serialization/tests/TestSerializeCustomHbondForce.cpp
serialization/tests/TestSerializeCustomHbondForce.cpp
+3
-3
serialization/tests/TestSerializeCustomNonbondedForce.cpp
serialization/tests/TestSerializeCustomNonbondedForce.cpp
+2
-2
serialization/tests/TestSerializeMonteCarloBarostat.cpp
serialization/tests/TestSerializeMonteCarloBarostat.cpp
+1
-1
No files found.
openmmapi/include/openmm/System.h
View file @
9fd73edf
...
@@ -124,7 +124,7 @@ public:
...
@@ -124,7 +124,7 @@ public:
* @param index the index of the particle to check
* @param index the index of the particle to check
*/
*/
bool
isVirtualSite
(
int
index
)
const
{
bool
isVirtualSite
(
int
index
)
const
{
return
(
index
<
virtualSites
.
size
()
&&
virtualSites
[
index
]
!=
NULL
);
return
(
index
<
(
int
)
virtualSites
.
size
()
&&
virtualSites
[
index
]
!=
NULL
);
}
}
/**
/**
* Get VirtualSite object for a particle. If the particle is not a virtual
* Get VirtualSite object for a particle. If the particle is not a virtual
...
...
openmmapi/include/openmm/internal/AssertionUtilities.h
View file @
9fd73edf
...
@@ -57,6 +57,6 @@ void OPENMM_EXPORT throwException(const char* file, int line, const std::string&
...
@@ -57,6 +57,6 @@ void OPENMM_EXPORT throwException(const char* file, int line, const std::string&
#define ASSERT_USUALLY_EQUAL_TOL(expected, found, tol) {double _scale_ = std::abs(expected) > 1.0 ? std::abs(expected) : 1.0; if (!(std::abs((expected)-(found))/_scale_ <= (tol))) {std::stringstream details; details << "Expected "<<(expected)<<", found "<<(found)<<" (This test is stochastic and may occasionally fail)"; throwException(__FILE__, __LINE__, details.str());}};
#define ASSERT_USUALLY_EQUAL_TOL(expected, found, tol) {double _scale_ = std::abs(expected) > 1.0 ? std::abs(expected) : 1.0; if (!(std::abs((expected)-(found))/_scale_ <= (tol))) {std::stringstream details; details << "Expected "<<(expected)<<", found "<<(found)<<" (This test is stochastic and may occasionally fail)"; throwException(__FILE__, __LINE__, details.str());}};
#define ASSERT_VALID_INDEX(index, vector) {if (index < 0 || index >= vector.size()) throwException(__FILE__, __LINE__, "Index out of range");};
#define ASSERT_VALID_INDEX(index, vector) {if (index < 0 || index >=
(int)
vector.size()) throwException(__FILE__, __LINE__, "Index out of range");};
#endif
/*OPENMM_ASSERTIONUTILITIES_H_*/
#endif
/*OPENMM_ASSERTIONUTILITIES_H_*/
openmmapi/src/System.cpp
View file @
9fd73edf
...
@@ -62,13 +62,13 @@ void System::setParticleMass(int index, double mass) {
...
@@ -62,13 +62,13 @@ void System::setParticleMass(int index, double mass) {
void
System
::
setVirtualSite
(
int
index
,
VirtualSite
*
virtualSite
)
{
void
System
::
setVirtualSite
(
int
index
,
VirtualSite
*
virtualSite
)
{
if
(
index
>=
virtualSites
.
size
())
if
(
index
>=
(
int
)
virtualSites
.
size
())
virtualSites
.
resize
(
getNumParticles
(),
NULL
);
virtualSites
.
resize
(
getNumParticles
(),
NULL
);
virtualSites
[
index
]
=
virtualSite
;
virtualSites
[
index
]
=
virtualSite
;
}
}
const
VirtualSite
&
System
::
getVirtualSite
(
int
index
)
const
{
const
VirtualSite
&
System
::
getVirtualSite
(
int
index
)
const
{
if
(
index
>=
virtualSites
.
size
()
||
virtualSites
[
index
]
==
NULL
)
if
(
index
>=
(
int
)
virtualSites
.
size
()
||
virtualSites
[
index
]
==
NULL
)
throw
OpenMMException
(
"This particle is not a virtual site"
);
throw
OpenMMException
(
"This particle is not a virtual site"
);
return
*
virtualSites
[
index
];
return
*
virtualSites
[
index
];
}
}
...
...
platforms/opencl/src/OpenCLArray.h
View file @
9fd73edf
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#include "OpenCLContext.h"
#include "OpenCLContext.h"
#include "openmm/OpenMMException.h"
#include "openmm/OpenMMException.h"
#include "openmm/internal/windowsExport.h"
#include <iostream>
#include <iostream>
#include <sstream>
#include <sstream>
#include <vector>
#include <vector>
...
@@ -40,7 +41,7 @@ namespace OpenMM {
...
@@ -40,7 +41,7 @@ namespace OpenMM {
* and for copying data to and from the OpenCL Buffer.
* and for copying data to and from the OpenCL Buffer.
*/
*/
class
OpenCLArray
{
class
OPENMM_EXPORT
OpenCLArray
{
public:
public:
/**
/**
* Create an OpenCLArray object. The object is allocated on the heap with the "new" operator.
* Create an OpenCLArray object. The object is allocated on the heap with the "new" operator.
...
...
platforms/opencl/src/OpenCLBondedUtilities.cpp
View file @
9fd73edf
...
@@ -49,7 +49,7 @@ void OpenCLBondedUtilities::addInteraction(const vector<vector<int> >& atoms, co
...
@@ -49,7 +49,7 @@ void OpenCLBondedUtilities::addInteraction(const vector<vector<int> >& atoms, co
forceSource
.
push_back
(
source
);
forceSource
.
push_back
(
source
);
forceGroup
.
push_back
(
group
);
forceGroup
.
push_back
(
group
);
int
width
=
1
;
int
width
=
1
;
while
(
width
<
atoms
[
0
].
size
())
while
(
width
<
(
int
)
atoms
[
0
].
size
())
width
*=
2
;
width
*=
2
;
indexWidth
.
push_back
(
width
);
indexWidth
.
push_back
(
width
);
}
}
...
@@ -124,7 +124,7 @@ void OpenCLBondedUtilities::initialize(const System& system) {
...
@@ -124,7 +124,7 @@ void OpenCLBondedUtilities::initialize(const System& system) {
while
(
unmerged
.
size
()
>
0
)
{
while
(
unmerged
.
size
()
>
0
)
{
int
sum
=
numBuffers
[
unmerged
.
back
()];
int
sum
=
numBuffers
[
unmerged
.
back
()];
int
i
;
int
i
;
for
(
i
=
0
;
i
<
unmerged
.
size
()
-
1
;
i
++
)
{
for
(
i
=
0
;
i
<
(
int
)
unmerged
.
size
()
-
1
;
i
++
)
{
if
(
sum
+
numBuffers
[
unmerged
[
i
]]
>
bufferLimit
)
if
(
sum
+
numBuffers
[
unmerged
[
i
]]
>
bufferLimit
)
break
;
break
;
sum
+=
numBuffers
[
unmerged
[
i
]];
sum
+=
numBuffers
[
unmerged
[
i
]];
...
@@ -142,7 +142,7 @@ void OpenCLBondedUtilities::initialize(const System& system) {
...
@@ -142,7 +142,7 @@ void OpenCLBondedUtilities::initialize(const System& system) {
bufferIndices
.
resize
(
numForces
);
bufferIndices
.
resize
(
numForces
);
for
(
int
i
=
0
;
i
<
(
int
)
forceSets
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
(
int
)
forceSets
.
size
();
i
++
)
for
(
int
j
=
0
;
j
<
forceSets
[
i
].
size
();
j
++
)
{
for
(
int
j
=
0
;
j
<
(
int
)
forceSets
[
i
].
size
();
j
++
)
{
int
force
=
forceSets
[
i
][
j
];
int
force
=
forceSets
[
i
][
j
];
int
numBonds
=
forceAtoms
[
force
].
size
();
int
numBonds
=
forceAtoms
[
force
].
size
();
int
numAtoms
=
forceAtoms
[
force
][
0
].
size
();
int
numAtoms
=
forceAtoms
[
force
][
0
].
size
();
...
...
platforms/opencl/src/OpenCLContext.cpp
View file @
9fd73edf
...
@@ -73,7 +73,7 @@ OpenCLContext::OpenCLContext(const System& system, int platformIndex, int device
...
@@ -73,7 +73,7 @@ OpenCLContext::OpenCLContext(const System& system, int platformIndex, int device
contextIndex
=
platformData
.
contexts
.
size
();
contextIndex
=
platformData
.
contexts
.
size
();
std
::
vector
<
cl
::
Platform
>
platforms
;
std
::
vector
<
cl
::
Platform
>
platforms
;
cl
::
Platform
::
get
(
&
platforms
);
cl
::
Platform
::
get
(
&
platforms
);
if
(
platformIndex
<
0
||
platformIndex
>=
platforms
.
size
())
if
(
platformIndex
<
0
||
platformIndex
>=
(
int
)
platforms
.
size
())
throw
OpenMMException
(
"Illegal value for OpenCL platform index"
);
throw
OpenMMException
(
"Illegal value for OpenCL platform index"
);
string
platformVendor
=
platforms
[
platformIndex
].
getInfo
<
CL_PLATFORM_VENDOR
>
();
string
platformVendor
=
platforms
[
platformIndex
].
getInfo
<
CL_PLATFORM_VENDOR
>
();
vector
<
cl
::
Device
>
devices
;
vector
<
cl
::
Device
>
devices
;
...
...
platforms/opencl/src/OpenCLKernels.cpp
View file @
9fd73edf
...
@@ -277,7 +277,7 @@ void OpenCLUpdateStateDataKernel::loadCheckpoint(ContextImpl& context, istream&
...
@@ -277,7 +277,7 @@ void OpenCLUpdateStateDataKernel::loadCheckpoint(ContextImpl& context, istream&
contexts
[
i
]
->
setPeriodicBoxSize
(
box
.
x
,
box
.
y
,
box
.
z
);
contexts
[
i
]
->
setPeriodicBoxSize
(
box
.
x
,
box
.
y
,
box
.
z
);
cl
.
getIntegrationUtilities
().
loadCheckpoint
(
stream
);
cl
.
getIntegrationUtilities
().
loadCheckpoint
(
stream
);
SimTKOpenMMUtilities
::
loadCheckpoint
(
stream
);
SimTKOpenMMUtilities
::
loadCheckpoint
(
stream
);
for
(
int
i
=
0
;
i
<
cl
.
getReorderListeners
().
size
();
i
++
)
for
(
int
i
=
0
;
i
<
(
int
)
cl
.
getReorderListeners
().
size
();
i
++
)
cl
.
getReorderListeners
()[
i
]
->
execute
();
cl
.
getReorderListeners
()[
i
]
->
execute
();
}
}
...
@@ -4832,8 +4832,8 @@ void OpenCLIntegrateCustomStepKernel::execute(ContextImpl& context, CustomIntegr
...
@@ -4832,8 +4832,8 @@ void OpenCLIntegrateCustomStepKernel::execute(ContextImpl& context, CustomIntegr
cl
.
executeKernel
(
kernels
[
i
][
0
],
numAtoms
);
cl
.
executeKernel
(
kernels
[
i
][
0
],
numAtoms
);
}
}
else
if
(
stepType
[
i
]
==
CustomIntegrator
::
ComputeGlobal
&&
!
merged
[
i
])
{
else
if
(
stepType
[
i
]
==
CustomIntegrator
::
ComputeGlobal
&&
!
merged
[
i
])
{
kernels
[
i
][
0
].
setArg
<
cl_float
>
(
3
,
SimTKOpenMMUtilities
::
getUniformlyDistributedRandomNumber
());
kernels
[
i
][
0
].
setArg
<
cl_float
>
(
3
,
(
cl_float
)
SimTKOpenMMUtilities
::
getUniformlyDistributedRandomNumber
());
kernels
[
i
][
0
].
setArg
<
cl_float
>
(
4
,
SimTKOpenMMUtilities
::
getNormallyDistributedRandomNumber
());
kernels
[
i
][
0
].
setArg
<
cl_float
>
(
4
,
(
cl_float
)
SimTKOpenMMUtilities
::
getNormallyDistributedRandomNumber
());
cl
.
executeKernel
(
kernels
[
i
][
0
],
1
,
1
);
cl
.
executeKernel
(
kernels
[
i
][
0
],
1
,
1
);
}
}
else
if
(
stepType
[
i
]
==
CustomIntegrator
::
ComputeSum
)
{
else
if
(
stepType
[
i
]
==
CustomIntegrator
::
ComputeSum
)
{
...
...
platforms/opencl/tests/TestOpenCLCustomBondForce.cpp
View file @
9fd73edf
...
@@ -118,7 +118,7 @@ void testManyParameters() {
...
@@ -118,7 +118,7 @@ void testManyParameters() {
forceField
->
addPerBondParameter
(
"h"
);
forceField
->
addPerBondParameter
(
"h"
);
forceField
->
addPerBondParameter
(
"i"
);
forceField
->
addPerBondParameter
(
"i"
);
vector
<
double
>
parameters
(
forceField
->
getNumPerBondParameters
());
vector
<
double
>
parameters
(
forceField
->
getNumPerBondParameters
());
for
(
int
i
=
0
;
i
<
parameters
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
(
int
)
parameters
.
size
();
i
++
)
parameters
[
i
]
=
i
;
parameters
[
i
]
=
i
;
forceField
->
addBond
(
0
,
1
,
parameters
);
forceField
->
addBond
(
0
,
1
,
parameters
);
system
.
addForce
(
forceField
);
system
.
addForce
(
forceField
);
...
@@ -179,4 +179,3 @@ int main() {
...
@@ -179,4 +179,3 @@ int main() {
return
0
;
return
0
;
}
}
platforms/opencl/tests/TestOpenCLFFT.cpp
View file @
9fd73edf
...
@@ -60,7 +60,7 @@ void testTransform() {
...
@@ -60,7 +60,7 @@ void testTransform() {
vector
<
mm_float2
>
original
(
xsize
*
ysize
*
zsize
);
vector
<
mm_float2
>
original
(
xsize
*
ysize
*
zsize
);
vector
<
t_complex
>
reference
(
original
.
size
());
vector
<
t_complex
>
reference
(
original
.
size
());
for
(
int
i
=
0
;
i
<
(
int
)
original
.
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
(
int
)
original
.
size
();
i
++
)
{
mm_float2
value
=
mm_float2
(
genrand_real2
(
sfmt
),
genrand_real2
(
sfmt
));
mm_float2
value
=
mm_float2
(
(
cl_float
)
genrand_real2
(
sfmt
),
(
cl_float
)
genrand_real2
(
sfmt
));
original
[
i
]
=
value
;
original
[
i
]
=
value
;
reference
[
i
]
=
t_complex
(
value
.
x
,
value
.
y
);
reference
[
i
]
=
t_complex
(
value
.
x
,
value
.
y
);
}
}
...
...
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceVdwForce.cpp
View file @
9fd73edf
...
@@ -308,7 +308,7 @@ RealOpenMM AmoebaReferenceVdwForce::calculateForceAndEnergy( int numParticles,
...
@@ -308,7 +308,7 @@ RealOpenMM AmoebaReferenceVdwForce::calculateForceAndEnergy( int numParticles,
RealOpenMM
sigmaI
=
sigmas
[
ii
];
RealOpenMM
sigmaI
=
sigmas
[
ii
];
RealOpenMM
epsilonI
=
epsilons
[
ii
];
RealOpenMM
epsilonI
=
epsilons
[
ii
];
for
(
std
::
set
<
int
>::
iterator
jj
=
allExclusions
[
ii
].
begin
();
jj
!=
allExclusions
[
ii
].
end
();
jj
++
){
for
(
std
::
set
<
int
>::
const_
iterator
jj
=
allExclusions
[
ii
].
begin
();
jj
!=
allExclusions
[
ii
].
end
();
jj
++
){
exclusions
[
*
jj
]
=
1
;
exclusions
[
*
jj
]
=
1
;
}
}
...
@@ -341,7 +341,7 @@ RealOpenMM AmoebaReferenceVdwForce::calculateForceAndEnergy( int numParticles,
...
@@ -341,7 +341,7 @@ RealOpenMM AmoebaReferenceVdwForce::calculateForceAndEnergy( int numParticles,
}
}
}
}
for
(
std
::
set
<
int
>::
iterator
jj
=
allExclusions
[
ii
].
begin
();
jj
!=
allExclusions
[
ii
].
end
();
jj
++
){
for
(
std
::
set
<
int
>::
const_
iterator
jj
=
allExclusions
[
ii
].
begin
();
jj
!=
allExclusions
[
ii
].
end
();
jj
++
){
exclusions
[
*
jj
]
=
0
;
exclusions
[
*
jj
]
=
0
;
}
}
}
}
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaVdwForce.cpp
View file @
9fd73edf
...
@@ -544,7 +544,7 @@ void setupAndGetForcesEnergyVdwWater( const std::string& sigmaCombiningRule, con
...
@@ -544,7 +544,7 @@ void setupAndGetForcesEnergyVdwWater( const std::string& sigmaCombiningRule, con
// addParticle: ivIndex, radius, epsilon, reductionFactor
// addParticle: ivIndex, radius, epsilon, reductionFactor
int
classIndex
=
0
;
int
classIndex
=
0
;
for
(
unsigned
int
ii
=
0
;
ii
<
numberOfParticles
;
ii
+=
3
){
for
(
int
ii
=
0
;
ii
<
numberOfParticles
;
ii
+=
3
){
system
.
addParticle
(
1.5995000e+01
);
system
.
addParticle
(
1.5995000e+01
);
amoebaVdwForce
->
addParticle
(
ii
,
1.7025000e-01
,
4.6024000e-01
,
0.0000000e+00
);
amoebaVdwForce
->
addParticle
(
ii
,
1.7025000e-01
,
4.6024000e-01
,
0.0000000e+00
);
...
@@ -559,7 +559,7 @@ void setupAndGetForcesEnergyVdwWater( const std::string& sigmaCombiningRule, con
...
@@ -559,7 +559,7 @@ void setupAndGetForcesEnergyVdwWater( const std::string& sigmaCombiningRule, con
// exclusions
// exclusions
std
::
vector
<
int
>
exclusions
(
3
);
std
::
vector
<
int
>
exclusions
(
3
);
for
(
unsigned
int
ii
=
0
;
ii
<
numberOfParticles
;
ii
+=
3
){
for
(
int
ii
=
0
;
ii
<
numberOfParticles
;
ii
+=
3
){
exclusions
[
0
]
=
ii
;
exclusions
[
0
]
=
ii
;
exclusions
[
1
]
=
ii
+
1
;
exclusions
[
1
]
=
ii
+
1
;
exclusions
[
2
]
=
ii
+
2
;
exclusions
[
2
]
=
ii
+
2
;
...
...
plugins/rpmd/platforms/opencl/src/OpenCLRpmdKernels.cpp
View file @
9fd73edf
...
@@ -138,15 +138,15 @@ void OpenCLIntegrateRPMDStepKernel::execute(ContextImpl& context, const RPMDInte
...
@@ -138,15 +138,15 @@ void OpenCLIntegrateRPMDStepKernel::execute(ContextImpl& context, const RPMDInte
const
double
dt
=
integrator
.
getStepSize
();
const
double
dt
=
integrator
.
getStepSize
();
pileKernel
.
setArg
<
cl_uint
>
(
5
,
integration
.
prepareRandomNumbers
(
numParticles
*
numCopies
));
pileKernel
.
setArg
<
cl_uint
>
(
5
,
integration
.
prepareRandomNumbers
(
numParticles
*
numCopies
));
pileKernel
.
setArg
<
cl
::
Buffer
>
(
4
,
integration
.
getRandom
().
getDeviceBuffer
());
// Do this *after* prepareRandomNumbers(), which might rebuild the array.
pileKernel
.
setArg
<
cl
::
Buffer
>
(
4
,
integration
.
getRandom
().
getDeviceBuffer
());
// Do this *after* prepareRandomNumbers(), which might rebuild the array.
pileKernel
.
setArg
<
cl_float
>
(
6
,
dt
);
pileKernel
.
setArg
<
cl_float
>
(
6
,
(
cl_float
)
dt
);
pileKernel
.
setArg
<
cl_float
>
(
7
,
integrator
.
getTemperature
()
*
BOLTZ
);
pileKernel
.
setArg
<
cl_float
>
(
7
,
(
cl_float
)
(
integrator
.
getTemperature
()
*
BOLTZ
)
)
;
pileKernel
.
setArg
<
cl_float
>
(
8
,
integrator
.
getFriction
());
pileKernel
.
setArg
<
cl_float
>
(
8
,
(
cl_float
)
integrator
.
getFriction
());
cl
.
executeKernel
(
pileKernel
,
numParticles
*
numCopies
,
workgroupSize
);
cl
.
executeKernel
(
pileKernel
,
numParticles
*
numCopies
,
workgroupSize
);
// Update positions and velocities.
// Update positions and velocities.
stepKernel
.
setArg
<
cl_float
>
(
7
,
dt
);
stepKernel
.
setArg
<
cl_float
>
(
7
,
(
cl_float
)
dt
);
stepKernel
.
setArg
<
cl_float
>
(
8
,
integrator
.
getTemperature
()
*
BOLTZ
);
stepKernel
.
setArg
<
cl_float
>
(
8
,
(
cl_float
)
(
integrator
.
getTemperature
()
*
BOLTZ
)
)
;
cl
.
executeKernel
(
stepKernel
,
numParticles
*
numCopies
,
workgroupSize
);
cl
.
executeKernel
(
stepKernel
,
numParticles
*
numCopies
,
workgroupSize
);
// Calculate forces based on the updated positions.
// Calculate forces based on the updated positions.
...
@@ -154,7 +154,7 @@ void OpenCLIntegrateRPMDStepKernel::execute(ContextImpl& context, const RPMDInte
...
@@ -154,7 +154,7 @@ void OpenCLIntegrateRPMDStepKernel::execute(ContextImpl& context, const RPMDInte
computeForces
(
context
);
computeForces
(
context
);
// Update velocities.
// Update velocities.
velocitiesKernel
.
setArg
<
cl_float
>
(
2
,
dt
);
velocitiesKernel
.
setArg
<
cl_float
>
(
2
,
(
cl_float
)
dt
);
cl
.
executeKernel
(
velocitiesKernel
,
numParticles
*
numCopies
,
workgroupSize
);
cl
.
executeKernel
(
velocitiesKernel
,
numParticles
*
numCopies
,
workgroupSize
);
// Apply the PILE-L thermostat again.
// Apply the PILE-L thermostat again.
...
@@ -193,7 +193,7 @@ void OpenCLIntegrateRPMDStepKernel::setPositions(int copy, const vector<Vec3>& p
...
@@ -193,7 +193,7 @@ void OpenCLIntegrateRPMDStepKernel::setPositions(int copy, const vector<Vec3>& p
vector
<
mm_float4
>
posq
(
cl
.
getPaddedNumAtoms
());
vector
<
mm_float4
>
posq
(
cl
.
getPaddedNumAtoms
());
cl
.
getPosq
().
download
(
posq
);
cl
.
getPosq
().
download
(
posq
);
for
(
int
i
=
0
;
i
<
numParticles
;
i
++
)
for
(
int
i
=
0
;
i
<
numParticles
;
i
++
)
posq
[
i
]
=
mm_float4
(
pos
[
i
][
0
],
pos
[
i
][
1
],
pos
[
i
][
2
],
posq
[
i
].
w
);
posq
[
i
]
=
mm_float4
(
(
cl_float
)
pos
[
i
][
0
],
(
cl_float
)
pos
[
i
][
1
],
(
cl_float
)
pos
[
i
][
2
],
posq
[
i
].
w
);
cl
.
getQueue
().
enqueueWriteBuffer
(
positions
->
getDeviceBuffer
(),
CL_TRUE
,
copy
*
cl
.
getPaddedNumAtoms
()
*
sizeof
(
mm_float4
),
numParticles
*
sizeof
(
mm_float4
),
&
posq
[
0
]);
cl
.
getQueue
().
enqueueWriteBuffer
(
positions
->
getDeviceBuffer
(),
CL_TRUE
,
copy
*
cl
.
getPaddedNumAtoms
()
*
sizeof
(
mm_float4
),
numParticles
*
sizeof
(
mm_float4
),
&
posq
[
0
]);
}
}
...
@@ -205,7 +205,7 @@ void OpenCLIntegrateRPMDStepKernel::setVelocities(int copy, const vector<Vec3>&
...
@@ -205,7 +205,7 @@ void OpenCLIntegrateRPMDStepKernel::setVelocities(int copy, const vector<Vec3>&
vector
<
mm_float4
>
velm
(
cl
.
getPaddedNumAtoms
());
vector
<
mm_float4
>
velm
(
cl
.
getPaddedNumAtoms
());
cl
.
getVelm
().
download
(
velm
);
cl
.
getVelm
().
download
(
velm
);
for
(
int
i
=
0
;
i
<
numParticles
;
i
++
)
for
(
int
i
=
0
;
i
<
numParticles
;
i
++
)
velm
[
i
]
=
mm_float4
(
vel
[
i
][
0
],
vel
[
i
][
1
],
vel
[
i
][
2
],
velm
[
i
].
w
);
velm
[
i
]
=
mm_float4
(
(
cl_float
)
vel
[
i
][
0
],
(
cl_float
)
vel
[
i
][
1
],
(
cl_float
)
vel
[
i
][
2
],
velm
[
i
].
w
);
cl
.
getQueue
().
enqueueWriteBuffer
(
velocities
->
getDeviceBuffer
(),
CL_TRUE
,
copy
*
cl
.
getPaddedNumAtoms
()
*
sizeof
(
mm_float4
),
numParticles
*
sizeof
(
mm_float4
),
&
velm
[
0
]);
cl
.
getQueue
().
enqueueWriteBuffer
(
velocities
->
getDeviceBuffer
(),
CL_TRUE
,
copy
*
cl
.
getPaddedNumAtoms
()
*
sizeof
(
mm_float4
),
numParticles
*
sizeof
(
mm_float4
),
&
velm
[
0
]);
}
}
...
...
serialization/tests/TestSerializeCustomAngleForce.cpp
View file @
9fd73edf
...
@@ -81,7 +81,7 @@ void testSerialization() {
...
@@ -81,7 +81,7 @@ void testSerialization() {
ASSERT_EQUAL
(
b2
,
b2
);
ASSERT_EQUAL
(
b2
,
b2
);
ASSERT_EQUAL
(
c2
,
c2
);
ASSERT_EQUAL
(
c2
,
c2
);
ASSERT_EQUAL
(
params1
.
size
(),
params2
.
size
());
ASSERT_EQUAL
(
params1
.
size
(),
params2
.
size
());
for
(
int
j
=
0
;
j
<
params1
.
size
();
j
++
)
for
(
int
j
=
0
;
j
<
(
int
)
params1
.
size
();
j
++
)
ASSERT_EQUAL
(
params1
[
j
],
params2
[
j
]);
ASSERT_EQUAL
(
params1
[
j
],
params2
[
j
]);
}
}
}
}
...
...
serialization/tests/TestSerializeCustomBondForce.cpp
View file @
9fd73edf
...
@@ -80,7 +80,7 @@ void testSerialization() {
...
@@ -80,7 +80,7 @@ void testSerialization() {
ASSERT_EQUAL
(
a1
,
a2
);
ASSERT_EQUAL
(
a1
,
a2
);
ASSERT_EQUAL
(
b2
,
b2
);
ASSERT_EQUAL
(
b2
,
b2
);
ASSERT_EQUAL
(
params1
.
size
(),
params2
.
size
());
ASSERT_EQUAL
(
params1
.
size
(),
params2
.
size
());
for
(
int
j
=
0
;
j
<
params1
.
size
();
j
++
)
for
(
int
j
=
0
;
j
<
(
int
)
params1
.
size
();
j
++
)
ASSERT_EQUAL
(
params1
[
j
],
params2
[
j
]);
ASSERT_EQUAL
(
params1
[
j
],
params2
[
j
]);
}
}
}
}
...
...
serialization/tests/TestSerializeCustomExternalForce.cpp
View file @
9fd73edf
...
@@ -79,7 +79,7 @@ void testSerialization() {
...
@@ -79,7 +79,7 @@ void testSerialization() {
force2
.
getParticleParameters
(
i
,
particle2
,
params2
);
force2
.
getParticleParameters
(
i
,
particle2
,
params2
);
ASSERT_EQUAL
(
particle1
,
particle2
);
ASSERT_EQUAL
(
particle1
,
particle2
);
ASSERT_EQUAL
(
params1
.
size
(),
params2
.
size
());
ASSERT_EQUAL
(
params1
.
size
(),
params2
.
size
());
for
(
int
j
=
0
;
j
<
params1
.
size
();
j
++
)
for
(
int
j
=
0
;
j
<
(
int
)
params1
.
size
();
j
++
)
ASSERT_EQUAL
(
params1
[
j
],
params2
[
j
]);
ASSERT_EQUAL
(
params1
[
j
],
params2
[
j
]);
}
}
}
}
...
...
serialization/tests/TestSerializeCustomGBForce.cpp
View file @
9fd73edf
...
@@ -109,7 +109,7 @@ void testSerialization() {
...
@@ -109,7 +109,7 @@ void testSerialization() {
force
.
getParticleParameters
(
i
,
params1
);
force
.
getParticleParameters
(
i
,
params1
);
force2
.
getParticleParameters
(
i
,
params2
);
force2
.
getParticleParameters
(
i
,
params2
);
ASSERT_EQUAL
(
params1
.
size
(),
params2
.
size
());
ASSERT_EQUAL
(
params1
.
size
(),
params2
.
size
());
for
(
int
j
=
0
;
j
<
params1
.
size
();
j
++
)
for
(
int
j
=
0
;
j
<
(
int
)
params1
.
size
();
j
++
)
ASSERT_EQUAL
(
params1
[
j
],
params2
[
j
]);
ASSERT_EQUAL
(
params1
[
j
],
params2
[
j
]);
}
}
ASSERT_EQUAL
(
force
.
getNumExclusions
(),
force2
.
getNumExclusions
());
ASSERT_EQUAL
(
force
.
getNumExclusions
(),
force2
.
getNumExclusions
());
...
@@ -131,7 +131,7 @@ void testSerialization() {
...
@@ -131,7 +131,7 @@ void testSerialization() {
ASSERT_EQUAL
(
min1
,
min2
);
ASSERT_EQUAL
(
min1
,
min2
);
ASSERT_EQUAL
(
max1
,
max2
);
ASSERT_EQUAL
(
max1
,
max2
);
ASSERT_EQUAL
(
val1
.
size
(),
val2
.
size
());
ASSERT_EQUAL
(
val1
.
size
(),
val2
.
size
());
for
(
int
j
=
0
;
j
<
val1
.
size
();
j
++
)
for
(
int
j
=
0
;
j
<
(
int
)
val1
.
size
();
j
++
)
ASSERT_EQUAL
(
val1
[
j
],
val2
[
j
]);
ASSERT_EQUAL
(
val1
[
j
],
val2
[
j
]);
}
}
}
}
...
...
serialization/tests/TestSerializeCustomHbondForce.cpp
View file @
9fd73edf
...
@@ -101,7 +101,7 @@ void testSerialization() {
...
@@ -101,7 +101,7 @@ void testSerialization() {
ASSERT_EQUAL
(
b1
,
b2
);
ASSERT_EQUAL
(
b1
,
b2
);
ASSERT_EQUAL
(
c1
,
c2
);
ASSERT_EQUAL
(
c1
,
c2
);
ASSERT_EQUAL
(
params1
.
size
(),
params2
.
size
());
ASSERT_EQUAL
(
params1
.
size
(),
params2
.
size
());
for
(
int
j
=
0
;
j
<
params1
.
size
();
j
++
)
for
(
int
j
=
0
;
j
<
(
int
)
params1
.
size
();
j
++
)
ASSERT_EQUAL
(
params1
[
j
],
params2
[
j
]);
ASSERT_EQUAL
(
params1
[
j
],
params2
[
j
]);
}
}
ASSERT_EQUAL
(
force
.
getNumAcceptors
(),
force2
.
getNumAcceptors
());
ASSERT_EQUAL
(
force
.
getNumAcceptors
(),
force2
.
getNumAcceptors
());
...
@@ -114,7 +114,7 @@ void testSerialization() {
...
@@ -114,7 +114,7 @@ void testSerialization() {
ASSERT_EQUAL
(
b1
,
b2
);
ASSERT_EQUAL
(
b1
,
b2
);
ASSERT_EQUAL
(
c1
,
c2
);
ASSERT_EQUAL
(
c1
,
c2
);
ASSERT_EQUAL
(
params1
.
size
(),
params2
.
size
());
ASSERT_EQUAL
(
params1
.
size
(),
params2
.
size
());
for
(
int
j
=
0
;
j
<
params1
.
size
();
j
++
)
for
(
int
j
=
0
;
j
<
(
int
)
params1
.
size
();
j
++
)
ASSERT_EQUAL
(
params1
[
j
],
params2
[
j
]);
ASSERT_EQUAL
(
params1
[
j
],
params2
[
j
]);
}
}
ASSERT_EQUAL
(
force
.
getNumExclusions
(),
force2
.
getNumExclusions
());
ASSERT_EQUAL
(
force
.
getNumExclusions
(),
force2
.
getNumExclusions
());
...
@@ -136,7 +136,7 @@ void testSerialization() {
...
@@ -136,7 +136,7 @@ void testSerialization() {
ASSERT_EQUAL
(
min1
,
min2
);
ASSERT_EQUAL
(
min1
,
min2
);
ASSERT_EQUAL
(
max1
,
max2
);
ASSERT_EQUAL
(
max1
,
max2
);
ASSERT_EQUAL
(
val1
.
size
(),
val2
.
size
());
ASSERT_EQUAL
(
val1
.
size
(),
val2
.
size
());
for
(
int
j
=
0
;
j
<
val1
.
size
();
j
++
)
for
(
int
j
=
0
;
j
<
(
int
)
val1
.
size
();
j
++
)
ASSERT_EQUAL
(
val1
[
j
],
val2
[
j
]);
ASSERT_EQUAL
(
val1
[
j
],
val2
[
j
]);
}
}
}
}
...
...
serialization/tests/TestSerializeCustomNonbondedForce.cpp
View file @
9fd73edf
...
@@ -87,7 +87,7 @@ void testSerialization() {
...
@@ -87,7 +87,7 @@ void testSerialization() {
force
.
getParticleParameters
(
i
,
params1
);
force
.
getParticleParameters
(
i
,
params1
);
force2
.
getParticleParameters
(
i
,
params2
);
force2
.
getParticleParameters
(
i
,
params2
);
ASSERT_EQUAL
(
params1
.
size
(),
params2
.
size
());
ASSERT_EQUAL
(
params1
.
size
(),
params2
.
size
());
for
(
int
j
=
0
;
j
<
params1
.
size
();
j
++
)
for
(
int
j
=
0
;
j
<
(
int
)
params1
.
size
();
j
++
)
ASSERT_EQUAL
(
params1
[
j
],
params2
[
j
]);
ASSERT_EQUAL
(
params1
[
j
],
params2
[
j
]);
}
}
ASSERT_EQUAL
(
force
.
getNumExclusions
(),
force2
.
getNumExclusions
());
ASSERT_EQUAL
(
force
.
getNumExclusions
(),
force2
.
getNumExclusions
());
...
@@ -109,7 +109,7 @@ void testSerialization() {
...
@@ -109,7 +109,7 @@ void testSerialization() {
ASSERT_EQUAL
(
min1
,
min2
);
ASSERT_EQUAL
(
min1
,
min2
);
ASSERT_EQUAL
(
max1
,
max2
);
ASSERT_EQUAL
(
max1
,
max2
);
ASSERT_EQUAL
(
val1
.
size
(),
val2
.
size
());
ASSERT_EQUAL
(
val1
.
size
(),
val2
.
size
());
for
(
int
j
=
0
;
j
<
val1
.
size
();
j
++
)
for
(
int
j
=
0
;
j
<
(
int
)
val1
.
size
();
j
++
)
ASSERT_EQUAL
(
val1
[
j
],
val2
[
j
]);
ASSERT_EQUAL
(
val1
[
j
],
val2
[
j
]);
}
}
}
}
...
...
serialization/tests/TestSerializeMonteCarloBarostat.cpp
View file @
9fd73edf
...
@@ -41,7 +41,7 @@ using namespace std;
...
@@ -41,7 +41,7 @@ using namespace std;
void
testSerialization
()
{
void
testSerialization
()
{
// Create a Force.
// Create a Force.
MonteCarloBarostat
force
(
25.5
,
250.0
,
0.2
);
MonteCarloBarostat
force
(
25.5
,
250.0
,
14
);
force
.
setRandomNumberSeed
(
3
);
force
.
setRandomNumberSeed
(
3
);
// Serialize and then deserialize it.
// Serialize and then deserialize it.
...
...
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