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
be73754b
Commit
be73754b
authored
Apr 08, 2011
by
Mark Friedrichs
Browse files
Added cudaMemcpy for initialization of induced dipoles
parent
6bad9d44
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
26 deletions
+15
-26
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaMutualInducedAndGkFields.cu
...c/kernels/kCalculateAmoebaCudaMutualInducedAndGkFields.cu
+4
-8
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaMutualInducedField.cu
...uda/src/kernels/kCalculateAmoebaCudaMutualInducedField.cu
+5
-9
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPmeMutualInducedField.cu
.../src/kernels/kCalculateAmoebaCudaPmeMutualInducedField.cu
+6
-9
No files found.
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaMutualInducedAndGkFields.cu
View file @
be73754b
...
...
@@ -249,8 +249,6 @@ void kInitializeMutualInducedAndGkField_kernel(
float
*
fixedEFieldPolar
,
float
*
fixedGkField
,
float
*
polarizability
,
float
*
inducedDipole
,
float
*
inducedDipolePolar
,
float
*
inducedDipoleS
,
float
*
inducedDipolePolarS
)
{
...
...
@@ -260,12 +258,9 @@ void kInitializeMutualInducedAndGkField_kernel(
{
fixedEField
[
pos
]
*=
polarizability
[
pos
];
inducedDipole
[
pos
]
=
fixedEField
[
pos
];
fixedEFieldPolar
[
pos
]
*=
polarizability
[
pos
];
inducedDipolePolar
[
pos
]
=
fixedEFieldPolar
[
pos
];
fixedGkField
[
pos
]
*=
polarizability
[
pos
];
inducedDipoleS
[
pos
]
=
fixedEField
[
pos
]
+
fixedGkField
[
pos
];
inducedDipolePolarS
[
pos
]
=
fixedEFieldPolar
[
pos
]
+
fixedGkField
[
pos
];
...
...
@@ -683,12 +678,13 @@ static void cudaComputeAmoebaMutualInducedAndGkFieldBySOR( amoebaGpuContext amoe
amoebaGpu
->
psE_FieldPolar
->
_pDevData
,
amoebaGpu
->
psGk_Field
->
_pDevData
,
amoebaGpu
->
psPolarizability
->
_pDevData
,
amoebaGpu
->
psInducedDipole
->
_pDevData
,
amoebaGpu
->
psInducedDipolePolar
->
_pDevData
,
amoebaGpu
->
psInducedDipoleS
->
_pDevData
,
amoebaGpu
->
psInducedDipolePolarS
->
_pDevData
);
LAUNCHERROR
(
"kInitializeMutualInducedAndGkField"
);
cudaMemcpy
(
amoebaGpu
->
psInducedDipole
->
_pDevData
,
amoebaGpu
->
psE_Field
->
_pDevData
,
3
*
gpu
->
sim
.
paddedNumberOfAtoms
*
sizeof
(
float
),
cudaMemcpyDeviceToDevice
);
cudaMemcpy
(
amoebaGpu
->
psInducedDipolePolar
->
_pDevData
,
amoebaGpu
->
psE_FieldPolar
->
_pDevData
,
3
*
gpu
->
sim
.
paddedNumberOfAtoms
*
sizeof
(
float
),
cudaMemcpyDeviceToDevice
);
#ifdef AMOEBA_DEBUG
if
(
amoebaGpu
->
log
){
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaMutualInducedField.cu
View file @
be73754b
...
...
@@ -115,9 +115,7 @@ void kInitializeMutualInducedField_kernel(
int
numberOfAtoms
,
float
*
fixedEField
,
float
*
fixedEFieldPolar
,
float
*
polarizability
,
float
*
inducedDipole
,
float
*
inducedDipolePolar
)
float
*
polarizability
)
{
int
pos
=
__mul24
(
blockIdx
.
x
,
blockDim
.
x
)
+
threadIdx
.
x
;
...
...
@@ -125,10 +123,7 @@ void kInitializeMutualInducedField_kernel(
{
fixedEField
[
pos
]
*=
polarizability
[
pos
];
inducedDipole
[
pos
]
=
fixedEField
[
pos
];
fixedEFieldPolar
[
pos
]
*=
polarizability
[
pos
];
inducedDipolePolar
[
pos
]
=
fixedEFieldPolar
[
pos
];
pos
+=
blockDim
.
x
*
gridDim
.
x
;
}
...
...
@@ -488,11 +483,12 @@ static void cudaComputeAmoebaMutualInducedFieldBySOR( amoebaGpuContext amoebaGpu
gpu
->
natoms
,
amoebaGpu
->
psE_Field
->
_pDevData
,
amoebaGpu
->
psE_FieldPolar
->
_pDevData
,
amoebaGpu
->
psPolarizability
->
_pDevData
,
amoebaGpu
->
psInducedDipole
->
_pDevData
,
amoebaGpu
->
psInducedDipolePolar
->
_pDevData
);
amoebaGpu
->
psPolarizability
->
_pDevData
);
LAUNCHERROR
(
"AmoebaMutualInducedFieldSetup"
);
cudaMemcpy
(
amoebaGpu
->
psInducedDipole
->
_pDevData
,
amoebaGpu
->
psE_Field
->
_pDevData
,
3
*
gpu
->
sim
.
paddedNumberOfAtoms
*
sizeof
(
float
),
cudaMemcpyDeviceToDevice
);
cudaMemcpy
(
amoebaGpu
->
psInducedDipolePolar
->
_pDevData
,
amoebaGpu
->
psE_FieldPolar
->
_pDevData
,
3
*
gpu
->
sim
.
paddedNumberOfAtoms
*
sizeof
(
float
),
cudaMemcpyDeviceToDevice
);
#ifdef AMOEBA_DEBUG
if
(
amoebaGpu
->
log
){
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaPmeMutualInducedField.cu
View file @
be73754b
...
...
@@ -237,19 +237,15 @@ static void kInitializeMutualInducedField_kernel(
int
numberOfAtoms
,
float
*
fixedEField
,
float
*
fixedEFieldPolar
,
float
*
polarizability
,
float
*
inducedDipole
,
float
*
inducedDipolePolar
)
float
*
polarizability
)
{
int
pos
=
__mul24
(
blockIdx
.
x
,
blockDim
.
x
)
+
threadIdx
.
x
;
while
(
pos
<
3
*
cSim
.
atoms
)
{
fixedEField
[
pos
]
*=
polarizability
[
pos
];
inducedDipole
[
pos
]
=
fixedEField
[
pos
];
fixedEFieldPolar
[
pos
]
*=
polarizability
[
pos
];
inducedDipolePolar
[
pos
]
=
fixedEFieldPolar
[
pos
];
pos
+=
blockDim
.
x
*
gridDim
.
x
;
}
...
...
@@ -555,11 +551,12 @@ static void cudaComputeAmoebaPmeMutualInducedFieldBySOR( amoebaGpuContext amoeba
gpu
->
natoms
,
amoebaGpu
->
psE_Field
->
_pDevData
,
amoebaGpu
->
psE_FieldPolar
->
_pDevData
,
amoebaGpu
->
psPolarizability
->
_pDevData
,
amoebaGpu
->
psInducedDipole
->
_pDevData
,
amoebaGpu
->
psInducedDipolePolar
->
_pDevData
);
amoebaGpu
->
psPolarizability
->
_pDevData
);
LAUNCHERROR
(
"AmoebaPmeMutualInducedFieldSetup"
);
cudaMemcpy
(
amoebaGpu
->
psInducedDipole
->
_pDevData
,
amoebaGpu
->
psE_Field
->
_pDevData
,
3
*
gpu
->
sim
.
paddedNumberOfAtoms
*
sizeof
(
float
),
cudaMemcpyDeviceToDevice
);
cudaMemcpy
(
amoebaGpu
->
psInducedDipolePolar
->
_pDevData
,
amoebaGpu
->
psE_FieldPolar
->
_pDevData
,
3
*
gpu
->
sim
.
paddedNumberOfAtoms
*
sizeof
(
float
),
cudaMemcpyDeviceToDevice
);
#ifdef AMOEBA_DEBUG
if
(
amoebaGpu
->
log
){
...
...
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