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
76f2e0b4
Commit
76f2e0b4
authored
Dec 07, 2012
by
Peter Eastman
Browse files
CustomGBForce was storing computed values in single precision even when double was requested
parent
084f034b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
platforms/cuda/src/CudaKernels.cpp
platforms/cuda/src/CudaKernels.cpp
+1
-1
platforms/opencl/src/OpenCLContext.cpp
platforms/opencl/src/OpenCLContext.cpp
+3
-3
platforms/opencl/src/OpenCLKernels.cpp
platforms/opencl/src/OpenCLKernels.cpp
+1
-1
No files found.
platforms/cuda/src/CudaKernels.cpp
View file @
76f2e0b4
...
...
@@ -2246,7 +2246,7 @@ void CudaCalcCustomGBForceKernel::initialize(const System& system, const CustomG
int numParticles = force.getNumParticles();
params = new CudaParameterSet(cu, force.getNumPerParticleParameters(), numParticles, "customGBParameters", true);
computedValues
=
new
CudaParameterSet
(
cu
,
force
.
getNumComputedValues
(),
numParticles
,
"customGBComputedValues"
,
true
);
computedValues = new CudaParameterSet(cu, force.getNumComputedValues(), numParticles, "customGBComputedValues", true
, cu.getUseDoublePrecision()
);
if (force.getNumGlobalParameters() > 0)
globals = CudaArray::create<float>(cu, force.getNumGlobalParameters(), "customGBGlobals");
vector<vector<float> > paramVector(numParticles);
...
...
platforms/opencl/src/OpenCLContext.cpp
View file @
76f2e0b4
...
...
@@ -149,9 +149,9 @@ OpenCLContext::OpenCLContext(const System& system, int platformIndex, int device
throw
OpenMMException
(
"The specified OpenCL device is not compatible with OpenMM"
);
compilationDefines
[
"WORK_GROUP_SIZE"
]
=
intToString
(
ThreadBlockSize
);
if
(
platformVendor
.
size
()
>=
5
&&
platformVendor
.
substr
(
0
,
5
)
==
"Intel"
)
defaultOptimizationOptions
=
""
;
else
defaultOptimizationOptions
=
"-cl-fast-relaxed-math"
;
defaultOptimizationOptions
=
""
;
else
defaultOptimizationOptions
=
"-cl-fast-relaxed-math"
;
supports64BitGlobalAtomics
=
(
device
.
getInfo
<
CL_DEVICE_EXTENSIONS
>
().
find
(
"cl_khr_int64_base_atomics"
)
!=
string
::
npos
);
supportsDoublePrecision
=
(
device
.
getInfo
<
CL_DEVICE_EXTENSIONS
>
().
find
(
"cl_khr_fp64"
)
!=
string
::
npos
);
if
((
useDoublePrecision
||
useMixedPrecision
)
&&
!
supportsDoublePrecision
)
...
...
platforms/opencl/src/OpenCLKernels.cpp
View file @
76f2e0b4
...
...
@@ -2302,7 +2302,7 @@ void OpenCLCalcCustomGBForceKernel::initialize(const System& system, const Custo
int
numParticles
=
force
.
getNumParticles
();
params
=
new
OpenCLParameterSet
(
cl
,
force
.
getNumPerParticleParameters
(),
numParticles
,
"customGBParameters"
,
true
);
computedValues
=
new
OpenCLParameterSet
(
cl
,
force
.
getNumComputedValues
(),
numParticles
,
"customGBComputedValues"
,
true
);
computedValues
=
new
OpenCLParameterSet
(
cl
,
force
.
getNumComputedValues
(),
numParticles
,
"customGBComputedValues"
,
true
,
cl
.
getUseDoublePrecision
()
);
if
(
force
.
getNumGlobalParameters
()
>
0
)
globals
=
OpenCLArray
::
create
<
cl_float
>
(
cl
,
force
.
getNumGlobalParameters
(),
"customGBGlobals"
,
CL_MEM_READ_ONLY
);
vector
<
vector
<
cl_float
>
>
paramVector
(
numParticles
);
...
...
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