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
a106d7d1
Commit
a106d7d1
authored
Apr 12, 2013
by
Peter Eastman
Browse files
Fixed errors in mixed precision mode
parent
820a6baa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
platforms/opencl/src/OpenCLIntegrationUtilities.cpp
platforms/opencl/src/OpenCLIntegrationUtilities.cpp
+1
-1
platforms/opencl/src/kernels/integrationUtilities.cl
platforms/opencl/src/kernels/integrationUtilities.cl
+2
-1
No files found.
platforms/opencl/src/OpenCLIntegrationUtilities.cpp
View file @
a106d7d1
...
@@ -977,7 +977,7 @@ double OpenCLIntegrationUtilities::computeKineticEnergy(double timeShift) {
...
@@ -977,7 +977,7 @@ double OpenCLIntegrationUtilities::computeKineticEnergy(double timeShift) {
timeShiftKernel
.
setArg
<
cl
::
Buffer
>
(
0
,
context
.
getVelm
().
getDeviceBuffer
());
timeShiftKernel
.
setArg
<
cl
::
Buffer
>
(
0
,
context
.
getVelm
().
getDeviceBuffer
());
timeShiftKernel
.
setArg
<
cl
::
Buffer
>
(
1
,
context
.
getForce
().
getDeviceBuffer
());
timeShiftKernel
.
setArg
<
cl
::
Buffer
>
(
1
,
context
.
getForce
().
getDeviceBuffer
());
if
(
context
.
getUseDoublePrecision
()
||
context
.
getUseMixedPrecision
()
)
if
(
context
.
getUseDoublePrecision
())
timeShiftKernel
.
setArg
<
cl_double
>
(
2
,
timeShift
);
timeShiftKernel
.
setArg
<
cl_double
>
(
2
,
timeShift
);
else
else
timeShiftKernel
.
setArg
<
cl_float
>
(
2
,
(
cl_float
)
timeShift
);
timeShiftKernel
.
setArg
<
cl_float
>
(
2
,
(
cl_float
)
timeShift
);
...
...
platforms/opencl/src/kernels/integrationUtilities.cl
View file @
a106d7d1
...
@@ -5,7 +5,8 @@ __kernel void timeShiftVelocities(__global mixed4* restrict velm, __global const
...
@@ -5,7 +5,8 @@ __kernel void timeShiftVelocities(__global mixed4* restrict velm, __global const
for
(
int
index
=
get_global_id
(
0
)
; index < NUM_ATOMS; index += get_global_size(0)) {
for
(
int
index
=
get_global_id
(
0
)
; index < NUM_ATOMS; index += get_global_size(0)) {
mixed4
velocity
=
velm[index]
;
mixed4
velocity
=
velm[index]
;
if
(
velocity.w
!=
0.0
)
{
if
(
velocity.w
!=
0.0
)
{
velocity.xyz
+=
timeShift*force[index].xyz*velocity.w
;
mixed4
f
=
convert_mixed4
(
force[index]
)
;
velocity.xyz
+=
timeShift*f.xyz*velocity.w
;
velm[index]
=
velocity
;
velm[index]
=
velocity
;
}
}
}
}
...
...
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