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
f92c61b0
Commit
f92c61b0
authored
Sep 03, 2009
by
Christopher Bruns
Browse files
Work around two different "PI" finding problems on Windows XP with Visual Studio Express 9 (2008)
parent
68ec5df7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
platforms/cuda/src/kernels/gpu.cpp
platforms/cuda/src/kernels/gpu.cpp
+2
-0
platforms/cuda/src/kernels/kCalculatePME.cu
platforms/cuda/src/kernels/kCalculatePME.cu
+5
-2
No files found.
platforms/cuda/src/kernels/gpu.cpp
View file @
f92c61b0
...
...
@@ -38,6 +38,8 @@
#include <set>
#include <algorithm>
#ifdef WIN32
#define _USE_MATH_DEFINES
/* M_PI */
#include <math.h>
#include <windows.h>
#else
#include <stdint.h>
...
...
platforms/cuda/src/kernels/kCalculatePME.cu
View file @
f92c61b0
...
...
@@ -32,6 +32,9 @@ using namespace std;
static
__constant__
cudaGmxSimulation
cSim
;
/* Cuda compiler on Windows does not recognized "static const float" values */
#define LOCAL_HACK_PI 3.1415926535897932384626433832795
void
SetCalculatePMESim
(
gpuContext
gpu
)
{
cudaError_t
status
;
...
...
@@ -372,8 +375,8 @@ __global__ void kGridSpreadCharge_kernel()
__global__
void
kReciprocalConvolution_kernel
()
{
const
unsigned
int
gridSize
=
cSim
.
pmeGridSize
.
x
*
cSim
.
pmeGridSize
.
y
*
cSim
.
pmeGridSize
.
z
;
float
expFactor
=
PI
*
PI
/
(
cSim
.
alphaEwald
*
cSim
.
alphaEwald
);
float
scaleFactor
=
1.0
/
(
PI
*
cSim
.
periodicBoxSizeX
*
cSim
.
periodicBoxSizeY
*
cSim
.
periodicBoxSizeZ
);
float
expFactor
=
LOCAL_HACK_PI
*
LOCAL_HACK_
PI
/
(
cSim
.
alphaEwald
*
cSim
.
alphaEwald
);
float
scaleFactor
=
1.0
/
(
LOCAL_HACK_
PI
*
cSim
.
periodicBoxSizeX
*
cSim
.
periodicBoxSizeY
*
cSim
.
periodicBoxSizeZ
);
float
energy
=
0.0
f
;
for
(
int
index
=
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
;
index
<
gridSize
;
index
+=
blockDim
.
x
*
gridDim
.
x
)
{
...
...
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