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
d65a225d
Commit
d65a225d
authored
Apr 11, 2018
by
Leonardo Solis
Browse files
reordered in gradient_minimizer
parent
6b052b35
Changes
2
Hide whitespace changes
Inline
Side-by-side
device/auxiliary_gradient.cl
View file @
d65a225d
//
Implementation
of
auxiliary
functions
//
for
the
gradient-based
minimizer
bool
is_gradDescent_enabled
(
void
is_gradDescent_enabled
(
__local
bool*
is_perturb_gt_gene_min,
__local
float*
local_gNorm,
float
gradMin_tol,
...
...
@@ -9,8 +9,9 @@ bool is_gradDescent_enabled(
uint
gradMin_maxiter,
__local
float*
local_perturbation,
__constant
float*
gradMin_conformation_min_perturbation,
__local
bool*
is_gradDescentEn,
uint
gradMin_numElements
)
uint
gradMin_numElements,
__local
bool*
is_gradDescentEn
)
{
bool
is_gNorm_gt_gMin
;
bool
is_nIter_lt_maxIter
;
...
...
@@ -60,10 +61,10 @@ bool is_gradDescent_enabled(
*/
}
/*
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
return
*is_gradDescentEn
;
*/
}
void
gradient_norm
(
...
...
@@ -81,6 +82,8 @@ void gradient_norm(
i+=
NUM_OF_THREADS_PER_BLOCK
)
{
init[i]
=
vector1[i]
*
vector1[i]
;
}
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
//
Accumulating
dot
product,
//
and
then
getting
the
norm
...
...
device/kernel_gradient.cl
View file @
d65a225d
...
...
@@ -178,16 +178,7 @@ gradient_minimizer(
//
-----------------------------------------------------------------------------
//
Perform
gradient-descent
iterations
while
(
is_gradDescent_enabled
(
is_perturb_gt_gene_min,
&local_gNorm,
gradMin_tol,
&local_nIter,
gradMin_maxiter,
local_perturbation,
gradMin_conformation_min_perturbation,
&is_gradDescentEn,
dockpars_num_of_genes
)
==
true
)
{
do
{
//
Calculating
gradient
//
=============================================================
...
...
@@ -257,6 +248,9 @@ gradient_minimizer(
//
Updating
current
solution
local_genotype[i]
=
local_genotype_new[i]
;
//
Storing
all
gene-based
perturbations
local_perturbation[i]
=
local_genotype_diff
[i]
;
}
//
Updating
number
of
stepest-descent
iterations
...
...
@@ -267,14 +261,14 @@ gradient_minimizer(
//
Storing
the
norm
of
all
gradients
gradient_norm
(
local_gradient,
dockpars_num_of_genes,
dotProduct,
&local_gNorm
)
;
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
/*
//
Storing
all
gene-based
perturbations
for
(
uint
i
=
get_local_id
(
0
)
;
i
<
dockpars_num_of_genes
;
i+=
NUM_OF_THREADS_PER_BLOCK
)
{
local_perturbation[i]
=
local_genotype_diff
[i]
;
}
*/
/*
if
(
get_local_id
(
0
)
==
0
)
{
...
...
@@ -287,7 +281,20 @@ gradient_minimizer(
printf
(
"Number of gradient iterations: %u\n"
,
local_nIter
)
;
}
*/
}
is_gradDescent_enabled
(
is_perturb_gt_gene_min,
&local_gNorm,
gradMin_tol,
&local_nIter,
gradMin_maxiter,
local_perturbation,
gradMin_conformation_min_perturbation,
dockpars_num_of_genes,
&is_gradDescentEn
)
;
}
while
(
is_gradDescentEn
==
true
)
;
//
-----------------------------------------------------------------------------
//
Calculating
energy
...
...
Write
Preview
Supports
Markdown
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