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
de04cdb3
Commit
de04cdb3
authored
Nov 06, 2009
by
Peter Eastman
Browse files
Bug fix
parent
3cf5495a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
11 deletions
+8
-11
platforms/opencl/src/kernels/langevin.cl
platforms/opencl/src/kernels/langevin.cl
+2
-2
platforms/opencl/src/kernels/verlet.cl
platforms/opencl/src/kernels/verlet.cl
+6
-9
No files found.
platforms/opencl/src/kernels/langevin.cl
View file @
de04cdb3
...
...
@@ -87,9 +87,9 @@ __kernel void selectLangevinStepSize(int numAtoms, float maxStepSize, float erro
float
err
=
0.0f
;
unsigned
int
index
=
get_local_id
(
0
)
;
while
(
index
<
numAtoms
)
{
float4
f
orce
=
force[index]
;
float4
f
=
force[index]
;
float
invMass
=
velm[index].w
;
err
+=
(
f
orce.x*force.x
+
force.y*force.y
+
force.z*force
.z
)
*invMass
;
err
+=
(
f
.x*f.x
+
f.y*f.y
+
f.z*f
.z
)
*invMass
;
index
+=
get_global_size
(
0
)
;
}
error[get_local_id
(
0
)
]
=
err
;
...
...
platforms/opencl/src/kernels/verlet.cl
View file @
de04cdb3
...
...
@@ -28,13 +28,10 @@ __kernel void integrateVerletPart1(int numAtoms, __global float2* dt, __global f
*/
__kernel
void
integrateVerletPart2
(
int
numAtoms,
__global
float2*
dt,
__global
float4*
posq,
__global
float4*
velm,
__global
float4*
posDelta
)
{
__local
float
oneOverDt
;
if
(
get_local_id
(
0
)
==
0
)
{
float2
stepSize
=
dt[0]
;
oneOverDt
=
1.0f/stepSize.y
;
if
(
get_global_id
(
0
)
==
0
)
dt[0].x
=
stepSize.y
;
}
float2
stepSize
=
dt[0]
;
float
oneOverDt
=
1.0f/stepSize.y
;
if
(
get_global_id
(
0
)
==
0
)
dt[0].x
=
stepSize.y
;
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
int
index
=
get_global_id
(
0
)
;
while
(
index
<
numAtoms
)
{
...
...
@@ -59,9 +56,9 @@ __kernel void selectVerletStepSize(int numAtoms, float maxStepSize, float errorT
float
err
=
0.0f
;
unsigned
int
index
=
get_local_id
(
0
)
;
while
(
index
<
numAtoms
)
{
float4
f
orce
=
force[index]
;
float4
f
=
force[index]
;
float
invMass
=
velm[index].w
;
err
+=
(
f
orce.x*force.x
+
force.y*force.y
+
force.z*force
.z
)
*invMass
;
err
+=
(
f
.x*f.x
+
f.y*f.y
+
f.z*f
.z
)
*invMass
;
index
+=
get_global_size
(
0
)
;
}
error[get_local_id
(
0
)
]
=
err
;
...
...
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