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
b2c89feb
Commit
b2c89feb
authored
Apr 17, 2009
by
Peter Eastman
Browse files
CUDA platform would fail if you had a GBSAOBCForce but no NonbondedForce.
parent
11eab27d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
8 deletions
+10
-8
platforms/cuda/src/CudaKernels.cpp
platforms/cuda/src/CudaKernels.cpp
+5
-5
platforms/cuda/src/kernels/gpu.cpp
platforms/cuda/src/kernels/gpu.cpp
+4
-2
platforms/cuda/src/kernels/gputypes.h
platforms/cuda/src/kernels/gputypes.h
+1
-1
No files found.
platforms/cuda/src/CudaKernels.cpp
View file @
b2c89feb
...
...
@@ -343,17 +343,17 @@ void CudaCalcGBSAOBCForceKernel::initialize(const System& system, const GBSAOBCF
int
numParticles
=
system
.
getNumParticles
();
_gpuContext
*
gpu
=
data
.
gpu
;
vector
<
int
>
particle
(
numParticles
);
vector
<
float
>
radius
(
numParticles
);
vector
<
float
>
scale
(
numParticles
);
vector
<
float
>
charge
(
numParticles
);
for
(
int
i
=
0
;
i
<
numParticles
;
i
++
)
{
double
charge
,
particleRadius
,
scalingFactor
;
force
.
getParticleParameters
(
i
,
charge
,
particleRadius
,
scalingFactor
);
particle
[
i
]
=
i
;
double
particleCharge
,
particleRadius
,
scalingFactor
;
force
.
getParticleParameters
(
i
,
particleCharge
,
particleRadius
,
scalingFactor
);
radius
[
i
]
=
(
float
)
particleRadius
;
scale
[
i
]
=
(
float
)
scalingFactor
;
charge
[
i
]
=
(
float
)
particleCharge
;
}
gpuSetObcParameters
(
gpu
,
(
float
)
force
.
getSoluteDielectric
(),
(
float
)
force
.
getSolventDielectric
(),
particle
,
radius
,
scale
);
gpuSetObcParameters
(
gpu
,
(
float
)
force
.
getSoluteDielectric
(),
(
float
)
force
.
getSolventDielectric
(),
radius
,
scale
,
charge
);
}
void
CudaCalcGBSAOBCForceKernel
::
executeForces
(
OpenMMContextImpl
&
context
)
{
...
...
platforms/cuda/src/kernels/gpu.cpp
View file @
b2c89feb
...
...
@@ -425,15 +425,16 @@ void gpuSetPeriodicBoxSize(gpuContext gpu, float xsize, float ysize, float zsize
}
extern
"C"
void
gpuSetObcParameters
(
gpuContext
gpu
,
float
innerDielectric
,
float
solventDielectric
,
const
vector
<
int
>&
atom
,
const
vector
<
float
>&
radius
,
const
vector
<
float
>&
scale
)
void
gpuSetObcParameters
(
gpuContext
gpu
,
float
innerDielectric
,
float
solventDielectric
,
const
vector
<
float
>&
radius
,
const
vector
<
float
>&
scale
,
const
vector
<
float
>&
charge
)
{
unsigned
int
atoms
=
atom
.
size
();
unsigned
int
atoms
=
radius
.
size
();
gpu
->
bIncludeGBSA
=
true
;
for
(
unsigned
int
i
=
0
;
i
<
atoms
;
i
++
)
{
(
*
gpu
->
psObcData
)[
i
].
x
=
radius
[
i
]
-
dielectricOffset
;
(
*
gpu
->
psObcData
)[
i
].
y
=
scale
[
i
]
*
(
*
gpu
->
psObcData
)[
i
].
x
;
(
*
gpu
->
psPosq4
)[
i
].
w
=
charge
[
i
];
#if (DUMP_PARAMETERS == 1)
cout
<<
...
...
@@ -453,6 +454,7 @@ void gpuSetObcParameters(gpuContext gpu, float innerDielectric, float solventDie
gpu
->
psBornRadii
->
Upload
();
gpu
->
psObcData
->
Upload
();
gpu
->
psPosq4
->
Upload
();
gpu
->
sim
.
preFactor
=
2.0
f
*
electricConstant
*
((
1.0
f
/
innerDielectric
)
-
(
1.0
f
/
solventDielectric
))
*
gpu
->
sim
.
forceConversionFactor
;
}
...
...
platforms/cuda/src/kernels/gputypes.h
View file @
b2c89feb
...
...
@@ -180,7 +180,7 @@ extern "C"
void
gpuSetPeriodicBoxSize
(
gpuContext
gpu
,
float
xsize
,
float
ysize
,
float
zsize
);
extern
"C"
void
gpuSetObcParameters
(
gpuContext
gpu
,
float
innerDielectric
,
float
solventDielectric
,
const
std
::
vector
<
int
>&
atom
,
const
std
::
vector
<
float
>&
radius
,
const
std
::
vector
<
float
>&
scale
);
void
gpuSetObcParameters
(
gpuContext
gpu
,
float
innerDielectric
,
float
solventDielectric
,
const
std
::
vector
<
float
>&
radius
,
const
std
::
vector
<
float
>&
scale
,
const
std
::
vector
<
float
>&
charge
);
extern
"C"
void
gpuSetConstraintParameters
(
gpuContext
gpu
,
const
std
::
vector
<
int
>&
atom1
,
const
std
::
vector
<
int
>&
atom2
,
const
std
::
vector
<
float
>&
distance
,
...
...
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