Unverified Commit cea03eea authored by peastman's avatar peastman Committed by GitHub
Browse files

Fixed uninitialized memory (#2819)

parent cdc0789a
...@@ -1174,6 +1174,8 @@ void CudaCalcNonbondedForceKernel::initialize(const System& system, const Nonbon ...@@ -1174,6 +1174,8 @@ void CudaCalcNonbondedForceKernel::initialize(const System& system, const Nonbon
exceptionOffsetIndices.upload(exceptionOffsetIndicesVec); exceptionOffsetIndices.upload(exceptionOffsetIndicesVec);
} }
globalParams.initialize(cu, max((int) paramValues.size(), 1), cu.getUseDoublePrecision() ? sizeof(double) : sizeof(float), "globalParams"); globalParams.initialize(cu, max((int) paramValues.size(), 1), cu.getUseDoublePrecision() ? sizeof(double) : sizeof(float), "globalParams");
if (paramValues.size() > 0)
globalParams.upload(paramValues, true);
recomputeParams = true; recomputeParams = true;
// Initialize the kernel for updating parameters. // Initialize the kernel for updating parameters.
......
...@@ -1124,6 +1124,8 @@ void OpenCLCalcNonbondedForceKernel::initialize(const System& system, const Nonb ...@@ -1124,6 +1124,8 @@ void OpenCLCalcNonbondedForceKernel::initialize(const System& system, const Nonb
exceptionOffsetIndices.upload(exceptionOffsetIndicesVec); exceptionOffsetIndices.upload(exceptionOffsetIndicesVec);
} }
globalParams.initialize(cl, max((int) paramValues.size(), 1), cl.getUseDoublePrecision() ? sizeof(double) : sizeof(float), "globalParams"); globalParams.initialize(cl, max((int) paramValues.size(), 1), cl.getUseDoublePrecision() ? sizeof(double) : sizeof(float), "globalParams");
if (paramValues.size() > 0)
globalParams.upload(paramValues, true);
recomputeParams = true; recomputeParams = true;
// Initialize the kernel for updating parameters. // Initialize the kernel for updating parameters.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment