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-fpga
Commits
1fd8db37
Commit
1fd8db37
authored
Jun 24, 2018
by
Leonardo Solis
Browse files
added fences in btw deeper block chan IC and GG + clean gmem in IC
Former-commit-id:
f17d3edb
parent
a2b5a4ba
Changes
10
Hide whitespace changes
Inline
Side-by-side
ofdock_taskpar_alt/device/Krnl_GA.cl
View file @
1fd8db37
...
...
@@ -44,8 +44,11 @@ channel char2 chan_Conf2Intrae_actmode;
channel
char
chan_Conf2Intrae_actmode
;
//
Send
energy
values
from
InterE
&
IntraE
to
genotype-senders
(
IC,
GG,
LSs
)
#
if
0
channel
float
chan_Intere2StoreIC_intere
__attribute__
((
depth
(
2
)))
;
channel
float
chan_Intere2StoreGG_intere
__attribute__
((
depth
(
2
)))
;
#
endif
#
if
1
channel
float
chan_Intere2StoreLS_LS1_intere
__attribute__
((
depth
(
2
)))
;
channel
float
chan_Intere2StoreLS_LS2_intere
__attribute__
((
depth
(
2
)))
;
channel
float
chan_Intere2StoreLS_LS3_intere
__attribute__
((
depth
(
2
)))
;
...
...
@@ -55,8 +58,28 @@ channel float chan_Intere2StoreLS_LS6_intere __attribute__((depth(2)));
channel
float
chan_Intere2StoreLS_LS7_intere
__attribute__
((
depth
(
2
)))
;
channel
float
chan_Intere2StoreLS_LS8_intere
__attribute__
((
depth
(
2
)))
;
channel
float
chan_Intere2StoreLS_LS9_intere
__attribute__
((
depth
(
2
)))
;
#
endif
#
if
1
channel
float
chan_Intere2StoreIC_intere
__attribute__
((
depth
(
MAX_POPSIZE
)))
;
channel
float
chan_Intere2StoreGG_intere
__attribute__
((
depth
(
MAX_POPSIZE
)))
;
#
endif
#
if
0
channel
float
chan_Intere2StoreLS_LS1_intere
__attribute__
((
depth
(
MAX_POPSIZE
)))
;
channel
float
chan_Intere2StoreLS_LS2_intere
__attribute__
((
depth
(
MAX_POPSIZE
)))
;
channel
float
chan_Intere2StoreLS_LS3_intere
__attribute__
((
depth
(
MAX_POPSIZE
)))
;
channel
float
chan_Intere2StoreLS_LS4_intere
__attribute__
((
depth
(
MAX_POPSIZE
)))
;
channel
float
chan_Intere2StoreLS_LS5_intere
__attribute__
((
depth
(
MAX_POPSIZE
)))
;
channel
float
chan_Intere2StoreLS_LS6_intere
__attribute__
((
depth
(
MAX_POPSIZE
)))
;
channel
float
chan_Intere2StoreLS_LS7_intere
__attribute__
((
depth
(
MAX_POPSIZE
)))
;
channel
float
chan_Intere2StoreLS_LS8_intere
__attribute__
((
depth
(
MAX_POPSIZE
)))
;
channel
float
chan_Intere2StoreLS_LS9_intere
__attribute__
((
depth
(
MAX_POPSIZE
)))
;
#
endif
#
if
0
channel
float
chan_Intrae2StoreIC_intrae
__attribute__
((
depth
(
2
)))
;
channel
float
chan_Intrae2StoreGG_intrae
__attribute__
((
depth
(
2
)))
;
#
endif
#
if
1
channel
float
chan_Intrae2StoreLS_LS1_intrae
__attribute__
((
depth
(
2
)))
;
channel
float
chan_Intrae2StoreLS_LS2_intrae
__attribute__
((
depth
(
2
)))
;
channel
float
chan_Intrae2StoreLS_LS3_intrae
__attribute__
((
depth
(
2
)))
;
...
...
@@ -66,6 +89,23 @@ channel float chan_Intrae2StoreLS_LS6_intrae __attribute__((depth(2)));
channel
float
chan_Intrae2StoreLS_LS7_intrae
__attribute__
((
depth
(
2
)))
;
channel
float
chan_Intrae2StoreLS_LS8_intrae
__attribute__
((
depth
(
2
)))
;
channel
float
chan_Intrae2StoreLS_LS9_intrae
__attribute__
((
depth
(
2
)))
;
#
endif
#
if
1
channel
float
chan_Intrae2StoreIC_intrae
__attribute__
((
depth
(
MAX_POPSIZE
)))
;
channel
float
chan_Intrae2StoreGG_intrae
__attribute__
((
depth
(
MAX_POPSIZE
)))
;
#
endif
#
if
0
channel
float
chan_Intrae2StoreLS_LS1_intrae
__attribute__
((
depth
(
MAX_POPSIZE
)))
;
channel
float
chan_Intrae2StoreLS_LS2_intrae
__attribute__
((
depth
(
MAX_POPSIZE
)))
;
channel
float
chan_Intrae2StoreLS_LS3_intrae
__attribute__
((
depth
(
MAX_POPSIZE
)))
;
channel
float
chan_Intrae2StoreLS_LS4_intrae
__attribute__
((
depth
(
MAX_POPSIZE
)))
;
channel
float
chan_Intrae2StoreLS_LS5_intrae
__attribute__
((
depth
(
MAX_POPSIZE
)))
;
channel
float
chan_Intrae2StoreLS_LS6_intrae
__attribute__
((
depth
(
MAX_POPSIZE
)))
;
channel
float
chan_Intrae2StoreLS_LS7_intrae
__attribute__
((
depth
(
MAX_POPSIZE
)))
;
channel
float
chan_Intrae2StoreLS_LS8_intrae
__attribute__
((
depth
(
MAX_POPSIZE
)))
;
channel
float
chan_Intrae2StoreLS_LS9_intrae
__attribute__
((
depth
(
MAX_POPSIZE
)))
;
#
endif
//
Send
PRNG
outputs
from
generators
to
consumers
channel
float8
chan_PRNG2GA_BT_ushort_float_prng
;
...
...
@@ -336,12 +376,24 @@ void Krnl_GA(__global float* restrict GlobPopulationCurrent,
mem_fence(CLK_CHANNEL_MEM_FENCE);
for (uchar pipe_cnt=0; pipe_cnt<DockConst_num_of_genes; pipe_cnt++) {
#if 0
#if defined(SINGLE_COPY_POP_ENE)
LocalPopCurr[pop_cnt][pipe_cnt & MASK_GENOTYPE] = GlobPopCurr[pop_cnt*ACTUAL_GENOTYPE_LENGTH + pipe_cnt];
#else
LocalPopCurr[pop_cnt][pipe_cnt & MASK_GENOTYPE] = GlobPopulationCurrent[pop_cnt*ACTUAL_GENOTYPE_LENGTH + pipe_cnt];
#endif
write_channel_altera(chan_IC2Conf_genotype, LocalPopCurr[pop_cnt][pipe_cnt & MASK_GENOTYPE]);
#endif
float tmp_ic;
#if defined(SINGLE_COPY_POP_ENE)
tmp_ic = GlobPopCurr[pop_cnt*ACTUAL_GENOTYPE_LENGTH + pipe_cnt];
#else
tmp_ic = GlobPopulationCurrent[pop_cnt*ACTUAL_GENOTYPE_LENGTH + pipe_cnt];
#endif
LocalPopCurr[pop_cnt][pipe_cnt & MASK_GENOTYPE] = tmp_ic;
write_channel_altera(chan_IC2Conf_genotype, tmp_ic);
}
#if defined (DEBUG_KRNL_IC)
...
...
@@ -349,6 +401,7 @@ void Krnl_GA(__global float* restrict GlobPopulationCurrent,
#endif
// Read energy
#if 0
float energyIA_IC_rx;
float energyIE_IC_rx;
bool intra_valid = false;
...
...
@@ -361,7 +414,14 @@ void Krnl_GA(__global float* restrict GlobPopulationCurrent,
energyIE_IC_rx = read_channel_nb_altera(chan_Intere2StoreIC_intere, &inter_valid);
}
}
#endif
#if 1
mem_fence(CLK_CHANNEL_MEM_FENCE);
float energyIA_IC_rx = read_channel_altera(chan_Intrae2StoreIC_intrae);
mem_fence(CLK_CHANNEL_MEM_FENCE);
float energyIE_IC_rx = read_channel_altera(chan_Intere2StoreIC_intere);
#endif
LocalEneCurr[pop_cnt] = energyIA_IC_rx + energyIE_IC_rx;
#if defined (DEBUG_KRNL_IC)
...
...
@@ -584,6 +644,7 @@ void Krnl_GA(__global float* restrict GlobPopulationCurrent,
#endif
// Read energy
#if 0
float energyIA_GG_rx;
float energyIE_GG_rx;
bool intra_valid = false;
...
...
@@ -596,7 +657,14 @@ void Krnl_GA(__global float* restrict GlobPopulationCurrent,
energyIE_GG_rx = read_channel_nb_altera(chan_Intere2StoreGG_intere, &inter_valid);
}
}
#endif
#if 1
mem_fence(CLK_CHANNEL_MEM_FENCE);
float energyIA_GG_rx = read_channel_altera(chan_Intrae2StoreGG_intrae);
mem_fence(CLK_CHANNEL_MEM_FENCE);
float energyIE_GG_rx = read_channel_altera(chan_Intere2StoreGG_intere);
#endif
LocalEneNext[new_pop_cnt] = energyIA_GG_rx + energyIE_GG_rx;
#if defined (DEBUG_KRNL_GG)
...
...
ofdock_taskpar_alt/device/Krnl_LS.cl
View file @
1fd8db37
...
...
@@ -191,7 +191,7 @@ while(valid) {
}
//printf("Energy to calculate sent from LS ... ");
#if 1
float energyIA_LS_rx;
float energyIE_LS_rx;
bool intra_valid = false;
...
...
@@ -204,7 +204,14 @@ while(valid) {
energyIE_LS_rx
=
read_channel_nb_altera
(
chan_Intere2StoreLS_LS1_intere,
&inter_valid
)
;
}
}
#
endif
#
if
0
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
float
energyIA_LS_rx
=
read_channel_altera
(
chan_Intrae2StoreLS_LS1_intrae
)
;
float
energyIE_LS_rx
=
read_channel_altera
(
chan_Intere2StoreLS_LS1_intere
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
#
endif
float
candidate_energy
=
energyIA_LS_rx
+
energyIE_LS_rx
;
//
update
LS
energy-evaluation
count
...
...
ofdock_taskpar_alt/device/Krnl_LS2.cl
View file @
1fd8db37
...
...
@@ -194,7 +194,7 @@ while(valid) {
}
//printf("Energy to calculate sent from LS2 ... ");
#if 1
float energyIA_LS_rx;
float energyIE_LS_rx;
bool intra_valid = false;
...
...
@@ -207,7 +207,14 @@ while(valid) {
energyIE_LS_rx
=
read_channel_nb_altera
(
chan_Intere2StoreLS_LS2_intere,
&inter_valid
)
;
}
}
#
endif
#
if
0
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
float
energyIA_LS_rx
=
read_channel_altera
(
chan_Intrae2StoreLS_LS2_intrae
)
;
float
energyIE_LS_rx
=
read_channel_altera
(
chan_Intere2StoreLS_LS2_intere
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
#
endif
float
candidate_energy
=
energyIA_LS_rx
+
energyIE_LS_rx
;
//
update
LS
energy-evaluation
count
...
...
ofdock_taskpar_alt/device/Krnl_LS3.cl
View file @
1fd8db37
...
...
@@ -194,7 +194,7 @@ while(valid) {
}
//printf("Energy to calculate sent from LS3 ... ");
#if 1
float energyIA_LS_rx;
float energyIE_LS_rx;
bool intra_valid = false;
...
...
@@ -207,7 +207,14 @@ while(valid) {
energyIE_LS_rx
=
read_channel_nb_altera
(
chan_Intere2StoreLS_LS3_intere,
&inter_valid
)
;
}
}
#
endif
#
if
0
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
float
energyIA_LS_rx
=
read_channel_altera
(
chan_Intrae2StoreLS_LS3_intrae
)
;
float
energyIE_LS_rx
=
read_channel_altera
(
chan_Intere2StoreLS_LS3_intere
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
#
endif
float
candidate_energy
=
energyIA_LS_rx
+
energyIE_LS_rx
;
//
update
LS
energy-evaluation
count
...
...
ofdock_taskpar_alt/device/Krnl_LS4.cl
View file @
1fd8db37
...
...
@@ -194,7 +194,7 @@ while(valid) {
}
//printf("Energy to calculate sent from LS4 ... ");
#if 1
float energyIA_LS_rx;
float energyIE_LS_rx;
bool intra_valid = false;
...
...
@@ -207,7 +207,14 @@ while(valid) {
energyIE_LS_rx
=
read_channel_nb_altera
(
chan_Intere2StoreLS_LS4_intere,
&inter_valid
)
;
}
}
#
endif
#
if
0
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
float
energyIA_LS_rx
=
read_channel_altera
(
chan_Intrae2StoreLS_LS4_intrae
)
;
float
energyIE_LS_rx
=
read_channel_altera
(
chan_Intere2StoreLS_LS4_intere
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
#
endif
float
candidate_energy
=
energyIA_LS_rx
+
energyIE_LS_rx
;
//
update
LS
energy-evaluation
count
...
...
ofdock_taskpar_alt/device/Krnl_LS5.cl
View file @
1fd8db37
...
...
@@ -194,7 +194,7 @@ while(valid) {
}
//printf("Energy to calculate sent from LS5 ... ");
#if 1
float energyIA_LS_rx;
float energyIE_LS_rx;
bool intra_valid = false;
...
...
@@ -207,7 +207,14 @@ while(valid) {
energyIE_LS_rx
=
read_channel_nb_altera
(
chan_Intere2StoreLS_LS5_intere,
&inter_valid
)
;
}
}
#
endif
#
if
0
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
float
energyIA_LS_rx
=
read_channel_altera
(
chan_Intrae2StoreLS_LS5_intrae
)
;
float
energyIE_LS_rx
=
read_channel_altera
(
chan_Intere2StoreLS_LS5_intere
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
#
endif
float
candidate_energy
=
energyIA_LS_rx
+
energyIE_LS_rx
;
//
update
LS
energy-evaluation
count
...
...
ofdock_taskpar_alt/device/Krnl_LS6.cl
View file @
1fd8db37
...
...
@@ -194,7 +194,7 @@ while(valid) {
}
//printf("Energy to calculate sent from LS6 ... ");
#if 1
float energyIA_LS_rx;
float energyIE_LS_rx;
bool intra_valid = false;
...
...
@@ -207,7 +207,14 @@ while(valid) {
energyIE_LS_rx
=
read_channel_nb_altera
(
chan_Intere2StoreLS_LS6_intere,
&inter_valid
)
;
}
}
#
endif
#
if
0
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
float
energyIA_LS_rx
=
read_channel_altera
(
chan_Intrae2StoreLS_LS6_intrae
)
;
float
energyIE_LS_rx
=
read_channel_altera
(
chan_Intere2StoreLS_LS6_intere
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
#
endif
float
candidate_energy
=
energyIA_LS_rx
+
energyIE_LS_rx
;
//
update
LS
energy-evaluation
count
...
...
ofdock_taskpar_alt/device/Krnl_LS7.cl
View file @
1fd8db37
...
...
@@ -194,7 +194,7 @@ while(valid) {
}
//printf("Energy to calculate sent from LS7 ... ");
#if 1
float energyIA_LS_rx;
float energyIE_LS_rx;
bool intra_valid = false;
...
...
@@ -207,7 +207,14 @@ while(valid) {
energyIE_LS_rx
=
read_channel_nb_altera
(
chan_Intere2StoreLS_LS7_intere,
&inter_valid
)
;
}
}
#
endif
#
if
0
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
float
energyIA_LS_rx
=
read_channel_altera
(
chan_Intrae2StoreLS_LS7_intrae
)
;
float
energyIE_LS_rx
=
read_channel_altera
(
chan_Intere2StoreLS_LS7_intere
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
#
endif
float
candidate_energy
=
energyIA_LS_rx
+
energyIE_LS_rx
;
//
update
LS
energy-evaluation
count
...
...
ofdock_taskpar_alt/device/Krnl_LS8.cl
View file @
1fd8db37
...
...
@@ -194,7 +194,7 @@ while(valid) {
}
//printf("Energy to calculate sent from LS8 ... ");
#if 1
float energyIA_LS_rx;
float energyIE_LS_rx;
bool intra_valid = false;
...
...
@@ -207,7 +207,14 @@ while(valid) {
energyIE_LS_rx
=
read_channel_nb_altera
(
chan_Intere2StoreLS_LS8_intere,
&inter_valid
)
;
}
}
#
endif
#
if
0
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
float
energyIA_LS_rx
=
read_channel_altera
(
chan_Intrae2StoreLS_LS8_intrae
)
;
float
energyIE_LS_rx
=
read_channel_altera
(
chan_Intere2StoreLS_LS8_intere
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
#
endif
float
candidate_energy
=
energyIA_LS_rx
+
energyIE_LS_rx
;
//
update
LS
energy-evaluation
count
...
...
ofdock_taskpar_alt/device/Krnl_LS9.cl
View file @
1fd8db37
...
...
@@ -194,7 +194,7 @@ while(valid) {
}
//printf("Energy to calculate sent from LS9 ... ");
#if 1
float energyIA_LS_rx;
float energyIE_LS_rx;
bool intra_valid = false;
...
...
@@ -207,7 +207,14 @@ while(valid) {
energyIE_LS_rx
=
read_channel_nb_altera
(
chan_Intere2StoreLS_LS9_intere,
&inter_valid
)
;
}
}
#
endif
#
if
0
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
float
energyIA_LS_rx
=
read_channel_altera
(
chan_Intrae2StoreLS_LS9_intrae
)
;
float
energyIE_LS_rx
=
read_channel_altera
(
chan_Intere2StoreLS_LS9_intere
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
#
endif
float
candidate_energy
=
energyIA_LS_rx
+
energyIE_LS_rx
;
//
update
LS
energy-evaluation
count
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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