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
6eabb453
Unverified
Commit
6eabb453
authored
Jan 10, 2022
by
Peter Eastman
Committed by
GitHub
Jan 10, 2022
Browse files
Fixed uninitialized memory access (#3399)
parent
f5ddd395
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
+12
-4
platforms/common/src/kernels/nonbondedParameters.cc
platforms/common/src/kernels/nonbondedParameters.cc
+2
-2
platforms/cuda/src/CudaKernels.cpp
platforms/cuda/src/CudaKernels.cpp
+5
-1
platforms/opencl/src/OpenCLKernels.cpp
platforms/opencl/src/OpenCLKernels.cpp
+5
-1
No files found.
platforms/common/src/kernels/nonbondedParameters.cc
View file @
6eabb453
...
...
@@ -15,7 +15,7 @@ KERNEL void computeParameters(GLOBAL mixed* RESTRICT energyBuffer, int includeSe
for
(
int
i
=
GLOBAL_ID
;
i
<
numAtoms
;
i
+=
GLOBAL_SIZE
)
{
float4
params
=
baseParticleParams
[
i
];
#ifdef HAS_OFFSETS
#ifdef HAS_
PARTICLE_
OFFSETS
int
start
=
particleOffsetIndices
[
i
],
end
=
particleOffsetIndices
[
i
+
1
];
for
(
int
j
=
start
;
j
<
end
;
j
++
)
{
float4
offset
=
particleParamOffsets
[
j
];
...
...
@@ -47,7 +47,7 @@ KERNEL void computeParameters(GLOBAL mixed* RESTRICT energyBuffer, int includeSe
#ifdef HAS_EXCEPTIONS
for
(
int
i
=
GLOBAL_ID
;
i
<
numExceptions
;
i
+=
GLOBAL_SIZE
)
{
float4
params
=
baseExceptionParams
[
i
];
#ifdef HAS_OFFSETS
#ifdef HAS_
EXCEPTION_
OFFSETS
int
start
=
exceptionOffsetIndices
[
i
],
end
=
exceptionOffsetIndices
[
i
+
1
];
for
(
int
j
=
start
;
j
<
end
;
j
++
)
{
float4
offset
=
exceptionParamOffsets
[
j
];
...
...
platforms/cuda/src/CudaKernels.cpp
View file @
6eabb453
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2008-202
1
Stanford University and the Authors. *
* Portions copyright (c) 2008-202
2
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -670,6 +670,10 @@ void CudaCalcNonbondedForceKernel::initialize(const System& system, const Nonbon
hasOffsets
=
(
force
.
getNumParticleParameterOffsets
()
>
0
||
force
.
getNumExceptionParameterOffsets
()
>
0
);
if
(
hasOffsets
)
paramsDefines
[
"HAS_OFFSETS"
]
=
"1"
;
if
(
force
.
getNumParticleParameterOffsets
()
>
0
)
paramsDefines
[
"HAS_PARTICLE_OFFSETS"
]
=
"1"
;
if
(
force
.
getNumExceptionParameterOffsets
()
>
0
)
paramsDefines
[
"HAS_EXCEPTION_OFFSETS"
]
=
"1"
;
if
(
usePosqCharges
)
paramsDefines
[
"USE_POSQ_CHARGES"
]
=
"1"
;
if
(
doLJPME
)
...
...
platforms/opencl/src/OpenCLKernels.cpp
View file @
6eabb453
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2008-202
1
Stanford University and the Authors. *
* Portions copyright (c) 2008-202
2
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -675,6 +675,10 @@ void OpenCLCalcNonbondedForceKernel::initialize(const System& system, const Nonb
hasOffsets
=
(
force
.
getNumParticleParameterOffsets
()
>
0
||
force
.
getNumExceptionParameterOffsets
()
>
0
);
if
(
hasOffsets
)
paramsDefines
[
"HAS_OFFSETS"
]
=
"1"
;
if
(
force
.
getNumParticleParameterOffsets
()
>
0
)
paramsDefines
[
"HAS_PARTICLE_OFFSETS"
]
=
"1"
;
if
(
force
.
getNumExceptionParameterOffsets
()
>
0
)
paramsDefines
[
"HAS_EXCEPTION_OFFSETS"
]
=
"1"
;
if
(
usePosqCharges
)
paramsDefines
[
"USE_POSQ_CHARGES"
]
=
"1"
;
if
(
doLJPME
)
...
...
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