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
3d6e98d2
Commit
3d6e98d2
authored
Sep 25, 2009
by
Peter Eastman
Browse files
Fixed errors under AMD's OpenCL
parent
0634e3cc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
platforms/opencl/src/kernels/harmonicAngleForce.cl
platforms/opencl/src/kernels/harmonicAngleForce.cl
+7
-7
platforms/opencl/src/kernels/harmonicBondForce.cl
platforms/opencl/src/kernels/harmonicBondForce.cl
+1
-1
platforms/opencl/src/kernels/periodicTorsionForce.cl
platforms/opencl/src/kernels/periodicTorsionForce.cl
+4
-4
No files found.
platforms/opencl/src/kernels/harmonicAngleForce.cl
View file @
3d6e98d2
...
...
@@ -10,20 +10,20 @@ __kernel void calcHarmonicAngleForce(int numAtoms, int numAngles, __global float
int8
atoms
=
indices[index]
;
float2
angleParams
=
params[index]
;
float4
a1
=
posq[atoms.
x
]
;
float4
a2
=
posq[atoms.
y
]
;
float4
a3
=
posq[atoms.
z
]
;
float4
a1
=
posq[atoms.
s0
]
;
float4
a2
=
posq[atoms.
s1
]
;
float4
a3
=
posq[atoms.
s2
]
;
//
Compute
the
force.
float4
v0
=
a2-a1
;
float4
v1
=
a2-a3
;
float4
cp
=
cross
(
v0,
v1
)
;
float
rp
=
dot
(
cp.xyz,
cp.xyz
)
;
float
rp
=
cp.x*cp.x
+
cp.y*cp.y
+
cp.z*cp.z
;
rp
=
max
(
sqrt
(
rp
)
,
1.0e-06f
)
;
float
r21
=
dot
(
v0.xyz,
v0.xyz
)
;
float
r23
=
dot
(
v1.xyz,
v1.xyz
)
;
float
dot
=
dot
(
v0.xyz,
v1.xyz
)
;
float
r21
=
v0.x*v0.x
+
v0.y*v0.y
+
v0.z*v0.z
;
float
r23
=
v1.x*v1.x
+
v1.y*v1.y
+
v1.z*v1.z
;
float
dot
=
v0.x*v1.x
+
v0.y*v1.y
+
v0.z*v1.z
;
float
cosine
=
dot/sqrt
(
r21*r23
)
;
float
deltaIdeal
=
acos
(
cosine
)
-angleParams.x
;
energy
+=
0.5f*angleParams.y*deltaIdeal*deltaIdeal
;
...
...
platforms/opencl/src/kernels/harmonicBondForce.cl
View file @
3d6e98d2
...
...
@@ -14,7 +14,7 @@ __kernel void calcHarmonicBondForce(int numAtoms, int numBonds, __global float4*
//
Compute
the
force.
float
r
=
sqrt
(
d
ot
(
delta.x
yz,
delta.
xyz
)
)
;
float
r
=
sqrt
(
d
elta.x*
delta.x
+
delta.
y*delta.y
+
delta.z*delta.z
)
;
float
deltaIdeal
=
r-bondParams.x
;
energy
+=
0.5f
*
bondParams.y*deltaIdeal*deltaIdeal
;
float
dEdR
=
bondParams.y
*
deltaIdeal
;
...
...
platforms/opencl/src/kernels/periodicTorsionForce.cl
View file @
3d6e98d2
...
...
@@ -10,10 +10,10 @@ __kernel void calcPeriodicTorsionForce(int numAtoms, int numTorsions, __global f
int8
atoms
=
indices[index]
;
float4
torsionParams
=
params[index]
;
float4
a1
=
posq[atoms.
x
]
;
float4
a2
=
posq[atoms.
y
]
;
float4
a3
=
posq[atoms.
z
]
;
float4
a4
=
posq[atoms.
w
]
;
float4
a1
=
posq[atoms.
s0
]
;
float4
a2
=
posq[atoms.
s1
]
;
float4
a3
=
posq[atoms.
s2
]
;
float4
a4
=
posq[atoms.
s3
]
;
//
Compute
the
force.
...
...
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