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
3862202e
Commit
3862202e
authored
Jul 12, 2013
by
Justin MacCallum
Browse files
Merge branch 'upstream' into fork
parents
e1a4e015
73882ac5
Changes
249
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
87 additions
and
18 deletions
+87
-18
platforms/cuda/tests/TestCudaMultipleForces.cpp
platforms/cuda/tests/TestCudaMultipleForces.cpp
+1
-1
platforms/cuda/tests/TestCudaNonbondedForce.cpp
platforms/cuda/tests/TestCudaNonbondedForce.cpp
+1
-1
platforms/cuda/tests/TestCudaPeriodicTorsionForce.cpp
platforms/cuda/tests/TestCudaPeriodicTorsionForce.cpp
+1
-1
platforms/cuda/tests/TestCudaRBTorsionForce.cpp
platforms/cuda/tests/TestCudaRBTorsionForce.cpp
+1
-1
platforms/cuda/tests/TestCudaRandom.cpp
platforms/cuda/tests/TestCudaRandom.cpp
+5
-5
platforms/cuda/tests/TestCudaSort.cpp
platforms/cuda/tests/TestCudaSort.cpp
+4
-4
platforms/cuda/tests/TestCudaVariableLangevinIntegrator.cpp
platforms/cuda/tests/TestCudaVariableLangevinIntegrator.cpp
+1
-1
platforms/cuda/tests/TestCudaVariableVerletIntegrator.cpp
platforms/cuda/tests/TestCudaVariableVerletIntegrator.cpp
+1
-1
platforms/cuda/tests/TestCudaVerletIntegrator.cpp
platforms/cuda/tests/TestCudaVerletIntegrator.cpp
+1
-1
platforms/opencl/CMakeLists.txt
platforms/opencl/CMakeLists.txt
+5
-0
platforms/opencl/include/OpenCLArray.h
platforms/opencl/include/OpenCLArray.h
+0
-0
platforms/opencl/include/OpenCLBondedUtilities.h
platforms/opencl/include/OpenCLBondedUtilities.h
+0
-0
platforms/opencl/include/OpenCLCompact.h
platforms/opencl/include/OpenCLCompact.h
+0
-0
platforms/opencl/include/OpenCLContext.h
platforms/opencl/include/OpenCLContext.h
+60
-1
platforms/opencl/include/OpenCLExpressionUtilities.h
platforms/opencl/include/OpenCLExpressionUtilities.h
+0
-0
platforms/opencl/include/OpenCLFFT3D.h
platforms/opencl/include/OpenCLFFT3D.h
+0
-0
platforms/opencl/include/OpenCLForceInfo.h
platforms/opencl/include/OpenCLForceInfo.h
+0
-0
platforms/opencl/include/OpenCLIntegrationUtilities.h
platforms/opencl/include/OpenCLIntegrationUtilities.h
+0
-0
platforms/opencl/include/OpenCLKernels.h
platforms/opencl/include/OpenCLKernels.h
+6
-1
platforms/opencl/include/OpenCLNonbondedUtilities.h
platforms/opencl/include/OpenCLNonbondedUtilities.h
+0
-0
No files found.
platforms/cuda/tests/TestCudaMultipleForces.cpp
View file @
3862202e
...
...
@@ -44,7 +44,7 @@
#include "openmm/RBTorsionForce.h"
#include "openmm/System.h"
#include "openmm/VerletIntegrator.h"
#include "
../src/SimTKUtilities/
SimTKOpenMMRealType.h"
#include "SimTKOpenMMRealType.h"
#include "sfmt/SFMT.h"
#include <iostream>
#include <vector>
...
...
platforms/cuda/tests/TestCudaNonbondedForce.cpp
View file @
3862202e
...
...
@@ -45,7 +45,7 @@
#include "openmm/internal/ContextImpl.h"
#include "CudaArray.h"
#include "CudaNonbondedUtilities.h"
#include "
../src/SimTKUtilities/
SimTKOpenMMRealType.h"
#include "SimTKOpenMMRealType.h"
#include "sfmt/SFMT.h"
#include <iostream>
#include <vector>
...
...
platforms/cuda/tests/TestCudaPeriodicTorsionForce.cpp
View file @
3862202e
...
...
@@ -39,7 +39,7 @@
#include "openmm/PeriodicTorsionForce.h"
#include "openmm/System.h"
#include "openmm/VerletIntegrator.h"
#include "
../src/SimTKUtilities/
SimTKOpenMMRealType.h"
#include "SimTKOpenMMRealType.h"
#include <iostream>
#include <vector>
...
...
platforms/cuda/tests/TestCudaRBTorsionForce.cpp
View file @
3862202e
...
...
@@ -39,7 +39,7 @@
#include "openmm/RBTorsionForce.h"
#include "openmm/System.h"
#include "openmm/VerletIntegrator.h"
#include "
../src/SimTKUtilities/
SimTKOpenMMRealType.h"
#include "SimTKOpenMMRealType.h"
#include <iostream>
#include <vector>
...
...
platforms/cuda/tests/TestCudaRandom.cpp
View file @
3862202e
...
...
@@ -34,14 +34,14 @@
*/
#include "openmm/internal/AssertionUtilities.h"
#include "
../src/
CudaArray.h"
#include "
../src/
CudaContext.h"
#include "
../src/
CudaIntegrationUtilities.h"
#include "CudaArray.h"
#include "CudaContext.h"
#include "CudaIntegrationUtilities.h"
#include "openmm/System.h"
#include "openmm/Context.h"
#include "CudaPlatform.h"
#include "openmm/VerletIntegrator.h"
#include "
../src/SimTKUtilities/
SimTKOpenMMRealType.h"
#include "SimTKOpenMMRealType.h"
#include <iostream>
using
namespace
OpenMM
;
...
...
@@ -54,7 +54,7 @@ void testGaussian() {
System
system
;
for
(
int
i
=
0
;
i
<
numAtoms
;
i
++
)
system
.
addParticle
(
1.0
);
CudaPlatform
::
PlatformData
platformData
(
system
,
""
,
"true"
,
platform
.
getPropertyDefaultValue
(
"CudaPrecision"
),
CudaPlatform
::
PlatformData
platformData
(
NULL
,
system
,
""
,
"true"
,
platform
.
getPropertyDefaultValue
(
"CudaPrecision"
),
"false"
,
platform
.
getPropertyDefaultValue
(
CudaPlatform
::
CudaCompiler
()),
platform
.
getPropertyDefaultValue
(
CudaPlatform
::
CudaTempDirectory
()));
CudaContext
&
context
=
*
platformData
.
contexts
[
0
];
context
.
initialize
();
...
...
platforms/cuda/tests/TestCudaSort.cpp
View file @
3862202e
...
...
@@ -34,9 +34,9 @@
*/
#include "openmm/internal/AssertionUtilities.h"
#include "
../src/
CudaArray.h"
#include "
../src/
CudaContext.h"
#include "
../src/
CudaSort.h"
#include "CudaArray.h"
#include "CudaContext.h"
#include "CudaSort.h"
#include "sfmt/SFMT.h"
#include "openmm/System.h"
#include <iostream>
...
...
@@ -64,7 +64,7 @@ void verifySorting(vector<float> array) {
System
system
;
system
.
addParticle
(
0.0
);
CudaPlatform
::
PlatformData
platformData
(
system
,
""
,
"true"
,
platform
.
getPropertyDefaultValue
(
"CudaPrecision"
),
CudaPlatform
::
PlatformData
platformData
(
NULL
,
system
,
""
,
"true"
,
platform
.
getPropertyDefaultValue
(
"CudaPrecision"
),
"false"
,
platform
.
getPropertyDefaultValue
(
CudaPlatform
::
CudaCompiler
()),
platform
.
getPropertyDefaultValue
(
CudaPlatform
::
CudaTempDirectory
()));
CudaContext
&
context
=
*
platformData
.
contexts
[
0
];
context
.
initialize
();
...
...
platforms/cuda/tests/TestCudaVariableLangevinIntegrator.cpp
View file @
3862202e
...
...
@@ -40,7 +40,7 @@
#include "openmm/NonbondedForce.h"
#include "openmm/System.h"
#include "openmm/VariableLangevinIntegrator.h"
#include "
../src/SimTKUtilities/
SimTKOpenMMRealType.h"
#include "SimTKOpenMMRealType.h"
#include "sfmt/SFMT.h"
#include <iostream>
#include <vector>
...
...
platforms/cuda/tests/TestCudaVariableVerletIntegrator.cpp
View file @
3862202e
...
...
@@ -40,7 +40,7 @@
#include "openmm/NonbondedForce.h"
#include "openmm/System.h"
#include "openmm/VariableVerletIntegrator.h"
#include "
../src/SimTKUtilities/
SimTKOpenMMRealType.h"
#include "SimTKOpenMMRealType.h"
#include "sfmt/SFMT.h"
#include <iostream>
#include <vector>
...
...
platforms/cuda/tests/TestCudaVerletIntegrator.cpp
View file @
3862202e
...
...
@@ -40,7 +40,7 @@
#include "openmm/NonbondedForce.h"
#include "openmm/System.h"
#include "openmm/VerletIntegrator.h"
#include "
../src/SimTKUtilities/
SimTKOpenMMRealType.h"
#include "SimTKOpenMMRealType.h"
#include "sfmt/SFMT.h"
#include <iostream>
#include <vector>
...
...
platforms/opencl/CMakeLists.txt
View file @
3862202e
...
...
@@ -102,4 +102,9 @@ SET(CL_KERNELS_H ${CMAKE_CURRENT_BINARY_DIR}/src/${CL_SOURCE_CLASS}.h)
SET
(
SOURCE_FILES
${
SOURCE_FILES
}
${
CL_KERNELS_CPP
}
${
CL_KERNELS_H
}
)
INCLUDE_DIRECTORIES
(
BEFORE
${
CMAKE_CURRENT_BINARY_DIR
}
/src
)
# Install headers
FILE
(
GLOB CORE_HEADERS include/*.h
)
INSTALL_FILES
(
/include/openmm/opencl FILES
${
CORE_HEADERS
}
)
SUBDIRS
(
sharedTarget
)
platforms/opencl/
src
/OpenCLArray.h
→
platforms/opencl/
include
/OpenCLArray.h
View file @
3862202e
File moved
platforms/opencl/
src
/OpenCLBondedUtilities.h
→
platforms/opencl/
include
/OpenCLBondedUtilities.h
View file @
3862202e
File moved
platforms/opencl/
src
/OpenCLCompact.h
→
platforms/opencl/
include
/OpenCLCompact.h
View file @
3862202e
File moved
platforms/opencl/
src
/OpenCLContext.h
→
platforms/opencl/
include
/OpenCLContext.h
View file @
3862202e
...
...
@@ -158,6 +158,8 @@ public:
class
WorkTask
;
class
WorkThread
;
class
ReorderListener
;
class
ForcePreComputation
;
class
ForcePostComputation
;
static
const
int
ThreadBlockSize
;
static
const
int
TileSize
;
OpenCLContext
(
const
System
&
system
,
int
platformIndex
,
int
deviceIndex
,
const
std
::
string
&
precision
,
OpenCLPlatform
::
PlatformData
&
platformData
);
...
...
@@ -554,6 +556,28 @@ public:
std
::
vector
<
ReorderListener
*>&
getReorderListeners
()
{
return
reorderListeners
;
}
/**
* Add a pre-computation that should be called at the very start of force and energy evaluations.
* The OpenCLContext assumes ownership of the object, and deletes it when the context itself is deleted.
*/
void
addPreComputation
(
ForcePreComputation
*
computation
);
/**
* Get the list of ForcePreComputations.
*/
std
::
vector
<
ForcePreComputation
*>&
getPreComputations
()
{
return
preComputations
;
}
/**
* Add a post-computation that should be called at the very end of force and energy evaluations.
* The OpenCLContext assumes ownership of the object, and deletes it when the context itself is deleted.
*/
void
addPostComputation
(
ForcePostComputation
*
computation
);
/**
* Get the list of ForcePostComputations.
*/
std
::
vector
<
ForcePostComputation
*>&
getPostComputations
()
{
return
postComputations
;
}
/**
* Mark that the current molecule definitions (and hence the atom order) may be invalid.
* This should be called whenever force field parameters change. It will cause the definitions
...
...
@@ -625,6 +649,8 @@ private:
std
::
vector
<
cl
::
Memory
*>
autoclearBuffers
;
std
::
vector
<
int
>
autoclearBufferSizes
;
std
::
vector
<
ReorderListener
*>
reorderListeners
;
std
::
vector
<
ForcePreComputation
*>
preComputations
;
std
::
vector
<
ForcePostComputation
*>
postComputations
;
OpenCLIntegrationUtilities
*
integration
;
OpenCLExpressionUtilities
*
expression
;
OpenCLBondedUtilities
*
bonded
;
...
...
@@ -686,7 +712,7 @@ private:
/**
* This abstract class defines a function to be executed whenever atoms get reordered.
* Objects that need to know when reordering happens should create a
r
eorderListener
* Objects that need to know when reordering happens should create a
R
eorderListener
* and register it by calling addReorderListener().
*/
class
OpenCLContext
::
ReorderListener
{
...
...
@@ -696,6 +722,39 @@ public:
}
};
/**
* This abstract class defines a function to be executed at the very beginning of force and
* energy evaluation, before any other calculation has been done. It is useful for operations
* that need to be performed at a nonstandard point in the process. After creating a
* ForcePreComputation, register it by calling addForcePreComputation().
*/
class
OpenCLContext
::
ForcePreComputation
{
public:
/**
* @param includeForce true if forces should be computed
* @param includeEnergy true if potential energy should be computed
* @param groups a set of bit flags for which force groups to include
*/
virtual
void
computeForceAndEnergy
(
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
=
0
;
};
/**
* This abstract class defines a function to be executed at the very end of force and
* energy evaluation, after all other calculations have been done. It is useful for operations
* that need to be performed at a nonstandard point in the process. After creating a
* ForcePostComputation, register it by calling addForcePostComputation().
*/
class
OpenCLContext
::
ForcePostComputation
{
public:
/**
* @param includeForce true if forces should be computed
* @param includeEnergy true if potential energy should be computed
* @param groups a set of bit flags for which force groups to include
* @return an optional contribution to add to the potential energy.
*/
virtual
double
computeForceAndEnergy
(
bool
includeForces
,
bool
includeEnergy
,
int
groups
)
=
0
;
};
}
// namespace OpenMM
#endif
/*OPENMM_OPENCLCONTEXT_H_*/
platforms/opencl/
src
/OpenCLExpressionUtilities.h
→
platforms/opencl/
include
/OpenCLExpressionUtilities.h
View file @
3862202e
File moved
platforms/opencl/
src
/OpenCLFFT3D.h
→
platforms/opencl/
include
/OpenCLFFT3D.h
View file @
3862202e
File moved
platforms/opencl/
src
/OpenCLForceInfo.h
→
platforms/opencl/
include
/OpenCLForceInfo.h
View file @
3862202e
File moved
platforms/opencl/
src
/OpenCLIntegrationUtilities.h
→
platforms/opencl/
include
/OpenCLIntegrationUtilities.h
View file @
3862202e
File moved
platforms/opencl/
src
/OpenCLKernels.h
→
platforms/opencl/
include
/OpenCLKernels.h
View file @
3862202e
...
...
@@ -557,7 +557,7 @@ public:
OpenCLCalcNonbondedForceKernel
(
std
::
string
name
,
const
Platform
&
platform
,
OpenCLContext
&
cl
,
const
System
&
system
)
:
CalcNonbondedForceKernel
(
name
,
platform
),
hasInitializedKernel
(
false
),
cl
(
cl
),
sigmaEpsilon
(
NULL
),
exceptionParams
(
NULL
),
cosSinSums
(
NULL
),
pmeGrid
(
NULL
),
pmeGrid2
(
NULL
),
pmeBsplineModuliX
(
NULL
),
pmeBsplineModuliY
(
NULL
),
pmeBsplineModuliZ
(
NULL
),
pmeBsplineTheta
(
NULL
),
pmeAtomRange
(
NULL
),
pmeAtomGridIndex
(
NULL
),
sort
(
NULL
),
fft
(
NULL
)
{
pmeAtomRange
(
NULL
),
pmeAtomGridIndex
(
NULL
),
sort
(
NULL
),
fft
(
NULL
)
,
pmeio
(
NULL
)
{
}
~
OpenCLCalcNonbondedForceKernel
();
/**
...
...
@@ -596,6 +596,9 @@ private:
const
char
*
getMaxValue
()
const
{
return
"(int2) (INT_MAX, INT_MAX)"
;}
const
char
*
getSortKey
()
const
{
return
"value.y"
;}
};
class
PmeIO
;
class
PmePreComputation
;
class
PmePostComputation
;
OpenCLContext
&
cl
;
bool
hasInitializedKernel
;
OpenCLArray
*
sigmaEpsilon
;
...
...
@@ -611,6 +614,8 @@ private:
OpenCLArray
*
pmeAtomGridIndex
;
OpenCLSort
*
sort
;
OpenCLFFT3D
*
fft
;
Kernel
cpuPme
;
PmeIO
*
pmeio
;
cl
::
Kernel
ewaldSumsKernel
;
cl
::
Kernel
ewaldForcesKernel
;
cl
::
Kernel
pmeGridIndexKernel
;
...
...
platforms/opencl/
src
/OpenCLNonbondedUtilities.h
→
platforms/opencl/
include
/OpenCLNonbondedUtilities.h
View file @
3862202e
File moved
Prev
1
2
3
4
5
6
7
…
13
Next
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