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
2a05277c
Commit
2a05277c
authored
Apr 24, 2018
by
Leonardo Solis
Browse files
removed aux_grad file of device
parent
b667924b
Changes
2
Hide whitespace changes
Inline
Side-by-side
bin/ocladock_cpu_16wi
deleted
100755 → 0
View file @
b667924b
File deleted
device/auxiliary_gradient.cl
deleted
100644 → 0
View file @
b667924b
//#define
DEBUG_GRADDESC_ENABLED
//
Implementation
of
auxiliary
functions
//
for
the
gradient-based
minimizer
void
is_gradDescent_enabled
(
__local
bool*
is_genotype_valid,
__local
uint*
local_nIter,
uint
gradMin_maxiter,
__local
float*
local_candidate_genotype,
uint
gradMin_numElements,
__local
bool*
is_gradDescentEn
)
{
bool
is_gNorm_gt_gMin
;
bool
is_nIter_lt_maxIter
;
bool
is_valid
;
if
(
get_local_id
(
0
)
==
0
)
{
is_nIter_lt_maxIter
=
(
local_nIter[0]
<
gradMin_maxiter
)
;
is_valid
=
true
;
}
/*
//
Verifying
that
Shoemake
genes
do
not
get
out
of
valid
range.
//
If
they
do
so,
then
set
them
to
0.0f
if
(
get_local_id
(
0
)
<
3
)
{
if
((
local_candidate_genotype[get_local_id
(
0
)
]
<
0.0f
)
&&
(
local_candidate_genotype[get_local_id
(
0
)
]
>
1.0f
))
{
local_candidate_genotype[get_local_id
(
0
)
]
=
0.0f
;
}
}
*/
//
Using
every
of
its
genes,
let
's
determine
//
if
candidate
genotype
is
valid
for
(
uint
i
=
get_local_id
(
0
)
;
i
<
gradMin_numElements
;
i+=
NUM_OF_THREADS_PER_BLOCK
)
{
is_genotype_valid[i]
=
!isnan
(
local_candidate_genotype[i]
)
&&
!isinf
(
local_candidate_genotype[i]
)
;
}
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
if
(
get_local_id
(
0
)
==
0
)
{
//
Reduce
all
"valid"
values
of
genes
//
into
their
corresponding
genotype
for
(
uint
i
=
0
;
i
<
gradMin_numElements
;
i++
)
{
is_valid
=
is_valid
&&
is_genotype_valid[i]
;
#
if
defined
(
DEBUG_GRADDESC_ENABLED
)
//printf
(
"is_genotype_valid[%u]?: %s\n"
,
i,
(
is_genotype_valid[i]
==
true
)
?
"yes"
:
"no"
)
;
#
endif
}
//
Reduce
all
previous
partial
evaluations
(
nIter,
valid
)
into
a
final
one
*is_gradDescentEn
=
is_nIter_lt_maxIter
&&
is_valid
;
#
if
defined
(
DEBUG_GRADDESC_ENABLED
)
//printf
(
"is_gNorm_gt_gMin?: %s\n"
,
(
is_gNorm_gt_gMin
==
true
)
?
"yes"
:
"no"
)
;
//printf
(
"is_nIter_lt_maxIter?: %s\n"
,
(
is_nIter_lt_maxIter
==
true
)
?
"yes"
:
"no"
)
;
//printf
(
"is_valid?: %s\n"
,
(
is_valid
==
true
)
?
"yes"
:
"no"
)
;
printf
(
"Continue grad-mini?: %s\n"
,
(
*is_gradDescentEn
==
true
)
?
"yes"
:
"no"
)
;
#
endif
}
}
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