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
ca63e6d8
"...reference/tests/TestReferenceCustomExternalForce.cpp" did not exist on "1f6802f977dc8ec6533153c0366953cbf4a9edfd"
Commit
ca63e6d8
authored
Mar 31, 2010
by
Mark Friedrichs
Browse files
Fix allocation of shared memory for shake kernels
parent
8868141e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
17 deletions
+7
-17
platforms/cuda/src/kernels/kShakeH.cu
platforms/cuda/src/kernels/kShakeH.cu
+7
-17
No files found.
platforms/cuda/src/kernels/kShakeH.cu
View file @
ca63e6d8
...
@@ -74,13 +74,7 @@ __launch_bounds__(G8X_SHAKE_THREADS_PER_BLOCK, 1)
...
@@ -74,13 +74,7 @@ __launch_bounds__(G8X_SHAKE_THREADS_PER_BLOCK, 1)
#endif
#endif
void
kApplyFirstShake_kernel
()
void
kApplyFirstShake_kernel
()
{
{
#if (__CUDA_ARCH__ >= 200)
extern
__shared__
Atom
sA
[];
__shared__
Atom
sA
[
GF1XX_SHAKE_THREADS_PER_BLOCK
];
#elif (__CUDA_ARCH__ >= 130)
__shared__
Atom
sA
[
GT2XX_SHAKE_THREADS_PER_BLOCK
];
#else
__shared__
Atom
sA
[
G8X_SHAKE_THREADS_PER_BLOCK
];
#endif
Atom
*
psA
=
&
sA
[
threadIdx
.
x
];
Atom
*
psA
=
&
sA
[
threadIdx
.
x
];
unsigned
int
pos
=
threadIdx
.
x
+
blockIdx
.
x
*
blockDim
.
x
;
unsigned
int
pos
=
threadIdx
.
x
+
blockIdx
.
x
*
blockDim
.
x
;
while
(
pos
<
cSim
.
ShakeConstraints
)
while
(
pos
<
cSim
.
ShakeConstraints
)
...
@@ -235,9 +229,10 @@ void kApplyFirstShake(gpuContext gpu)
...
@@ -235,9 +229,10 @@ void kApplyFirstShake(gpuContext gpu)
// printf("kApplyFirstShake\n");
// printf("kApplyFirstShake\n");
if
(
gpu
->
sim
.
ShakeConstraints
>
0
)
if
(
gpu
->
sim
.
ShakeConstraints
>
0
)
{
{
kApplyFirstShake_kernel
<<<
gpu
->
sim
.
blocks
,
gpu
->
sim
.
shake_threads_per_block
>>>
();
kApplyFirstShake_kernel
<<<
gpu
->
sim
.
blocks
,
gpu
->
sim
.
shake_threads_per_block
,
sizeof
(
Atom
)
*
gpu
->
sim
.
shake_threads_per_block
>>>
();
LAUNCHERROR
(
"kApplyFirstShake"
);
LAUNCHERROR
(
"kApplyFirstShake"
);
}
}
}
}
__global__
__global__
...
@@ -250,13 +245,7 @@ __launch_bounds__(G8X_SHAKE_THREADS_PER_BLOCK, 1)
...
@@ -250,13 +245,7 @@ __launch_bounds__(G8X_SHAKE_THREADS_PER_BLOCK, 1)
#endif
#endif
void
kApplySecondShake_kernel
()
void
kApplySecondShake_kernel
()
{
{
#if (__CUDA_ARCH__ >= 200)
extern
__shared__
Atom
sA
[];
__shared__
Atom
sA
[
GF1XX_SHAKE_THREADS_PER_BLOCK
];
#elif (__CUDA_ARCH__ >= 130)
__shared__
Atom
sA
[
GT2XX_SHAKE_THREADS_PER_BLOCK
];
#else
__shared__
Atom
sA
[
G8X_SHAKE_THREADS_PER_BLOCK
];
#endif
Atom
*
psA
=
&
sA
[
threadIdx
.
x
];
Atom
*
psA
=
&
sA
[
threadIdx
.
x
];
unsigned
int
pos
=
threadIdx
.
x
+
blockIdx
.
x
*
blockDim
.
x
;
unsigned
int
pos
=
threadIdx
.
x
+
blockIdx
.
x
*
blockDim
.
x
;
while
(
pos
<
cSim
.
ShakeConstraints
)
while
(
pos
<
cSim
.
ShakeConstraints
)
...
@@ -465,10 +454,10 @@ kApplyNoShake_kernel()
...
@@ -465,10 +454,10 @@ kApplyNoShake_kernel()
void
kApplySecondShake
(
gpuContext
gpu
)
void
kApplySecondShake
(
gpuContext
gpu
)
{
{
// printf("kApplySecondShake\n");
// printf("kApplySecondShake\n");
if
(
gpu
->
sim
.
ShakeConstraints
>
0
)
if
(
gpu
->
sim
.
ShakeConstraints
>
0
)
{
{
kApplySecondShake_kernel
<<<
gpu
->
sim
.
blocks
,
gpu
->
sim
.
shake_threads_per_block
>>>
();
kApplySecondShake_kernel
<<<
gpu
->
sim
.
blocks
,
gpu
->
sim
.
shake_threads_per_block
,
sizeof
(
Atom
)
*
gpu
->
sim
.
shake_threads_per_block
>>>
();
LAUNCHERROR
(
"kApplySecondShake"
);
LAUNCHERROR
(
"kApplySecondShake"
);
}
}
else
if
(
gpu
->
sim
.
NonShakeConstraints
>
0
)
else
if
(
gpu
->
sim
.
NonShakeConstraints
>
0
)
...
@@ -477,5 +466,6 @@ void kApplySecondShake(gpuContext gpu)
...
@@ -477,5 +466,6 @@ void kApplySecondShake(gpuContext gpu)
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