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
9e66f0b1
Commit
9e66f0b1
authored
Apr 25, 2016
by
peastman
Browse files
Merge pull request #1469 from peastman/properties
Unified names of platform properties
parents
25d21454
cc4caaba
Changes
35
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
96 additions
and
66 deletions
+96
-66
docs-source/usersguide/application.rst
docs-source/usersguide/application.rst
+1
-1
docs-source/usersguide/library.rst
docs-source/usersguide/library.rst
+15
-15
examples/benchmark.py
examples/benchmark.py
+4
-10
olla/include/openmm/Platform.h
olla/include/openmm/Platform.h
+3
-1
olla/src/Platform.cpp
olla/src/Platform.cpp
+9
-3
openmmapi/src/ContextImpl.cpp
openmmapi/src/ContextImpl.cpp
+8
-3
platforms/cpu/include/CpuPlatform.h
platforms/cpu/include/CpuPlatform.h
+2
-2
platforms/cpu/src/CpuPlatform.cpp
platforms/cpu/src/CpuPlatform.cpp
+6
-2
platforms/cuda/include/CudaPlatform.h
platforms/cuda/include/CudaPlatform.h
+8
-8
platforms/cuda/src/CudaContext.cpp
platforms/cuda/src/CudaContext.cpp
+3
-3
platforms/cuda/src/CudaPlatform.cpp
platforms/cuda/src/CudaPlatform.cpp
+12
-1
platforms/cuda/tests/CudaTests.h
platforms/cuda/tests/CudaTests.h
+2
-2
platforms/opencl/include/OpenCLPlatform.h
platforms/opencl/include/OpenCLPlatform.h
+5
-5
platforms/opencl/src/OpenCLContext.cpp
platforms/opencl/src/OpenCLContext.cpp
+2
-2
platforms/opencl/src/OpenCLPlatform.cpp
platforms/opencl/src/OpenCLPlatform.cpp
+9
-1
platforms/opencl/tests/OpenCLTests.h
platforms/opencl/tests/OpenCLTests.h
+3
-3
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaAngleForce.cpp
.../amoeba/platforms/cuda/tests/TestCudaAmoebaAngleForce.cpp
+1
-1
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaBondForce.cpp
...s/amoeba/platforms/cuda/tests/TestCudaAmoebaBondForce.cpp
+1
-1
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaGeneralizedKirkwoodForce.cpp
...rms/cuda/tests/TestCudaAmoebaGeneralizedKirkwoodForce.cpp
+1
-1
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaInPlaneAngleForce.cpp
.../platforms/cuda/tests/TestCudaAmoebaInPlaneAngleForce.cpp
+1
-1
No files found.
docs-source/usersguide/application.rst
View file @
9e66f0b1
...
@@ -746,7 +746,7 @@ double precision:
...
@@ -746,7 +746,7 @@ double precision:
::
::
platform
=
Platform
.
getPlatformByName
(
'CUDA'
)
platform
=
Platform
.
getPlatformByName
(
'CUDA'
)
properties
=
{
'
Cuda
DeviceIndex'
:
'0,1'
,
'
Cuda
Precision'
:
'double'
}
properties
=
{
'DeviceIndex'
:
'0,1'
,
'Precision'
:
'double'
}
simulation
=
Simulation
(
prmtop
.
topology
,
system
,
integrator
,
platform
,
properties
)
simulation
=
Simulation
(
prmtop
.
topology
,
system
,
integrator
,
platform
,
properties
)
..
_force
-
fields
:
..
_force
-
fields
:
...
...
docs-source/usersguide/library.rst
View file @
9e66f0b1
...
@@ -1836,7 +1836,7 @@ Context constructor:
...
@@ -1836,7 +1836,7 @@ Context constructor:
Platform& platform = Platform::getPlatformByName("OpenCL");
Platform& platform = Platform::getPlatformByName("OpenCL");
map<string, string> properties;
map<string, string> properties;
properties["
OpenCL
DeviceIndex"] = "1";
properties["DeviceIndex"] = "1";
Context context(system, integrator, platform, properties);
Context context(system, integrator, platform, properties);
After a Context is created, you can use the Platform’s \
After a Context is created, you can use the Platform’s \
...
@@ -1847,7 +1847,7 @@ OpenCL Platform
...
@@ -1847,7 +1847,7 @@ OpenCL Platform
The OpenCL Platform recognizes the following Platform-specific properties:
The OpenCL Platform recognizes the following Platform-specific properties:
*
OpenCL
Precision: This selects what numeric precision to use for calculations.
* Precision: This selects what numeric precision to use for calculations.
The allowed values are “single”, “mixed”, and “double”. If it is set to
The allowed values are “single”, “mixed”, and “double”. If it is set to
“single”, nearly all calculations are done in single precision. This is the
“single”, nearly all calculations are done in single precision. This is the
fastest option but also the least accurate. If it is set to “mixed”, forces are
fastest option but also the least accurate. If it is set to “mixed”, forces are
...
@@ -1855,7 +1855,7 @@ The OpenCL Platform recognizes the following Platform-specific properties:
...
@@ -1855,7 +1855,7 @@ The OpenCL Platform recognizes the following Platform-specific properties:
gives much better energy conservation with only a slight decrease in speed.
gives much better energy conservation with only a slight decrease in speed.
If it is set to “double”, all calculations are done in double precision. This
If it is set to “double”, all calculations are done in double precision. This
is the most accurate option, but is usually much slower than the others.
is the most accurate option, but is usually much slower than the others.
*
OpenCL
UseCpuPme: This selects whether to use the CPU-based PME
* UseCpuPme: This selects whether to use the CPU-based PME
implementation. The allowed values are “true” or “false”. Depending on your
implementation. The allowed values are “true” or “false”. Depending on your
hardware, this might (or might not) improve performance. To use this option,
hardware, this might (or might not) improve performance. To use this option,
you must have FFTW (single precision, multithreaded) installed, and your CPU
you must have FFTW (single precision, multithreaded) installed, and your CPU
...
@@ -1865,19 +1865,19 @@ The OpenCL Platform recognizes the following Platform-specific properties:
...
@@ -1865,19 +1865,19 @@ The OpenCL Platform recognizes the following Platform-specific properties:
zero-based index of the platform (in the OpenCL sense, not the OpenMM sense) to use,
zero-based index of the platform (in the OpenCL sense, not the OpenMM sense) to use,
in the order they are returned by the OpenCL platform API. This is useful, for
in the order they are returned by the OpenCL platform API. This is useful, for
example, in selecting whether to use a GPU or CPU based OpenCL implementation.
example, in selecting whether to use a GPU or CPU based OpenCL implementation.
*
OpenCL
DeviceIndex: When multiple OpenCL devices are available on your
* DeviceIndex: When multiple OpenCL devices are available on your
computer, this is used to select which one to use. The value is the zero-based
computer, this is used to select which one to use. The value is the zero-based
index of the device to use, in the order they are returned by the OpenCL device
index of the device to use, in the order they are returned by the OpenCL device
API.
API.
The OpenCL Platform also supports parallelizing a simulation across multiple
The OpenCL Platform also supports parallelizing a simulation across multiple
GPUs. To do that, set the
OpenCL
DeviceIndex property to a comma separated list
GPUs. To do that, set the DeviceIndex property to a comma separated list
of values. For example,
of values. For example,
.. code-block:: c
.. code-block:: c
properties["
OpenCL
DeviceIndex"] = "0,1";
properties["DeviceIndex"] = "0,1";
This tells it to use both devices 0 and 1, splitting the work between them.
This tells it to use both devices 0 and 1, splitting the work between them.
...
@@ -1886,7 +1886,7 @@ CUDA Platform
...
@@ -1886,7 +1886,7 @@ CUDA Platform
The CUDA Platform recognizes the following Platform-specific properties:
The CUDA Platform recognizes the following Platform-specific properties:
*
Cuda
Precision: This selects what numeric precision to use for calculations.
* Precision: This selects what numeric precision to use for calculations.
The allowed values are “single”, “mixed”, and “double”. If it is set to
The allowed values are “single”, “mixed”, and “double”. If it is set to
“single”, nearly all calculations are done in single precision. This is the
“single”, nearly all calculations are done in single precision. This is the
fastest option but also the least accurate. If it is set to “mixed”, forces are
fastest option but also the least accurate. If it is set to “mixed”, forces are
...
@@ -1894,7 +1894,7 @@ The CUDA Platform recognizes the following Platform-specific properties:
...
@@ -1894,7 +1894,7 @@ The CUDA Platform recognizes the following Platform-specific properties:
gives much better energy conservation with only a slight decrease in speed.
gives much better energy conservation with only a slight decrease in speed.
If it is set to “double”, all calculations are done in double precision. This
If it is set to “double”, all calculations are done in double precision. This
is the most accurate option, but is usually much slower than the others.
is the most accurate option, but is usually much slower than the others.
*
Cuda
UseCpuPme: This selects whether to use the CPU-based PME implementation.
* UseCpuPme: This selects whether to use the CPU-based PME implementation.
The allowed values are “true” or “false”. Depending on your hardware, this
The allowed values are “true” or “false”. Depending on your hardware, this
might (or might not) improve performance. To use this option, you must have
might (or might not) improve performance. To use this option, you must have
FFTW (single precision, multithreaded) installed, and your CPU must support SSE
FFTW (single precision, multithreaded) installed, and your CPU must support SSE
...
@@ -1912,20 +1912,20 @@ The CUDA Platform recognizes the following Platform-specific properties:
...
@@ -1912,20 +1912,20 @@ The CUDA Platform recognizes the following Platform-specific properties:
appends \nvcc.exe to it. That environment variable is set by the CUDA
appends \nvcc.exe to it. That environment variable is set by the CUDA
installer, so it usually is present.
installer, so it usually is present.
*
Cuda
TempDirectory: This specifies a directory where temporary files can be
* TempDirectory: This specifies a directory where temporary files can be
written while compiling kernels. OpenMM usually can locate your operating
written while compiling kernels. OpenMM usually can locate your operating
system’s temp directory automatically (for example, by looking for the TEMP
system’s temp directory automatically (for example, by looking for the TEMP
environment variable), so you rarely need to specify this.
environment variable), so you rarely need to specify this.
*
Cuda
DeviceIndex: When multiple CUDA devices are available on your computer,
* DeviceIndex: When multiple CUDA devices are available on your computer,
this is used to select which one to use. The value is the zero-based index of
this is used to select which one to use. The value is the zero-based index of
the device to use, in the order they are returned by the CUDA API.
the device to use, in the order they are returned by the CUDA API.
*
Cuda
UseBlockingSync: This is used to control how the CUDA runtime
* UseBlockingSync: This is used to control how the CUDA runtime
synchronizes between the CPU and GPU. If this is set to “true” (the default),
synchronizes between the CPU and GPU. If this is set to “true” (the default),
CUDA will allow the calling thread to sleep while the GPU is performing a
CUDA will allow the calling thread to sleep while the GPU is performing a
computation, allowing the CPU to do other work. If it is set to “false”, CUDA
computation, allowing the CPU to do other work. If it is set to “false”, CUDA
will spin-lock while the GPU is working. Setting it to "false" can improve performance slightly,
will spin-lock while the GPU is working. Setting it to "false" can improve performance slightly,
but also prevents the CPU from doing anything else while the GPU is working.
but also prevents the CPU from doing anything else while the GPU is working.
*
Cuda
DeterministicForces: In some cases, the CUDA platform may compute forces
* DeterministicForces: In some cases, the CUDA platform may compute forces
in ways that are not fully deterministic (typically differing in what order a
in ways that are not fully deterministic (typically differing in what order a
set of numbers get added together). This means that if you compute the forces
set of numbers get added together). This means that if you compute the forces
twice for the same particle positions, there may be tiny differences in the
twice for the same particle positions, there may be tiny differences in the
...
@@ -1936,12 +1936,12 @@ The CUDA Platform recognizes the following Platform-specific properties:
...
@@ -1936,12 +1936,12 @@ The CUDA Platform recognizes the following Platform-specific properties:
performance.
performance.
The CUDA Platform also supports parallelizing a simulation across multiple GPUs.
The CUDA Platform also supports parallelizing a simulation across multiple GPUs.
To do that, set the
Cuda
DeviceIndex property to a comma separated list of
To do that, set the DeviceIndex property to a comma separated list of
values. For example,
values. For example,
.. code-block:: c
.. code-block:: c
properties["
Cuda
DeviceIndex"] = "0,1";
properties["DeviceIndex"] = "0,1";
This tells it to use both devices 0 and 1, splitting the work between them.
This tells it to use both devices 0 and 1, splitting the work between them.
...
@@ -1950,7 +1950,7 @@ CPU Platform
...
@@ -1950,7 +1950,7 @@ CPU Platform
The CPU Platform recognizes the following Platform-specific properties:
The CPU Platform recognizes the following Platform-specific properties:
*
Cpu
Threads: This specifies the number of CPU threads to use. If you do not
* Threads: This specifies the number of CPU threads to use. If you do not
specify this, OpenMM will select a default number of threads as follows:
specify this, OpenMM will select a default number of threads as follows:
* If an environment variable called OPENMM_CPU_THREADS is set, its value is
* If an environment variable called OPENMM_CPU_THREADS is set, its value is
...
...
examples/benchmark.py
View file @
9e66f0b1
...
@@ -81,18 +81,12 @@ def runOneTest(testName, options):
...
@@ -81,18 +81,12 @@ def runOneTest(testName, options):
print
(
'Step Size: %g fs'
%
dt
.
value_in_unit
(
unit
.
femtoseconds
))
print
(
'Step Size: %g fs'
%
dt
.
value_in_unit
(
unit
.
femtoseconds
))
properties
=
{}
properties
=
{}
initialSteps
=
5
initialSteps
=
5
if
options
.
device
is
not
None
:
if
options
.
device
is
not
None
and
platform
.
getName
()
in
(
'CUDA'
,
'OpenCL'
):
if
platform
.
getName
()
==
'CUDA'
:
properties
[
'DeviceIndex'
]
=
options
.
device
properties
[
'CudaDeviceIndex'
]
=
options
.
device
elif
platform
.
getName
()
==
'OpenCL'
:
properties
[
'OpenCLDeviceIndex'
]
=
options
.
device
if
','
in
options
.
device
or
' '
in
options
.
device
:
if
','
in
options
.
device
or
' '
in
options
.
device
:
initialSteps
=
250
initialSteps
=
250
if
options
.
precision
is
not
None
:
if
options
.
precision
is
not
None
and
platform
.
getName
()
in
(
'CUDA'
,
'OpenCL'
):
if
platform
.
getName
()
==
'CUDA'
:
properties
[
'Precision'
]
=
options
.
precision
properties
[
'CudaPrecision'
]
=
options
.
precision
elif
platform
.
getName
()
==
'OpenCL'
:
properties
[
'OpenCLPrecision'
]
=
options
.
precision
# Run the simulation.
# Run the simulation.
...
...
olla/include/openmm/Platform.h
View file @
9e66f0b1
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2008-201
2
Stanford University and the Authors. *
* Portions copyright (c) 2008-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -236,7 +236,9 @@ protected:
...
@@ -236,7 +236,9 @@ protected:
*/
*/
const
ContextImpl
&
getContextImpl
(
const
Context
&
context
)
const
;
const
ContextImpl
&
getContextImpl
(
const
Context
&
context
)
const
;
std
::
vector
<
std
::
string
>
platformProperties
;
std
::
vector
<
std
::
string
>
platformProperties
;
std
::
map
<
std
::
string
,
std
::
string
>
deprecatedPropertyReplacements
;
private:
private:
friend
class
ContextImpl
;
std
::
map
<
std
::
string
,
KernelFactory
*>
kernelFactories
;
std
::
map
<
std
::
string
,
KernelFactory
*>
kernelFactories
;
std
::
map
<
std
::
string
,
std
::
string
>
defaultProperties
;
std
::
map
<
std
::
string
,
std
::
string
>
defaultProperties
;
static
std
::
vector
<
Platform
*>&
getPlatforms
();
static
std
::
vector
<
Platform
*>&
getPlatforms
();
...
...
olla/src/Platform.cpp
View file @
9e66f0b1
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2008-201
2
Stanford University and the Authors. *
* Portions copyright (c) 2008-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -89,15 +89,21 @@ void Platform::setPropertyValue(Context& context, const string& property, const
...
@@ -89,15 +89,21 @@ void Platform::setPropertyValue(Context& context, const string& property, const
}
}
const
string
&
Platform
::
getPropertyDefaultValue
(
const
string
&
property
)
const
{
const
string
&
Platform
::
getPropertyDefaultValue
(
const
string
&
property
)
const
{
map
<
string
,
string
>::
const_iterator
value
=
defaultProperties
.
find
(
property
);
string
propertyName
=
property
;
if
(
deprecatedPropertyReplacements
.
find
(
property
)
!=
deprecatedPropertyReplacements
.
end
())
propertyName
=
deprecatedPropertyReplacements
.
find
(
property
)
->
second
;
map
<
string
,
string
>::
const_iterator
value
=
defaultProperties
.
find
(
propertyName
);
if
(
value
==
defaultProperties
.
end
())
if
(
value
==
defaultProperties
.
end
())
throw
OpenMMException
(
"getPropertyDefaultValue: Illegal property name"
);
throw
OpenMMException
(
"getPropertyDefaultValue: Illegal property name"
);
return
value
->
second
;
return
value
->
second
;
}
}
void
Platform
::
setPropertyDefaultValue
(
const
string
&
property
,
const
string
&
value
)
{
void
Platform
::
setPropertyDefaultValue
(
const
string
&
property
,
const
string
&
value
)
{
string
propertyName
=
property
;
if
(
deprecatedPropertyReplacements
.
find
(
property
)
!=
deprecatedPropertyReplacements
.
end
())
propertyName
=
deprecatedPropertyReplacements
.
find
(
property
)
->
second
;
for
(
int
i
=
0
;
i
<
(
int
)
platformProperties
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
(
int
)
platformProperties
.
size
();
i
++
)
if
(
platformProperties
[
i
]
==
property
)
{
if
(
platformProperties
[
i
]
==
property
Name
)
{
defaultProperties
[
property
]
=
value
;
defaultProperties
[
property
]
=
value
;
return
;
return
;
}
}
...
...
openmmapi/src/ContextImpl.cpp
View file @
9e66f0b1
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2008-201
3
Stanford University and the Authors. *
* Portions copyright (c) 2008-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -84,15 +84,20 @@ ContextImpl::ContextImpl(Context& owner, const System& system, Integrator& integ
...
@@ -84,15 +84,20 @@ ContextImpl::ContextImpl(Context& owner, const System& system, Integrator& integ
// Validate the list of properties.
// Validate the list of properties.
const
vector
<
string
>&
platformProperties
=
platform
->
getPropertyNames
();
const
vector
<
string
>&
platformProperties
=
platform
->
getPropertyNames
();
map
<
string
,
string
>
validatedProperties
;
for
(
map
<
string
,
string
>::
const_iterator
iter
=
properties
.
begin
();
iter
!=
properties
.
end
();
++
iter
)
{
for
(
map
<
string
,
string
>::
const_iterator
iter
=
properties
.
begin
();
iter
!=
properties
.
end
();
++
iter
)
{
string
property
=
iter
->
first
;
if
(
platform
->
deprecatedPropertyReplacements
.
find
(
property
)
!=
platform
->
deprecatedPropertyReplacements
.
end
())
property
=
platform
->
deprecatedPropertyReplacements
[
property
];
bool
valid
=
false
;
bool
valid
=
false
;
for
(
int
i
=
0
;
i
<
(
int
)
platformProperties
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
(
int
)
platformProperties
.
size
();
i
++
)
if
(
platformProperties
[
i
]
==
iter
->
first
)
{
if
(
platformProperties
[
i
]
==
property
)
{
valid
=
true
;
valid
=
true
;
break
;
break
;
}
}
if
(
!
valid
)
if
(
!
valid
)
throw
OpenMMException
(
"Illegal property name: "
+
iter
->
first
);
throw
OpenMMException
(
"Illegal property name: "
+
iter
->
first
);
validatedProperties
[
property
]
=
iter
->
second
;
}
}
// Find the list of kernels required.
// Find the list of kernels required.
...
@@ -139,7 +144,7 @@ ContextImpl::ContextImpl(Context& owner, const System& system, Integrator& integ
...
@@ -139,7 +144,7 @@ ContextImpl::ContextImpl(Context& owner, const System& system, Integrator& integ
for
(
int
i
=
candidatePlatforms
.
size
()
-
1
;
i
>=
0
;
i
--
)
{
for
(
int
i
=
candidatePlatforms
.
size
()
-
1
;
i
>=
0
;
i
--
)
{
try
{
try
{
this
->
platform
=
platform
=
candidatePlatforms
[
i
].
second
;
this
->
platform
=
platform
=
candidatePlatforms
[
i
].
second
;
platform
->
contextCreated
(
*
this
,
p
roperties
);
platform
->
contextCreated
(
*
this
,
validatedP
roperties
);
break
;
break
;
}
}
catch
(...)
{
catch
(...)
{
...
...
platforms/cpu/include/CpuPlatform.h
View file @
9e66f0b1
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2013 Stanford University and the Authors.
*
* Portions copyright (c) 2013
-2016
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -64,7 +64,7 @@ public:
...
@@ -64,7 +64,7 @@ public:
* This is the name of the parameter for selecting the number of threads to use.
* This is the name of the parameter for selecting the number of threads to use.
*/
*/
static
const
std
::
string
&
CpuThreads
()
{
static
const
std
::
string
&
CpuThreads
()
{
static
const
std
::
string
key
=
"
Cpu
Threads"
;
static
const
std
::
string
key
=
"Threads"
;
return
key
;
return
key
;
}
}
/**
/**
...
...
platforms/cpu/src/CpuPlatform.cpp
View file @
9e66f0b1
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2013-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2013-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -59,6 +59,7 @@ extern "C" OPENMM_EXPORT_CPU void registerPlatforms() {
...
@@ -59,6 +59,7 @@ extern "C" OPENMM_EXPORT_CPU void registerPlatforms() {
map
<
const
ContextImpl
*
,
CpuPlatform
::
PlatformData
*>
CpuPlatform
::
contextData
;
map
<
const
ContextImpl
*
,
CpuPlatform
::
PlatformData
*>
CpuPlatform
::
contextData
;
CpuPlatform
::
CpuPlatform
()
{
CpuPlatform
::
CpuPlatform
()
{
deprecatedPropertyReplacements
[
"CpuThreads"
]
=
CpuThreads
();
CpuKernelFactory
*
factory
=
new
CpuKernelFactory
();
CpuKernelFactory
*
factory
=
new
CpuKernelFactory
();
registerKernelFactory
(
CalcForcesAndEnergyKernel
::
Name
(),
factory
);
registerKernelFactory
(
CalcForcesAndEnergyKernel
::
Name
(),
factory
);
registerKernelFactory
(
CalcHarmonicAngleForceKernel
::
Name
(),
factory
);
registerKernelFactory
(
CalcHarmonicAngleForceKernel
::
Name
(),
factory
);
...
@@ -83,7 +84,10 @@ CpuPlatform::CpuPlatform() {
...
@@ -83,7 +84,10 @@ CpuPlatform::CpuPlatform() {
const
string
&
CpuPlatform
::
getPropertyValue
(
const
Context
&
context
,
const
string
&
property
)
const
{
const
string
&
CpuPlatform
::
getPropertyValue
(
const
Context
&
context
,
const
string
&
property
)
const
{
const
ContextImpl
&
impl
=
getContextImpl
(
context
);
const
ContextImpl
&
impl
=
getContextImpl
(
context
);
const
PlatformData
&
data
=
getPlatformData
(
impl
);
const
PlatformData
&
data
=
getPlatformData
(
impl
);
map
<
string
,
string
>::
const_iterator
value
=
data
.
propertyValues
.
find
(
property
);
string
propertyName
=
property
;
if
(
deprecatedPropertyReplacements
.
find
(
property
)
!=
deprecatedPropertyReplacements
.
end
())
propertyName
=
deprecatedPropertyReplacements
.
find
(
property
)
->
second
;
map
<
string
,
string
>::
const_iterator
value
=
data
.
propertyValues
.
find
(
propertyName
);
if
(
value
!=
data
.
propertyValues
.
end
())
if
(
value
!=
data
.
propertyValues
.
end
())
return
value
->
second
;
return
value
->
second
;
return
ReferencePlatform
::
getPropertyValue
(
context
,
property
);
return
ReferencePlatform
::
getPropertyValue
(
context
,
property
);
...
...
platforms/cuda/include/CudaPlatform.h
View file @
9e66f0b1
...
@@ -58,35 +58,35 @@ public:
...
@@ -58,35 +58,35 @@ public:
* This is the name of the parameter for selecting which CUDA device or devices to use.
* This is the name of the parameter for selecting which CUDA device or devices to use.
*/
*/
static
const
std
::
string
&
CudaDeviceIndex
()
{
static
const
std
::
string
&
CudaDeviceIndex
()
{
static
const
std
::
string
key
=
"
Cuda
DeviceIndex"
;
static
const
std
::
string
key
=
"DeviceIndex"
;
return
key
;
return
key
;
}
}
/**
/**
* This is the name of the parameter that reports the CUDA device or devices being used.
* This is the name of the parameter that reports the CUDA device or devices being used.
*/
*/
static
const
std
::
string
&
CudaDeviceName
()
{
static
const
std
::
string
&
CudaDeviceName
()
{
static
const
std
::
string
key
=
"
Cuda
DeviceName"
;
static
const
std
::
string
key
=
"DeviceName"
;
return
key
;
return
key
;
}
}
/**
/**
* This is the name of the parameter for selecting whether CUDA should sync or spin loop while waiting for results.
* This is the name of the parameter for selecting whether CUDA should sync or spin loop while waiting for results.
*/
*/
static
const
std
::
string
&
CudaUseBlockingSync
()
{
static
const
std
::
string
&
CudaUseBlockingSync
()
{
static
const
std
::
string
key
=
"
Cuda
UseBlockingSync"
;
static
const
std
::
string
key
=
"UseBlockingSync"
;
return
key
;
return
key
;
}
}
/**
/**
* This is the name of the parameter for selecting what numerical precision to use.
* This is the name of the parameter for selecting what numerical precision to use.
*/
*/
static
const
std
::
string
&
CudaPrecision
()
{
static
const
std
::
string
&
CudaPrecision
()
{
static
const
std
::
string
key
=
"
Cuda
Precision"
;
static
const
std
::
string
key
=
"Precision"
;
return
key
;
return
key
;
}
}
/**
/**
* This is the name of the parameter for selecting whether to use the CPU based PME calculation.
* This is the name of the parameter for selecting whether to use the CPU based PME calculation.
*/
*/
static
const
std
::
string
&
CudaUseCpuPme
()
{
static
const
std
::
string
&
CudaUseCpuPme
()
{
static
const
std
::
string
key
=
"
Cuda
UseCpuPme"
;
static
const
std
::
string
key
=
"UseCpuPme"
;
return
key
;
return
key
;
}
}
/**
/**
...
@@ -107,21 +107,21 @@ public:
...
@@ -107,21 +107,21 @@ public:
* This is the name of the parameter for specifying the path to the directory for creating temporary files.
* This is the name of the parameter for specifying the path to the directory for creating temporary files.
*/
*/
static
const
std
::
string
&
CudaTempDirectory
()
{
static
const
std
::
string
&
CudaTempDirectory
()
{
static
const
std
::
string
key
=
"
Cuda
TempDirectory"
;
static
const
std
::
string
key
=
"TempDirectory"
;
return
key
;
return
key
;
}
}
/**
/**
* This is the name of the parameter for selecting whether to disable use of a separate stream for PME.
* This is the name of the parameter for selecting whether to disable use of a separate stream for PME.
*/
*/
static
const
std
::
string
&
CudaDisablePmeStream
()
{
static
const
std
::
string
&
CudaDisablePmeStream
()
{
static
const
std
::
string
key
=
"
Cuda
DisablePmeStream"
;
static
const
std
::
string
key
=
"DisablePmeStream"
;
return
key
;
return
key
;
}
}
/**
/**
* This is the name of the parameter for requesting that force computations be fully deterministic.
* This is the name of the parameter for requesting that force computations be fully deterministic.
*/
*/
static
const
std
::
string
&
CudaDeterministicForces
()
{
static
const
std
::
string
&
CudaDeterministicForces
()
{
static
const
std
::
string
key
=
"
Cuda
DeterministicForces"
;
static
const
std
::
string
key
=
"DeterministicForces"
;
return
key
;
return
key
;
}
}
};
};
...
...
platforms/cuda/src/CudaContext.cpp
View file @
9e66f0b1
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2009-201
5
Stanford University and the Authors. *
* Portions copyright (c) 2009-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -106,7 +106,7 @@ CudaContext::CudaContext(const System& system, int deviceIndex, bool useBlocking
...
@@ -106,7 +106,7 @@ CudaContext::CudaContext(const System& system, int deviceIndex, bool useBlocking
useMixedPrecision
=
false
;
useMixedPrecision
=
false
;
}
}
else
else
throw
OpenMMException
(
"Illegal value for
Cuda
Precision: "
+
precision
);
throw
OpenMMException
(
"Illegal value for Precision: "
+
precision
);
char
*
cacheVariable
=
getenv
(
"OPENMM_CACHE_DIR"
);
char
*
cacheVariable
=
getenv
(
"OPENMM_CACHE_DIR"
);
cacheDir
=
(
cacheVariable
==
NULL
?
tempDir
:
string
(
cacheVariable
));
cacheDir
=
(
cacheVariable
==
NULL
?
tempDir
:
string
(
cacheVariable
));
#ifdef WIN32
#ifdef WIN32
...
@@ -121,7 +121,7 @@ CudaContext::CudaContext(const System& system, int deviceIndex, bool useBlocking
...
@@ -121,7 +121,7 @@ CudaContext::CudaContext(const System& system, int deviceIndex, bool useBlocking
string
errorMessage
=
"Error initializing Context"
;
string
errorMessage
=
"Error initializing Context"
;
CHECK_RESULT
(
cuDeviceGetCount
(
&
numDevices
));
CHECK_RESULT
(
cuDeviceGetCount
(
&
numDevices
));
if
(
deviceIndex
<
-
1
||
deviceIndex
>=
numDevices
)
if
(
deviceIndex
<
-
1
||
deviceIndex
>=
numDevices
)
throw
OpenMMException
(
"Illegal value for
Cuda
DeviceIndex: "
+
intToString
(
deviceIndex
));
throw
OpenMMException
(
"Illegal value for DeviceIndex: "
+
intToString
(
deviceIndex
));
vector
<
int
>
devicePrecedence
;
vector
<
int
>
devicePrecedence
;
if
(
deviceIndex
==
-
1
)
{
if
(
deviceIndex
==
-
1
)
{
...
...
platforms/cuda/src/CudaPlatform.cpp
View file @
9e66f0b1
...
@@ -62,6 +62,14 @@ extern "C" OPENMM_EXPORT_CUDA void registerPlatforms() {
...
@@ -62,6 +62,14 @@ extern "C" OPENMM_EXPORT_CUDA void registerPlatforms() {
#endif
#endif
CudaPlatform
::
CudaPlatform
()
{
CudaPlatform
::
CudaPlatform
()
{
deprecatedPropertyReplacements
[
"CudaDeviceIndex"
]
=
CudaDeviceIndex
();
deprecatedPropertyReplacements
[
"CudaDeviceName"
]
=
CudaDeviceName
();
deprecatedPropertyReplacements
[
"CudaUseBlockingSync"
]
=
CudaUseBlockingSync
();
deprecatedPropertyReplacements
[
"CudaPrecision"
]
=
CudaPrecision
();
deprecatedPropertyReplacements
[
"CudaUseCpuPme"
]
=
CudaUseCpuPme
();
deprecatedPropertyReplacements
[
"CudaTempDirectory"
]
=
CudaTempDirectory
();
deprecatedPropertyReplacements
[
"CudaDisablePmeStream"
]
=
CudaDisablePmeStream
();
deprecatedPropertyReplacements
[
"CudaDeterministicForces"
]
=
CudaDeterministicForces
();
CudaKernelFactory
*
factory
=
new
CudaKernelFactory
();
CudaKernelFactory
*
factory
=
new
CudaKernelFactory
();
registerKernelFactory
(
CalcForcesAndEnergyKernel
::
Name
(),
factory
);
registerKernelFactory
(
CalcForcesAndEnergyKernel
::
Name
(),
factory
);
registerKernelFactory
(
UpdateStateDataKernel
::
Name
(),
factory
);
registerKernelFactory
(
UpdateStateDataKernel
::
Name
(),
factory
);
...
@@ -144,7 +152,10 @@ bool CudaPlatform::supportsDoublePrecision() const {
...
@@ -144,7 +152,10 @@ bool CudaPlatform::supportsDoublePrecision() const {
const
string
&
CudaPlatform
::
getPropertyValue
(
const
Context
&
context
,
const
string
&
property
)
const
{
const
string
&
CudaPlatform
::
getPropertyValue
(
const
Context
&
context
,
const
string
&
property
)
const
{
const
ContextImpl
&
impl
=
getContextImpl
(
context
);
const
ContextImpl
&
impl
=
getContextImpl
(
context
);
const
PlatformData
*
data
=
reinterpret_cast
<
const
PlatformData
*>
(
impl
.
getPlatformData
());
const
PlatformData
*
data
=
reinterpret_cast
<
const
PlatformData
*>
(
impl
.
getPlatformData
());
map
<
string
,
string
>::
const_iterator
value
=
data
->
propertyValues
.
find
(
property
);
string
propertyName
=
property
;
if
(
deprecatedPropertyReplacements
.
find
(
property
)
!=
deprecatedPropertyReplacements
.
end
())
propertyName
=
deprecatedPropertyReplacements
.
find
(
property
)
->
second
;
map
<
string
,
string
>::
const_iterator
value
=
data
->
propertyValues
.
find
(
propertyName
);
if
(
value
!=
data
->
propertyValues
.
end
())
if
(
value
!=
data
->
propertyValues
.
end
())
return
value
->
second
;
return
value
->
second
;
return
Platform
::
getPropertyValue
(
context
,
property
);
return
Platform
::
getPropertyValue
(
context
,
property
);
...
...
platforms/cuda/tests/CudaTests.h
View file @
9e66f0b1
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2015 Stanford University and the Authors.
*
* Portions copyright (c) 2015
-2016
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -39,5 +39,5 @@ OpenMM::CudaPlatform platform;
...
@@ -39,5 +39,5 @@ OpenMM::CudaPlatform platform;
void
initializeTests
(
int
argc
,
char
*
argv
[])
{
void
initializeTests
(
int
argc
,
char
*
argv
[])
{
if
(
argc
>
1
)
if
(
argc
>
1
)
platform
.
setPropertyDefaultValue
(
"
Cuda
Precision"
,
std
::
string
(
argv
[
1
]));
platform
.
setPropertyDefaultValue
(
"Precision"
,
std
::
string
(
argv
[
1
]));
}
}
platforms/opencl/include/OpenCLPlatform.h
View file @
9e66f0b1
...
@@ -58,14 +58,14 @@ public:
...
@@ -58,14 +58,14 @@ public:
* This is the name of the parameter for selecting which OpenCL device or devices to use.
* This is the name of the parameter for selecting which OpenCL device or devices to use.
*/
*/
static
const
std
::
string
&
OpenCLDeviceIndex
()
{
static
const
std
::
string
&
OpenCLDeviceIndex
()
{
static
const
std
::
string
key
=
"
OpenCL
DeviceIndex"
;
static
const
std
::
string
key
=
"DeviceIndex"
;
return
key
;
return
key
;
}
}
/**
/**
* This is the name of the parameter that reports the OpenCL device or devices being used.
* This is the name of the parameter that reports the OpenCL device or devices being used.
*/
*/
static
const
std
::
string
&
OpenCLDeviceName
()
{
static
const
std
::
string
&
OpenCLDeviceName
()
{
static
const
std
::
string
key
=
"
OpenCL
DeviceName"
;
static
const
std
::
string
key
=
"DeviceName"
;
return
key
;
return
key
;
}
}
/**
/**
...
@@ -86,21 +86,21 @@ public:
...
@@ -86,21 +86,21 @@ public:
* This is the name of the parameter for selecting what numerical precision to use.
* This is the name of the parameter for selecting what numerical precision to use.
*/
*/
static
const
std
::
string
&
OpenCLPrecision
()
{
static
const
std
::
string
&
OpenCLPrecision
()
{
static
const
std
::
string
key
=
"
OpenCL
Precision"
;
static
const
std
::
string
key
=
"Precision"
;
return
key
;
return
key
;
}
}
/**
/**
* This is the name of the parameter for selecting whether to use the CPU based PME calculation.
* This is the name of the parameter for selecting whether to use the CPU based PME calculation.
*/
*/
static
const
std
::
string
&
OpenCLUseCpuPme
()
{
static
const
std
::
string
&
OpenCLUseCpuPme
()
{
static
const
std
::
string
key
=
"
OpenCL
UseCpuPme"
;
static
const
std
::
string
key
=
"UseCpuPme"
;
return
key
;
return
key
;
}
}
/**
/**
* This is the name of the parameter for selecting whether to disable use of a separate stream for PME.
* This is the name of the parameter for selecting whether to disable use of a separate stream for PME.
*/
*/
static
const
std
::
string
&
OpenCLDisablePmeStream
()
{
static
const
std
::
string
&
OpenCLDisablePmeStream
()
{
static
const
std
::
string
key
=
"
OpenCL
DisablePmeStream"
;
static
const
std
::
string
key
=
"DisablePmeStream"
;
return
key
;
return
key
;
}
}
};
};
...
...
platforms/opencl/src/OpenCLContext.cpp
View file @
9e66f0b1
...
@@ -84,7 +84,7 @@ OpenCLContext::OpenCLContext(const System& system, int platformIndex, int device
...
@@ -84,7 +84,7 @@ OpenCLContext::OpenCLContext(const System& system, int platformIndex, int device
useMixedPrecision
=
false
;
useMixedPrecision
=
false
;
}
}
else
else
throw
OpenMMException
(
"Illegal value for
OpenCL
Precision: "
+
precision
);
throw
OpenMMException
(
"Illegal value for Precision: "
+
precision
);
try
{
try
{
contextIndex
=
platformData
.
contexts
.
size
();
contextIndex
=
platformData
.
contexts
.
size
();
std
::
vector
<
cl
::
Platform
>
platforms
;
std
::
vector
<
cl
::
Platform
>
platforms
;
...
@@ -105,7 +105,7 @@ OpenCLContext::OpenCLContext(const System& system, int platformIndex, int device
...
@@ -105,7 +105,7 @@ OpenCLContext::OpenCLContext(const System& system, int platformIndex, int device
vector
<
cl
::
Device
>
devices
;
vector
<
cl
::
Device
>
devices
;
platforms
[
j
].
getDevices
(
CL_DEVICE_TYPE_ALL
,
&
devices
);
platforms
[
j
].
getDevices
(
CL_DEVICE_TYPE_ALL
,
&
devices
);
if
(
deviceIndex
<
-
1
||
deviceIndex
>=
(
int
)
devices
.
size
())
if
(
deviceIndex
<
-
1
||
deviceIndex
>=
(
int
)
devices
.
size
())
throw
OpenMMException
(
"Illegal value for
OpenCL
DeviceIndex: "
+
intToString
(
deviceIndex
));
throw
OpenMMException
(
"Illegal value for DeviceIndex: "
+
intToString
(
deviceIndex
));
for
(
int
i
=
0
;
i
<
(
int
)
devices
.
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
(
int
)
devices
.
size
();
i
++
)
{
// If they supplied a valid deviceIndex, we only look through that one
// If they supplied a valid deviceIndex, we only look through that one
...
...
platforms/opencl/src/OpenCLPlatform.cpp
View file @
9e66f0b1
...
@@ -56,6 +56,11 @@ extern "C" OPENMM_EXPORT_OPENCL void registerPlatforms() {
...
@@ -56,6 +56,11 @@ extern "C" OPENMM_EXPORT_OPENCL void registerPlatforms() {
#endif
#endif
OpenCLPlatform
::
OpenCLPlatform
()
{
OpenCLPlatform
::
OpenCLPlatform
()
{
deprecatedPropertyReplacements
[
"OpenCLDeviceIndex"
]
=
OpenCLDeviceIndex
();
deprecatedPropertyReplacements
[
"OpenCLDeviceName"
]
=
OpenCLDeviceName
();
deprecatedPropertyReplacements
[
"OpenCLPrecision"
]
=
OpenCLPrecision
();
deprecatedPropertyReplacements
[
"OpenCLUseCpuPme"
]
=
OpenCLUseCpuPme
();
deprecatedPropertyReplacements
[
"OpenCLDisablePmeStream"
]
=
OpenCLDisablePmeStream
();
OpenCLKernelFactory
*
factory
=
new
OpenCLKernelFactory
();
OpenCLKernelFactory
*
factory
=
new
OpenCLKernelFactory
();
registerKernelFactory
(
CalcForcesAndEnergyKernel
::
Name
(),
factory
);
registerKernelFactory
(
CalcForcesAndEnergyKernel
::
Name
(),
factory
);
registerKernelFactory
(
UpdateStateDataKernel
::
Name
(),
factory
);
registerKernelFactory
(
UpdateStateDataKernel
::
Name
(),
factory
);
...
@@ -139,7 +144,10 @@ bool OpenCLPlatform::isPlatformSupported() {
...
@@ -139,7 +144,10 @@ bool OpenCLPlatform::isPlatformSupported() {
const
string
&
OpenCLPlatform
::
getPropertyValue
(
const
Context
&
context
,
const
string
&
property
)
const
{
const
string
&
OpenCLPlatform
::
getPropertyValue
(
const
Context
&
context
,
const
string
&
property
)
const
{
const
ContextImpl
&
impl
=
getContextImpl
(
context
);
const
ContextImpl
&
impl
=
getContextImpl
(
context
);
const
PlatformData
*
data
=
reinterpret_cast
<
const
PlatformData
*>
(
impl
.
getPlatformData
());
const
PlatformData
*
data
=
reinterpret_cast
<
const
PlatformData
*>
(
impl
.
getPlatformData
());
map
<
string
,
string
>::
const_iterator
value
=
data
->
propertyValues
.
find
(
property
);
string
propertyName
=
property
;
if
(
deprecatedPropertyReplacements
.
find
(
property
)
!=
deprecatedPropertyReplacements
.
end
())
propertyName
=
deprecatedPropertyReplacements
.
find
(
property
)
->
second
;
map
<
string
,
string
>::
const_iterator
value
=
data
->
propertyValues
.
find
(
propertyName
);
if
(
value
!=
data
->
propertyValues
.
end
())
if
(
value
!=
data
->
propertyValues
.
end
())
return
value
->
second
;
return
value
->
second
;
return
Platform
::
getPropertyValue
(
context
,
property
);
return
Platform
::
getPropertyValue
(
context
,
property
);
...
...
platforms/opencl/tests/OpenCLTests.h
View file @
9e66f0b1
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2015 Stanford University and the Authors.
*
* Portions copyright (c) 2015
-2016
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Authors: Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -39,9 +39,9 @@ OpenMM::OpenCLPlatform platform;
...
@@ -39,9 +39,9 @@ OpenMM::OpenCLPlatform platform;
void
initializeTests
(
int
argc
,
char
*
argv
[])
{
void
initializeTests
(
int
argc
,
char
*
argv
[])
{
if
(
argc
>
1
)
if
(
argc
>
1
)
platform
.
setPropertyDefaultValue
(
"
OpenCL
Precision"
,
std
::
string
(
argv
[
1
]));
platform
.
setPropertyDefaultValue
(
"Precision"
,
std
::
string
(
argv
[
1
]));
if
(
argc
>
2
)
if
(
argc
>
2
)
platform
.
setPropertyDefaultValue
(
"OpenCLPlatformIndex"
,
std
::
string
(
argv
[
2
]));
platform
.
setPropertyDefaultValue
(
"OpenCLPlatformIndex"
,
std
::
string
(
argv
[
2
]));
if
(
argc
>
3
)
if
(
argc
>
3
)
platform
.
setPropertyDefaultValue
(
"
OpenCL
DeviceIndex"
,
std
::
string
(
argv
[
3
]));
platform
.
setPropertyDefaultValue
(
"DeviceIndex"
,
std
::
string
(
argv
[
3
]));
}
}
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaAngleForce.cpp
View file @
9e66f0b1
...
@@ -329,7 +329,7 @@ int main(int argc, char* argv[]) {
...
@@ -329,7 +329,7 @@ int main(int argc, char* argv[]) {
std
::
cout
<<
"TestCudaAmoebaAngleForce running test..."
<<
std
::
endl
;
std
::
cout
<<
"TestCudaAmoebaAngleForce running test..."
<<
std
::
endl
;
registerAmoebaCudaKernelFactories
();
registerAmoebaCudaKernelFactories
();
if
(
argc
>
1
)
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"
Cuda
Precision"
,
std
::
string
(
argv
[
1
]));
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"Precision"
,
std
::
string
(
argv
[
1
]));
testOneAngle
();
testOneAngle
();
testPeriodic
();
testPeriodic
();
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaBondForce.cpp
View file @
9e66f0b1
...
@@ -248,7 +248,7 @@ int main(int argc, char* argv[]) {
...
@@ -248,7 +248,7 @@ int main(int argc, char* argv[]) {
std
::
cout
<<
"TestCudaAmoebaBondForce running test..."
<<
std
::
endl
;
std
::
cout
<<
"TestCudaAmoebaBondForce running test..."
<<
std
::
endl
;
registerAmoebaCudaKernelFactories
();
registerAmoebaCudaKernelFactories
();
if
(
argc
>
1
)
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"
Cuda
Precision"
,
std
::
string
(
argv
[
1
]));
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"Precision"
,
std
::
string
(
argv
[
1
]));
testTwoBond
();
testTwoBond
();
testPeriodic
();
testPeriodic
();
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
const
std
::
exception
&
e
)
{
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaGeneralizedKirkwoodForce.cpp
View file @
9e66f0b1
...
@@ -8460,7 +8460,7 @@ int main(int argc, char* argv[]) {
...
@@ -8460,7 +8460,7 @@ int main(int argc, char* argv[]) {
std::cout << "TestCudaAmoebaGeneralizedKirkwoodForce running test..." << std::endl;
std::cout << "TestCudaAmoebaGeneralizedKirkwoodForce running test..." << std::endl;
registerAmoebaCudaKernelFactories();
registerAmoebaCudaKernelFactories();
if (argc > 1)
if (argc > 1)
Platform::getPlatformByName("CUDA").setPropertyDefaultValue("
Cuda
Precision", std::string(argv[1]));
Platform::getPlatformByName("CUDA").setPropertyDefaultValue("Precision", std::string(argv[1]));
// test direct and mutual polarization cases and
// test direct and mutual polarization cases and
// mutual polarization w/ the cavity term
// mutual polarization w/ the cavity term
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaInPlaneAngleForce.cpp
View file @
9e66f0b1
...
@@ -395,7 +395,7 @@ int main(int argc, char* argv[]) {
...
@@ -395,7 +395,7 @@ int main(int argc, char* argv[]) {
std
::
cout
<<
"TestCudaAmoebaInPlaneAngleForce running test..."
<<
std
::
endl
;
std
::
cout
<<
"TestCudaAmoebaInPlaneAngleForce running test..."
<<
std
::
endl
;
registerAmoebaCudaKernelFactories
();
registerAmoebaCudaKernelFactories
();
if
(
argc
>
1
)
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"
Cuda
Precision"
,
std
::
string
(
argv
[
1
]));
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"Precision"
,
std
::
string
(
argv
[
1
]));
testOneAngle
();
testOneAngle
();
testPeriodic
();
testPeriodic
();
}
catch
(
const
std
::
exception
&
e
)
{
}
catch
(
const
std
::
exception
&
e
)
{
...
...
Prev
1
2
Next
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