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
a170606b
Commit
a170606b
authored
Nov 18, 2009
by
Peter Eastman
Browse files
Fixed some Valgrind warnings
parent
15899649
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
16 deletions
+17
-16
platforms/cuda/src/CudaKernels.cpp
platforms/cuda/src/CudaKernels.cpp
+6
-6
platforms/cuda/src/kernels/cudaKernels.h
platforms/cuda/src/kernels/cudaKernels.h
+3
-3
platforms/cuda/src/kernels/gpu.cpp
platforms/cuda/src/kernels/gpu.cpp
+2
-1
platforms/cuda/src/kernels/kCalculateCustomBondForces.cu
platforms/cuda/src/kernels/kCalculateCustomBondForces.cu
+2
-2
platforms/cuda/src/kernels/kCalculateCustomExternalForces.cu
platforms/cuda/src/kernels/kCalculateCustomExternalForces.cu
+2
-2
platforms/cuda/src/kernels/kCalculateCustomNonbondedForces.cu
...forms/cuda/src/kernels/kCalculateCustomNonbondedForces.cu
+2
-2
No files found.
platforms/cuda/src/CudaKernels.cpp
View file @
a170606b
...
@@ -223,7 +223,7 @@ void CudaCalcCustomBondForceKernel::initialize(const System& system, const Custo
...
@@ -223,7 +223,7 @@ void CudaCalcCustomBondForceKernel::initialize(const System& system, const Custo
}
}
gpuSetCustomBondParameters
(
data
.
gpu
,
particle1
,
particle2
,
params
,
force
.
getEnergyFunction
(),
paramNames
,
globalParamNames
);
gpuSetCustomBondParameters
(
data
.
gpu
,
particle1
,
particle2
,
params
,
force
.
getEnergyFunction
(),
paramNames
,
globalParamNames
);
if
(
globalParamValues
.
size
()
>
0
)
if
(
globalParamValues
.
size
()
>
0
)
SetCustomBondGlobalParams
(
&
globalParamValues
[
0
]
);
SetCustomBondGlobalParams
(
globalParamValues
);
}
}
void
CudaCalcCustomBondForceKernel
::
executeForces
(
ContextImpl
&
context
)
{
void
CudaCalcCustomBondForceKernel
::
executeForces
(
ContextImpl
&
context
)
{
...
@@ -246,7 +246,7 @@ void CudaCalcCustomBondForceKernel::updateGlobalParams(ContextImpl& context) {
...
@@ -246,7 +246,7 @@ void CudaCalcCustomBondForceKernel::updateGlobalParams(ContextImpl& context) {
globalParamValues
[
i
]
=
value
;
globalParamValues
[
i
]
=
value
;
}
}
if
(
changed
)
if
(
changed
)
SetCustomBondGlobalParams
(
&
globalParamValues
[
0
]
);
SetCustomBondGlobalParams
(
globalParamValues
);
}
}
CudaCalcHarmonicAngleForceKernel
::~
CudaCalcHarmonicAngleForceKernel
()
{
CudaCalcHarmonicAngleForceKernel
::~
CudaCalcHarmonicAngleForceKernel
()
{
...
@@ -514,7 +514,7 @@ void CudaCalcCustomNonbondedForceKernel::initialize(const System& system, const
...
@@ -514,7 +514,7 @@ void CudaCalcCustomNonbondedForceKernel::initialize(const System& system, const
}
}
gpuSetCustomNonbondedParameters
(
gpu
,
parameters
,
exclusionList
,
method
,
(
float
)
force
.
getCutoffDistance
(),
force
.
getEnergyFunction
(),
paramNames
,
globalParamNames
);
gpuSetCustomNonbondedParameters
(
gpu
,
parameters
,
exclusionList
,
method
,
(
float
)
force
.
getCutoffDistance
(),
force
.
getEnergyFunction
(),
paramNames
,
globalParamNames
);
if
(
globalParamValues
.
size
()
>
0
)
if
(
globalParamValues
.
size
()
>
0
)
SetCustomNonbondedGlobalParams
(
&
globalParamValues
[
0
]
);
SetCustomNonbondedGlobalParams
(
globalParamValues
);
}
}
void
CudaCalcCustomNonbondedForceKernel
::
executeForces
(
ContextImpl
&
context
)
{
void
CudaCalcCustomNonbondedForceKernel
::
executeForces
(
ContextImpl
&
context
)
{
...
@@ -535,7 +535,7 @@ void CudaCalcCustomNonbondedForceKernel::updateGlobalParams(ContextImpl& context
...
@@ -535,7 +535,7 @@ void CudaCalcCustomNonbondedForceKernel::updateGlobalParams(ContextImpl& context
globalParamValues
[
i
]
=
value
;
globalParamValues
[
i
]
=
value
;
}
}
if
(
changed
)
if
(
changed
)
SetCustomNonbondedGlobalParams
(
&
globalParamValues
[
0
]
);
SetCustomNonbondedGlobalParams
(
globalParamValues
);
}
}
CudaCalcGBSAOBCForceKernel
::~
CudaCalcGBSAOBCForceKernel
()
{
CudaCalcGBSAOBCForceKernel
::~
CudaCalcGBSAOBCForceKernel
()
{
...
@@ -613,7 +613,7 @@ void CudaCalcCustomExternalForceKernel::initialize(const System& system, const C
...
@@ -613,7 +613,7 @@ void CudaCalcCustomExternalForceKernel::initialize(const System& system, const C
}
}
gpuSetCustomExternalParameters
(
data
.
gpu
,
particle
,
params
,
force
.
getEnergyFunction
(),
paramNames
,
globalParamNames
);
gpuSetCustomExternalParameters
(
data
.
gpu
,
particle
,
params
,
force
.
getEnergyFunction
(),
paramNames
,
globalParamNames
);
if
(
globalParamValues
.
size
()
>
0
)
if
(
globalParamValues
.
size
()
>
0
)
SetCustomExternalGlobalParams
(
&
globalParamValues
[
0
]
);
SetCustomExternalGlobalParams
(
globalParamValues
);
}
}
void
CudaCalcCustomExternalForceKernel
::
executeForces
(
ContextImpl
&
context
)
{
void
CudaCalcCustomExternalForceKernel
::
executeForces
(
ContextImpl
&
context
)
{
...
@@ -636,7 +636,7 @@ void CudaCalcCustomExternalForceKernel::updateGlobalParams(ContextImpl& context)
...
@@ -636,7 +636,7 @@ void CudaCalcCustomExternalForceKernel::updateGlobalParams(ContextImpl& context)
globalParamValues
[
i
]
=
value
;
globalParamValues
[
i
]
=
value
;
}
}
if
(
changed
)
if
(
changed
)
SetCustomExternalGlobalParams
(
&
globalParamValues
[
0
]
);
SetCustomExternalGlobalParams
(
globalParamValues
);
}
}
static
void
initializeIntegration
(
const
System
&
system
,
CudaPlatform
::
PlatformData
&
data
,
const
Integrator
&
integrator
)
{
static
void
initializeIntegration
(
const
System
&
system
,
CudaPlatform
::
PlatformData
&
data
,
const
Integrator
&
integrator
)
{
...
...
platforms/cuda/src/kernels/cudaKernels.h
View file @
a170606b
...
@@ -113,10 +113,10 @@ extern void SetRandomSim(gpuContext gpu);
...
@@ -113,10 +113,10 @@ extern void SetRandomSim(gpuContext gpu);
extern
void
GetRandomSim
(
gpuContext
gpu
);
extern
void
GetRandomSim
(
gpuContext
gpu
);
extern
void
SetCustomBondForceExpression
(
const
Expression
<
128
>&
expression
);
extern
void
SetCustomBondForceExpression
(
const
Expression
<
128
>&
expression
);
extern
void
SetCustomBondEnergyExpression
(
const
Expression
<
128
>&
expression
);
extern
void
SetCustomBondEnergyExpression
(
const
Expression
<
128
>&
expression
);
extern
void
SetCustomBondGlobalParams
(
float
*
paramValues
);
extern
void
SetCustomBondGlobalParams
(
const
std
::
vector
<
float
>&
paramValues
);
extern
void
SetCustomExternalForceExpressions
(
const
Expression
<
128
>&
expressionX
,
const
Expression
<
128
>&
expressionY
,
const
Expression
<
128
>&
expressionZ
);
extern
void
SetCustomExternalForceExpressions
(
const
Expression
<
128
>&
expressionX
,
const
Expression
<
128
>&
expressionY
,
const
Expression
<
128
>&
expressionZ
);
extern
void
SetCustomExternalEnergyExpression
(
const
Expression
<
128
>&
expression
);
extern
void
SetCustomExternalEnergyExpression
(
const
Expression
<
128
>&
expression
);
extern
void
SetCustomExternalGlobalParams
(
float
*
paramValues
);
extern
void
SetCustomExternalGlobalParams
(
const
std
::
vector
<
float
>&
paramValues
);
extern
void
SetCustomNonbondedForceExpression
(
const
Expression
<
128
>&
expression
);
extern
void
SetCustomNonbondedForceExpression
(
const
Expression
<
128
>&
expression
);
extern
void
SetCustomNonbondedEnergyExpression
(
const
Expression
<
128
>&
expression
);
extern
void
SetCustomNonbondedEnergyExpression
(
const
Expression
<
128
>&
expression
);
extern
void
SetCustomNonbondedGlobalParams
(
float
*
paramValues
);
extern
void
SetCustomNonbondedGlobalParams
(
const
std
::
vector
<
float
>&
paramValues
);
platforms/cuda/src/kernels/gpu.cpp
View file @
a170606b
...
@@ -1863,6 +1863,7 @@ void* gpuInit(int numAtoms, unsigned int device, bool useBlockingSync)
...
@@ -1863,6 +1863,7 @@ void* gpuInit(int numAtoms, unsigned int device, bool useBlockingSync)
for
(
int
i
=
0
;
i
<
MAX_TABULATED_FUNCTIONS
;
i
++
)
for
(
int
i
=
0
;
i
<
MAX_TABULATED_FUNCTIONS
;
i
++
)
gpu
->
tabulatedFunctions
[
i
].
coefficients
=
NULL
;
gpu
->
tabulatedFunctions
[
i
].
coefficients
=
NULL
;
gpu
->
sim
.
customExpressionStackSize
=
0
;
gpu
->
sim
.
customExpressionStackSize
=
0
;
gpu
->
sim
.
customBonds
=
0
;
// Initialize output buffer before reading parameters
// Initialize output buffer before reading parameters
gpu
->
pOutputBufferCounter
=
new
unsigned
int
[
gpu
->
sim
.
paddedNumberOfAtoms
];
gpu
->
pOutputBufferCounter
=
new
unsigned
int
[
gpu
->
sim
.
paddedNumberOfAtoms
];
...
...
platforms/cuda/src/kernels/kCalculateCustomBondForces.cu
View file @
a170606b
...
@@ -70,10 +70,10 @@ void SetCustomBondEnergyExpression(const Expression<128>& expression)
...
@@ -70,10 +70,10 @@ void SetCustomBondEnergyExpression(const Expression<128>& expression)
RTERROR
(
status
,
"SetCustomBondEnergyExpression: cudaMemcpyToSymbol failed"
);
RTERROR
(
status
,
"SetCustomBondEnergyExpression: cudaMemcpyToSymbol failed"
);
}
}
void
SetCustomBondGlobalParams
(
float
*
paramValues
)
void
SetCustomBondGlobalParams
(
const
vector
<
float
>&
paramValues
)
{
{
cudaError_t
status
;
cudaError_t
status
;
status
=
cudaMemcpyToSymbol
(
globalParams
,
paramValues
,
sizeof
(
g
lo
balParams
));
status
=
cudaMemcpyToSymbol
(
globalParams
,
&
paramValues
[
0
],
paramValues
.
size
()
*
sizeof
(
f
lo
at
));
RTERROR
(
status
,
"SetCustomBondGlobalParams: cudaMemcpyToSymbol failed"
);
RTERROR
(
status
,
"SetCustomBondGlobalParams: cudaMemcpyToSymbol failed"
);
}
}
...
...
platforms/cuda/src/kernels/kCalculateCustomExternalForces.cu
View file @
a170606b
...
@@ -74,10 +74,10 @@ void SetCustomExternalEnergyExpression(const Expression<128>& expression)
...
@@ -74,10 +74,10 @@ void SetCustomExternalEnergyExpression(const Expression<128>& expression)
RTERROR
(
status
,
"SetCustomExternalEnergyExpression: cudaMemcpyToSymbol failed"
);
RTERROR
(
status
,
"SetCustomExternalEnergyExpression: cudaMemcpyToSymbol failed"
);
}
}
void
SetCustomExternalGlobalParams
(
float
*
paramValues
)
void
SetCustomExternalGlobalParams
(
const
vector
<
float
>&
paramValues
)
{
{
cudaError_t
status
;
cudaError_t
status
;
status
=
cudaMemcpyToSymbol
(
globalParams
,
paramValues
,
sizeof
(
g
lo
balParams
));
status
=
cudaMemcpyToSymbol
(
globalParams
,
&
paramValues
[
0
],
paramValues
.
size
()
*
sizeof
(
f
lo
at
));
RTERROR
(
status
,
"SetCustomExternalGlobalParams: cudaMemcpyToSymbol failed"
);
RTERROR
(
status
,
"SetCustomExternalGlobalParams: cudaMemcpyToSymbol failed"
);
}
}
...
...
platforms/cuda/src/kernels/kCalculateCustomNonbondedForces.cu
View file @
a170606b
...
@@ -83,10 +83,10 @@ void SetCustomNonbondedEnergyExpression(const Expression<128>& expression)
...
@@ -83,10 +83,10 @@ void SetCustomNonbondedEnergyExpression(const Expression<128>& expression)
RTERROR
(
status
,
"SetCustomNonbondedEnergyExpression: cudaMemcpyToSymbol failed"
);
RTERROR
(
status
,
"SetCustomNonbondedEnergyExpression: cudaMemcpyToSymbol failed"
);
}
}
void
SetCustomNonbondedGlobalParams
(
float
*
paramValues
)
void
SetCustomNonbondedGlobalParams
(
const
vector
<
float
>&
paramValues
)
{
{
cudaError_t
status
;
cudaError_t
status
;
status
=
cudaMemcpyToSymbol
(
globalParams
,
paramValues
,
sizeof
(
g
lo
balParams
));
status
=
cudaMemcpyToSymbol
(
globalParams
,
&
paramValues
[
0
],
paramValues
.
size
()
*
sizeof
(
f
lo
at
));
RTERROR
(
status
,
"SetCustomNonbondedGlobalParams: cudaMemcpyToSymbol failed"
);
RTERROR
(
status
,
"SetCustomNonbondedGlobalParams: cudaMemcpyToSymbol failed"
);
}
}
...
...
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