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
852bfaea
Commit
852bfaea
authored
May 06, 2009
by
Peter Eastman
Browse files
Fixed a bug in random number generation for the CUDA platform. Updated test cases.
parent
b2da8475
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
12 deletions
+12
-12
platforms/cuda/src/kernels/gpu.cpp
platforms/cuda/src/kernels/gpu.cpp
+1
-1
platforms/cuda/tests/TestCudaBrownianIntegrator.cpp
platforms/cuda/tests/TestCudaBrownianIntegrator.cpp
+1
-1
platforms/reference/src/SimTKReference/ReferenceRigidShakeAlgorithm.cpp
...rence/src/SimTKReference/ReferenceRigidShakeAlgorithm.cpp
+9
-9
platforms/reference/tests/TestReferenceBrownianIntegrator.cpp
...forms/reference/tests/TestReferenceBrownianIntegrator.cpp
+1
-1
No files found.
platforms/cuda/src/kernels/gpu.cpp
View file @
852bfaea
...
@@ -869,7 +869,7 @@ int gpuAllocateInitialBuffers(gpuContext gpu)
...
@@ -869,7 +869,7 @@ int gpuAllocateInitialBuffers(gpuContext gpu)
gpu
->
seed
=
1
;
gpu
->
seed
=
1
;
gpu
->
sim
.
randomFrames
=
20
;
gpu
->
sim
.
randomFrames
=
20
;
gpu
->
sim
.
randomIterations
=
gpu
->
sim
.
randomFrames
;
gpu
->
sim
.
randomIterations
=
gpu
->
sim
.
randomFrames
;
gpu
->
sim
.
randoms
=
gpu
->
sim
.
randomFrames
*
gpu
->
sim
.
paddedNumberOfAtoms
-
5
*
GRID
;
gpu
->
sim
.
randoms
=
gpu
->
sim
.
randomFrames
*
gpu
->
sim
.
paddedNumberOfAtoms
;
gpu
->
sim
.
totalRandoms
=
gpu
->
sim
.
randoms
+
gpu
->
sim
.
paddedNumberOfAtoms
;
gpu
->
sim
.
totalRandoms
=
gpu
->
sim
.
randoms
+
gpu
->
sim
.
paddedNumberOfAtoms
;
gpu
->
sim
.
totalRandomsTimesTwo
=
gpu
->
sim
.
totalRandoms
*
2
;
gpu
->
sim
.
totalRandomsTimesTwo
=
gpu
->
sim
.
totalRandoms
*
2
;
gpu
->
psRandom4
=
new
CUDAStream
<
float4
>
(
gpu
->
sim
.
totalRandomsTimesTwo
,
1
,
"Random4"
);
gpu
->
psRandom4
=
new
CUDAStream
<
float4
>
(
gpu
->
sim
.
totalRandomsTimesTwo
,
1
,
"Random4"
);
...
...
platforms/cuda/tests/TestCudaBrownianIntegrator.cpp
View file @
852bfaea
...
@@ -121,7 +121,7 @@ void testTemperature() {
...
@@ -121,7 +121,7 @@ void testTemperature() {
}
}
pe
/=
steps
;
pe
/=
steps
;
double
expected
=
0.5
*
numBonds
*
BOLTZ
*
temp
;
double
expected
=
0.5
*
numBonds
*
BOLTZ
*
temp
;
ASSERT_EQUAL_TOL
(
expected
,
pe
,
2
0
*
expected
/
std
::
sqrt
((
double
)
steps
)
);
ASSERT_EQUAL_TOL
(
expected
,
pe
,
0
.1
*
expected
);
}
}
void
testConstraints
()
{
void
testConstraints
()
{
...
...
platforms/reference/src/SimTKReference/ReferenceRigidShakeAlgorithm.cpp
View file @
852bfaea
...
@@ -499,15 +499,15 @@ RealOpenMM damping = one;//(RealOpenMM) (iterations%2 == 0 ? 0.5 : 1.0);
...
@@ -499,15 +499,15 @@ RealOpenMM damping = one;//(RealOpenMM) (iterations%2 == 0 ? 0.5 : 1.0);
}
}
}
}
}
}
static
int
sum
=
0
;
//
static int sum = 0;
static
int
count
=
0
;
//
static int count = 0;
sum
+=
iterations
;
//
sum += iterations;
count
++
;
//
count++;
if
(
count
==
100
)
{
//
if (count == 100) {
printf
(
"%d iterations
\n
"
,
sum
);
//
printf("%d iterations\n", sum);
sum
=
0
;
//
sum = 0;
count
=
0
;
//
count = 0;
}
//
}
// diagnostics
// diagnostics
...
...
platforms/reference/tests/TestReferenceBrownianIntegrator.cpp
View file @
852bfaea
...
@@ -119,7 +119,7 @@ void testTemperature() {
...
@@ -119,7 +119,7 @@ void testTemperature() {
}
}
pe
/=
steps
;
pe
/=
steps
;
double
expected
=
0.5
*
numBonds
*
BOLTZ
*
temp
;
double
expected
=
0.5
*
numBonds
*
BOLTZ
*
temp
;
ASSERT_EQUAL_TOL
(
expected
,
pe
,
2
0
*
expected
/
std
::
sqrt
((
double
)
steps
)
);
ASSERT_EQUAL_TOL
(
expected
,
pe
,
0
.1
*
expected
);
}
}
void
testConstraints
()
{
void
testConstraints
()
{
...
...
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