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
2833fb44
Commit
2833fb44
authored
Jun 29, 2010
by
Mark Friedrichs
Browse files
Added static to __device__ declarations to allow compilation w/ CUDA 3.1
parent
15a2db5e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
13 deletions
+13
-13
platforms/cuda/src/kernels/bbsort_kernel.cu
platforms/cuda/src/kernels/bbsort_kernel.cu
+4
-4
platforms/cuda/src/kernels/kCalculateCDLJForces.cu
platforms/cuda/src/kernels/kCalculateCDLJForces.cu
+1
-1
platforms/cuda/src/kernels/kCalculateCDLJObcGbsaForces1.cu
platforms/cuda/src/kernels/kCalculateCDLJObcGbsaForces1.cu
+1
-1
platforms/cuda/src/kernels/kCalculateGBVIAux.h
platforms/cuda/src/kernels/kCalculateGBVIAux.h
+6
-6
plugins/freeEnergy/platforms/cuda/src/kernels/kSoftcoreLJ.h
plugins/freeEnergy/platforms/cuda/src/kernels/kSoftcoreLJ.h
+1
-1
No files found.
platforms/cuda/src/kernels/bbsort_kernel.cu
View file @
2833fb44
...
@@ -19,23 +19,23 @@ texture<unsigned int, 1, cudaReadModeElementType> tBucketOffsets;
...
@@ -19,23 +19,23 @@ texture<unsigned int, 1, cudaReadModeElementType> tBucketOffsets;
texture
<
unsigned
int
,
1
,
cudaReadModeElementType
>
tBucketOfSlices
;
texture
<
unsigned
int
,
1
,
cudaReadModeElementType
>
tBucketOfSlices
;
texture
<
unsigned
int
,
1
,
cudaReadModeElementType
>
tSliceOffsetInBucket
;
texture
<
unsigned
int
,
1
,
cudaReadModeElementType
>
tSliceOffsetInBucket
;
__device__
int
dGetValue
(
int2
v
){
static
__device__
int
dGetValue
(
int2
v
){
return
v
.
y
;
return
v
.
y
;
}
}
template
<
typename
T
>
template
<
typename
T
>
__device__
T
dGetValue
(
T
v
){
static
__device__
T
dGetValue
(
T
v
){
return
v
;
return
v
;
}
}
__device__
void
dPad
(
int2
&
v
){
static
__device__
void
dPad
(
int2
&
v
){
v
.
x
=
0x3fffffff
;
v
.
x
=
0x3fffffff
;
v
.
y
=
0x4fffffff
;
v
.
y
=
0x4fffffff
;
}
}
template
<
typename
T
>
template
<
typename
T
>
__device__
void
dPad
(
T
&
v
){
static
__device__
void
dPad
(
T
&
v
){
v
=
0x7fffffff
;
v
=
0x7fffffff
;
}
}
...
...
platforms/cuda/src/kernels/kCalculateCDLJForces.cu
View file @
2833fb44
...
@@ -69,7 +69,7 @@ void GetCalculateCDLJForcesSim(gpuContext gpu)
...
@@ -69,7 +69,7 @@ void GetCalculateCDLJForcesSim(gpuContext gpu)
texture
<
float
,
1
,
cudaReadModeElementType
>
tabulatedErfcRef
;
texture
<
float
,
1
,
cudaReadModeElementType
>
tabulatedErfcRef
;
__device__
float
fastErfc
(
float
r
)
static
__device__
float
fastErfc
(
float
r
)
{
{
float
normalized
=
cSim
.
tabulatedErfcScale
*
r
;
float
normalized
=
cSim
.
tabulatedErfcScale
*
r
;
int
index
=
(
int
)
normalized
;
int
index
=
(
int
)
normalized
;
...
...
platforms/cuda/src/kernels/kCalculateCDLJObcGbsaForces1.cu
View file @
2833fb44
...
@@ -66,7 +66,7 @@ void GetCalculateCDLJObcGbsaForces1Sim(gpuContext gpu)
...
@@ -66,7 +66,7 @@ void GetCalculateCDLJObcGbsaForces1Sim(gpuContext gpu)
}
}
texture
<
float
,
1
,
cudaReadModeElementType
>
tabulatedErfcRef
;
texture
<
float
,
1
,
cudaReadModeElementType
>
tabulatedErfcRef
;
__device__
float
fastErfc
(
float
r
)
static
__device__
float
fastErfc
(
float
r
)
{
{
float
normalized
=
cSim
.
tabulatedErfcScale
*
r
;
float
normalized
=
cSim
.
tabulatedErfcScale
*
r
;
int
index
=
(
int
)
normalized
;
int
index
=
(
int
)
normalized
;
...
...
platforms/cuda/src/kernels/kCalculateGBVIAux.h
View file @
2833fb44
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
* This file contains subroutines used in evaluating quantities associated w/ the GB/VI function
* This file contains subroutines used in evaluating quantities associated w/ the GB/VI function
*/
*/
__device__
float
getGBVI_L
(
float
r
,
float
x
,
float
S
)
static
__device__
float
getGBVI_L
(
float
r
,
float
x
,
float
S
)
{
{
float
rInv
=
1
.
0
f
/
r
;
float
rInv
=
1
.
0
f
/
r
;
...
@@ -48,7 +48,7 @@ __device__ float getGBVI_L( float r, float x, float S )
...
@@ -48,7 +48,7 @@ __device__ float getGBVI_L( float r, float x, float S )
return
(
1
.
5
f
*
xInv2
)
*
(
(
0
.
25
f
*
rInv
)
-
(
xInv
/
3
.
0
f
)
+
(
0
.
125
f
*
diff2
*
xInv2
*
rInv
)
);
return
(
1
.
5
f
*
xInv2
)
*
(
(
0
.
25
f
*
rInv
)
-
(
xInv
/
3
.
0
f
)
+
(
0
.
125
f
*
diff2
*
xInv2
*
rInv
)
);
}
}
__device__
float
getGBVI_Volume
(
float
r_ij
,
float
R
,
float
S
)
static
__device__
float
getGBVI_Volume
(
float
r_ij
,
float
R
,
float
S
)
{
{
float
upperBound
=
r_ij
+
S
;
float
upperBound
=
r_ij
+
S
;
...
@@ -63,7 +63,7 @@ __device__ float getGBVI_Volume( float r_ij, float R, float S )
...
@@ -63,7 +63,7 @@ __device__ float getGBVI_Volume( float r_ij, float R, float S )
}
}
__device__
float
getGBVI_dL_dr
(
float
r
,
float
x
,
float
S
)
static
__device__
float
getGBVI_dL_dr
(
float
r
,
float
x
,
float
S
)
{
{
float
rInv
=
1
.
0
f
/
r
;
float
rInv
=
1
.
0
f
/
r
;
...
@@ -80,7 +80,7 @@ __device__ float getGBVI_dL_dr( float r, float x, float S )
...
@@ -80,7 +80,7 @@ __device__ float getGBVI_dL_dr( float r, float x, float S )
}
}
__device__
float
getGBVI_dL_dx
(
float
r
,
float
x
,
float
S
)
static
__device__
float
getGBVI_dL_dx
(
float
r
,
float
x
,
float
S
)
{
{
float
rInv
=
1
.
0
f
/
r
;
float
rInv
=
1
.
0
f
/
r
;
...
@@ -96,7 +96,7 @@ __device__ float getGBVI_dL_dx( float r, float x, float S )
...
@@ -96,7 +96,7 @@ __device__ float getGBVI_dL_dx( float r, float x, float S )
}
}
__device__
float
getGBVI_dE2
(
float
r
,
float
R
,
float
S
,
float
bornForce
)
static
__device__
float
getGBVI_dE2
(
float
r
,
float
R
,
float
S
,
float
bornForce
)
{
{
float
diff
=
S
-
R
;
float
diff
=
S
-
R
;
...
@@ -119,7 +119,7 @@ __device__ float getGBVI_dE2( float r, float R, float S, float bornForce )
...
@@ -119,7 +119,7 @@ __device__ float getGBVI_dE2( float r, float R, float S, float bornForce )
}
}
__device__
float
getGBVIBornForce2
(
float
bornRadius
,
float
R
,
float
bornForce
,
float
gamma
)
static
__device__
float
getGBVIBornForce2
(
float
bornRadius
,
float
R
,
float
bornForce
,
float
gamma
)
{
{
float
ratio
=
(
R
/
bornRadius
);
float
ratio
=
(
R
/
bornRadius
);
float
returnBornForce
=
bornForce
+
(
3
.
0
f
*
gamma
*
ratio
*
ratio
*
ratio
)
/
bornRadius
;
// 'cavity' term
float
returnBornForce
=
bornForce
+
(
3
.
0
f
*
gamma
*
ratio
*
ratio
*
ratio
)
/
bornRadius
;
// 'cavity' term
...
...
plugins/freeEnergy/platforms/cuda/src/kernels/kSoftcoreLJ.h
View file @
2833fb44
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
*/
*/
#ifdef USE_SOFTCORE_LJ
#ifdef USE_SOFTCORE_LJ
__device__
float
getSoftCoreLJ
(
float
r2
,
float
sig
,
float
eps
,
float
lambdaI
,
float
lambdaJ
,
float
*
energy
)
static
__device__
float
getSoftCoreLJ
(
float
r2
,
float
sig
,
float
eps
,
float
lambdaI
,
float
lambdaJ
,
float
*
energy
)
{
{
float
r
=
sqrt
(
r2
);
float
r
=
sqrt
(
r2
);
...
...
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