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
613bd77b
Commit
613bd77b
authored
Mar 27, 2013
by
Peter Eastman
Browse files
Fixed errors in mixed precision mode
parent
00e0bb96
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
platforms/opencl/src/kernels/andersenThermostat.cl
platforms/opencl/src/kernels/andersenThermostat.cl
+1
-1
platforms/opencl/src/kernels/brownian.cl
platforms/opencl/src/kernels/brownian.cl
+3
-3
No files found.
platforms/opencl/src/kernels/andersenThermostat.cl
View file @
613bd77b
...
@@ -11,7 +11,7 @@ __kernel void applyAndersenThermostat(float collisionFrequency, float kT, __glob
...
@@ -11,7 +11,7 @@ __kernel void applyAndersenThermostat(float collisionFrequency, float kT, __glob
float4
selectRand
=
random[randomIndex+atomGroups[index]]
;
float4
selectRand
=
random[randomIndex+atomGroups[index]]
;
float4
velRand
=
random[randomIndex+index]
;
float4
velRand
=
random[randomIndex+index]
;
real
scale
=
(
selectRand.w
>
-randomRange
&&
selectRand.w
<
randomRange
?
0
:
1
)
;
real
scale
=
(
selectRand.w
>
-randomRange
&&
selectRand.w
<
randomRange
?
0
:
1
)
;
real
add
=
(
1-scale
)
*
SQRT
(
kT*velocity.w
)
;
real
add
=
(
1-scale
)
*
sqrt
(
kT*velocity.w
)
;
velocity.x
=
scale*velocity.x
+
add*velRand.x
;
velocity.x
=
scale*velocity.x
+
add*velRand.x
;
velocity.y
=
scale*velocity.y
+
add*velRand.y
;
velocity.y
=
scale*velocity.y
+
add*velRand.y
;
velocity.z
=
scale*velocity.z
+
add*velRand.z
;
velocity.z
=
scale*velocity.z
+
add*velRand.z
;
...
...
platforms/opencl/src/kernels/brownian.cl
View file @
613bd77b
...
@@ -8,9 +8,9 @@ __kernel void integrateBrownianPart1(mixed tauDeltaT, mixed noiseAmplitude, __gl
...
@@ -8,9 +8,9 @@ __kernel void integrateBrownianPart1(mixed tauDeltaT, mixed noiseAmplitude, __gl
for
(
int
index
=
get_global_id
(
0
)
; index < NUM_ATOMS; index += get_global_size(0)) {
for
(
int
index
=
get_global_id
(
0
)
; index < NUM_ATOMS; index += get_global_size(0)) {
mixed
invMass
=
velm[index].w
;
mixed
invMass
=
velm[index].w
;
if
(
invMass
!=
0
)
{
if
(
invMass
!=
0
)
{
posDelta[index]
=
(
mixed4
)
(
tauDeltaT*invMass*force[index].x
+
noiseAmplitude*
SQRT
(
invMass
)
*random[randomIndex].x,
posDelta[index]
=
(
mixed4
)
(
tauDeltaT*invMass*force[index].x
+
noiseAmplitude*
sqrt
(
invMass
)
*random[randomIndex].x,
tauDeltaT*invMass*force[index].y
+
noiseAmplitude*
SQRT
(
invMass
)
*random[randomIndex].y,
tauDeltaT*invMass*force[index].y
+
noiseAmplitude*
sqrt
(
invMass
)
*random[randomIndex].y,
tauDeltaT*invMass*force[index].z
+
noiseAmplitude*
SQRT
(
invMass
)
*random[randomIndex].z,
0
)
;
tauDeltaT*invMass*force[index].z
+
noiseAmplitude*
sqrt
(
invMass
)
*random[randomIndex].z,
0
)
;
}
}
randomIndex
+=
get_global_size
(
0
)
;
randomIndex
+=
get_global_size
(
0
)
;
}
}
...
...
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