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
e37555bb
Commit
e37555bb
authored
Jul 28, 2010
by
Peter Eastman
Browse files
Fixed compilation errors on Linux
parent
59e00d79
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
20 additions
and
19 deletions
+20
-19
plugins/amoeba/platforms/cuda/src/kernels/AmoebaGpu.cpp
plugins/amoeba/platforms/cuda/src/kernels/AmoebaGpu.cpp
+1
-0
plugins/amoeba/platforms/cuda/src/kernels/amoebaScaleFactors.h
...ns/amoeba/platforms/cuda/src/kernels/amoebaScaleFactors.h
+7
-7
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaFixedFieldParticle.h
...cuda/src/kernels/kCalculateAmoebaCudaFixedFieldParticle.h
+2
-2
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaKirkwood.cu
...latforms/cuda/src/kernels/kCalculateAmoebaCudaKirkwood.cu
+1
-1
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaKirkwoodEDiff.cu
...rms/cuda/src/kernels/kCalculateAmoebaCudaKirkwoodEDiff.cu
+1
-1
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaMutualInducedAndGkFields.cu
...c/kernels/kCalculateAmoebaCudaMutualInducedAndGkFields.cu
+1
-1
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaMutualInducedParticle.h
...a/src/kernels/kCalculateAmoebaCudaMutualInducedParticle.h
+1
-1
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaMapTorques.cu
.../platforms/cuda/src/kernels/kCalculateAmoebaMapTorques.cu
+1
-1
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaRotateFrame.cu
...platforms/cuda/src/kernels/kCalculateAmoebaRotateFrame.cu
+1
-1
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaHarmonicBondForce.cpp
.../platforms/cuda/tests/TestCudaAmoebaHarmonicBondForce.cpp
+4
-4
No files found.
plugins/amoeba/platforms/cuda/src/kernels/AmoebaGpu.cpp
View file @
e37555bb
...
@@ -38,6 +38,7 @@ extern void OPENMMCUDA_EXPORT SetForcesSim(gpuContext gpu);
...
@@ -38,6 +38,7 @@ extern void OPENMMCUDA_EXPORT SetForcesSim(gpuContext gpu);
#include <sstream>
#include <sstream>
#include <limits>
#include <limits>
#include <cstring>
#ifdef WIN32
#ifdef WIN32
// #include <windows.h>
// #include <windows.h>
...
...
plugins/amoeba/platforms/cuda/src/kernels/amoebaScaleFactors.h
View file @
e37555bb
...
@@ -41,14 +41,14 @@ static __constant__ float directScale[5] = { 0.0f, 1.0f, 1.0f, 1.0f, 1.0f };
...
@@ -41,14 +41,14 @@ static __constant__ float directScale[5] = { 0.0f, 1.0f, 1.0f, 1.0f, 1.0f };
// subroutine to get masked scale factors
// subroutine to get masked scale factors
__device__
void
getMaskedDScaleFactor
(
unsigned
int
gridIndex
,
int
scaleMask
,
float
*
dScale
)
__device__
static
void
getMaskedDScaleFactor
(
unsigned
int
gridIndex
,
int
scaleMask
,
float
*
dScale
)
{
{
unsigned
int
mask
=
1
<<
gridIndex
;
unsigned
int
mask
=
1
<<
gridIndex
;
*
dScale
=
(
scaleMask
&
mask
)
?
0
.
0
f
:
1
.
0
f
;
*
dScale
=
(
scaleMask
&
mask
)
?
0
.
0
f
:
1
.
0
f
;
}
}
__device__
void
getMaskedPScaleFactor
(
unsigned
int
gridIndex
,
int2
scaleMask
,
float
*
pScale
)
__device__
static
void
getMaskedPScaleFactor
(
unsigned
int
gridIndex
,
int2
scaleMask
,
float
*
pScale
)
{
{
unsigned
int
mask
=
1
<<
gridIndex
;
unsigned
int
mask
=
1
<<
gridIndex
;
*
pScale
=
(
scaleMask
.
x
&
mask
)
?
0
.
5
f
:
1
.
0
f
;
*
pScale
=
(
scaleMask
.
x
&
mask
)
?
0
.
5
f
:
1
.
0
f
;
...
@@ -56,7 +56,7 @@ __device__ void getMaskedPScaleFactor( unsigned int gridIndex, int2 scaleMask, f
...
@@ -56,7 +56,7 @@ __device__ void getMaskedPScaleFactor( unsigned int gridIndex, int2 scaleMask, f
}
}
__device__
void
getMaskedMScaleFactor
(
unsigned
int
gridIndex
,
int2
scaleMask
,
float
*
mScale
)
__device__
static
void
getMaskedMScaleFactor
(
unsigned
int
gridIndex
,
int2
scaleMask
,
float
*
mScale
)
{
{
unsigned
int
mask
=
1
<<
gridIndex
;
unsigned
int
mask
=
1
<<
gridIndex
;
...
@@ -73,7 +73,7 @@ __device__ void getMaskedMScaleFactor( unsigned int gridIndex, int2 scaleMask, f
...
@@ -73,7 +73,7 @@ __device__ void getMaskedMScaleFactor( unsigned int gridIndex, int2 scaleMask, f
// subroutine to get cell coordinates
// subroutine to get cell coordinates
__device__
void
decodeCell
(
unsigned
int
cellId
,
unsigned
int
*
x
,
unsigned
int
*
y
,
bool
*
exclusions
)
__device__
static
void
decodeCell
(
unsigned
int
cellId
,
unsigned
int
*
x
,
unsigned
int
*
y
,
bool
*
exclusions
)
{
{
*
x
=
cellId
;
*
x
=
cellId
;
*
y
=
((
*
x
>>
2
)
&
0x7fff
)
<<
GRIDBITS
;
*
y
=
((
*
x
>>
2
)
&
0x7fff
)
<<
GRIDBITS
;
...
@@ -83,7 +83,7 @@ __device__ void decodeCell( unsigned int cellId, unsigned int* x, unsigned int*
...
@@ -83,7 +83,7 @@ __device__ void decodeCell( unsigned int cellId, unsigned int* x, unsigned int*
}
}
__device__
void
load3dArrayBufferPerWarp
(
unsigned
int
offset
,
float
*
forceSum
,
float
*
outputForce
)
__device__
static
void
load3dArrayBufferPerWarp
(
unsigned
int
offset
,
float
*
forceSum
,
float
*
outputForce
)
{
{
float
of
;
float
of
;
...
@@ -101,7 +101,7 @@ __device__ void load3dArrayBufferPerWarp( unsigned int offset, float* forceSum,
...
@@ -101,7 +101,7 @@ __device__ void load3dArrayBufferPerWarp( unsigned int offset, float* forceSum,
}
}
__device__
void
load3dArray
(
unsigned
int
offset
,
float
*
forceSum
,
float
*
outputForce
)
__device__
static
void
load3dArray
(
unsigned
int
offset
,
float
*
forceSum
,
float
*
outputForce
)
{
{
outputForce
[
offset
]
=
forceSum
[
0
];
outputForce
[
offset
]
=
forceSum
[
0
];
...
@@ -110,7 +110,7 @@ __device__ void load3dArray( unsigned int offset, float* forceSum, float* output
...
@@ -110,7 +110,7 @@ __device__ void load3dArray( unsigned int offset, float* forceSum, float* output
}
}
__device__
void
scale3dArray
(
float
scaleFactor
,
float
*
force
)
__device__
static
void
scale3dArray
(
float
scaleFactor
,
float
*
force
)
{
{
force
[
0
]
*=
scaleFactor
;
force
[
0
]
*=
scaleFactor
;
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaFixedFieldParticle.h
View file @
e37555bb
...
@@ -124,7 +124,7 @@ __device__ void loadFixedFieldParticleData( struct FixedFieldParticle* sA,
...
@@ -124,7 +124,7 @@ __device__ void loadFixedFieldParticleData( struct FixedFieldParticle* sA,
// zero fields
// zero fields
__device__
void
zeroFixedFieldParticleSharedField
(
struct
FixedFieldParticle
*
sA
)
__device__
static
void
zeroFixedFieldParticleSharedField
(
struct
FixedFieldParticle
*
sA
)
{
{
sA
->
eField
[
0
]
=
0
.
0
f
;
sA
->
eField
[
0
]
=
0
.
0
f
;
...
@@ -144,7 +144,7 @@ __device__ void zeroFixedFieldParticleSharedField( struct FixedFieldParticle* sA
...
@@ -144,7 +144,7 @@ __device__ void zeroFixedFieldParticleSharedField( struct FixedFieldParticle* sA
// body of fixed E-field calculation
// body of fixed E-field calculation
__device__
void
calculateFixedEFieldPairIxn_kernel
(
float4
atomCoordinatesI
,
float4
atomCoordinatesJ
,
__device__
static
void
calculateFixedEFieldPairIxn_kernel
(
float4
atomCoordinatesI
,
float4
atomCoordinatesJ
,
float
dampingFactorI
,
float
dampingFactorJ
,
float
dampingFactorI
,
float
dampingFactorJ
,
float
tholeI
,
float
tholeJ
,
float
tholeI
,
float
tholeJ
,
float
*
labDipoleI
,
float
*
labDipoleJ
,
float
*
labDipoleI
,
float
*
labDipoleJ
,
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaKirkwood.cu
View file @
e37555bb
...
@@ -1997,7 +1997,7 @@ int debugIndex = atomJ;
...
@@ -1997,7 +1997,7 @@ int debugIndex = atomJ;
}
}
__device__
int
debugAccumulate
(
int
index
,
float4
*
debugArray
,
float
*
field
,
unsigned
int
addMask
,
float
idLabel
)
__device__
static
int
debugAccumulate
(
int
index
,
float4
*
debugArray
,
float
*
field
,
unsigned
int
addMask
,
float
idLabel
)
{
{
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
debugArray
[
index
].
x
=
addMask
?
field
[
0
]
:
0.0
f
;
debugArray
[
index
].
x
=
addMask
?
field
[
0
]
:
0.0
f
;
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaKirkwoodEDiff.cu
View file @
e37555bb
...
@@ -1031,7 +1031,7 @@ __device__ void calculateKirkwoodEDiffPairIxn_kernel( float4 atomCoordinatesI,
...
@@ -1031,7 +1031,7 @@ __device__ void calculateKirkwoodEDiffPairIxn_kernel( float4 atomCoordinatesI,
}
}
__device__
int
debugAccumulate
(
unsigned
int
index
,
float4
*
debugArray
,
float
*
field
,
unsigned
int
addMask
,
float
idLabel
)
__device__
static
int
debugAccumulate
(
unsigned
int
index
,
float4
*
debugArray
,
float
*
field
,
unsigned
int
addMask
,
float
idLabel
)
{
{
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
debugArray
[
index
].
x
=
addMask
?
field
[
0
]
:
0.0
f
;
debugArray
[
index
].
x
=
addMask
?
field
[
0
]
:
0.0
f
;
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaMutualInducedAndGkFields.cu
View file @
e37555bb
...
@@ -267,7 +267,7 @@ __device__ void calculateMutualInducedAndGkFieldsGkPairIxn_kernel( float4 atomCo
...
@@ -267,7 +267,7 @@ __device__ void calculateMutualInducedAndGkFieldsGkPairIxn_kernel( float4 atomCo
}
}
__device__
int
debugAccumulate
(
int
index
,
float4
*
debugArray
,
float
*
field
,
unsigned
int
addMask
,
float
idLabel
)
__device__
static
int
debugAccumulate
(
int
index
,
float4
*
debugArray
,
float
*
field
,
unsigned
int
addMask
,
float
idLabel
)
{
{
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
debugArray
[
index
].
x
=
addMask
?
field
[
0
]
:
0.0
f
;
debugArray
[
index
].
x
=
addMask
?
field
[
0
]
:
0.0
f
;
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaMutualInducedParticle.h
View file @
e37555bb
...
@@ -77,7 +77,7 @@ __device__ void loadMutualInducedShared( struct MutualInducedParticle* sA, unsig
...
@@ -77,7 +77,7 @@ __device__ void loadMutualInducedShared( struct MutualInducedParticle* sA, unsig
#endif
#endif
}
}
__device__
void
zeroMutualInducedParticleSharedField
(
struct
MutualInducedParticle
*
sA
)
__device__
static
void
zeroMutualInducedParticleSharedField
(
struct
MutualInducedParticle
*
sA
)
{
{
// zero shared fields
// zero shared fields
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaMapTorques.cu
View file @
e37555bb
...
@@ -28,7 +28,7 @@ void GetCalculateAmoebaCudaMapTorquesSim(amoebaGpuContext amoebaGpu)
...
@@ -28,7 +28,7 @@ void GetCalculateAmoebaCudaMapTorquesSim(amoebaGpuContext amoebaGpu)
RTERROR
(
status
,
"GetCalculateAmoebaCudaMapTorquesSim: cudaMemcpyFromSymbol: SetSim copy from cAmoebaSim failed"
);
RTERROR
(
status
,
"GetCalculateAmoebaCudaMapTorquesSim: cudaMemcpyFromSymbol: SetSim copy from cAmoebaSim failed"
);
}
}
__device__
float
normVector3
(
float
*
vector
)
__device__
static
float
normVector3
(
float
*
vector
)
{
{
float
norm
=
DOT3
(
vector
,
vector
);
float
norm
=
DOT3
(
vector
,
vector
);
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaRotateFrame.cu
View file @
e37555bb
...
@@ -34,7 +34,7 @@ void GetCalculateAmoebaMultipoleForcesSim(amoebaGpuContext amoebaGpu)
...
@@ -34,7 +34,7 @@ void GetCalculateAmoebaMultipoleForcesSim(amoebaGpuContext amoebaGpu)
RTERROR
(
status
,
"GetCalculateAmoebaMultipoleForcesSim: cudaMemcpyFromSymbol: SetSim copy from cAmoebaSim failed"
);
RTERROR
(
status
,
"GetCalculateAmoebaMultipoleForcesSim: cudaMemcpyFromSymbol: SetSim copy from cAmoebaSim failed"
);
}
}
__device__
float
normVector3
(
float
*
vector
)
__device__
static
float
normVector3
(
float
*
vector
)
{
{
float
norm
=
DOT3
(
vector
,
vector
);
float
norm
=
DOT3
(
vector
,
vector
);
...
...
plugins/amoeba/platforms/cuda/tests/TestCudaAmoebaHarmonicBondForce.cpp
View file @
e37555bb
...
@@ -54,7 +54,7 @@ static void computeAmoebaHarmonicBondForce(int bondIndex, std::vector<Vec3>& po
...
@@ -54,7 +54,7 @@ static void computeAmoebaHarmonicBondForce(int bondIndex, std::vector<Vec3>& po
double
quadraticK
;
double
quadraticK
;
double
cubicK
;
double
cubicK
;
double
quarticK
;
double
quarticK
;
amoebaHarmonicBondForce
.
getBondParameters
(
bondIndex
,
particle1
,
particle2
,
bondLength
,
quadraticK
,
cubicK
,
quarticK
);
amoebaHarmonicBondForce
.
getBondParameters
(
bondIndex
,
particle1
,
particle2
,
bondLength
,
quadraticK
);
double
deltaR
[
3
];
double
deltaR
[
3
];
double
r2
=
0.0
;
double
r2
=
0.0
;
...
@@ -152,7 +152,7 @@ void testOneBond( FILE* log ) {
...
@@ -152,7 +152,7 @@ void testOneBond( FILE* log ) {
double
quadraticK
=
1.0
;
double
quadraticK
=
1.0
;
double
cubicK
=
2.0
;
double
cubicK
=
2.0
;
double
quarticicK
=
3.0
;
double
quarticicK
=
3.0
;
amoebaHarmonicBondForce
->
addBond
(
0
,
1
,
bondLength
,
quadraticK
,
cubicK
,
quarticicK
);
amoebaHarmonicBondForce
->
addBond
(
0
,
1
,
bondLength
,
quadraticK
);
system
.
addForce
(
amoebaHarmonicBondForce
);
system
.
addForce
(
amoebaHarmonicBondForce
);
Context
context
(
system
,
integrator
,
Platform
::
getPlatformByName
(
"Cuda"
));
Context
context
(
system
,
integrator
,
Platform
::
getPlatformByName
(
"Cuda"
));
...
@@ -181,8 +181,8 @@ void testTwoBond( FILE* log ) {
...
@@ -181,8 +181,8 @@ void testTwoBond( FILE* log ) {
double
quadraticK
=
1.0
;
double
quadraticK
=
1.0
;
double
cubicK
=
2.0
;
double
cubicK
=
2.0
;
double
quarticicK
=
3.0
;
double
quarticicK
=
3.0
;
amoebaHarmonicBondForce
->
addBond
(
0
,
1
,
bondLength
,
quadraticK
,
cubicK
,
quarticicK
);
amoebaHarmonicBondForce
->
addBond
(
0
,
1
,
bondLength
,
quadraticK
);
amoebaHarmonicBondForce
->
addBond
(
1
,
2
,
bondLength
,
quadraticK
,
cubicK
,
quarticicK
);
amoebaHarmonicBondForce
->
addBond
(
1
,
2
,
bondLength
,
quadraticK
);
system
.
addForce
(
amoebaHarmonicBondForce
);
system
.
addForce
(
amoebaHarmonicBondForce
);
Context
context
(
system
,
integrator
,
Platform
::
getPlatformByName
(
"Cuda"
));
Context
context
(
system
,
integrator
,
Platform
::
getPlatformByName
(
"Cuda"
));
...
...
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