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
f12cb008
Commit
f12cb008
authored
Apr 21, 2016
by
Peter Eastman
Browse files
Unified names of platform properties
parent
95584c96
Changes
33
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
82 additions
and
51 deletions
+82
-51
examples/benchmark.py
examples/benchmark.py
+4
-9
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
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaMultipoleForce.cpp
...eba/platforms/cuda/tests/TestCudaAmoebaMultipoleForce.cpp
+1
-1
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaOutOfPlaneBendForce.cpp
...latforms/cuda/tests/TestCudaAmoebaOutOfPlaneBendForce.cpp
+1
-1
No files found.
examples/benchmark.py
View file @
f12cb008
...
...
@@ -82,17 +82,12 @@ def runOneTest(testName, options):
properties
=
{}
initialSteps
=
5
if
options
.
device
is
not
None
:
if
platform
.
getName
()
==
'CUDA'
:
properties
[
'CudaDeviceIndex'
]
=
options
.
device
elif
platform
.
getName
()
==
'OpenCL'
:
properties
[
'OpenCLDeviceIndex'
]
=
options
.
device
if
platform
.
getName
()
in
(
'CUDA'
,
'OpenCL'
):
properties
[
'DeviceIndex'
]
=
options
.
device
if
','
in
options
.
device
or
' '
in
options
.
device
:
initialSteps
=
250
if
options
.
precision
is
not
None
:
if
platform
.
getName
()
==
'CUDA'
:
properties
[
'CudaPrecision'
]
=
options
.
precision
elif
platform
.
getName
()
==
'OpenCL'
:
properties
[
'OpenCLPrecision'
]
=
options
.
precision
if
options
.
precision
is
not
None
and
platform
.
getName
()
in
(
'CUDA'
,
'OpenCL'
):
properties
[
'Precision'
]
=
options
.
precision
# Run the simulation.
...
...
olla/include/openmm/Platform.h
View file @
f12cb008
...
...
@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* 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 *
* Contributors: *
* *
...
...
@@ -236,7 +236,9 @@ protected:
*/
const
ContextImpl
&
getContextImpl
(
const
Context
&
context
)
const
;
std
::
vector
<
std
::
string
>
platformProperties
;
std
::
map
<
std
::
string
,
std
::
string
>
deprecatedPropertyReplacements
;
private:
friend
class
ContextImpl
;
std
::
map
<
std
::
string
,
KernelFactory
*>
kernelFactories
;
std
::
map
<
std
::
string
,
std
::
string
>
defaultProperties
;
static
std
::
vector
<
Platform
*>&
getPlatforms
();
...
...
olla/src/Platform.cpp
View file @
f12cb008
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* 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 *
* Contributors: *
* *
...
...
@@ -89,15 +89,21 @@ void Platform::setPropertyValue(Context& context, 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
())
throw
OpenMMException
(
"getPropertyDefaultValue: Illegal property name"
);
return
value
->
second
;
}
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
++
)
if
(
platformProperties
[
i
]
==
property
)
{
if
(
platformProperties
[
i
]
==
property
Name
)
{
defaultProperties
[
property
]
=
value
;
return
;
}
...
...
openmmapi/src/ContextImpl.cpp
View file @
f12cb008
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* 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 *
* Contributors: *
* *
...
...
@@ -84,15 +84,20 @@ ContextImpl::ContextImpl(Context& owner, const System& system, Integrator& integ
// Validate the list of properties.
const
vector
<
string
>&
platformProperties
=
platform
->
getPropertyNames
();
map
<
string
,
string
>
validatedProperties
;
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
;
for
(
int
i
=
0
;
i
<
(
int
)
platformProperties
.
size
();
i
++
)
if
(
platformProperties
[
i
]
==
iter
->
first
)
{
if
(
platformProperties
[
i
]
==
property
)
{
valid
=
true
;
break
;
}
if
(
!
valid
)
throw
OpenMMException
(
"Illegal property name: "
+
iter
->
first
);
validatedProperties
[
property
]
=
iter
->
second
;
}
// Find the list of kernels required.
...
...
@@ -139,7 +144,7 @@ ContextImpl::ContextImpl(Context& owner, const System& system, Integrator& integ
for
(
int
i
=
candidatePlatforms
.
size
()
-
1
;
i
>=
0
;
i
--
)
{
try
{
this
->
platform
=
platform
=
candidatePlatforms
[
i
].
second
;
platform
->
contextCreated
(
*
this
,
p
roperties
);
platform
->
contextCreated
(
*
this
,
validatedP
roperties
);
break
;
}
catch
(...)
{
...
...
platforms/cpu/include/CpuPlatform.h
View file @
f12cb008
...
...
@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* 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 *
* Contributors: *
* *
...
...
@@ -64,7 +64,7 @@ public:
* This is the name of the parameter for selecting the number of threads to use.
*/
static
const
std
::
string
&
CpuThreads
()
{
static
const
std
::
string
key
=
"
Cpu
Threads"
;
static
const
std
::
string
key
=
"Threads"
;
return
key
;
}
/**
...
...
platforms/cpu/src/CpuPlatform.cpp
View file @
f12cb008
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* 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 *
* Contributors: *
* *
...
...
@@ -59,6 +59,7 @@ extern "C" OPENMM_EXPORT_CPU void registerPlatforms() {
map
<
const
ContextImpl
*
,
CpuPlatform
::
PlatformData
*>
CpuPlatform
::
contextData
;
CpuPlatform
::
CpuPlatform
()
{
deprecatedPropertyReplacements
[
"CpuThreads"
]
=
"Threads"
;
CpuKernelFactory
*
factory
=
new
CpuKernelFactory
();
registerKernelFactory
(
CalcForcesAndEnergyKernel
::
Name
(),
factory
);
registerKernelFactory
(
CalcHarmonicAngleForceKernel
::
Name
(),
factory
);
...
...
@@ -83,7 +84,10 @@ CpuPlatform::CpuPlatform() {
const
string
&
CpuPlatform
::
getPropertyValue
(
const
Context
&
context
,
const
string
&
property
)
const
{
const
ContextImpl
&
impl
=
getContextImpl
(
context
);
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
())
return
value
->
second
;
return
ReferencePlatform
::
getPropertyValue
(
context
,
property
);
...
...
platforms/cuda/include/CudaPlatform.h
View file @
f12cb008
...
...
@@ -58,35 +58,35 @@ public:
* 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
key
=
"
Cuda
DeviceIndex"
;
static
const
std
::
string
key
=
"DeviceIndex"
;
return
key
;
}
/**
* 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
key
=
"
Cuda
DeviceName"
;
static
const
std
::
string
key
=
"DeviceName"
;
return
key
;
}
/**
* 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
key
=
"
Cuda
UseBlockingSync"
;
static
const
std
::
string
key
=
"UseBlockingSync"
;
return
key
;
}
/**
* This is the name of the parameter for selecting what numerical precision to use.
*/
static
const
std
::
string
&
CudaPrecision
()
{
static
const
std
::
string
key
=
"
Cuda
Precision"
;
static
const
std
::
string
key
=
"Precision"
;
return
key
;
}
/**
* 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
key
=
"
Cuda
UseCpuPme"
;
static
const
std
::
string
key
=
"UseCpuPme"
;
return
key
;
}
/**
...
...
@@ -107,21 +107,21 @@ public:
* 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
key
=
"
Cuda
TempDirectory"
;
static
const
std
::
string
key
=
"TempDirectory"
;
return
key
;
}
/**
* 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
key
=
"
Cuda
DisablePmeStream"
;
static
const
std
::
string
key
=
"DisablePmeStream"
;
return
key
;
}
/**
* This is the name of the parameter for requesting that force computations be fully deterministic.
*/
static
const
std
::
string
&
CudaDeterministicForces
()
{
static
const
std
::
string
key
=
"
Cuda
DeterministicForces"
;
static
const
std
::
string
key
=
"DeterministicForces"
;
return
key
;
}
};
...
...
platforms/cuda/src/CudaContext.cpp
View file @
f12cb008
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* 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 *
* Contributors: *
* *
...
...
@@ -106,7 +106,7 @@ CudaContext::CudaContext(const System& system, int deviceIndex, bool useBlocking
useMixedPrecision
=
false
;
}
else
throw
OpenMMException
(
"Illegal value for
Cuda
Precision: "
+
precision
);
throw
OpenMMException
(
"Illegal value for Precision: "
+
precision
);
char
*
cacheVariable
=
getenv
(
"OPENMM_CACHE_DIR"
);
cacheDir
=
(
cacheVariable
==
NULL
?
tempDir
:
string
(
cacheVariable
));
#ifdef WIN32
...
...
@@ -121,7 +121,7 @@ CudaContext::CudaContext(const System& system, int deviceIndex, bool useBlocking
string
errorMessage
=
"Error initializing Context"
;
CHECK_RESULT
(
cuDeviceGetCount
(
&
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
;
if
(
deviceIndex
==
-
1
)
{
...
...
platforms/cuda/src/CudaPlatform.cpp
View file @
f12cb008
...
...
@@ -62,6 +62,14 @@ extern "C" OPENMM_EXPORT_CUDA void registerPlatforms() {
#endif
CudaPlatform
::
CudaPlatform
()
{
deprecatedPropertyReplacements
[
"CudaDeviceIndex"
]
=
"DeviceIndex"
;
deprecatedPropertyReplacements
[
"CudaDeviceName"
]
=
"DeviceName"
;
deprecatedPropertyReplacements
[
"CudaUseBlockingSync"
]
=
"UseBlockingSync"
;
deprecatedPropertyReplacements
[
"CudaPrecision"
]
=
"Precision"
;
deprecatedPropertyReplacements
[
"CudaUseCpuPme"
]
=
"UseCpuPme"
;
deprecatedPropertyReplacements
[
"CudaTempDirectory"
]
=
"TempDirectory"
;
deprecatedPropertyReplacements
[
"CudaDisablePmeStream"
]
=
"DisablePmeStream"
;
deprecatedPropertyReplacements
[
"CudaDeterministicForces"
]
=
"DeterministicForces"
;
CudaKernelFactory
*
factory
=
new
CudaKernelFactory
();
registerKernelFactory
(
CalcForcesAndEnergyKernel
::
Name
(),
factory
);
registerKernelFactory
(
UpdateStateDataKernel
::
Name
(),
factory
);
...
...
@@ -144,7 +152,10 @@ bool CudaPlatform::supportsDoublePrecision() const {
const
string
&
CudaPlatform
::
getPropertyValue
(
const
Context
&
context
,
const
string
&
property
)
const
{
const
ContextImpl
&
impl
=
getContextImpl
(
context
);
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
())
return
value
->
second
;
return
Platform
::
getPropertyValue
(
context
,
property
);
...
...
platforms/cuda/tests/CudaTests.h
View file @
f12cb008
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* 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 *
* Contributors: *
* *
...
...
@@ -39,5 +39,5 @@ OpenMM::CudaPlatform platform;
void
initializeTests
(
int
argc
,
char
*
argv
[])
{
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 @
f12cb008
...
...
@@ -58,14 +58,14 @@ public:
* 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
key
=
"
OpenCL
DeviceIndex"
;
static
const
std
::
string
key
=
"DeviceIndex"
;
return
key
;
}
/**
* 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
key
=
"
OpenCL
DeviceName"
;
static
const
std
::
string
key
=
"DeviceName"
;
return
key
;
}
/**
...
...
@@ -86,21 +86,21 @@ public:
* This is the name of the parameter for selecting what numerical precision to use.
*/
static
const
std
::
string
&
OpenCLPrecision
()
{
static
const
std
::
string
key
=
"
OpenCL
Precision"
;
static
const
std
::
string
key
=
"Precision"
;
return
key
;
}
/**
* 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
key
=
"
OpenCL
UseCpuPme"
;
static
const
std
::
string
key
=
"UseCpuPme"
;
return
key
;
}
/**
* 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
key
=
"
OpenCL
DisablePmeStream"
;
static
const
std
::
string
key
=
"DisablePmeStream"
;
return
key
;
}
};
...
...
platforms/opencl/src/OpenCLContext.cpp
View file @
f12cb008
...
...
@@ -84,7 +84,7 @@ OpenCLContext::OpenCLContext(const System& system, int platformIndex, int device
useMixedPrecision
=
false
;
}
else
throw
OpenMMException
(
"Illegal value for
OpenCL
Precision: "
+
precision
);
throw
OpenMMException
(
"Illegal value for Precision: "
+
precision
);
try
{
contextIndex
=
platformData
.
contexts
.
size
();
std
::
vector
<
cl
::
Platform
>
platforms
;
...
...
@@ -105,7 +105,7 @@ OpenCLContext::OpenCLContext(const System& system, int platformIndex, int device
vector
<
cl
::
Device
>
devices
;
platforms
[
j
].
getDevices
(
CL_DEVICE_TYPE_ALL
,
&
devices
);
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
++
)
{
// If they supplied a valid deviceIndex, we only look through that one
...
...
platforms/opencl/src/OpenCLPlatform.cpp
View file @
f12cb008
...
...
@@ -56,6 +56,11 @@ extern "C" OPENMM_EXPORT_OPENCL void registerPlatforms() {
#endif
OpenCLPlatform
::
OpenCLPlatform
()
{
deprecatedPropertyReplacements
[
"OpenCLDeviceIndex"
]
=
"DeviceIndex"
;
deprecatedPropertyReplacements
[
"OpenCLDeviceName"
]
=
"DeviceName"
;
deprecatedPropertyReplacements
[
"OpenCLPrecision"
]
=
"Precision"
;
deprecatedPropertyReplacements
[
"OpenCLUseCpuPme"
]
=
"UseCpuPme"
;
deprecatedPropertyReplacements
[
"OpenCLDisablePmeStream"
]
=
"DisablePmeStream"
;
OpenCLKernelFactory
*
factory
=
new
OpenCLKernelFactory
();
registerKernelFactory
(
CalcForcesAndEnergyKernel
::
Name
(),
factory
);
registerKernelFactory
(
UpdateStateDataKernel
::
Name
(),
factory
);
...
...
@@ -139,7 +144,10 @@ bool OpenCLPlatform::isPlatformSupported() {
const
string
&
OpenCLPlatform
::
getPropertyValue
(
const
Context
&
context
,
const
string
&
property
)
const
{
const
ContextImpl
&
impl
=
getContextImpl
(
context
);
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
())
return
value
->
second
;
return
Platform
::
getPropertyValue
(
context
,
property
);
...
...
platforms/opencl/tests/OpenCLTests.h
View file @
f12cb008
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* 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 *
* Contributors: *
* *
...
...
@@ -39,9 +39,9 @@ OpenMM::OpenCLPlatform platform;
void
initializeTests
(
int
argc
,
char
*
argv
[])
{
if
(
argc
>
1
)
platform
.
setPropertyDefaultValue
(
"
OpenCL
Precision"
,
std
::
string
(
argv
[
1
]));
platform
.
setPropertyDefaultValue
(
"Precision"
,
std
::
string
(
argv
[
1
]));
if
(
argc
>
2
)
platform
.
setPropertyDefaultValue
(
"OpenCLPlatformIndex"
,
std
::
string
(
argv
[
2
]));
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 @
f12cb008
...
...
@@ -329,7 +329,7 @@ int main(int argc, char* argv[]) {
std
::
cout
<<
"TestCudaAmoebaAngleForce running test..."
<<
std
::
endl
;
registerAmoebaCudaKernelFactories
();
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"
Cuda
Precision"
,
std
::
string
(
argv
[
1
]));
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"Precision"
,
std
::
string
(
argv
[
1
]));
testOneAngle
();
testPeriodic
();
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaBondForce.cpp
View file @
f12cb008
...
...
@@ -248,7 +248,7 @@ int main(int argc, char* argv[]) {
std
::
cout
<<
"TestCudaAmoebaBondForce running test..."
<<
std
::
endl
;
registerAmoebaCudaKernelFactories
();
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"
Cuda
Precision"
,
std
::
string
(
argv
[
1
]));
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"Precision"
,
std
::
string
(
argv
[
1
]));
testTwoBond
();
testPeriodic
();
}
catch
(
const
std
::
exception
&
e
)
{
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaGeneralizedKirkwoodForce.cpp
View file @
f12cb008
...
...
@@ -8460,7 +8460,7 @@ int main(int argc, char* argv[]) {
std::cout << "TestCudaAmoebaGeneralizedKirkwoodForce running test..." << std::endl;
registerAmoebaCudaKernelFactories();
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
// mutual polarization w/ the cavity term
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaInPlaneAngleForce.cpp
View file @
f12cb008
...
...
@@ -395,7 +395,7 @@ int main(int argc, char* argv[]) {
std
::
cout
<<
"TestCudaAmoebaInPlaneAngleForce running test..."
<<
std
::
endl
;
registerAmoebaCudaKernelFactories
();
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"
Cuda
Precision"
,
std
::
string
(
argv
[
1
]));
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"Precision"
,
std
::
string
(
argv
[
1
]));
testOneAngle
();
testPeriodic
();
}
catch
(
const
std
::
exception
&
e
)
{
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaMultipoleForce.cpp
View file @
f12cb008
...
...
@@ -3066,7 +3066,7 @@ int main(int argc, char* argv[]) {
std
::
cout
<<
"TestCudaAmoebaMultipoleForce running test..."
<<
std
::
endl
;
registerAmoebaCudaKernelFactories
();
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"
Cuda
Precision"
,
std
::
string
(
argv
[
1
]));
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"Precision"
,
std
::
string
(
argv
[
1
]));
// tests using two ammonia molecules
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaOutOfPlaneBendForce.cpp
View file @
f12cb008
...
...
@@ -490,7 +490,7 @@ int main(int argc, char* argv[]) {
std
::
cout
<<
"TestCudaAmoebaOutOfPlaneBendForce running test..."
<<
std
::
endl
;
registerAmoebaCudaKernelFactories
();
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"
Cuda
Precision"
,
std
::
string
(
argv
[
1
]));
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"Precision"
,
std
::
string
(
argv
[
1
]));
testOneOutOfPlaneBend
();
testPeriodic
();
...
...
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