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
9fffe6da
Commit
9fffe6da
authored
Sep 07, 2012
by
Yutong Zhao
Browse files
fixed sigmaEpsilon padding errors. Gets rid of computeNonbonded cuda-memcheck errors
parent
01235988
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
platforms/cuda2/src/CudaKernels.cpp
platforms/cuda2/src/CudaKernels.cpp
+3
-3
platforms/opencl/src/OpenCLKernels.cpp
platforms/opencl/src/OpenCLKernels.cpp
+3
-3
No files found.
platforms/cuda2/src/CudaKernels.cpp
View file @
9fffe6da
...
@@ -1343,11 +1343,11 @@ void CudaCalcNonbondedForceKernel::initialize(const System& system, const Nonbon
...
@@ -1343,11 +1343,11 @@ void CudaCalcNonbondedForceKernel::initialize(const System& system, const Nonbon
// Initialize nonbonded interactions.
// Initialize nonbonded interactions.
int
numParticles
=
force
.
getNumParticles
();
int
numParticles
=
force
.
getNumParticles
();
sigmaEpsilon
=
CudaArray
::
create
<
float2
>
(
cu
,
numParticles
,
"sigmaEpsilon"
);
sigmaEpsilon
=
CudaArray
::
create
<
float2
>
(
cu
,
cu
.
getPaddedNumAtoms
()
,
"sigmaEpsilon"
);
CudaArray
&
posq
=
cu
.
getPosq
();
CudaArray
&
posq
=
cu
.
getPosq
();
float4
*
posqf
=
(
float4
*
)
cu
.
getPinnedBuffer
();
float4
*
posqf
=
(
float4
*
)
cu
.
getPinnedBuffer
();
double4
*
posqd
=
(
double4
*
)
cu
.
getPinnedBuffer
();
double4
*
posqd
=
(
double4
*
)
cu
.
getPinnedBuffer
();
vector
<
float2
>
sigmaEpsilonVector
(
numParticles
);
vector
<
float2
>
sigmaEpsilonVector
(
cu
.
getPaddedNumAtoms
()
);
vector
<
vector
<
int
>
>
exclusionList
(
numParticles
);
vector
<
vector
<
int
>
>
exclusionList
(
numParticles
);
double
sumSquaredCharges
=
0.0
;
double
sumSquaredCharges
=
0.0
;
hasCoulomb
=
false
;
hasCoulomb
=
false
;
...
@@ -1654,7 +1654,7 @@ void CudaCalcNonbondedForceKernel::copyParametersToContext(ContextImpl& context,
...
@@ -1654,7 +1654,7 @@ void CudaCalcNonbondedForceKernel::copyParametersToContext(ContextImpl& context,
posq
.
download
(
cu
.
getPinnedBuffer
());
posq
.
download
(
cu
.
getPinnedBuffer
());
float4
*
posqf
=
(
float4
*
)
cu
.
getPinnedBuffer
();
float4
*
posqf
=
(
float4
*
)
cu
.
getPinnedBuffer
();
double4
*
posqd
=
(
double4
*
)
cu
.
getPinnedBuffer
();
double4
*
posqd
=
(
double4
*
)
cu
.
getPinnedBuffer
();
vector
<
float2
>
sigmaEpsilonVector
(
force
.
getNumParticle
s
());
vector
<
float2
>
sigmaEpsilonVector
(
cu
.
getPaddedNumAtom
s
());
double
sumSquaredCharges
=
0.0
;
double
sumSquaredCharges
=
0.0
;
const
vector
<
int
>&
order
=
cu
.
getAtomIndex
();
const
vector
<
int
>&
order
=
cu
.
getAtomIndex
();
for
(
int
i
=
0
;
i
<
force
.
getNumParticles
();
i
++
)
{
for
(
int
i
=
0
;
i
<
force
.
getNumParticles
();
i
++
)
{
...
...
platforms/opencl/src/OpenCLKernels.cpp
View file @
9fffe6da
...
@@ -1229,9 +1229,9 @@ void OpenCLCalcNonbondedForceKernel::initialize(const System& system, const Nonb
...
@@ -1229,9 +1229,9 @@ void OpenCLCalcNonbondedForceKernel::initialize(const System& system, const Nonb
// Initialize nonbonded interactions.
// Initialize nonbonded interactions.
int
numParticles
=
force
.
getNumParticles
();
int
numParticles
=
force
.
getNumParticles
();
sigmaEpsilon
=
new
OpenCLArray
<
mm_float2
>
(
cl
,
numParticles
,
"sigmaEpsilon"
);
sigmaEpsilon
=
new
OpenCLArray
<
mm_float2
>
(
cl
,
cl
.
getPaddedNumAtoms
()
,
"sigmaEpsilon"
);
OpenCLArray
<
mm_float4
>&
posq
=
cl
.
getPosq
();
OpenCLArray
<
mm_float4
>&
posq
=
cl
.
getPosq
();
vector
<
mm_float2
>
sigmaEpsilonVector
(
numParticles
);
vector
<
mm_float2
>
sigmaEpsilonVector
(
cl
.
getPaddedNumAtoms
()
);
vector
<
vector
<
int
>
>
exclusionList
(
numParticles
);
vector
<
vector
<
int
>
>
exclusionList
(
numParticles
);
double
sumSquaredCharges
=
0.0
;
double
sumSquaredCharges
=
0.0
;
hasCoulomb
=
false
;
hasCoulomb
=
false
;
...
@@ -1579,7 +1579,7 @@ void OpenCLCalcNonbondedForceKernel::copyParametersToContext(ContextImpl& contex
...
@@ -1579,7 +1579,7 @@ void OpenCLCalcNonbondedForceKernel::copyParametersToContext(ContextImpl& contex
OpenCLArray
<
mm_float4
>&
posq
=
cl
.
getPosq
();
OpenCLArray
<
mm_float4
>&
posq
=
cl
.
getPosq
();
posq
.
download
();
posq
.
download
();
vector
<
mm_float2
>
sigmaEpsilonVector
(
force
.
getNumParticle
s
());
vector
<
mm_float2
>
sigmaEpsilonVector
(
cl
.
getPaddedNumAtom
s
());
double
sumSquaredCharges
=
0.0
;
double
sumSquaredCharges
=
0.0
;
OpenCLArray
<
cl_int
>&
order
=
cl
.
getAtomIndex
();
OpenCLArray
<
cl_int
>&
order
=
cl
.
getAtomIndex
();
for
(
int
i
=
0
;
i
<
force
.
getNumParticles
();
i
++
)
{
for
(
int
i
=
0
;
i
<
force
.
getNumParticles
();
i
++
)
{
...
...
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