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
d0f8db59
Commit
d0f8db59
authored
Sep 03, 2013
by
peastman
Browse files
Fixed compilation error when total system mass is 0
parent
61ea4d43
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
platforms/cuda/src/CudaKernels.cpp
platforms/cuda/src/CudaKernels.cpp
+1
-1
platforms/opencl/src/OpenCLKernels.cpp
platforms/opencl/src/OpenCLKernels.cpp
+1
-1
No files found.
platforms/cuda/src/CudaKernels.cpp
View file @
d0f8db59
...
...
@@ -5752,7 +5752,7 @@ void CudaRemoveCMMotionKernel::initialize(const System& system, const CMMotionRe
for
(
int
i
=
0
;
i
<
numAtoms
;
i
++
)
totalMass
+=
system
.
getParticleMass
(
i
);
map
<
string
,
string
>
defines
;
defines
[
"INVERSE_TOTAL_MASS"
]
=
cu
.
doubleToString
(
1.0
/
totalMass
);
defines
[
"INVERSE_TOTAL_MASS"
]
=
cu
.
doubleToString
(
totalMass
==
0
?
0.0
:
1.0
/
totalMass
);
CUmodule
module
=
cu
.
createModule
(
CudaKernelSources
::
removeCM
,
defines
);
kernel1
=
cu
.
getKernel
(
module
,
"calcCenterOfMassMomentum"
);
kernel2
=
cu
.
getKernel
(
module
,
"removeCenterOfMassMomentum"
);
...
...
platforms/opencl/src/OpenCLKernels.cpp
View file @
d0f8db59
...
...
@@ -5978,7 +5978,7 @@ void OpenCLRemoveCMMotionKernel::initialize(const System& system, const CMMotion
for
(
int
i
=
0
;
i
<
numAtoms
;
i
++
)
totalMass
+=
system
.
getParticleMass
(
i
);
map
<
string
,
string
>
defines
;
defines
[
"INVERSE_TOTAL_MASS"
]
=
cl
.
doubleToString
(
1.0
/
totalMass
);
defines
[
"INVERSE_TOTAL_MASS"
]
=
cl
.
doubleToString
(
totalMass
==
0
?
0.0
:
1.0
/
totalMass
);
cl
::
Program
program
=
cl
.
createProgram
(
OpenCLKernelSources
::
removeCM
,
defines
);
kernel1
=
cl
::
Kernel
(
program
,
"calcCenterOfMassMomentum"
);
kernel1
.
setArg
<
cl_int
>
(
0
,
numAtoms
);
...
...
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