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
394d29a8
Commit
394d29a8
authored
Oct 28, 2009
by
Peter Eastman
Browse files
Fixed compilation warnings under Windows
parent
53b4e664
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
platforms/cuda/src/CudaKernels.cpp
platforms/cuda/src/CudaKernels.cpp
+4
-4
platforms/cuda/src/kernels/gpu.cpp
platforms/cuda/src/kernels/gpu.cpp
+8
-8
No files found.
platforms/cuda/src/CudaKernels.cpp
View file @
394d29a8
...
@@ -481,7 +481,7 @@ void CudaCalcCustomNonbondedForceKernel::initialize(const System& system, const
...
@@ -481,7 +481,7 @@ void CudaCalcCustomNonbondedForceKernel::initialize(const System& system, const
globalParamValues
.
resize
(
force
.
getNumGlobalParameters
());
globalParamValues
.
resize
(
force
.
getNumGlobalParameters
());
for
(
int
i
=
0
;
i
<
force
.
getNumGlobalParameters
();
i
++
)
{
for
(
int
i
=
0
;
i
<
force
.
getNumGlobalParameters
();
i
++
)
{
globalParamNames
[
i
]
=
force
.
getGlobalParameterName
(
i
);
globalParamNames
[
i
]
=
force
.
getGlobalParameterName
(
i
);
globalParamValues
[
i
]
=
force
.
getGlobalParameterDefaultValue
(
i
);
globalParamValues
[
i
]
=
(
float
)
force
.
getGlobalParameterDefaultValue
(
i
);
}
}
gpuSetCustomNonbondedParameters
(
gpu
,
parameters
,
exclusionList
,
exceptionParticle1
,
exceptionParticle2
,
exceptionParams
,
method
,
gpuSetCustomNonbondedParameters
(
gpu
,
parameters
,
exclusionList
,
exceptionParticle1
,
exceptionParticle2
,
exceptionParams
,
method
,
(
float
)
force
.
getCutoffDistance
(),
force
.
getEnergyFunction
(),
combiningRules
,
paramNames
,
globalParamNames
);
(
float
)
force
.
getCutoffDistance
(),
force
.
getEnergyFunction
(),
combiningRules
,
paramNames
,
globalParamNames
);
...
@@ -500,7 +500,7 @@ double CudaCalcCustomNonbondedForceKernel::executeEnergy(ContextImpl& context) {
...
@@ -500,7 +500,7 @@ double CudaCalcCustomNonbondedForceKernel::executeEnergy(ContextImpl& context) {
void
CudaCalcCustomNonbondedForceKernel
::
updateGlobalParams
(
ContextImpl
&
context
)
{
void
CudaCalcCustomNonbondedForceKernel
::
updateGlobalParams
(
ContextImpl
&
context
)
{
bool
changed
=
false
;
bool
changed
=
false
;
for
(
int
i
=
0
;
i
<
globalParamNames
.
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
(
int
)
globalParamNames
.
size
();
i
++
)
{
float
value
=
(
float
)
context
.
getParameter
(
globalParamNames
[
i
]);
float
value
=
(
float
)
context
.
getParameter
(
globalParamNames
[
i
]);
if
(
value
!=
globalParamValues
[
i
])
if
(
value
!=
globalParamValues
[
i
])
changed
=
true
;
changed
=
true
;
...
@@ -761,7 +761,7 @@ void CudaIntegrateVariableLangevinStepKernel::execute(ContextImpl& context, cons
...
@@ -761,7 +761,7 @@ void CudaIntegrateVariableLangevinStepKernel::execute(ContextImpl& context, cons
// Initialize the GPU parameters.
// Initialize the GPU parameters.
double
tau
=
(
friction
==
0.0
?
0.0
:
1.0
/
friction
);
double
tau
=
(
friction
==
0.0
?
0.0
:
1.0
/
friction
);
gpuSetLangevinIntegrationParameters
(
gpu
,
(
float
)
tau
,
0.0
f
,
(
float
)
temperature
,
errorTol
);
gpuSetLangevinIntegrationParameters
(
gpu
,
(
float
)
tau
,
0.0
f
,
(
float
)
temperature
,
(
float
)
errorTol
);
gpuSetConstants
(
gpu
);
gpuSetConstants
(
gpu
);
kGenerateRandoms
(
gpu
);
kGenerateRandoms
(
gpu
);
prevTemp
=
temperature
;
prevTemp
=
temperature
;
...
@@ -806,7 +806,7 @@ void CudaApplyAndersenThermostatKernel::execute(ContextImpl& context) {
...
@@ -806,7 +806,7 @@ void CudaApplyAndersenThermostatKernel::execute(ContextImpl& context) {
if
(
temperature
!=
prevTemp
||
frequency
!=
prevFrequency
||
stepSize
!=
prevStepSize
)
{
if
(
temperature
!=
prevTemp
||
frequency
!=
prevFrequency
||
stepSize
!=
prevStepSize
)
{
// Initialize the GPU parameters.
// Initialize the GPU parameters.
gpuSetAndersenThermostatParameters
(
gpu
,
(
float
)
temperature
,
frequency
);
gpuSetAndersenThermostatParameters
(
gpu
,
(
float
)
temperature
,
(
float
)
frequency
);
gpuSetConstants
(
gpu
);
gpuSetConstants
(
gpu
);
kGenerateRandoms
(
gpu
);
kGenerateRandoms
(
gpu
);
prevTemp
=
temperature
;
prevTemp
=
temperature
;
...
...
platforms/cuda/src/kernels/gpu.cpp
View file @
394d29a8
...
@@ -712,7 +712,7 @@ void gpuSetCustomNonbondedParameters(gpuContext gpu, const vector<vector<double>
...
@@ -712,7 +712,7 @@ void gpuSetCustomNonbondedParameters(gpuContext gpu, const vector<vector<double>
for
(
int
i
=
0
;
i
<
MAX_TABULATED_FUNCTIONS
;
i
++
)
{
for
(
int
i
=
0
;
i
<
MAX_TABULATED_FUNCTIONS
;
i
++
)
{
gpuTabulatedFunction
&
func
=
gpu
->
tabulatedFunctions
[
i
];
gpuTabulatedFunction
&
func
=
gpu
->
tabulatedFunctions
[
i
];
if
(
func
.
coefficients
!=
NULL
)
{
if
(
func
.
coefficients
!=
NULL
)
{
(
*
gpu
->
psTabulatedFunctionParams
)[
i
]
=
make_float4
(
func
.
min
,
func
.
max
,
func
.
coefficients
->
_length
/
(
func
.
max
-
func
.
min
),
0.0
f
);
(
*
gpu
->
psTabulatedFunctionParams
)[
i
]
=
make_float4
(
(
float
)
func
.
min
,
(
float
)
func
.
max
,
(
float
)
(
func
.
coefficients
->
_length
/
(
func
.
max
-
func
.
min
)
)
,
0.0
f
);
functions
[
func
.
name
]
=
fp
;
functions
[
func
.
name
]
=
fp
;
}
}
}
}
...
@@ -722,7 +722,7 @@ void gpuSetCustomNonbondedParameters(gpuContext gpu, const vector<vector<double>
...
@@ -722,7 +722,7 @@ void gpuSetCustomNonbondedParameters(gpuContext gpu, const vector<vector<double>
vector
<
string
>
variables
;
vector
<
string
>
variables
;
variables
.
push_back
(
"r"
);
variables
.
push_back
(
"r"
);
for
(
int
i
=
0
;
i
<
paramNames
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
(
int
)
paramNames
.
size
();
i
++
)
variables
.
push_back
(
paramNames
[
i
]);
variables
.
push_back
(
paramNames
[
i
]);
gpu
->
sim
.
customExpressionStackSize
=
0
;
gpu
->
sim
.
customExpressionStackSize
=
0
;
SetCustomNonbondedEnergyExpression
(
createExpression
<
128
>
(
gpu
,
energyExp
,
Lepton
::
Parser
::
parse
(
energyExp
,
functions
).
optimize
().
createProgram
(),
variables
,
globalParamNames
,
gpu
->
sim
.
customExpressionStackSize
));
SetCustomNonbondedEnergyExpression
(
createExpression
<
128
>
(
gpu
,
energyExp
,
Lepton
::
Parser
::
parse
(
energyExp
,
functions
).
optimize
().
createProgram
(),
variables
,
globalParamNames
,
gpu
->
sim
.
customExpressionStackSize
));
...
@@ -730,7 +730,7 @@ void gpuSetCustomNonbondedParameters(gpuContext gpu, const vector<vector<double>
...
@@ -730,7 +730,7 @@ void gpuSetCustomNonbondedParameters(gpuContext gpu, const vector<vector<double>
Expression
<
64
>
paramExpressions
[
4
];
Expression
<
64
>
paramExpressions
[
4
];
vector
<
string
>
combiningRuleParams
;
vector
<
string
>
combiningRuleParams
;
for
(
int
j
=
1
;
j
<
3
;
j
++
)
{
for
(
int
j
=
1
;
j
<
3
;
j
++
)
{
for
(
int
i
=
0
;
i
<
paramNames
.
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
(
int
)
paramNames
.
size
();
i
++
)
{
stringstream
name
;
stringstream
name
;
name
<<
paramNames
[
i
]
<<
j
;
name
<<
paramNames
[
i
]
<<
j
;
combiningRuleParams
.
push_back
(
name
.
str
());
combiningRuleParams
.
push_back
(
name
.
str
());
...
@@ -738,7 +738,7 @@ void gpuSetCustomNonbondedParameters(gpuContext gpu, const vector<vector<double>
...
@@ -738,7 +738,7 @@ void gpuSetCustomNonbondedParameters(gpuContext gpu, const vector<vector<double>
for
(
int
i
=
paramNames
.
size
();
i
<
4
;
i
++
)
for
(
int
i
=
paramNames
.
size
();
i
<
4
;
i
++
)
combiningRuleParams
.
push_back
(
""
);
combiningRuleParams
.
push_back
(
""
);
}
}
for
(
int
i
=
0
;
i
<
paramNames
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
(
int
)
paramNames
.
size
();
i
++
)
paramExpressions
[
i
]
=
createExpression
<
64
>
(
gpu
,
combiningRules
[
i
],
Lepton
::
Parser
::
parse
(
combiningRules
[
i
],
functions
).
optimize
().
createProgram
(),
combiningRuleParams
,
globalParamNames
,
gpu
->
sim
.
customExpressionStackSize
);
paramExpressions
[
i
]
=
createExpression
<
64
>
(
gpu
,
combiningRules
[
i
],
Lepton
::
Parser
::
parse
(
combiningRules
[
i
],
functions
).
optimize
().
createProgram
(),
combiningRuleParams
,
globalParamNames
,
gpu
->
sim
.
customExpressionStackSize
);
SetCustomNonbondedCombiningRules
(
paramExpressions
);
SetCustomNonbondedCombiningRules
(
paramExpressions
);
delete
fp
;
delete
fp
;
...
@@ -846,12 +846,12 @@ void gpuSetPMEParameters(gpuContext gpu, float alpha, int gridSizeX, int gridSiz
...
@@ -846,12 +846,12 @@ void gpuSetPMEParameters(gpuContext gpu, float alpha, int gridSizeX, int gridSiz
sc
+=
bsplines_data
[
j
]
*
cos
(
arg
);
sc
+=
bsplines_data
[
j
]
*
cos
(
arg
);
ss
+=
bsplines_data
[
j
]
*
sin
(
arg
);
ss
+=
bsplines_data
[
j
]
*
sin
(
arg
);
}
}
(
*
gpu
->
psPmeBsplineModuli
[
dim
])[
i
]
=
sc
*
sc
+
ss
*
ss
;
(
*
gpu
->
psPmeBsplineModuli
[
dim
])[
i
]
=
(
float
)
(
sc
*
sc
+
ss
*
ss
)
;
}
}
for
(
int
i
=
0
;
i
<
ndata
;
i
++
)
for
(
int
i
=
0
;
i
<
ndata
;
i
++
)
{
{
if
((
*
gpu
->
psPmeBsplineModuli
[
dim
])[
i
]
<
1.0e-7
)
if
((
*
gpu
->
psPmeBsplineModuli
[
dim
])[
i
]
<
1.0e-7
)
(
*
gpu
->
psPmeBsplineModuli
[
dim
])[
i
]
=
((
*
gpu
->
psPmeBsplineModuli
[
dim
])[
i
-
1
]
+
(
*
gpu
->
psPmeBsplineModuli
[
dim
])[
i
+
1
])
*
0.5
;
(
*
gpu
->
psPmeBsplineModuli
[
dim
])[
i
]
=
((
*
gpu
->
psPmeBsplineModuli
[
dim
])[
i
-
1
]
+
(
*
gpu
->
psPmeBsplineModuli
[
dim
])[
i
+
1
])
*
0.5
f
;
}
}
gpu
->
psPmeBsplineModuli
[
dim
]
->
Upload
();
gpu
->
psPmeBsplineModuli
[
dim
]
->
Upload
();
}
}
...
@@ -1146,7 +1146,7 @@ void gpuSetConstraintParameters(gpuContext gpu, const vector<int>& atom1, const
...
@@ -1146,7 +1146,7 @@ void gpuSetConstraintParameters(gpuContext gpu, const vector<int>& atom1, const
// Compute the constraint coupling matrix
// Compute the constraint coupling matrix
vector
<
vector
<
int
>
>
atomAngles
(
gpu
->
natoms
);
vector
<
vector
<
int
>
>
atomAngles
(
gpu
->
natoms
);
for
(
int
i
=
0
;
i
<
gpu
->
sim
.
bond_angles
;
i
++
)
for
(
int
i
=
0
;
i
<
(
int
)
gpu
->
sim
.
bond_angles
;
i
++
)
atomAngles
[(
*
gpu
->
psBondAngleID1
)[
i
].
y
].
push_back
(
i
);
atomAngles
[(
*
gpu
->
psBondAngleID1
)[
i
].
y
].
push_back
(
i
);
vector
<
vector
<
pair
<
int
,
double
>
>
>
matrix
(
numCCMA
);
vector
<
vector
<
pair
<
int
,
double
>
>
>
matrix
(
numCCMA
);
if
(
numCCMA
>
0
)
{
if
(
numCCMA
>
0
)
{
...
@@ -1320,7 +1320,7 @@ void gpuSetConstraintParameters(gpuContext gpu, const vector<int>& atom1, const
...
@@ -1320,7 +1320,7 @@ void gpuSetConstraintParameters(gpuContext gpu, const vector<int>& atom1, const
(
*
psCcmaReducedMass
)[
i
]
=
0.5
f
/
(
invMass1
[
c
]
+
invMass2
[
c
]);
(
*
psCcmaReducedMass
)[
i
]
=
0.5
f
/
(
invMass1
[
c
]
+
invMass2
[
c
]);
for
(
unsigned
int
j
=
0
;
j
<
matrix
[
index
].
size
();
j
++
)
{
for
(
unsigned
int
j
=
0
;
j
<
matrix
[
index
].
size
();
j
++
)
{
(
*
psConstraintMatrixColumn
)[
i
+
j
*
numCCMA
]
=
matrix
[
index
][
j
].
first
;
(
*
psConstraintMatrixColumn
)[
i
+
j
*
numCCMA
]
=
matrix
[
index
][
j
].
first
;
(
*
psConstraintMatrixValue
)[
i
+
j
*
numCCMA
]
=
matrix
[
index
][
j
].
second
;
(
*
psConstraintMatrixValue
)[
i
+
j
*
numCCMA
]
=
(
float
)
matrix
[
index
][
j
].
second
;
}
}
(
*
psConstraintMatrixColumn
)[
i
+
matrix
[
index
].
size
()
*
numCCMA
]
=
numCCMA
;
(
*
psConstraintMatrixColumn
)[
i
+
matrix
[
index
].
size
()
*
numCCMA
]
=
numCCMA
;
}
}
...
...
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