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
62cf5c93
Commit
62cf5c93
authored
May 21, 2010
by
Mark Friedrichs
Browse files
Update
parent
87542608
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
30 additions
and
25 deletions
+30
-25
platforms/cuda/CMakeLists.txt
platforms/cuda/CMakeLists.txt
+1
-1
platforms/cuda/include/CudaKernelFactory.h
platforms/cuda/include/CudaKernelFactory.h
+2
-1
platforms/cuda/include/CudaPlatform.h
platforms/cuda/include/CudaPlatform.h
+1
-1
platforms/cuda/sharedTarget/CMakeLists.txt
platforms/cuda/sharedTarget/CMakeLists.txt
+1
-0
platforms/cuda/src/CudaKernelFactory.cpp
platforms/cuda/src/CudaKernelFactory.cpp
+1
-1
platforms/cuda/src/CudaKernels.cpp
platforms/cuda/src/CudaKernels.cpp
+2
-0
platforms/cuda/src/kernels/cudaKernels.h
platforms/cuda/src/kernels/cudaKernels.h
+1
-1
platforms/cuda/src/kernels/gpu.cpp
platforms/cuda/src/kernels/gpu.cpp
+2
-1
platforms/cuda/src/kernels/gputypes.h
platforms/cuda/src/kernels/gputypes.h
+1
-1
platforms/cuda/src/kernels/kCalculateObcGbsaBornSum.cu
platforms/cuda/src/kernels/kCalculateObcGbsaBornSum.cu
+2
-2
platforms/cuda/src/kernels/kCalculateObcGbsaForces2.cu
platforms/cuda/src/kernels/kCalculateObcGbsaForces2.cu
+1
-1
platforms/cuda/src/kernels/kForces.cu
platforms/cuda/src/kernels/kForces.cu
+3
-3
platforms/cuda/staticTarget/CMakeLists.txt
platforms/cuda/staticTarget/CMakeLists.txt
+3
-4
platforms/reference/src/SimTKUtilities/SimTKOpenMMRealType.h
platforms/reference/src/SimTKUtilities/SimTKOpenMMRealType.h
+9
-8
No files found.
platforms/cuda/CMakeLists.txt
View file @
62cf5c93
...
...
@@ -131,4 +131,4 @@ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/src)
# SET(FINDCUDA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cuda-cmake)
SUBDIRS
(
sharedTarget
)
SUBDIRS
(
sharedTarget
staticTarget
)
platforms/cuda/include/CudaKernelFactory.h
View file @
62cf5c93
...
...
@@ -28,6 +28,7 @@
* -------------------------------------------------------------------------- */
#include "openmm/KernelFactory.h"
#include "windowsExportCuda.h"
namespace
OpenMM
{
...
...
@@ -37,7 +38,7 @@ namespace OpenMM {
class
CudaKernelFactory
:
public
KernelFactory
{
public:
KernelImpl
*
createKernelImpl
(
std
::
string
name
,
const
Platform
&
platform
,
ContextImpl
&
context
)
const
;
OPENMMCUDA_EXPORT
KernelImpl
*
createKernelImpl
(
std
::
string
name
,
const
Platform
&
platform
,
ContextImpl
&
context
)
const
;
};
}
// namespace OpenMM
...
...
platforms/cuda/include/CudaPlatform.h
View file @
62cf5c93
...
...
@@ -72,7 +72,7 @@ public:
class
CudaPlatform
::
PlatformData
{
public:
PlatformData
(
_gpuContext
*
gpu
);
OPENMMCUDA_EXPORT
PlatformData
(
_gpuContext
*
gpu
);
_gpuContext
*
gpu
;
bool
removeCM
;
bool
hasBonds
,
hasAngles
,
hasPeriodicTorsions
,
hasRB
,
hasNonbonded
,
hasCustomNonbonded
;
...
...
platforms/cuda/sharedTarget/CMakeLists.txt
View file @
62cf5c93
...
...
@@ -3,6 +3,7 @@
#
# INCLUDE(${FINDCUDA_DIR}/FindCuda.cmake)
INCLUDE_DIRECTORIES
(
${
CUDA_INCLUDE
}
)
SET
(
CUDA_NVCC_FLAGS
"
${
CUDA_NVCC_FLAGS
}
-Xcompiler -DOPENMMCUDA_BUILDING_SHARED_LIBRARY"
)
LINK_DIRECTORIES
(
${
CUDA_TARGET_LINK
}
)
FOREACH
(
subdir
${
OPENMM_SOURCE_SUBDIRS
}
)
FILE
(
GLOB src_files
${
CMAKE_SOURCE_DIR
}
/platforms/cuda/
${
subdir
}
/src/*.cu
${
CMAKE_SOURCE_DIR
}
/platforms/cuda/
${
subdir
}
/src/*/*.cu
)
...
...
platforms/cuda/src/CudaKernelFactory.cpp
View file @
62cf5c93
...
...
@@ -31,7 +31,7 @@
using
namespace
OpenMM
;
KernelImpl
*
CudaKernelFactory
::
createKernelImpl
(
std
::
string
name
,
const
Platform
&
platform
,
ContextImpl
&
context
)
const
{
OPENMMCUDA_EXPORT
KernelImpl
*
CudaKernelFactory
::
createKernelImpl
(
std
::
string
name
,
const
Platform
&
platform
,
ContextImpl
&
context
)
const
{
CudaPlatform
::
PlatformData
&
data
=
*
static_cast
<
CudaPlatform
::
PlatformData
*>
(
context
.
getPlatformData
());
if
(
name
==
CalcForcesAndEnergyKernel
::
Name
())
return
new
CudaCalcForcesAndEnergyKernel
(
name
,
platform
,
data
);
...
...
platforms/cuda/src/CudaKernels.cpp
View file @
62cf5c93
...
...
@@ -767,8 +767,10 @@ void OPENMMCUDA_EXPORT OpenMM::cudaOpenMMInitializeIntegration(const System& sys
if
(
!
data
.
hasNonbonded
)
{
gpuSetCoulombParameters
(
gpu
,
(
float
)
ONE_4PI_EPS0
,
vector
<
int
>
(),
vector
<
float
>
(),
vector
<
float
>
(),
vector
<
float
>
(),
vector
<
char
>
(),
vector
<
vector
<
int
>
>
(),
NO_CUTOFF
);
gpuSetLJ14Parameters
(
gpu
,
(
float
)
ONE_4PI_EPS0
,
1.0
f
,
vector
<
int
>
(),
vector
<
int
>
(),
vector
<
float
>
(),
vector
<
float
>
(),
vector
<
float
>
(),
vector
<
float
>
());
/*
if (gpu->bIncludeGBSA || gpu->bIncludeGBVI)
throw OpenMMException("CudaPlatform requires GBSAOBCForce and GBVIForce to be used with a NonbondedForce");
*/
}
// Set masses.
...
...
platforms/cuda/src/kernels/cudaKernels.h
View file @
62cf5c93
...
...
@@ -48,7 +48,7 @@ extern void kCalculateCustomTorsionForces(gpuContext gpu);
extern
void
kCalculateCustomExternalForces
(
gpuContext
gpu
);
extern
void
kCalculateCustomNonbondedForces
(
gpuContext
gpu
,
bool
neighborListValid
);
extern
void
kReduceObcGbsaBornForces
(
gpuContext
gpu
);
extern
void
kCalculateObcGbsaForces2
(
gpuContext
gpu
);
extern
void
OPENMMCUDA_EXPORT
kCalculateObcGbsaForces2
(
gpuContext
gpu
);
extern
void
kCalculateGBVIForces2
(
gpuContext
gpu
);
extern
void
kCalculateLocalForces
(
gpuContext
gpu
);
extern
void
kCalculateAndersenThermostat
(
gpuContext
gpu
);
...
...
platforms/cuda/src/kernels/gpu.cpp
View file @
62cf5c93
...
...
@@ -58,6 +58,7 @@ using namespace std;
// make sure that erf() and erfc() are defined.
#include "openmm/internal/MSVC_erfc.h"
#include "openmm/internal/windowsExport.h"
#include "windowsExportCuda.h"
using
OpenMM
::
OpenMMException
;
using
Lepton
::
Operation
;
...
...
@@ -1788,7 +1789,7 @@ bool gpuIsAvailable()
}
extern
"C"
void
*
gpuInit
(
int
numAtoms
,
unsigned
int
device
,
bool
useBlockingSync
)
void
*
gpuInit
(
int
numAtoms
,
unsigned
int
device
,
bool
useBlockingSync
)
{
gpuContext
gpu
=
new
_gpuContext
;
int
LRFSize
=
0
;
...
...
platforms/cuda/src/kernels/gputypes.h
View file @
62cf5c93
...
...
@@ -272,7 +272,7 @@ extern "C"
void
OPENMMCUDA_EXPORT
gpuInitializeRandoms
(
gpuContext
gpu
);
extern
"C"
void
*
gpuInit
(
int
numAtoms
,
unsigned
int
device
=
0
,
bool
useBlockingSync
=
false
);
OPENMMCUDA_EXPORT
void
*
gpuInit
(
int
numAtoms
,
unsigned
int
device
=
0
,
bool
useBlockingSync
=
false
);
extern
"C"
void
gpuSetLangevinIntegrationParameters
(
gpuContext
gpu
,
float
tau
,
float
deltaT
,
float
temperature
,
float
errorTol
);
...
...
platforms/cuda/src/kernels/kCalculateObcGbsaBornSum.cu
View file @
62cf5c93
...
...
@@ -133,7 +133,7 @@ void kReduceObcGbsaBornSum_kernel()
}
}
void
kReduceObcGbsaBornSum
(
gpuContext
gpu
)
void
OPENMMCUDA_EXPORT
kReduceObcGbsaBornSum
(
gpuContext
gpu
)
{
// printf("kReduceObcGbsaBornSum\n");
kReduceObcGbsaBornSum_kernel
<<<
gpu
->
sim
.
blocks
,
384
>>>
();
...
...
@@ -141,7 +141,7 @@ void kReduceObcGbsaBornSum(gpuContext gpu)
LAUNCHERROR
(
"kReduceObcGbsaBornSum"
);
}
void
kCalculateObcGbsaBornSum
(
gpuContext
gpu
)
void
OPENMMCUDA_EXPORT
kCalculateObcGbsaBornSum
(
gpuContext
gpu
)
{
// printf("kCalculateObcgbsaBornSum\n");
switch
(
gpu
->
sim
.
nonbondedMethod
)
...
...
platforms/cuda/src/kernels/kCalculateObcGbsaForces2.cu
View file @
62cf5c93
...
...
@@ -99,7 +99,7 @@ void GetCalculateObcGbsaForces2Sim(gpuContext gpu)
#define METHOD_NAME(a, b) a##PeriodicByWarp##b
#include "kCalculateObcGbsaForces2.h"
void
kCalculateObcGbsaForces2
(
gpuContext
gpu
)
void
OPENMMCUDA_EXPORT
kCalculateObcGbsaForces2
(
gpuContext
gpu
)
{
//printf("kCalculateObcGbsaForces2\n");
switch
(
gpu
->
sim
.
nonbondedMethod
)
...
...
platforms/cuda/src/kernels/kForces.cu
View file @
62cf5c93
...
...
@@ -39,7 +39,7 @@ using namespace std;
static
__constant__
cudaGmxSimulation
cSim
;
void
SetForcesSim
(
gpuContext
gpu
)
void
OPENMMCUDA_EXPORT
SetForcesSim
(
gpuContext
gpu
)
{
cudaError_t
status
;
status
=
cudaMemcpyToSymbol
(
cSim
,
&
gpu
->
sim
,
sizeof
(
cudaGmxSimulation
));
...
...
@@ -65,7 +65,7 @@ void kClearForces_kernel()
}
}
void
kClearForces
(
gpuContext
gpu
)
void
OPENMMCUDA_EXPORT
kClearForces
(
gpuContext
gpu
)
{
// printf("kClearForces\n");
kClearForces_kernel
<<<
gpu
->
sim
.
blocks
,
384
>>>
();
...
...
@@ -279,7 +279,7 @@ void kReduceForces_kernel()
}
}
void
kReduceForces
(
gpuContext
gpu
)
void
OPENMMCUDA_EXPORT
kReduceForces
(
gpuContext
gpu
)
{
// printf("kReduceForces\n");
kReduceForces_kernel
<<<
gpu
->
sim
.
blocks
,
gpu
->
sim
.
bsf_reduce_threads_per_block
>>>
();
...
...
platforms/cuda/staticTarget/CMakeLists.txt
View file @
62cf5c93
#
# Include CUDA related files.
#
SET
(
CUDA_NVCC_BUILD_FLAGS
"-DCUDPP_STATIC_LIB"
)
INCLUDE
(
${
FINDCUDA_DIR
}
/FindCuda.cmake
)
#INCLUDE(${FINDCUDA_DIR}/FindCuda.cmake)
INCLUDE_DIRECTORIES
(
${
CUDA_INCLUDE
}
)
LINK_DIRECTORIES
(
${
CUDA_TARGET_LINK
}
)
FOREACH
(
subdir
${
OPENMM_SOURCE_SUBDIRS
}
)
...
...
@@ -21,10 +20,10 @@ CUDA_ADD_LIBRARY(${STATIC_TARGET} STATIC ${SOURCE_FILES} ${SOURCE_INCLUDE_FILES}
# required for getting OPENMM_EXPORT to be set correctly in 'class OPENMM_EXPORT CudaStreamFactory', ...
# see OpenMM/openmmapi/include/internal/windowsExport.h for details
SET
(
CUDA_STATIC_COMPILE_FLAG
"-DOPENMMCUDA_BUILDING_STATIC_LIBRARY -DOPENMMCUDA_USE_STATIC_LIBRARIES
-DCUDPP_STATIC_LIB
"
)
SET
(
CUDA_STATIC_COMPILE_FLAG
"-DOPENMMCUDA_BUILDING_STATIC_LIBRARY -DOPENMMCUDA_USE_STATIC_LIBRARIES"
)
SET_TARGET_PROPERTIES
(
${
STATIC_TARGET
}
PROPERTIES COMPILE_FLAGS
${
CUDA_STATIC_COMPILE_FLAG
}
)
TARGET_LINK_LIBRARIES
(
${
STATIC_TARGET
}
optimized
${
OPENMM_LIBRARY_NAME
}
_static
)
TARGET_LINK_LIBRARIES
(
${
STATIC_TARGET
}
debug
${
OPENMM_LIBRARY_NAME
}
_static_d optimized
${
OPENMM_LIBRARY_NAME
}
_static
${
CUFFT_TARGET_LINK
}
)
INSTALL_TARGETS
(
/lib/plugins RUNTIME_DIRECTORY /lib/plugins
${
STATIC_TARGET
}
)
#
INSTALL_TARGETS(/lib/plugins RUNTIME_DIRECTORY /lib/plugins ${STATIC_TARGET})
platforms/reference/src/SimTKUtilities/SimTKOpenMMRealType.h
View file @
62cf5c93
...
...
@@ -23,20 +23,20 @@
*/
#ifndef __RealSimTk_H_
#define __RealSimTk_H__
#ifndef __Real
OpenMMOpenMM
SimTk_H_
#define __Real
OpenMMOpenMM
SimTk_H__
#include <math.h>
// Set RealOpenMMType to 2 for double precision, 1 for float
// Set RealOpenMM
OpenMMOpenMM
Type to 2 for double precision, 1 for float
#ifndef RealOpenMMType
#define RealOpenMMType 2
#ifndef RealOpenMM
OpenMMOpenMM
Type
#define RealOpenMM
OpenMMOpenMM
Type 2
#endif
#if RealOpenMMType == 1
#if RealOpenMM
OpenMMOpenMM
Type == 1
#define RealOpenMM float
#define RealOpenMM
OpenMMOpenMM
float
#define SQRT sqrtf
#define POW powf
#define SIN sinf
...
...
@@ -67,6 +67,7 @@
#else
#define RealOpenMM double
#define Real double
#define SQRT sqrt
#define POW pow
#define SIN sin
...
...
@@ -143,4 +144,4 @@
#define ENM2DEBYE 48.0321
/* Convert electron nm to debye */
#define DEBYE2ENM 0.02081941
#endif // __RealSimTk_H__
#endif // __Real
OpenMMOpenMM
SimTk_H__
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