Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
docking
ocladock
Commits
a8fb9077
Commit
a8fb9077
authored
May 29, 2018
by
lvs
Browse files
corrected smoothing with vdw index
parent
9b20069a
Changes
12
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
a8fb9077
...
...
@@ -206,10 +206,10 @@ NRUN := 100
POPSIZE
:=
150
TESTNAME
:=
test
TESTLS
:=
sd
NUM_LSIT
:=
30
0
NUM_LSIT
:=
30
test
:
odock
$(BIN_DIR)
/
$(TARGET)
-ffile
./input/
$(PDB)
/derived/
$(PDB)
_protein.maps.fld
-lfile
./input/
$(PDB)
/derived/
$(PDB)
_ligand.pdbqt
-nrun
$(NRUN)
-psize
$(POPSIZE)
-resnam
$(TESTNAME)
-gfpop
1
-lsmet
$(TESTLS)
-lsit
$(NUM_LSIT)
-smooth
0.
0
$(BIN_DIR)
/
$(TARGET)
-ffile
./input/
$(PDB)
/derived/
$(PDB)
_protein.maps.fld
-lfile
./input/
$(PDB)
/derived/
$(PDB)
_ligand.pdbqt
-nrun
$(NRUN)
-psize
$(POPSIZE)
-resnam
$(TESTNAME)
-gfpop
1
-lsmet
$(TESTLS)
-lsit
$(NUM_LSIT)
-smooth
0.
5
ASTEX_PDB
:=
2bsm
ASTEX_NRUN
:=
10
...
...
device/calcenergy.cl
View file @
a8fb9077
...
...
@@ -21,9 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//#define
DEBUG_ENERGY_KERNEL1
//#define
DEBUG_ENERGY_KERNEL4
//#define
DEBUG_ENERGY_KERNEL3
//#define
DEBUG_ENERGY_KERNEL
#
include
"calcenergy_basic.h"
...
...
@@ -59,7 +57,7 @@ void gpu_calc_energy(
__local
float*
calc_coords_z,
__local
float*
partial_energies,
#
if
defined
(
DEBUG_ENERGY_KERNEL
1
)
|
| defined (DEBUG_ENERGY_KERNEL4) || defined (DEBUG_ENERGY_KERNEL3
)
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
__local
float*
partial_interE,
__local
float*
partial_intraE,
#
endif
...
...
@@ -67,9 +65,14 @@ void gpu_calc_energy(
__constant
float*
atom_charges_const,
__constant
char*
atom_types_const,
__constant
char*
intraE_contributors_const,
#
if
0
bool
debug,
#
endif
float
dockpars_smooth,
__constant
float*
reqm,
__constant
float*
reqm_hbond,
__constant
uint*
atom1_types_reqm,
__constant
uint*
atom2_types_reqm,
__constant
float*
VWpars_AC_const,
__constant
float*
VWpars_BD_const,
__constant
float*
dspars_S_const,
...
...
@@ -90,7 +93,7 @@ void gpu_calc_energy(
{
partial_energies[get_local_id
(
0
)
]
=
0.0f
;
#if defined (DEBUG_ENERGY_KERNEL
1) || defined (DEBUG_ENERGY_KERNEL4) || defined (DEBUG_ENERGY_KERNEL3
)
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
partial_interE[get_local_id
(
0
)
]
=
0.0f
;
partial_intraE[get_local_id
(
0
)
]
=
0.0f
;
#
endif
...
...
@@ -269,7 +272,7 @@ void gpu_calc_energy(
|
|
(
z
>=
dockpars_gridsize_z-1
))
{
partial_energies[get_local_id
(
0
)
]
+=
16777216.0f
; //100000.0f;
#if defined (DEBUG_ENERGY_KERNEL
1) || defined (DEBUG_ENERGY_KERNEL4) || defined (DEBUG_ENERGY_KERNEL3
)
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
partial_interE[get_local_id
(
0
)
]
+=
16777216.0f
;
#
endif
}
...
...
@@ -328,7 +331,7 @@ void gpu_calc_energy(
//
Calculating
affinity
energy
partial_energies[get_local_id
(
0
)
]
+=
TRILININTERPOL
(
cube,
weights
)
;
#if defined (DEBUG_ENERGY_KERNEL
1) || defined (DEBUG_ENERGY_KERNEL4) || defined (DEBUG_ENERGY_KERNEL3
)
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
partial_interE[get_local_id
(
0
)
]
+=
TRILININTERPOL
(
cube,
weights
)
;
#
endif
...
...
@@ -348,7 +351,7 @@ void gpu_calc_energy(
//
Calculating
electrostatic
energy
partial_energies[get_local_id
(
0
)
]
+=
q
*
TRILININTERPOL
(
cube,
weights
)
;
#if defined (DEBUG_ENERGY_KERNEL
1) || defined (DEBUG_ENERGY_KERNEL4) || defined (DEBUG_ENERGY_KERNEL3
)
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
partial_interE[get_local_id
(
0
)
]
+=
q
*
TRILININTERPOL
(
cube,
weights
)
;
#
endif
...
...
@@ -368,7 +371,7 @@ void gpu_calc_energy(
//
Calculating
desolvation
energy
partial_energies[get_local_id
(
0
)
]
+=
fabs
(
q
)
*
TRILININTERPOL
(
cube,
weights
)
;
#if defined (DEBUG_ENERGY_KERNEL
1) || defined (DEBUG_ENERGY_KERNEL4) || defined (DEBUG_ENERGY_KERNEL3
)
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
partial_interE[get_local_id
(
0
)
]
+=
fabs
(
q
)
*
TRILININTERPOL
(
cube,
weights
)
;
#
endif
}
...
...
@@ -376,7 +379,7 @@ void gpu_calc_energy(
}
//
End
atom_id
for-loop
(
INTERMOLECULAR
ENERGY
)
#if defined (DEBUG_ENERGY_KERNEL
1) || defined (DEBUG_ENERGY_KERNEL4) || defined (DEBUG_ENERGY_KERNEL3
)
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
if
(
get_local_id
(
0
)
==
0
)
...
...
@@ -408,7 +411,24 @@ void gpu_calc_energy(
for
(
uint
contributor_counter
=
get_local_id
(
0
)
;
contributor_counter
<
dockpars_num_of_intraE_contributors
;
contributor_counter
+=NUM_OF_THREADS_PER_BLOCK
)
#
if
0
if
(
get_local_id
(
0
)
==
0
)
{
for
(
uint
contributor_counter
=
0
;
contributor_counter
<
dockpars_num_of_intraE_contributors
;
contributor_counter
++
)
#
endif
{
#
if
0
//
Only
for
testing
smoothing
float
smoothed_intraE
=
0.0f
;
float
raw_intraE_vdw_hb
=
0.0f
;
float
raw_intraE_el
=
0.0f
;
float
raw_intraE_sol
=
0.0f
;
float
raw_intraE
=
0.0f
;
#
endif
//
Getting
atom
IDs
uint
atom1_id
=
intraE_contributors_const[3*contributor_counter]
;
uint
atom2_id
=
intraE_contributors_const[3*contributor_counter+1]
;
...
...
@@ -423,12 +443,17 @@ void gpu_calc_energy(
float
atomic_distance
=
native_sqrt
(
subx*subx
+
suby*suby
+
subz*subz
)
*dockpars_grid_spacing
;
//
Calculating
energy
contributions
/*
if
(
atomic_distance
<
8.0f
)
{
*/
//
Getting
type
IDs
uint
atom1_typeid
=
atom_types_const[atom1_id]
;
uint
atom2_typeid
=
atom_types_const[atom2_id]
;
uint
atom1_type_vdw_hb
=
atom1_types_reqm
[atom1_typeid]
;
uint
atom2_type_vdw_hb
=
atom2_types_reqm
[atom2_typeid]
;
//
Getting
optimum
pair
distance
(
opt_distance
)
from
reqm
and
reqm_hbond
//
reqm:
equilibrium
internuclear
separation
//
(
sum
of
the
vdW
radii
of
two
like
atoms
(
A
))
in
the
case
of
vdW
...
...
@@ -438,11 +463,17 @@ void gpu_calc_energy(
if
(
intraE_contributors_const[3*contributor_counter+2]
==
1
)
//H-bond
{
#
if
0
opt_distance
=
reqm_hbond
[atom1_typeid]
+
reqm_hbond
[atom2_typeid]
;
#
endif
opt_distance
=
reqm_hbond
[atom1_type_vdw_hb]
+
reqm_hbond
[atom2_type_vdw_hb]
;
}
else
//van
der
Waals
{
#
if
0
opt_distance
=
0.5f*
(
reqm
[atom1_typeid]
+
reqm
[atom2_typeid]
)
;
#
endif
opt_distance
=
0.5f*
(
reqm
[atom1_type_vdw_hb]
+
reqm
[atom2_type_vdw_hb]
)
;
}
//
Getting
smoothed
distance
...
...
@@ -460,38 +491,33 @@ void gpu_calc_energy(
smoothed_distance
=
atomic_distance
-
delta_distance
;
}
/*
if (get_local_id (0) == 0) {
if (intraE_contributors_const[3*contributor_counter+2] == 1) //H-bond
{
printf("%-5s %u %u %f %f %f %f %f %f\n", "hbond", atom1_typeid, atom2_typeid, reqm_hbond [atom1_typeid], reqm_hbond [atom2_typeid], opt_distance, delta_distance, atomic_distance, smoothed_distance);
}
else //van der Waals
{
printf("%-5s %u %u %f %f %f %f %f %f\n", "vdw", atom1_typeid, atom2_typeid, reqm [atom1_typeid], reqm [atom2_typeid], opt_distance, delta_distance, atomic_distance, smoothed_distance);
}
}
*/
//
Calculating
van
der
Waals
/
hydrogen
bond
term
partial_energies[get_local_id
(
0
)
]
+=
native_divide
(
VWpars_AC_const[atom1_typeid
*
dockpars_num_of_atypes+atom2_typeid],native_powr
(
smoothed_distance/*atomic_distance*/,12
))
;
#if defined (DEBUG_ENERGY_KERNEL1) || defined (DEBUG_ENERGY_KERNEL4) || defined (DEBUG_ENERGY_KERNEL3)
#
if
0
smoothed_intraE
=
native_divide
(
VWpars_AC_const[atom1_typeid
*
dockpars_num_of_atypes+atom2_typeid],native_powr
(
smoothed_distance,12
))
;
raw_intraE_vdw_hb
=
native_divide
(
VWpars_AC_const[atom1_typeid
*
dockpars_num_of_atypes+atom2_typeid],native_powr
(
atomic_distance
,
12
))
;
#
endif
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
partial_intraE[get_local_id
(
0
)
]
+=
native_divide
(
VWpars_AC_const[atom1_typeid
*
dockpars_num_of_atypes+atom2_typeid],native_powr
(
smoothed_distance/*atomic_distance*/,12
))
;
#
endif
if
(
intraE_contributors_const[3*contributor_counter+2]
==
1
)
{
//H-bond
partial_energies[get_local_id
(
0
)
]
-=
native_divide
(
VWpars_BD_const[atom1_typeid
*
dockpars_num_of_atypes+atom2_typeid],native_powr
(
smoothed_distance/*atomic_distance*/,10
))
;
#if defined (DEBUG_ENERGY_KERNEL1) || defined (DEBUG_ENERGY_KERNEL4) || defined (DEBUG_ENERGY_KERNEL3)
#
if
0
smoothed_intraE
-=
native_divide
(
VWpars_BD_const[atom1_typeid
*
dockpars_num_of_atypes+atom2_typeid],native_powr
(
smoothed_distance,10
))
;
raw_intraE_vdw_hb
-=
native_divide
(
VWpars_BD_const[atom1_typeid
*
dockpars_num_of_atypes+atom2_typeid],native_powr
(
atomic_distance
,
10
))
;
#
endif
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
partial_intraE[get_local_id
(
0
)
]
-=
native_divide
(
VWpars_BD_const[atom1_typeid
*
dockpars_num_of_atypes+atom2_typeid],native_powr
(
smoothed_distance/*atomic_distance*/,10
))
;
#
endif
}
else
{
//van
der
Waals
partial_energies[get_local_id
(
0
)
]
-=
native_divide
(
VWpars_BD_const[atom1_typeid
*
dockpars_num_of_atypes+atom2_typeid],native_powr
(
smoothed_distance/*atomic_distance*/,6
))
;
#if defined (DEBUG_ENERGY_KERNEL1) || defined (DEBUG_ENERGY_KERNEL4) || defined (DEBUG_ENERGY_KERNEL3)
#
if
0
smoothed_intraE
-=
native_divide
(
VWpars_BD_const[atom1_typeid
*
dockpars_num_of_atypes+atom2_typeid],native_powr
(
smoothed_distance,6
))
;
raw_intraE_vdw_hb
-=
native_divide
(
VWpars_BD_const[atom1_typeid
*
dockpars_num_of_atypes+atom2_typeid],native_powr
(
atomic_distance
,
6
))
;
#
endif
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
partial_intraE[get_local_id
(
0
)
]
-=
native_divide
(
VWpars_BD_const[atom1_typeid
*
dockpars_num_of_atypes+atom2_typeid],native_powr
(
smoothed_distance/*atomic_distance*/,6
))
;
#
endif
}
...
...
@@ -501,8 +527,19 @@ void gpu_calc_energy(
dockpars_coeff_elec
*
atom_charges_const[atom1_id]
*
atom_charges_const[atom2_id],
atomic_distance
*
(
DIEL_A
+
native_divide
(
DIEL_B,
(
1.0f
+
DIEL_K*native_exp
(
-DIEL_B_TIMES_H*atomic_distance
))))
)
;
#if defined (DEBUG_ENERGY_KERNEL1) || defined (DEBUG_ENERGY_KERNEL4) || defined (DEBUG_ENERGY_KERNEL3)
#
if
0
smoothed_intraE
+=
native_divide
(
dockpars_coeff_elec
*
atom_charges_const[atom1_id]
*
atom_charges_const[atom2_id],
atomic_distance
*
(
DIEL_A
+
native_divide
(
DIEL_B,
(
1.0f
+
DIEL_K*native_exp
(
-DIEL_B_TIMES_H*atomic_distance
))))
)
;
raw_intraE_el
=
native_divide
(
dockpars_coeff_elec
*
atom_charges_const[atom1_id]
*
atom_charges_const[atom2_id],
atomic_distance
*
(
DIEL_A
+
native_divide
(
DIEL_B,
(
1.0f
+
DIEL_K*native_exp
(
-DIEL_B_TIMES_H*atomic_distance
))))
)
;
#
endif
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
partial_intraE[get_local_id
(
0
)
]
+=
native_divide
(
dockpars_coeff_elec
*
atom_charges_const[atom1_id]
*
atom_charges_const[atom2_id],
atomic_distance
*
(
DIEL_A
+
native_divide
(
DIEL_B,
(
1.0f
+
DIEL_K*native_exp
(
-DIEL_B_TIMES_H*atomic_distance
))))
...
...
@@ -517,7 +554,20 @@ void gpu_calc_energy(
dockpars_qasp*fabs
(
atom_charges_const[atom2_id]
))
*dspars_V_const[atom1_typeid]
)
*
dockpars_coeff_desolv*native_exp
(
-0.03858025f*native_powr
(
atomic_distance,
2
))
;
#if defined (DEBUG_ENERGY_KERNEL1) || defined (DEBUG_ENERGY_KERNEL4) || defined (DEBUG_ENERGY_KERNEL3)
#
if
0
smoothed_intraE
+=
((
dspars_S_const[atom1_typeid]
+
dockpars_qasp*fabs
(
atom_charges_const[atom1_id]
))
*dspars_V_const[atom2_typeid]
+
(
dspars_S_const[atom2_typeid]
+
dockpars_qasp*fabs
(
atom_charges_const[atom2_id]
))
*dspars_V_const[atom1_typeid]
)
*
dockpars_coeff_desolv*native_exp
(
-0.03858025f*native_powr
(
atomic_distance,
2
))
;
raw_intraE_sol
=
((
dspars_S_const[atom1_typeid]
+
dockpars_qasp*fabs
(
atom_charges_const[atom1_id]
))
*dspars_V_const[atom2_typeid]
+
(
dspars_S_const[atom2_typeid]
+
dockpars_qasp*fabs
(
atom_charges_const[atom2_id]
))
*dspars_V_const[atom1_typeid]
)
*
dockpars_coeff_desolv*native_exp
(
-0.03858025f*native_powr
(
atomic_distance,
2
))
;
#
endif
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
partial_intraE[get_local_id
(
0
)
]
+=
((
dspars_S_const[atom1_typeid]
+
dockpars_qasp*fabs
(
atom_charges_const[atom1_id]
))
*dspars_V_const[atom2_typeid]
+
(
dspars_S_const[atom2_typeid]
+
...
...
@@ -527,9 +577,61 @@ void gpu_calc_energy(
}
#
if
0
raw_intraE
=
raw_intraE_vdw_hb
+
raw_intraE_el
+
raw_intraE_sol
;
if
(
debug
==
true
)
{
///*
//if
(
get_local_id
(
0
)
==
0
)
{
if
(
intraE_contributors_const[3*contributor_counter+2]
==
1
)
//H-bond
{
//
diogos
table
//
printf
(
"%3u %-5s %3u %3u %3.5f %3.5f %3.5f %3.5f %3.5f %3.5f %3.5f\n"
,
contributor_counter,
"hbond"
,
atom1_id,
atom2_id,
reqm_hbond
[atom1_type_vdw_hb],
reqm_hbond
[atom2_type_vdw_hb],
opt_distance,
atomic_distance,
smoothed_distance,
smoothed_intraE,
raw_intraE
)
;
printf
(
"%3u %-5s %3u %3u %3.5f %3.5f %3.5f %3.5f %3.5f %3.5f %3.5f %3.5f %3.5f %3.5f\n"
,
contributor_counter,
"hbond"
,
atom1_id,
atom2_id,
reqm_hbond
[atom1_type_vdw_hb],
reqm_hbond
[atom2_type_vdw_hb],
opt_distance,
atomic_distance,
smoothed_distance,
smoothed_intraE,
raw_intraE,
raw_intraE_vdw_hb,
raw_intraE_el,
raw_intraE_sol
)
;
}
else
//van
der
Waals
{
//
diogos
table
//
printf
(
"%3u %-5s %3u %3u %3.5f %3.5f %3.5f %3.5f %3.5f %3.5f %3.5f\n"
,
contributor_counter,
"vdw"
,
atom1_id,
atom2_id,
reqm
[atom1_type_vdw_hb],
reqm
[atom2_type_vdw_hb],
opt_distance,
atomic_distance,
smoothed_distance,
smoothed_intraE,
raw_intraE
)
;
printf
(
"%3u %-5s %3u %3u %3.5f %3.5f %3.5f %3.5f %3.5f %3.5f %3.5f %3.5f %3.5f %3.5f\n"
,
contributor_counter,
"vdw"
,
atom1_id,
atom2_id,
reqm
[atom1_type_vdw_hb],
reqm
[atom2_type_vdw_hb],
opt_distance,
atomic_distance,
smoothed_distance,
smoothed_intraE,
raw_intraE,
raw_intraE_vdw_hb,
raw_intraE_el,
raw_intraE_sol
)
;
}
;
//}
//*/
}
#
endif
/*
}
//
if
(
atomic_distance
<
8.0f
)
*/
}
//
End
contributor_counter
for-loop
(
INTRAMOLECULAR
ENERGY
)
#
if
0
}
//
if
(
get_local_id
(
0
)
==
0
)
{
#
endif
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
if
(
get_local_id
(
0
)
==
0
)
...
...
@@ -546,7 +648,7 @@ void gpu_calc_energy(
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
#if defined (DEBUG_ENERGY_KERNEL
1) || defined (DEBUG_ENERGY_KERNEL4) |
|
defined
(
DEBUG_ENERGY_KERNEL3
)
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
if
(
get_local_id
(
0
)
==
0
)
{
float
energy_intraE
=
partial_intraE[0]
;
...
...
device/calcgradient.cl
View file @
a8fb9077
...
...
@@ -37,7 +37,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//#define
DEBUG_GRAD_TRANSLATION_GENES
//#define
DEBUG_GRAD_ROTATION_GENES
//#define
DEBUG_GRAD_TORSION_GENES
//#define
DEBUG_ENERGY_KERNEL5
//
Atomic
operations
used
in
gradients
of
intra
contributors.
//
Only
atomic_cmpxchg
()
works
on
floats.
...
...
@@ -111,6 +111,8 @@ void gpu_calc_gradient(
float
dockpars_smooth,
__constant
float*
reqm,
__constant
float*
reqm_hbond,
__constant
uint*
atom1_types_reqm,
__constant
uint*
atom2_types_reqm,
__constant
float*
VWpars_AC_const,
__constant
float*
VWpars_BD_const,
__constant
float*
dspars_S_const,
...
...
@@ -609,6 +611,9 @@ void gpu_calc_gradient(
//
Getting
type
IDs
uint
atom1_typeid
=
atom_types_const[atom1_id]
;
uint
atom2_typeid
=
atom_types_const[atom2_id]
;
uint
atom1_type_vdw_hb
=
atom1_types_reqm
[atom1_typeid]
;
uint
atom2_type_vdw_hb
=
atom2_types_reqm
[atom2_typeid]
;
//printf
(
"%-5u %-5u %-5u\n"
,
contributor_counter,
atom1_id,
atom2_id
)
;
//
Getting
optimum
pair
distance
(
opt_distance
)
from
reqm
and
reqm_hbond
...
...
@@ -620,11 +625,17 @@ void gpu_calc_gradient(
if
(
intraE_contributors_const[3*contributor_counter+2]
==
1
)
//H-bond
{
/*
opt_distance
=
reqm_hbond
[atom1_typeid]
+
reqm_hbond
[atom2_typeid]
;
*/
opt_distance
=
reqm_hbond
[atom1_type_vdw_hb]
+
reqm_hbond
[atom2_type_vdw_hb]
;
}
else
//van
der
Waals
{
/*
opt_distance
=
0.5f*
(
reqm
[atom1_typeid]
+
reqm
[atom2_typeid]
)
;
*/
opt_distance
=
0.5f*
(
reqm
[atom1_type_vdw_hb]
+
reqm
[atom2_type_vdw_hb]
)
;
}
//
Getting
smoothed
distance
...
...
device/kernel1.cl
View file @
a8fb9077
...
...
@@ -47,6 +47,8 @@ gpu_calc_initpop(
float
dockpars_smooth,
__constant
float*
reqm,
__constant
float*
reqm_hbond,
__constant
uint*
atom1_types_reqm,
__constant
uint*
atom2_types_reqm,
__constant
float*
VWpars_AC_const,
__constant
float*
VWpars_BD_const,
__constant
float*
dspars_S_const,
...
...
@@ -71,7 +73,7 @@ gpu_calc_initpop(
__local
float
calc_coords_y[MAX_NUM_OF_ATOMS]
;
__local
float
calc_coords_z[MAX_NUM_OF_ATOMS]
;
__local
float
partial_energies[NUM_OF_THREADS_PER_BLOCK]
;
#
if
defined
(
DEBUG_ENERGY_KERNEL
1
)
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
__local
float
partial_interE[NUM_OF_THREADS_PER_BLOCK]
;
__local
float
partial_intraE[NUM_OF_THREADS_PER_BLOCK]
;
#
endif
...
...
@@ -119,7 +121,7 @@ gpu_calc_initpop(
calc_coords_y,
calc_coords_z,
partial_energies,
#
if
defined
(
DEBUG_ENERGY_KERNEL
1
)
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
partial_interE,
partial_intraE,
#
endif
...
...
@@ -127,9 +129,14 @@ gpu_calc_initpop(
atom_charges_const,
atom_types_const,
intraE_contributors_const,
#
if
0
false,
#
endif
dockpars_smooth,
reqm,
reqm_hbond,
atom1_types_reqm,
atom2_types_reqm,
VWpars_AC_const,
VWpars_BD_const,
dspars_S_const,
...
...
@@ -148,7 +155,7 @@ gpu_calc_initpop(
dockpars_energies_current[get_group_id
(
0
)
]
=
energy
;
dockpars_evals_of_new_entities[get_group_id
(
0
)
]
=
1
;
#
if
defined
(
DEBUG_ENERGY_KERNEL
1
)
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
printf
(
"%-18s [%-5s]---{%-5s} [%-10.8f]---{%-10.8f}\n"
,
"-ENERGY-KERNEL1-"
,
"GRIDS"
,
"INTRA"
,
partial_interE[0],
partial_intraE[0]
)
;
#
endif
}
...
...
device/kernel3.cl
View file @
a8fb9077
...
...
@@ -58,6 +58,8 @@ perform_LS(
float
dockpars_smooth,
__constant
float*
reqm,
__constant
float*
reqm_hbond,
__constant
uint*
atom1_types_reqm,
__constant
uint*
atom2_types_reqm,
__constant
float*
VWpars_AC_const,
__constant
float*
VWpars_BD_const,
__constant
float*
dspars_S_const,
...
...
@@ -103,7 +105,7 @@ perform_LS(
__local
float
calc_coords_z[MAX_NUM_OF_ATOMS]
;
__local
float
partial_energies[NUM_OF_THREADS_PER_BLOCK]
;
#
if
defined
(
DEBUG_ENERGY_KERNEL
3
)
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
__local
float
partial_interE
[NUM_OF_THREADS_PER_BLOCK]
;
__local
float
partial_intraE
[NUM_OF_THREADS_PER_BLOCK]
;
#
endif
...
...
@@ -222,7 +224,7 @@ perform_LS(
calc_coords_y,
calc_coords_z,
partial_energies,
#
if
defined
(
DEBUG_ENERGY_KERNEL
3
)
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
partial_interE,
partial_intraE,
#
endif
...
...
@@ -230,9 +232,14 @@ perform_LS(
atom_charges_const,
atom_types_const,
intraE_contributors_const,
#
if
0
false,
#
endif
dockpars_smooth,
reqm,
reqm_hbond,
atom1_types_reqm,
atom2_types_reqm,
VWpars_AC_const,
VWpars_BD_const,
dspars_S_const,
...
...
@@ -250,7 +257,7 @@ perform_LS(
if
(
get_local_id
(
0
)
==
0
)
{
evaluation_cnt++
;
#
if
defined
(
DEBUG_ENERGY_KERNEL
3
)
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
printf
(
"%-18s [%-5s]---{%-5s} [%-10.8f]---{%-10.8f}\n"
,
"-ENERGY-KERNEL3-"
,
"GRIDS"
,
"INTRA"
,
partial_interE[0],
partial_intraE[0]
)
;
#
endif
}
...
...
@@ -330,7 +337,7 @@ perform_LS(
calc_coords_y,
calc_coords_z,
partial_energies,
#
if
defined
(
DEBUG_ENERGY_KERNEL
3
)
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
partial_interE,
partial_intraE,
#
endif
...
...
@@ -338,9 +345,14 @@ perform_LS(
atom_charges_const,
atom_types_const,
intraE_contributors_const,
#
if
0
false,
#
endif
dockpars_smooth,
reqm,
reqm_hbond,
atom1_types_reqm,
atom2_types_reqm,
VWpars_AC_const,
VWpars_BD_const,
dspars_S_const,
...
...
@@ -358,7 +370,7 @@ perform_LS(
if
(
get_local_id
(
0
)
==
0
)
{
evaluation_cnt++
;
#
if
defined
(
DEBUG_ENERGY_KERNEL
3
)
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
printf
(
"%-18s [%-5s]---{%-5s} [%-10.8f]---{%-10.8f}\n"
,
"-ENERGY-KERNEL3-"
,
"GRIDS"
,
"INTRA"
,
partial_interE[0],
partial_intraE[0]
)
;
#
endif
}
...
...
device/kernel4.cl
View file @
a8fb9077
...
...
@@ -58,6 +58,8 @@ gpu_gen_and_eval_newpops(
float
dockpars_smooth,
__constant
float*
reqm,
__constant
float*
reqm_hbond,
__constant
uint*
atom1_types_reqm,
__constant
uint*
atom2_types_reqm,
__constant
float*
VWpars_AC_const,
__constant
float*
VWpars_BD_const,
__constant
float*
dspars_S_const,
...
...
@@ -95,7 +97,7 @@ gpu_gen_and_eval_newpops(
__local
float
calc_coords_y[MAX_NUM_OF_ATOMS]
;
__local
float
calc_coords_z[MAX_NUM_OF_ATOMS]
;
__local
float
partial_energies[NUM_OF_THREADS_PER_BLOCK]
;
#
if
defined
(
DEBUG_ENERGY_KERNEL
4
)
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
__local
float
partial_interE
[NUM_OF_THREADS_PER_BLOCK]
;
__local
float
partial_intraE
[NUM_OF_THREADS_PER_BLOCK]
;
#
endif
...
...
@@ -277,7 +279,7 @@ gpu_gen_and_eval_newpops(
calc_coords_y,
calc_coords_z,
partial_energies,
#
if
defined
(
DEBUG_ENERGY_KERNEL
4
)
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
partial_interE,
partial_intraE,
#
endif
...
...
@@ -285,9 +287,14 @@ gpu_gen_and_eval_newpops(
atom_charges_const,
atom_types_const,
intraE_contributors_const,
#
if
0
false,
#
endif
dockpars_smooth,
reqm,
reqm_hbond,
atom1_types_reqm,
atom2_types_reqm,
VWpars_AC_const,
VWpars_BD_const,
dspars_S_const,
...
...
@@ -306,7 +313,7 @@ gpu_gen_and_eval_newpops(
dockpars_evals_of_new_entities[get_group_id
(
0
)
]
=
1
;
dockpars_energies_next[get_group_id
(
0
)
]
=
energy
;
#
if
defined
(
DEBUG_ENERGY_KERNEL
4
)
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
printf
(
"%-18s [%-5s]---{%-5s} [%-10.8f]---{%-10.8f}\n"
,
"-ENERGY-KERNEL4-"
,
"GRIDS"
,
"INTRA"
,
partial_interE[0],
partial_intraE[0]
)
;
#
endif
}
...
...
device/kernel_gradient.cl
View file @
a8fb9077
...
...
@@ -32,6 +32,8 @@ gradient_minimizer(
float
dockpars_smooth,
__constant
float*
reqm,
__constant
float*
reqm_hbond,
__constant
uint*
atom1_types_reqm,
__constant
uint*
atom2_types_reqm,
__constant
float*
VWpars_AC_const,
__constant
float*
VWpars_BD_const,
__constant
float*
dspars_S_const,
...
...
@@ -142,7 +144,7 @@ gradient_minimizer(
__local
float
calc_coords_z[MAX_NUM_OF_ATOMS]
;
__local
float
partial_energies[NUM_OF_THREADS_PER_BLOCK]
;
#
if
defined
(
DEBUG_ENERGY_KERNEL
5
)
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
__local
float
partial_interE[NUM_OF_THREADS_PER_BLOCK]
;
__local
float
partial_intraE[NUM_OF_THREADS_PER_BLOCK]
;
#
endif
...
...
@@ -362,6 +364,8 @@ gradient_minimizer(
dockpars_smooth,
reqm,
reqm_hbond,
atom1_types_reqm,
atom2_types_reqm,
VWpars_AC_const,
VWpars_BD_const,
dspars_S_const,
...
...
@@ -432,7 +436,7 @@ gradient_minimizer(
dockpars_coeff_elec,
dockpars_qasp,
dockpars_coeff_desolv,
candidate_genotype,
/*
candidate_genotype,
*/genotype,
/*use
genotype
only
for
reproduce
results*/
&candidate_energy,
&run_id,
//
Some
OpenCL
compilers
don
't
allow
declaring
...
...
@@ -443,7 +447,7 @@ gradient_minimizer(
calc_coords_y,
calc_coords_z,
partial_energies,
#
if
defined
(
DEBUG_ENERGY_KERNEL
5
)
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
partial_interE,
partial_intraE,
#
endif
...
...
@@ -451,9 +455,14 @@ gradient_minimizer(
atom_charges_const,
atom_types_const,
intraE_contributors_const,
#
if
0
true,
#
endif
dockpars_smooth,
reqm,
reqm_hbond,
atom1_types_reqm,
atom2_types_reqm,
VWpars_AC_const,
VWpars_BD_const,
dspars_S_const,
...
...
@@ -468,6 +477,16 @@ gradient_minimizer(
)
;
//
=============================================================
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
if
((
get_group_id
(
0
)
==
0
)
&&
(
get_local_id
(
0
)
==
0
))
{
for
(
uint
i
=
0
; i < dockpars_num_of_genes; i++) {
printf
(
"genotype[%u]=%f \n"
,
i,
genotype[i]
)
;
}
printf
(
"partial_interE=%f \n"
,
partial_interE[0]
)
;
printf
(
"partial_intraE=%f \n"
,
partial_intraE[0]
)
;
}
#
endif
//
Checking
if
E
(
candidate_genotype
)
<
E
(
genotype
)
if
(
candidate_energy
<
energy
)
{
...
...
@@ -507,7 +526,7 @@ gradient_minimizer(
printf
(
"# minimizer-iters: %-3u, stepsize: %10.7f, E: %10.7f\n"
,
iteration_cnt,
stepsize,
energy
)
;
#
endif
#
if
defined
(
DEBUG_ENERGY_KERNEL
5
)
#
if
defined
(
DEBUG_ENERGY_KERNEL
)
printf
(
"%-18s [%-5s]---{%-5s} [%-10.7f]---{%-10.7f}\n"
,
"-ENERGY-KERNEL5-"
,
"GRIDS"
,
"INTRA"
,
partial_interE[0],
partial_intraE[0]
)
;
#
endif