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
2cb112f0
"platforms/vscode:/vscode.git/clone" did not exist on "dbbf7c3e7224aaf4eb3068a55af20eaf76b3ff28"
Commit
2cb112f0
authored
Mar 25, 2010
by
Peter Eastman
Browse files
Optimization (reduce bank conflicts)
parent
9ecb1797
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
15 deletions
+5
-15
platforms/cuda/src/kernels/kCalculateObcGbsaBornSum.cu
platforms/cuda/src/kernels/kCalculateObcGbsaBornSum.cu
+5
-4
platforms/cuda/src/kernels/kCalculateObcGbsaBornSum.h
platforms/cuda/src/kernels/kCalculateObcGbsaBornSum.h
+0
-11
No files found.
platforms/cuda/src/kernels/kCalculateObcGbsaBornSum.cu
View file @
2cb112f0
...
@@ -45,6 +45,7 @@ struct Atom {
...
@@ -45,6 +45,7 @@ struct Atom {
float
r
;
float
r
;
float
sr
;
float
sr
;
float
sum
;
float
sum
;
float
padding
;
};
};
static
__constant__
cudaGmxSimulation
cSim
;
static
__constant__
cudaGmxSimulation
cSim
;
...
...
platforms/cuda/src/kernels/kCalculateObcGbsaBornSum.h
View file @
2cb112f0
...
@@ -41,12 +41,6 @@ __launch_bounds__(G8X_NONBOND_THREADS_PER_BLOCK, 1)
...
@@ -41,12 +41,6 @@ __launch_bounds__(G8X_NONBOND_THREADS_PER_BLOCK, 1)
void
METHOD_NAME
(
kCalculateObcGbsa
,
BornSum_kernel
)(
unsigned
int
*
workUnit
)
void
METHOD_NAME
(
kCalculateObcGbsa
,
BornSum_kernel
)(
unsigned
int
*
workUnit
)
{
{
extern
__shared__
Atom
sA
[];
extern
__shared__
Atom
sA
[];
/*
unsigned int numWorkUnits = cSim.pInteractionCount[0];
int end = numWorkUnits / gridDim.x;
int pos = end - (threadIdx.x >> GRIDBITS) - 1;
*/
unsigned
int
totalWarps
=
cSim
.
nonbond_blocks
*
cSim
.
nonbond_threads_per_block
/
GRID
;
unsigned
int
totalWarps
=
cSim
.
nonbond_blocks
*
cSim
.
nonbond_threads_per_block
/
GRID
;
unsigned
int
warp
=
(
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
)
/
GRID
;
unsigned
int
warp
=
(
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
)
/
GRID
;
unsigned
int
numWorkUnits
=
cSim
.
pInteractionCount
[
0
];
unsigned
int
numWorkUnits
=
cSim
.
pInteractionCount
[
0
];
...
@@ -60,12 +54,10 @@ void METHOD_NAME(kCalculateObcGbsa, BornSum_kernel)(unsigned int* workUnit)
...
@@ -60,12 +54,10 @@ void METHOD_NAME(kCalculateObcGbsa, BornSum_kernel)(unsigned int* workUnit)
float
*
tempBuffer
=
(
float
*
)
&
sA
[
cSim
.
nonbond_threads_per_block
];
float
*
tempBuffer
=
(
float
*
)
&
sA
[
cSim
.
nonbond_threads_per_block
];
#endif
#endif
//while (pos >= 0)
while
(
pos
<
end
)
while
(
pos
<
end
)
{
{
// Extract cell coordinates from appropriate work unit
// Extract cell coordinates from appropriate work unit
//unsigned int x = workUnit[pos + (blockIdx.x*numWorkUnits)/gridDim.x];
unsigned
int
x
=
workUnit
[
pos
];
unsigned
int
x
=
workUnit
[
pos
];
unsigned
int
y
=
((
x
>>
2
)
&
0x7fff
)
<<
GRIDBITS
;
unsigned
int
y
=
((
x
>>
2
)
&
0x7fff
)
<<
GRIDBITS
;
x
=
(
x
>>
17
)
<<
GRIDBITS
;
x
=
(
x
>>
17
)
<<
GRIDBITS
;
...
@@ -162,7 +154,6 @@ void METHOD_NAME(kCalculateObcGbsa, BornSum_kernel)(unsigned int* workUnit)
...
@@ -162,7 +154,6 @@ void METHOD_NAME(kCalculateObcGbsa, BornSum_kernel)(unsigned int* workUnit)
sA
[
threadIdx
.
x
].
sum
=
apos
.
w
=
0
.
0
f
;
sA
[
threadIdx
.
x
].
sum
=
apos
.
w
=
0
.
0
f
;
#ifdef USE_CUTOFF
#ifdef USE_CUTOFF
//unsigned int flags = cSim.pInteractionFlag[pos + (blockIdx.x*numWorkUnits)/gridDim.x];
unsigned
int
flags
=
cSim
.
pInteractionFlag
[
pos
];
unsigned
int
flags
=
cSim
.
pInteractionFlag
[
pos
];
if
(
flags
==
0
)
if
(
flags
==
0
)
{
{
...
@@ -339,8 +330,6 @@ void METHOD_NAME(kCalculateObcGbsa, BornSum_kernel)(unsigned int* workUnit)
...
@@ -339,8 +330,6 @@ void METHOD_NAME(kCalculateObcGbsa, BornSum_kernel)(unsigned int* workUnit)
cSim
.
pBornSum
[
offset
]
=
sA
[
threadIdx
.
x
].
sum
;
cSim
.
pBornSum
[
offset
]
=
sA
[
threadIdx
.
x
].
sum
;
#endif
#endif
}
}
//pos -= cSim.nonbond_workBlock;
pos
++
;
pos
++
;
}
}
}
}
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