Skip to content
GitLab
Menu
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
cfc9bc52
Commit
cfc9bc52
authored
Apr 04, 2018
by
Leonardo Solis
Browse files
mutation and LS modify u1 gene as 0.2f
parent
f9234691
Changes
4
Hide whitespace changes
Inline
Side-by-side
device/calcenergy.cl
View file @
cfc9bc52
...
...
@@ -296,6 +296,9 @@ void gpu_calc_energy( int dockpars_rotbondlist_length,
//
FIXME:
add
precision
choices
with
preprocessor
directives:
//
NATIVE_PRECISION,
HALF_PRECISION,
Full
precision
//
Used
to
test
if
u1
is
within
the
valid
range
[0,1]
/*
if
(
u1
>
1
)
{
u1
=
0.9f
;
}
...
...
@@ -303,13 +306,14 @@ void gpu_calc_energy( int dockpars_rotbondlist_length,
if
(
u1
<
0
)
{
u1
=
0.1f
;
}
*/
quatrot_left_q
=
native_sqrt
(
1
-
u1
)
*
native_sin
(
u2
)
;
quatrot_left_x
=
native_sqrt
(
1
-
u1
)
*
native_cos
(
u2
)
;
quatrot_left_y
=
native_sqrt
(
u1
)
*
native_sin
(
u3
)
;
quatrot_left_z
=
native_sqrt
(
u1
)
*
native_cos
(
u3
)
;
//
Used
to
test
if
u1
is
within
the
valid
range
[0,1]
/*
if
((
1-u1
)
<
0
)
{
printf
(
"u1:%f 1-u1:%f sqrt(1-u1):%f\n"
,
u1,
(
1-u1
)
,
sqrt
(
1-u1
))
;
...
...
device/kernel3.cl
View file @
cfc9bc52
...
...
@@ -200,9 +200,15 @@ perform_LS( char dockpars_num_of_atoms,
for
(
gene_counter=get_local_id
(
0
)
;
gene_counter<dockpars_num_of_genes
;
gene_counter
+=
NUM_OF_THREADS_PER_BLOCK
)
{
if
(
gene_counter
==
3
)
{
genotype_candidate[gene_counter]
=
0.2f*gpu_randf
(
dockpars_prng_states
)
;
}
else
{
genotype_candidate[gene_counter]
=
offspring_genotype[gene_counter]
+
genotype_deviate[gene_counter]
+
genotype_bias[gene_counter]
;
}
/*
genotype_candidate[gene_counter]
=
offspring_genotype[gene_counter]
+
genotype_deviate[gene_counter]
+
genotype_bias[gene_counter]
;
///*
if
(
gene_counter
==
3
)
{//
u1,
FIXME:
hardcoded
if
(
genotype_candidate[gene_counter]
>
1.0f
)
{
//
clamp
it
offspring_genotype[gene_counter]
=
0.9f
;
...
...
@@ -212,7 +218,7 @@ perform_LS( char dockpars_num_of_atoms,
}
//printf
(
"LS positive - genotype_candidate[gene_counter]: %f\n"
,
genotype_candidate[gene_counter]
)
;
}
//
*/
*/
}
...
...
@@ -295,9 +301,18 @@ perform_LS( char dockpars_num_of_atoms,
for
(
gene_counter=get_local_id
(
0
)
;
gene_counter<dockpars_num_of_genes
;
gene_counter
+=
NUM_OF_THREADS_PER_BLOCK
)
{
if
(
gene_counter
==
3
)
{
genotype_candidate[gene_counter]
=
0.2f*gpu_randf
(
dockpars_prng_states
)
;
}
else
{
genotype_candidate[gene_counter]
=
offspring_genotype[gene_counter]
-
genotype_deviate[gene_counter]
-
genotype_bias[gene_counter]
;
}
/*
genotype_candidate[gene_counter]
=
offspring_genotype[gene_counter]
-
genotype_deviate[gene_counter]
-
genotype_bias[gene_counter]
;
///*
if
(
gene_counter
==
3
)
{//
u1,
FIXME:
hardcoded
if
(
genotype_candidate[gene_counter]
>
1.0f
)
{
//
clamp
it
offspring_genotype[gene_counter]
=
0.9f
;
...
...
@@ -307,7 +322,7 @@ perform_LS( char dockpars_num_of_atoms,
}
//printf
(
"LS negative - genotype_candidate[gene_counter]: %f\n"
,
genotype_candidate[gene_counter]
)
;
}
//
*/
*/
}
...
...
device/kernel4.cl
View file @
cfc9bc52
...
...
@@ -251,9 +251,13 @@ gpu_gen_and_eval_newpops(char dockpars_num_of_atoms,
if
(
gene_counter
<
3
)
offspring_genotype[gene_counter]
+=
dockpars_abs_max_dmov*
(
2*gpu_randf
(
dockpars_prng_states
)
-1
)
;
else
if
(
gene_counter
==
3
)
{//
u1,
FIXME:
hardcoded
offspring_genotype[gene_counter]
=
0.2f*gpu_randf
(
dockpars_prng_states
)
;
/*
offspring_genotype[gene_counter]
+=
0.2f*
(
2*gpu_randf
(
dockpars_prng_states
)
-1
)
;
///*
if
(
offspring_genotype[gene_counter]
>
1.0f
)
{
//
clamp
it
offspring_genotype[gene_counter]
=
0.9f
;
}
...
...
@@ -261,7 +265,7 @@ gpu_gen_and_eval_newpops(char dockpars_num_of_atoms,
offspring_genotype[gene_counter]
=
0.1f
;
}
//printf
(
"mutation - offspring_genotype[gene_counter]: %f\n"
,
offspring_genotype[gene_counter]
)
;
//
*/
*/
}
else
if
(
gene_counter
<
6
)
{
//
u2&3,
FIXME:
hardcoded
...
...
host/src/performdocking.cpp
View file @
cfc9bc52
...
...
@@ -722,9 +722,10 @@ filled with clock() */
#if defined (DOCK_DEBUG)
for
(
int
cnt_pop
=
0
;
cnt_pop
<
size_populations
/
sizeof
(
float
);
cnt_pop
++
)
printf
(
"total_num_pop: %u, cpu_final_populations[%u]: %f
\n
"
,(
unsigned
int
)(
size_populations
/
sizeof
(
float
)),
cnt_pop
,
cpu_final_populations
[
cnt_pop
]);
#endif
for
(
int
cnt_pop
=
0
;
cnt_pop
<
size_energies
/
sizeof
(
float
);
cnt_pop
++
)
printf
(
"total_num_energies: %u, cpu_energies[%u]: %f
\n
"
,
(
unsigned
int
)(
size_energies
/
sizeof
(
float
)),
cnt_pop
,
cpu_energies
[
cnt_pop
]);
#endif
// ===============================================================================
...
...
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