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
172d41e5
"vscode:/vscode.git/clone" did not exist on "43926c46ddf720468bf60a4f10dce60c36f1ad53"
Commit
172d41e5
authored
Jan 09, 2010
by
Mike Houston
Browse files
Can't use 'cross' as a variable name since that is a builtin function name
parent
211042a9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
platforms/opencl/src/kernels/periodicTorsionForce.cl
platforms/opencl/src/kernels/periodicTorsionForce.cl
+2
-2
platforms/opencl/src/kernels/rbTorsionForce.cl
platforms/opencl/src/kernels/rbTorsionForce.cl
+2
-2
No files found.
platforms/opencl/src/kernels/periodicTorsionForce.cl
View file @
172d41e5
...
@@ -28,9 +28,9 @@ __kernel void calcPeriodicTorsionForce(int numAtoms, int numTorsions, __global f
...
@@ -28,9 +28,9 @@ __kernel void calcPeriodicTorsionForce(int numAtoms, int numTorsions, __global f
if
(
cosangle
>
0.99f
||
cosangle
<
-0.99f
)
{
if
(
cosangle
>
0.99f
||
cosangle
<
-0.99f
)
{
//
We
're
close
to
the
singularity
in
acos
()
,
so
take
the
cross
product
and
use
asin
()
instead.
//
We
're
close
to
the
singularity
in
acos
()
,
so
take
the
cross
product
and
use
asin
()
instead.
float4
cross
=
cross
(
cp0,
cp1
)
;
float4
cross
_prod
=
cross
(
cp0,
cp1
)
;
float
scale
=
dot
(
cp0,
cp0
)
*dot
(
cp1,
cp1
)
;
float
scale
=
dot
(
cp0,
cp0
)
*dot
(
cp1,
cp1
)
;
dihedralAngle
=
asin
(
sqrt
(
dot
(
cross,
cross
)
/scale
))
;
dihedralAngle
=
asin
(
sqrt
(
dot
(
cross
_prod
,
cross
_prod
)
/scale
))
;
if
(
cosangle
<
0.0f
)
if
(
cosangle
<
0.0f
)
dihedralAngle
=
PI-dihedralAngle
;
dihedralAngle
=
PI-dihedralAngle
;
}
}
...
...
platforms/opencl/src/kernels/rbTorsionForce.cl
View file @
172d41e5
...
@@ -28,9 +28,9 @@ __kernel void calcRBTorsionForce(int numAtoms, int numTorsions, __global float4*
...
@@ -28,9 +28,9 @@ __kernel void calcRBTorsionForce(int numAtoms, int numTorsions, __global float4*
if
(
cosangle
>
0.99f
||
cosangle
<
-0.99f
)
{
if
(
cosangle
>
0.99f
||
cosangle
<
-0.99f
)
{
//
We
're
close
to
the
singularity
in
acos
()
,
so
take
the
cross
product
and
use
asin
()
instead.
//
We
're
close
to
the
singularity
in
acos
()
,
so
take
the
cross
product
and
use
asin
()
instead.
float4
cross
=
cross
(
cp0,
cp1
)
;
float4
cross
_prod
=
cross
(
cp0,
cp1
)
;
float
scale
=
dot
(
cp0,
cp0
)
*dot
(
cp1,
cp1
)
;
float
scale
=
dot
(
cp0,
cp0
)
*dot
(
cp1,
cp1
)
;
dihedralAngle
=
asin
(
sqrt
(
dot
(
cross,
cross
)
/scale
))
;
dihedralAngle
=
asin
(
sqrt
(
dot
(
cross
_prod
,
cross
_prod
)
/scale
))
;
if
(
cosangle
<
0.0f
)
if
(
cosangle
<
0.0f
)
dihedralAngle
=
PI-dihedralAngle
;
dihedralAngle
=
PI-dihedralAngle
;
}
}
...
...
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