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
8d3d9af0
Commit
8d3d9af0
authored
Mar 27, 2011
by
Mark Friedrichs
Browse files
Temp fix for Vdw w/ cutoff
parent
dd218599
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaVdw14_7.cu
...platforms/cuda/src/kernels/kCalculateAmoebaCudaVdw14_7.cu
+19
-6
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaVdw14_7.h
.../platforms/cuda/src/kernels/kCalculateAmoebaCudaVdw14_7.h
+2
-0
No files found.
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaVdw14_7.cu
View file @
8d3d9af0
...
...
@@ -51,6 +51,10 @@ __device__ void zeroVdw14_7SharedForce( struct Vdw14_7Particle* sA )
sA
->
force
[
1
]
=
0.0
f
;
sA
->
force
[
2
]
=
0.0
f
;
sA
->
tempForce
[
0
]
=
0.0
f
;
sA
->
tempForce
[
1
]
=
0.0
f
;
sA
->
tempForce
[
2
]
=
0.0
f
;
}
__device__
void
loadVdw14_7Shared
(
struct
Vdw14_7Particle
*
sA
,
unsigned
int
atomI
,
...
...
@@ -115,6 +119,14 @@ __device__ void calculateVdw14_7PairIxn_kernel( float combindedSigma, float c
float
r2
=
force
[
0
]
*
force
[
0
]
+
force
[
1
]
*
force
[
1
]
+
force
[
2
]
*
force
[
2
];
if
(
r2
>
cAmoebaSim
.
vdwCutoff2
){
*
energy
=
force
[
0
]
=
force
[
1
]
=
force
[
2
]
=
0.0
f
;
#ifdef AMOEBA_DEBUG
float
rI
=
rsqrtf
(
r2
);
float
r
=
1.0
f
/
rI
;
debugArray
[
0
].
x
=
r
;
debugArray
[
0
].
y
=
debugArray
[
0
].
z
=
debugArray
[
0
].
w
=
0.0
f
;
debugArray
[
1
].
x
=
debugArray
[
1
].
y
=
debugArray
[
1
].
z
=
0.0
f
;
debugArray
[
1
].
w
=
r
;
#endif
return
;
}
float
rI
=
rsqrtf
(
r2
);
...
...
@@ -498,10 +510,11 @@ void kCalculateAmoebaVdw14_7Forces( amoebaGpuContext amoebaGpu, int applyCutoff
}
#ifdef AMOEBA_DEBUG
int
paddedNumberOfAtoms
=
amoebaGpu
->
gpuContext
->
sim
.
paddedNumberOfAtoms
;
CUDAStream
<
float4
>*
debugArray
=
new
CUDAStream
<
float4
>
(
paddedNumberOfAtoms
*
paddedNumberOfAtoms
,
1
,
"DebugArray"
);
memset
(
debugArray
->
_pSysData
,
0
,
sizeof
(
float
)
*
4
*
paddedNumberOfAtoms
*
paddedNumberOfAtoms
);
int
maxSlots
=
10
;
CUDAStream
<
float4
>*
debugArray
=
new
CUDAStream
<
float4
>
(
maxSlots
*
paddedNumberOfAtoms
,
1
,
"DebugArray"
);
memset
(
debugArray
->
_pSysData
,
0
,
sizeof
(
float
)
*
4
*
maxSlots
*
paddedNumberOfAtoms
);
debugArray
->
Upload
();
int
targetAtom
=
342
;
int
targetAtom
=
1
;
#endif
#endif
...
...
@@ -706,12 +719,12 @@ void kCalculateAmoebaVdw14_7Forces( amoebaGpuContext amoebaGpu, int applyCutoff
kCalculateAmoebaVdw14_7Reduction
(
amoebaGpu
,
amoebaGpu
->
psWorkArray_3_2
,
amoebaGpu
->
gpuContext
->
psForce4
);
kCalculateAmoebaVdw14_7NonReduction
(
amoebaGpu
,
amoebaGpu
->
psWorkArray_3_2
,
amoebaGpu
->
gpuContext
->
psForce4
);
if
(
0
){
if
(
1
){
int
paddedNumberOfAtoms
=
amoebaGpu
->
gpuContext
->
sim
.
paddedNumberOfAtoms
;
CUDAStream
<
float4
>*
psTempForce
=
new
CUDAStream
<
float4
>
(
paddedNumberOfAtoms
,
1
,
"psTempForce"
);
kClearFloat4
(
amoebaGpu
,
paddedNumberOfAtoms
,
psTempForce
);
kCalculateAmoebaVdw14_7Reduction
(
amoebaGpu
,
amoebaGpu
->
psWorkArray_3_2
,
psTempForce
);
//
kCalculateAmoebaVdw14_7NonReduction( amoebaGpu, amoebaGpu->psWorkArray_3_2, psTempForce );
//
kCalculateAmoebaVdw14_7Reduction( amoebaGpu, amoebaGpu->psWorkArray_3_2, psTempForce );
kCalculateAmoebaVdw14_7NonReduction
(
amoebaGpu
,
amoebaGpu
->
psWorkArray_3_2
,
psTempForce
);
std
::
vector
<
int
>
fileId
;
//fileId.push_back( 0 );
VectorOfDoubleVectors
outputVector
;
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaVdw14_7.h
View file @
8d3d9af0
...
...
@@ -209,6 +209,8 @@ if( atomI == targetAtom || (y+j) == targetAtom ){
#ifdef USE_CUTOFF
unsigned
int
flags
=
cSim
.
pInteractionFlag
[
pos
];
// this should be removed once problem w/ calmodulin is resolved
flags
=
0xFFFFFFFF
;
if
(
flags
==
0
)
{
}
else
{
#endif
...
...
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