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
845050d4
Commit
845050d4
authored
Mar 26, 2010
by
Peter Eastman
Browse files
Optimization (consolidated two SHAKE related kernels into one)
parent
08f52358
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
platforms/cuda/src/kernels/kShakeH.cu
platforms/cuda/src/kernels/kShakeH.cu
+18
-5
No files found.
platforms/cuda/src/kernels/kShakeH.cu
View file @
845050d4
...
@@ -420,6 +420,22 @@ void kApplySecondShake_kernel()
...
@@ -420,6 +420,22 @@ void kApplySecondShake_kernel()
pos
+=
blockDim
.
x
*
gridDim
.
x
;
pos
+=
blockDim
.
x
*
gridDim
.
x
;
}
}
// Update any atoms that SHAKE is not applied to.
pos
=
threadIdx
.
x
+
blockIdx
.
x
*
blockDim
.
x
;
while
(
pos
<
cSim
.
NonShakeConstraints
)
{
int
atomID
=
cSim
.
pNonShakeID
[
pos
];
float4
apos
=
cSim
.
pOldPosq
[
atomID
];
float4
xpi
=
cSim
.
pPosq
[
atomID
];
xpi
.
x
+=
apos
.
x
;
xpi
.
y
+=
apos
.
y
;
xpi
.
z
+=
apos
.
z
;
cSim
.
pPosq
[
atomID
]
=
xpi
;
pos
+=
blockDim
.
x
*
gridDim
.
x
;
}
}
}
__global__
void
__global__
void
...
@@ -447,7 +463,6 @@ kApplyNoShake_kernel()
...
@@ -447,7 +463,6 @@ kApplyNoShake_kernel()
}
}
}
}
void
kApplySecondShake
(
gpuContext
gpu
)
void
kApplySecondShake
(
gpuContext
gpu
)
{
{
// printf("kApplySecondShake\n");
// printf("kApplySecondShake\n");
...
@@ -456,11 +471,9 @@ void kApplySecondShake(gpuContext gpu)
...
@@ -456,11 +471,9 @@ void kApplySecondShake(gpuContext gpu)
kApplySecondShake_kernel
<<<
gpu
->
sim
.
blocks
,
gpu
->
sim
.
shake_threads_per_block
>>>
();
kApplySecondShake_kernel
<<<
gpu
->
sim
.
blocks
,
gpu
->
sim
.
shake_threads_per_block
>>>
();
LAUNCHERROR
(
"kApplySecondShake"
);
LAUNCHERROR
(
"kApplySecondShake"
);
}
}
else
if
(
gpu
->
sim
.
NonShakeConstraints
>
0
)
// handle non-Shake atoms
if
(
gpu
->
sim
.
NonShakeConstraints
>
0
)
{
{
// handle non-Shake atoms
kApplyNoShake_kernel
<<<
gpu
->
sim
.
blocks
,
gpu
->
sim
.
nonshake_threads_per_block
>>>
();
kApplyNoShake_kernel
<<<
gpu
->
sim
.
blocks
,
gpu
->
sim
.
nonshake_threads_per_block
>>>
();
LAUNCHERROR
(
"kApplyNoShake"
);
LAUNCHERROR
(
"kApplyNoShake"
);
}
}
...
...
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