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-fpga
Commits
451b4f0d
Commit
451b4f0d
authored
Jul 28, 2018
by
Leonardo Solis
Browse files
minor cleanup
Former-commit-id:
20ffd521
parent
10898a12
Changes
1
Hide whitespace changes
Inline
Side-by-side
ofdock_taskpar_alt/device/Krnl_GA.cl
View file @
451b4f0d
...
...
@@ -302,13 +302,6 @@ fixedpt fixedpt_map_angle_360(fixedpt angle)
}
#endif
#if 0
// Shift register sizes
// Such registers are used to reduce Initiation Interval (II)
#define SHIFT_REG_SIZE 10
#define SHIFT_REG_SIZE_MINUS_ONE (SHIFT_REG_SIZE-1)
#endif
// --------------------------------------------------------------------------
// Lamarckian Genetic-Algorithm (GA): GA + LS (Local Search)
// Originally from: searchoptimum.c
...
...
@@ -467,16 +460,6 @@ void Krnl_GA(__global float* restrict GlobPopulationCurrent,
numwriteports(1)
)) loc_energies[MAX_POPSIZE];
#if 0
// Shift register to reduce II (initially II=6) of best entity for-loop
float shift_reg[SHIFT_REG_SIZE];
#pragma unroll
for (uchar i=0; i<SHIFT_REG_SIZE; i++) {
shift_reg[i] = 0.0f;
}
#endif
ushort best_entity = 0;
// for (ushort pop_cnt=1; pop_cnt<DockConst_pop_size; pop_cnt++) {
...
...
@@ -489,26 +472,6 @@ void Krnl_GA(__global float* restrict GlobPopulationCurrent,
printf("%3u %20.6f\n", pop_cnt, loc_energies[pop_cnt]);
#endif
#if 0
// Identifying best entity
// The enclosing "if (pop_cnt>0) {}" should not be commented
// but it is removed in order to improve performance.
// It does not affect functionality as it performs
// an unnecessary evaluation when pop_cnt=0
//if (pop_cnt>0) {
shift_reg[SHIFT_REG_SIZE_MINUS_ONE] = loc_energies[best_entity];
#pragma unroll
for (uchar j=0; j<SHIFT_REG_SIZE_MINUS_ONE; j++) {
shift_reg[j] = shift_reg[j+1];
}
if (loc_energies[pop_cnt] < shift_reg[0]) {
best_entity = pop_cnt;
}
//}
#endif
if (loc_energies[pop_cnt] < loc_energies[best_entity]) {
best_entity = pop_cnt;
}
...
...
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