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
ac67d179
"platforms/cuda/src/CudaArray.cpp" did not exist on "ed1fb1923aeff2fe99e090bab87aeddd63115043"
Unverified
Commit
ac67d179
authored
Feb 02, 2021
by
Peter Eastman
Committed by
GitHub
Feb 02, 2021
Browse files
Fixed test failures on CPU OpenCL (#3003)
parent
e53bdc5e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
platforms/opencl/src/OpenCLContext.cpp
platforms/opencl/src/OpenCLContext.cpp
+3
-1
platforms/opencl/tests/TestOpenCLNonbondedForce.cpp
platforms/opencl/tests/TestOpenCLNonbondedForce.cpp
+4
-2
tests/TestNonbondedForce.h
tests/TestNonbondedForce.h
+2
-2
No files found.
platforms/opencl/src/OpenCLContext.cpp
View file @
ac67d179
...
@@ -530,7 +530,9 @@ void OpenCLContext::initialize() {
...
@@ -530,7 +530,9 @@ void OpenCLContext::initialize() {
energyParamDerivBuffer
.
initialize
<
cl_float
>
(
*
this
,
numEnergyParamDerivs
*
energyBufferSize
,
"energyParamDerivBuffer"
);
energyParamDerivBuffer
.
initialize
<
cl_float
>
(
*
this
,
numEnergyParamDerivs
*
energyBufferSize
,
"energyParamDerivBuffer"
);
addAutoclearBuffer
(
energyParamDerivBuffer
);
addAutoclearBuffer
(
energyParamDerivBuffer
);
}
}
int
bufferBytes
=
max
(
velm
.
getSize
()
*
velm
.
getElementSize
(),
energyBufferSize
*
energyBuffer
.
getElementSize
());
int
bufferBytes
=
max
(
max
(
velm
.
getSize
()
*
velm
.
getElementSize
(),
energyBufferSize
*
energyBuffer
.
getElementSize
()),
longForceBuffer
.
getSize
()
*
longForceBuffer
.
getElementSize
());
pinnedBuffer
=
new
cl
::
Buffer
(
context
,
CL_MEM_ALLOC_HOST_PTR
,
bufferBytes
);
pinnedBuffer
=
new
cl
::
Buffer
(
context
,
CL_MEM_ALLOC_HOST_PTR
,
bufferBytes
);
pinnedMemory
=
currentQueue
.
enqueueMapBuffer
(
*
pinnedBuffer
,
CL_TRUE
,
CL_MAP_READ
|
CL_MAP_WRITE
,
0
,
bufferBytes
);
pinnedMemory
=
currentQueue
.
enqueueMapBuffer
(
*
pinnedBuffer
,
CL_TRUE
,
CL_MAP_READ
|
CL_MAP_WRITE
,
0
,
bufferBytes
);
for
(
int
i
=
0
;
i
<
numAtoms
;
i
++
)
{
for
(
int
i
=
0
;
i
<
numAtoms
;
i
++
)
{
...
...
platforms/opencl/tests/TestOpenCLNonbondedForce.cpp
View file @
ac67d179
...
@@ -155,6 +155,8 @@ void runPlatformTests() {
...
@@ -155,6 +155,8 @@ void runPlatformTests() {
testParallelComputation
(
NonbondedForce
::
Ewald
);
testParallelComputation
(
NonbondedForce
::
Ewald
);
testParallelComputation
(
NonbondedForce
::
PME
);
testParallelComputation
(
NonbondedForce
::
PME
);
testReordering
();
testReordering
();
if
(
canRunHugeTest
())
if
(
canRunHugeTest
())
{
testHugeSystem
();
double
tol
=
(
platform
.
getPropertyDefaultValue
(
"Precision"
)
==
"single"
?
1e-4
:
1e-5
);
testHugeSystem
(
tol
);
}
}
}
tests/TestNonbondedForce.h
View file @
ac67d179
...
@@ -536,7 +536,7 @@ void testLargeSystem() {
...
@@ -536,7 +536,7 @@ void testLargeSystem() {
ASSERT_EQUAL_TOL
(
state
.
getPotentialEnergy
(),
referenceState
.
getPotentialEnergy
(),
tol
);
ASSERT_EQUAL_TOL
(
state
.
getPotentialEnergy
(),
referenceState
.
getPotentialEnergy
(),
tol
);
}
}
void
testHugeSystem
()
{
void
testHugeSystem
(
double
tol
=
1e-5
)
{
// Create a system with over 3 million particles.
// Create a system with over 3 million particles.
const
int
gridSize
=
150
;
const
int
gridSize
=
150
;
...
@@ -590,7 +590,7 @@ void testHugeSystem() {
...
@@ -590,7 +590,7 @@ void testHugeSystem() {
State
state2
=
context
.
getState
(
State
::
Energy
);
State
state2
=
context
.
getState
(
State
::
Energy
);
context
.
setPositions
(
positions3
);
context
.
setPositions
(
positions3
);
State
state3
=
context
.
getState
(
State
::
Energy
);
State
state3
=
context
.
getState
(
State
::
Energy
);
ASSERT_EQUAL_TOL
(
state2
.
getPotentialEnergy
(),
state3
.
getPotentialEnergy
()
+
norm
*
delta
,
1e-5
)
ASSERT_EQUAL_TOL
(
state2
.
getPotentialEnergy
(),
state3
.
getPotentialEnergy
()
+
norm
*
delta
,
tol
)
}
}
void
testDispersionCorrection
()
{
void
testDispersionCorrection
()
{
...
...
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