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
138c1c88
"plugins/vscode:/vscode.git/clone" did not exist on "b591d0113681896c1d7613858cfaea11f5091641"
Commit
138c1c88
authored
Jun 16, 2009
by
Peter Eastman
Browse files
Fixed a bug in local force computation that produced a launch failure on Linux
parent
b12bd24c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
78 deletions
+40
-78
platforms/cuda/src/kernels/kCalculateLocalForces.cu
platforms/cuda/src/kernels/kCalculateLocalForces.cu
+40
-78
No files found.
platforms/cuda/src/kernels/kCalculateLocalForces.cu
View file @
138c1c88
...
...
@@ -136,12 +136,8 @@ __global__ void kCalculateLocalForces_kernel()
dz
*=
dEdR
;
unsigned
int
offsetA
=
atom
.
x
+
atom
.
z
*
cSim
.
stride
;
unsigned
int
offsetB
=
atom
.
y
+
atom
.
w
*
cSim
.
stride
;
float4
forceA
=
{
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
};
if
(
atom
.
z
<
cSim
.
totalNonbondOutputBuffers
)
forceA
=
cSim
.
pForce4
[
offsetA
];
float4
forceB
=
{
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
};
if
(
atom
.
w
<
cSim
.
totalNonbondOutputBuffers
)
forceB
=
cSim
.
pForce4
[
offsetB
];
float4
forceA
=
cSim
.
pForce4
[
offsetA
];
float4
forceB
=
cSim
.
pForce4
[
offsetB
];
forceA
.
x
+=
dx
;
forceA
.
y
+=
dy
;
forceA
.
z
+=
dz
;
...
...
@@ -195,24 +191,18 @@ __global__ void kCalculateLocalForces_kernel()
c23
.
z
*=
termC
;
int2
atom2
=
cSim
.
pBondAngleID2
[
pos1
];
unsigned
int
offset
=
atom1
.
x
+
atom1
.
w
*
cSim
.
stride
;
float4
force
=
{
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
};
if
(
atom1
.
w
<
cSim
.
totalNonbondOutputBuffers
)
force
=
cSim
.
pForce4
[
offset
];
float4
force
=
cSim
.
pForce4
[
offset
];
force
.
x
+=
c21
.
x
;
force
.
y
+=
c21
.
y
;
force
.
z
+=
c21
.
z
;
cSim
.
pForce4
[
offset
]
=
force
;
offset
=
atom1
.
y
+
atom2
.
x
*
cSim
.
stride
;
force
.
x
=
force
.
y
=
force
.
z
=
0.0
f
;
if
(
atom2
.
x
<
cSim
.
totalNonbondOutputBuffers
)
force
=
cSim
.
pForce4
[
offset
];
force
.
x
-=
(
c21
.
x
+
c23
.
x
);
force
.
y
-=
(
c21
.
y
+
c23
.
y
);
force
.
z
-=
(
c21
.
z
+
c23
.
z
);
cSim
.
pForce4
[
offset
]
=
force
;
offset
=
atom1
.
z
+
atom2
.
y
*
cSim
.
stride
;
force
.
x
=
force
.
y
=
force
.
z
=
0.0
f
;
if
(
atom2
.
y
<
cSim
.
totalNonbondOutputBuffers
)
force
=
cSim
.
pForce4
[
offset
];
force
.
x
+=
c23
.
x
;
force
.
y
+=
c23
.
y
;
...
...
@@ -264,9 +254,7 @@ __global__ void kCalculateLocalForces_kernel()
// printf("%4d: %9.4f %9.4f %9.4f %9.4f\n", pos1, ff.x, ff.y, ff.z, ff.w);
unsigned
int
offset
=
atom1
.
x
+
atom2
.
x
*
cSim
.
stride
;
float4
force
=
{
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
};
if
(
atom2
.
x
<
cSim
.
totalNonbondOutputBuffers
)
force
=
cSim
.
pForce4
[
offset
];
float4
force
=
cSim
.
pForce4
[
offset
];
internalF0
.
x
=
ff
.
x
*
cp0
.
x
;
force
.
x
+=
internalF0
.
x
;
internalF0
.
y
=
ff
.
x
*
cp0
.
y
;
...
...
@@ -277,8 +265,6 @@ __global__ void kCalculateLocalForces_kernel()
//printf("%4d - 0: %9.4f %9.4f %9.4f\n", pos1, cSim.pForce[offset], cSim.pForce[offset + cSim.stride], cSim.pForce[offset + cSim.stride2]);
offset
=
atom1
.
w
+
atom2
.
w
*
cSim
.
stride
;
force
.
x
=
force
.
y
=
force
.
z
=
0.0
f
;
if
(
atom2
.
w
<
cSim
.
totalNonbondOutputBuffers
)
force
=
cSim
.
pForce4
[
offset
];
internalF3
.
x
=
ff
.
w
*
cp1
.
x
;
force
.
x
+=
internalF3
.
x
;
...
...
@@ -293,8 +279,6 @@ __global__ void kCalculateLocalForces_kernel()
s
.
y
=
ff
.
y
*
internalF0
.
y
-
ff
.
z
*
internalF3
.
y
;
s
.
z
=
ff
.
y
*
internalF0
.
z
-
ff
.
z
*
internalF3
.
z
;
offset
=
atom1
.
y
+
atom2
.
y
*
cSim
.
stride
;
force
.
x
=
force
.
y
=
force
.
z
=
0.0
f
;
if
(
atom2
.
y
<
cSim
.
totalNonbondOutputBuffers
)
force
=
cSim
.
pForce4
[
offset
];
force
.
x
+=
-
internalF0
.
x
+
s
.
x
;
force
.
y
+=
-
internalF0
.
y
+
s
.
y
;
...
...
@@ -303,8 +287,6 @@ __global__ void kCalculateLocalForces_kernel()
//printf("%4d - 1: %9.4f %9.4f %9.4f\n", pos1, cSim.pForce[offset], cSim.pForce[offset + cSim.stride], cSim.pForce[offset + cSim.stride2]);
offset
=
atom1
.
z
+
atom2
.
z
*
cSim
.
stride
;
force
.
x
=
force
.
y
=
force
.
z
=
0.0
f
;
if
(
atom2
.
z
<
cSim
.
totalNonbondOutputBuffers
)
force
=
cSim
.
pForce4
[
offset
];
force
.
x
+=
-
internalF3
.
x
-
s
.
x
;
force
.
y
+=
-
internalF3
.
y
-
s
.
y
;
...
...
@@ -385,9 +367,7 @@ __global__ void kCalculateLocalForces_kernel()
// printf("%4d: %9.4f %9.4f %9.4f %9.4f\n", pos1, ff.x, ff.y, ff.z, ff.w);
unsigned
int
offset
=
atom1
.
x
+
atom2
.
x
*
cSim
.
stride
;
float4
force
=
{
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
};
if
(
atom2
.
x
<
cSim
.
totalNonbondOutputBuffers
)
force
=
cSim
.
pForce4
[
offset
];
float4
force
=
cSim
.
pForce4
[
offset
];
internalF0
.
x
=
ff
.
x
*
cp0
.
x
;
force
.
x
+=
internalF0
.
x
;
internalF0
.
y
=
ff
.
x
*
cp0
.
y
;
...
...
@@ -398,8 +378,6 @@ __global__ void kCalculateLocalForces_kernel()
// printf("%4d - 0: %9.4f %9.4f %9.4f\n", pos1, cSim.pForce[offset], cSim.pForce[offset + cSim.stride], cSim.pForce[offset + cSim.stride2]);
offset
=
atom1
.
w
+
atom2
.
w
*
cSim
.
stride
;
force
.
x
=
force
.
y
=
force
.
z
=
0.0
f
;
if
(
atom2
.
w
<
cSim
.
totalNonbondOutputBuffers
)
force
=
cSim
.
pForce4
[
offset
];
internalF3
.
x
=
ff
.
w
*
cp1
.
x
;
force
.
x
+=
internalF3
.
x
;
...
...
@@ -414,8 +392,6 @@ __global__ void kCalculateLocalForces_kernel()
s
.
y
=
ff
.
y
*
internalF0
.
y
-
ff
.
z
*
internalF3
.
y
;
s
.
z
=
ff
.
y
*
internalF0
.
z
-
ff
.
z
*
internalF3
.
z
;
offset
=
atom1
.
y
+
atom2
.
y
*
cSim
.
stride
;
force
.
x
=
force
.
y
=
force
.
z
=
0.0
f
;
if
(
atom2
.
y
<
cSim
.
totalNonbondOutputBuffers
)
force
=
cSim
.
pForce4
[
offset
];
force
.
x
+=
-
internalF0
.
x
+
s
.
x
;
force
.
y
+=
-
internalF0
.
y
+
s
.
y
;
...
...
@@ -423,8 +399,6 @@ __global__ void kCalculateLocalForces_kernel()
cSim
.
pForce4
[
offset
]
=
force
;
// printf("%4d - 1: %9.4f %9.4f %9.4f\n", pos1, cSim.pForce[offset], cSim.pForce[offset + cSim.stride], cSim.pForce[offset + cSim.stride2]);
offset
=
atom1
.
z
+
atom2
.
z
*
cSim
.
stride
;
force
.
x
=
force
.
y
=
force
.
z
=
0.0
f
;
if
(
atom2
.
z
<
cSim
.
totalNonbondOutputBuffers
)
force
=
cSim
.
pForce4
[
offset
];
force
.
x
+=
-
internalF3
.
x
-
s
.
x
;
force
.
y
+=
-
internalF3
.
y
-
s
.
y
;
...
...
@@ -460,12 +434,8 @@ __global__ void kCalculateLocalForces_kernel()
dEdR
*=
inverseR
*
inverseR
;
unsigned
int
offsetA
=
atom
.
x
+
atom
.
z
*
cSim
.
stride
;
unsigned
int
offsetB
=
atom
.
y
+
atom
.
w
*
cSim
.
stride
;
float4
forceA
=
{
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
};
if
(
atom
.
z
<
cSim
.
totalNonbondOutputBuffers
)
forceA
=
cSim
.
pForce4
[
offsetA
];
float4
forceB
=
{
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
};
if
(
atom
.
w
<
cSim
.
totalNonbondOutputBuffers
)
forceB
=
cSim
.
pForce4
[
offsetB
];
float4
forceA
=
cSim
.
pForce4
[
offsetA
];
float4
forceB
=
cSim
.
pForce4
[
offsetB
];
d
.
x
*=
dEdR
;
d
.
y
*=
dEdR
;
d
.
z
*=
dEdR
;
...
...
@@ -510,12 +480,8 @@ __global__ void kCalculateLocalForces_kernel()
}
unsigned
int
offsetA
=
atom
.
x
+
atom
.
z
*
cSim
.
stride
;
unsigned
int
offsetB
=
atom
.
y
+
atom
.
w
*
cSim
.
stride
;
float4
forceA
=
{
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
};
if
(
atom
.
z
<
cSim
.
totalNonbondOutputBuffers
)
forceA
=
cSim
.
pForce4
[
offsetA
];
float4
forceB
=
{
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
};
if
(
atom
.
w
<
cSim
.
totalNonbondOutputBuffers
)
forceB
=
cSim
.
pForce4
[
offsetB
];
float4
forceA
=
cSim
.
pForce4
[
offsetA
];
float4
forceB
=
cSim
.
pForce4
[
offsetB
];
d
.
x
*=
dEdR
;
d
.
y
*=
dEdR
;
d
.
z
*=
dEdR
;
...
...
@@ -563,12 +529,8 @@ __global__ void kCalculateLocalForces_kernel()
}
unsigned
int
offsetA
=
atom
.
x
+
atom
.
z
*
cSim
.
stride
;
unsigned
int
offsetB
=
atom
.
y
+
atom
.
w
*
cSim
.
stride
;
float4
forceA
=
{
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
};
if
(
atom
.
z
<
cSim
.
totalNonbondOutputBuffers
)
forceA
=
cSim
.
pForce4
[
offsetA
];
float4
forceB
=
{
0.0
f
,
0.0
f
,
0.0
f
,
0.0
f
};
if
(
atom
.
w
<
cSim
.
totalNonbondOutputBuffers
)
forceB
=
cSim
.
pForce4
[
offsetB
];
float4
forceA
=
cSim
.
pForce4
[
offsetA
];
float4
forceB
=
cSim
.
pForce4
[
offsetB
];
d
.
x
*=
dEdR
;
d
.
y
*=
dEdR
;
d
.
z
*=
dEdR
;
...
...
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