Commit c57f78d9 authored by Leonardo Solis's avatar Leonardo Solis
Browse files

LS replicated 5 times


Former-commit-id: f170a58d
parent 0f21ae28
......@@ -212,6 +212,14 @@ ENABLE_K35 = YES
# bt ushort_float
ENABLE_K36 = YES
# prng ls4, ls5
ENABLE_K37 = YES
ENABLE_K38 = YES
# krnl_ls4, Krnl_ls5
ENABLE_K39 = YES
ENABLE_K40 = YES
ifeq ($(ENABLE_K1),YES)
K1 =-DENABLE_KERNEL1
......@@ -435,7 +443,31 @@ else
K36 =
endif
ENABLE_KERNELS = $(K1) $(K2) $(K3) $(K4) $(K5) $(K6) $(K7) $(K8) $(K9) $(K10) $(K11) $(K12) $(K13) $(K14) $(K15) $(K16) $(K17) $(K18) $(K19) $(K20) $(K21) $(K22) $(K23) $(K24) $(K25) $(K26) $(K27) $(K28) $(K29) $(K30) $(K31) $(K32) $(K33) $(K34) $(K35) $(K36)
ifeq ($(ENABLE_K37),YES)
K37 =-DENABLE_KERNEL37
else
K37 =
endif
ifeq ($(ENABLE_K38),YES)
K38 =-DENABLE_KERNEL38
else
K38 =
endif
ifeq ($(ENABLE_K39),YES)
K39 =-DENABLE_KERNEL39
else
K39 =
endif
ifeq ($(ENABLE_K40),YES)
K40 =-DENABLE_KERNEL40
else
K40 =
endif
ENABLE_KERNELS = $(K1) $(K2) $(K3) $(K4) $(K5) $(K6) $(K7) $(K8) $(K9) $(K10) $(K11) $(K12) $(K13) $(K14) $(K15) $(K16) $(K17) $(K18) $(K19) $(K20) $(K21) $(K22) $(K23) $(K24) $(K25) $(K26) $(K27) $(K28) $(K29) $(K30) $(K31) $(K32) $(K33) $(K34) $(K35) $(K36) $(K37) $(K38) $(K39) $(K40)
# =============================
# Reproduce result (remove randomness)
......@@ -461,9 +493,13 @@ FIXED_POINT_INTRAE=NO
FIXED_POINT_LS1=YES
FIXED_POINT_LS2=YES
FIXED_POINT_LS3=YES
FIXED_POINT_LS4=YES
FIXED_POINT_LS5=YES
#FIXED_POINT_LS1=NO
#FIXED_POINT_LS2=NO
#FIXED_POINT_LS3=NO
#FIXED_POINT_LS4=NO
#FIXED_POINT_LS5=NO
SINGLE_COPY_POP_ENE=YES
......@@ -505,6 +541,18 @@ else
FIPOLS3_FLAG=
endif
ifeq ($(FIXED_POINT_LS4), YES)
FIPOLS4_FLAG=-DFIXED_POINT_LS4
else
FIPOLS4_FLAG=
endif
ifeq ($(FIXED_POINT_LS5), YES)
FIPOLS5_FLAG=-DFIXED_POINT_LS5
else
FIPOLS5_FLAG=
endif
ifeq ($(SINGLE_COPY_POP_ENE), YES)
COPYPOPENE_FLAG=-DSINGLE_COPY_POP_ENE
else
......@@ -517,7 +565,7 @@ else
SEP_FGRID_FLAG=
endif
FIPO_FLAG = $(FIPOCO_FLAG) $(FIPOIE_FLAG) $(FIPOIA_FLAG) $(FIPOLS1_FLAG) $(FIPOLS2_FLAG) $(FIPOLS3_FLAG) $(COPYPOPENE_FLAG) $(SEP_FGRID_FLAG)
FIPO_FLAG = $(FIPOCO_FLAG) $(FIPOIE_FLAG) $(FIPOIA_FLAG) $(FIPOLS1_FLAG) $(FIPOLS2_FLAG) $(FIPOLS3_FLAG) $(FIPOLS4_FLAG) $(FIPOLS5_FLAG) $(COPYPOPENE_FLAG) $(SEP_FGRID_FLAG)
# =============================
# AOC flags
......
......@@ -135,6 +135,14 @@ while(active) {
case 0x03:
fl_tmp = read_channel_altera(chan_LS2Conf_LS3_genotype);
break;
case 0x04:
fl_tmp = read_channel_altera(chan_LS2Conf_LS4_genotype);
break;
case 0x05:
fl_tmp = read_channel_altera(chan_LS2Conf_LS5_genotype);
break;
}
if (i > 2) {
......
......@@ -19,6 +19,8 @@ channel float chan_GG2Conf_genotype __attribute__((depth(CHAN_DEPTH_G
channel float chan_LS2Conf_LS1_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_LS2Conf_LS2_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_LS2Conf_LS3_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_LS2Conf_LS4_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_LS2Conf_LS5_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
// Conform to IE, IA
channel float8 chan_Conf2Intere_xyz __attribute__((depth(CHAN_DEPTH_ATOMXYZ)));
......@@ -33,12 +35,16 @@ channel float chan_Intere2StoreGG_intere __attribute__((depth(2)));
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)));
channel float chan_Intere2StoreLS_LS4_intere __attribute__((depth(2)));
channel float chan_Intere2StoreLS_LS5_intere __attribute__((depth(2)));
channel float chan_Intrae2StoreIC_intrae __attribute__((depth(2)));
channel float chan_Intrae2StoreGG_intrae __attribute__((depth(2)));
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)));
channel float chan_Intrae2StoreLS_LS4_intrae __attribute__((depth(2)));
channel float chan_Intrae2StoreLS_LS5_intrae __attribute__((depth(2)));
// PRNG kernerls
channel float8 chan_PRNG2GA_BT_ushort_float_prng;
......@@ -46,11 +52,13 @@ channel float8 chan_PRNG2GA_BT_ushort_float_prng;
channel uchar2 chan_PRNG2GA_GG_uchar_prng;
channel float chan_PRNG2GA_GG_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel ushort3 chan_PRNG2GA_LS123_ushort_prng;
channel ushort8 chan_PRNG2GA_LS123_ushort_prng;
channel float chan_PRNG2GA_LS_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS2_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS3_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS4_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS5_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel bool chan_Arbiter_BT_ushort_float_off;
channel bool chan_Arbiter_GG_uchar_off;
......@@ -59,34 +67,48 @@ channel bool chan_Arbiter_LS123_ushort_off;
channel bool chan_Arbiter_LS_float_off;
channel bool chan_Arbiter_LS2_float_off;
channel bool chan_Arbiter_LS3_float_off;
channel bool chan_Arbiter_LS4_float_off;
channel bool chan_Arbiter_LS5_float_off;
/*
channel bool chan_GA2PRNG_LS_float_Off;
*/
// LS1, LS2, LS3
channel float chan_GA2LS_LS1_energy;
channel float chan_GA2LS_LS2_energy;
channel float chan_GA2LS_LS3_energy;
channel float chan_GA2LS_LS4_energy;
channel float chan_GA2LS_LS5_energy;
channel float chan_GA2LS_LS1_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_GA2LS_LS2_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_GA2LS_LS3_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_GA2LS_LS4_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_GA2LS_LS5_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel bool chan_LS2Arbiter_LS1_end;
channel bool chan_LS2Arbiter_LS2_end;
channel bool chan_LS2Arbiter_LS3_end;
channel bool chan_LS2Arbiter_LS4_end;
channel bool chan_LS2Arbiter_LS5_end;
channel float2 chan_LS2GA_LS1_evalenergy __attribute__((depth(2)));
channel float2 chan_LS2GA_LS2_evalenergy __attribute__((depth(2)));
channel float2 chan_LS2GA_LS3_evalenergy __attribute__((depth(2)));
channel float2 chan_LS2GA_LS3_evalenergy __attribute__((depth(2)));
channel float2 chan_LS2GA_LS4_evalenergy __attribute__((depth(2)));
channel float2 chan_LS2GA_LS5_evalenergy __attribute__((depth(2)));
channel float chan_LS2GA_LS1_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_LS2GA_LS2_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_LS2GA_LS3_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_LS2GA_LS4_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_LS2GA_LS5_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel bool chan_GA2LS_Off1_active;
channel bool chan_GA2LS_Off2_active;
channel bool chan_GA2LS_Off3_active;
channel bool chan_GA2LS_Off4_active;
channel bool chan_GA2LS_Off5_active;
// IGL_Arbiter -> Conform
channel char2 chan_IGL2Conform_actmode __attribute__((depth(3))); // active, mode
channel float chan_IGL2Conform_genotype __attribute__((depth(3*CHAN_DEPTH_GENOTYPE)));
channel char2 chan_IGL2Conform_actmode __attribute__((depth(5))); // active, mode
channel float chan_IGL2Conform_genotype __attribute__((depth(5*CHAN_DEPTH_GENOTYPE)));
channel bool chan_IGLArbiter_Off;
......@@ -512,36 +534,45 @@ void Krnl_GA(__global float* restrict GlobPopulationCurrent,
uint ls_eval_cnt = 0;
#pragma ivdep
//for (ushort ls_ent_cnt=0; ls_ent_cnt<DockConst_num_of_lsentities; ls_ent_cnt++) {
for (ushort ls_ent_cnt=0; ls_ent_cnt<DockConst_num_of_lsentities; ls_ent_cnt+=3) {
for (ushort ls_ent_cnt=0; ls_ent_cnt<DockConst_num_of_lsentities; ls_ent_cnt+=5) {
// choose random & different entities on every iteration
ushort3 entity_ls = read_channel_altera(chan_PRNG2GA_LS123_ushort_prng);
ushort8 entity_ls = read_channel_altera(chan_PRNG2GA_LS123_ushort_prng);
mem_fence(CLK_CHANNEL_MEM_FENCE);
ushort entity_ls1 = entity_ls.x;
ushort entity_ls2 = entity_ls.y;
ushort entity_ls3 = entity_ls.z;
ushort entity_ls1 = entity_ls.s0;
ushort entity_ls2 = entity_ls.s1;
ushort entity_ls3 = entity_ls.s2;
ushort entity_ls4 = entity_ls.s3;
ushort entity_ls5 = entity_ls.s4;
write_channel_altera(chan_GA2LS_LS1_energy, LocalEneNext[entity_ls1]);
write_channel_altera(chan_GA2LS_LS2_energy, LocalEneNext[entity_ls2]);
write_channel_altera(chan_GA2LS_LS3_energy, LocalEneNext[entity_ls3]);
write_channel_altera(chan_GA2LS_LS4_energy, LocalEneNext[entity_ls4]);
write_channel_altera(chan_GA2LS_LS5_energy, LocalEneNext[entity_ls5]);
mem_fence(CLK_CHANNEL_MEM_FENCE);
for (uchar gene_cnt=0; gene_cnt<DockConst_num_of_genes; gene_cnt++) {
write_channel_altera(chan_GA2LS_LS1_genotype, LocalPopNext[entity_ls1][gene_cnt & MASK_GENOTYPE]);
write_channel_altera(chan_GA2LS_LS2_genotype, LocalPopNext[entity_ls2][gene_cnt & MASK_GENOTYPE]);
write_channel_altera(chan_GA2LS_LS3_genotype, LocalPopNext[entity_ls3][gene_cnt & MASK_GENOTYPE]);
write_channel_altera(chan_GA2LS_LS4_genotype, LocalPopNext[entity_ls4][gene_cnt & MASK_GENOTYPE]);
write_channel_altera(chan_GA2LS_LS5_genotype, LocalPopNext[entity_ls5][gene_cnt & MASK_GENOTYPE]);
}
mem_fence(CLK_CHANNEL_MEM_FENCE);
float2 evalenergy_tmp1;
float2 evalenergy_tmp2;
float2 evalenergy_tmp3;
float2 evalenergy_tmp4;
float2 evalenergy_tmp5;
bool ls1_done = false;
bool ls2_done = false;
bool ls3_done = false;
while( (ls1_done == false) || (ls2_done == false) || (ls3_done == false) ){
bool ls3_done = false;
bool ls4_done = false;
bool ls5_done = false;
while( (ls1_done == false) || (ls2_done == false) || (ls3_done == false) || (ls4_done == false) || (ls5_done == false)){
if (ls1_done == false) {
evalenergy_tmp1 = read_channel_nb_altera(chan_LS2GA_LS1_evalenergy, &ls1_done);
}
......@@ -551,6 +582,12 @@ void Krnl_GA(__global float* restrict GlobPopulationCurrent,
else if (ls3_done == false) {
evalenergy_tmp3 = read_channel_nb_altera(chan_LS2GA_LS3_evalenergy, &ls3_done);
}
else if (ls4_done == false) {
evalenergy_tmp4 = read_channel_nb_altera(chan_LS2GA_LS4_evalenergy, &ls4_done);
}
else if (ls5_done == false) {
evalenergy_tmp5 = read_channel_nb_altera(chan_LS2GA_LS5_evalenergy, &ls5_done);
}
}
#if defined (DEBUG_KRNL_LS)
......@@ -560,23 +597,31 @@ void Krnl_GA(__global float* restrict GlobPopulationCurrent,
float eetmp1 = evalenergy_tmp1.x;
float eetmp2 = evalenergy_tmp2.x;
float eetmp3 = evalenergy_tmp3.x;
float eetmp4 = evalenergy_tmp4.x;
float eetmp5 = evalenergy_tmp5.x;
uint eval_tmp1 = *(uint*)&eetmp1;
uint eval_tmp2 = *(uint*)&eetmp2;
uint eval_tmp3 = *(uint*)&eetmp3;
uint eval_tmp4 = *(uint*)&eetmp4;
uint eval_tmp5 = *(uint*)&eetmp5;
LocalEneNext[entity_ls1] = evalenergy_tmp1.y;
LocalEneNext[entity_ls2] = evalenergy_tmp2.y;
LocalEneNext[entity_ls3] = evalenergy_tmp3.y;
LocalEneNext[entity_ls4] = evalenergy_tmp4.y;
LocalEneNext[entity_ls5] = evalenergy_tmp5.y;
#pragma ivdep
for (uchar gene_cnt=0; gene_cnt<DockConst_num_of_genes; gene_cnt++) {
LocalPopNext[entity_ls1][gene_cnt & MASK_GENOTYPE] = read_channel_altera(chan_LS2GA_LS1_genotype);
LocalPopNext[entity_ls2][gene_cnt & MASK_GENOTYPE] = read_channel_altera(chan_LS2GA_LS2_genotype);
LocalPopNext[entity_ls3][gene_cnt & MASK_GENOTYPE] = read_channel_altera(chan_LS2GA_LS3_genotype);
LocalPopNext[entity_ls4][gene_cnt & MASK_GENOTYPE] = read_channel_altera(chan_LS2GA_LS4_genotype);
LocalPopNext[entity_ls5][gene_cnt & MASK_GENOTYPE] = read_channel_altera(chan_LS2GA_LS5_genotype);
}
ls_eval_cnt += eval_tmp1 + eval_tmp2 + eval_tmp3;
ls_eval_cnt += eval_tmp1 + eval_tmp2 + eval_tmp3 + eval_tmp4 + eval_tmp5;
#if defined (DEBUG_KRNL_LS)
printf("%u, ls_eval_cnt: %u\n", ls_ent_cnt, ls_eval_cnt);
......@@ -634,12 +679,16 @@ void Krnl_GA(__global float* restrict GlobPopulationCurrent,
write_channel_altera(chan_Arbiter_LS_float_off, false);
write_channel_altera(chan_Arbiter_LS2_float_off, false);
write_channel_altera(chan_Arbiter_LS3_float_off, false);
write_channel_altera(chan_Arbiter_LS4_float_off, false);
write_channel_altera(chan_Arbiter_LS5_float_off, false);
mem_fence(CLK_CHANNEL_MEM_FENCE);
// turn off LS kernels
write_channel_altera(chan_GA2LS_Off1_active, false);
write_channel_altera(chan_GA2LS_Off2_active, false);
write_channel_altera(chan_GA2LS_Off3_active, false);
write_channel_altera(chan_GA2LS_Off4_active, false);
write_channel_altera(chan_GA2LS_Off5_active, false);
mem_fence(CLK_CHANNEL_MEM_FENCE);
// turn off IGL, Conform, IE, IA
......@@ -690,6 +739,8 @@ void Krnl_GA(__global float* restrict GlobPopulationCurrent,
#include "Krnl_LS.cl"
#include "Krnl_LS2.cl"
#include "Krnl_LS3.cl"
#include "Krnl_LS4.cl"
#include "Krnl_LS5.cl"
#include "Krnl_IGL_Arbiter.cl"
#include "Krnl_Conform.cl"
......
......@@ -19,6 +19,8 @@ while(active) {
bool LS1_end_valid = false;
bool LS2_end_valid = false;
bool LS3_end_valid = false;
bool LS4_end_valid = false;
bool LS5_end_valid = false;
bool Off_active;
bool IC_active;
......@@ -26,6 +28,8 @@ while(active) {
bool LS1_end_active;
bool LS2_end_active;
bool LS3_end_active;
bool LS4_end_active;
bool LS5_end_active;
while (
(Off_valid == false) &&
......@@ -33,7 +37,9 @@ while(active) {
(GG_valid == false) &&
(LS1_end_valid == false) &&
(LS2_end_valid == false) &&
(LS3_end_valid == false)
(LS3_end_valid == false) &&
(LS4_end_valid == false) &&
(LS5_end_valid == false)
){
Off_active = read_channel_nb_altera(chan_IGLArbiter_Off, &Off_valid);
IC_active = read_channel_nb_altera(chan_GA2IGL_IC_active, &IC_valid);
......@@ -41,11 +47,13 @@ while(active) {
LS1_end_active = read_channel_nb_altera(chan_LS2Arbiter_LS1_end, &LS1_end_valid);
LS2_end_active = read_channel_nb_altera(chan_LS2Arbiter_LS2_end, &LS2_end_valid);
LS3_end_active = read_channel_nb_altera(chan_LS2Arbiter_LS3_end, &LS3_end_valid);
LS4_end_active = read_channel_nb_altera(chan_LS2Arbiter_LS4_end, &LS4_end_valid);
LS5_end_active = read_channel_nb_altera(chan_LS2Arbiter_LS5_end, &LS5_end_valid);
}
uchar bound_tmp = 0;
active = Off_valid ? 0x00 : 0x01;
char mode [3]; // mode for all LS
char mode [5]; // mode for all LS
/*
float genotypeICGG [ACTUAL_GENOTYPE_LENGTH];
......@@ -54,110 +62,96 @@ while(active) {
// get genotype from IC, GG, LS1, LS2, LS3
if (active == 0x01) {
//#pragma ivdep
/*
for (uchar i=0; i<DockConst_num_of_genes; i++) {
*/
if (IC_valid == true) {
bound_tmp++;
/*
if (i == 0) {bound_tmp++; }
genotypeICGG [i] = read_channel_altera(chan_IC2Conf_genotype);
*/
}
else if (GG_valid == true) {
bound_tmp++;
/*
if (i == 0) {bound_tmp++; }
genotypeICGG [i] = read_channel_altera(chan_GG2Conf_genotype);
*/
}
else{
/*
float genotype1;
float genotype2;
float genotype3;
*/
#if 0
if (LS1_end_valid == true) {
//printf("%-15s %5s\n", "LS1_valid: ", "reading genotypes");
if (i == 0) {bound_tmp++; }
genotype1 /*[i]*/ = read_channel_altera(chan_LS2Conf_LS1_genotype);
}
#endif
/*
if (LS2_end_valid == true) {
genotype2 = read_channel_altera(chan_LS2Conf_LS2_genotype);
}
if (LS3_end_valid == true) {
genotype3 = read_channel_altera(chan_LS2Conf_LS3_genotype);
if (IC_valid == true) {
bound_tmp++;
}
else if (GG_valid == true) {
bound_tmp++;
}
else{
// Reorder the mode & genotype coming from LS
if (LS1_end_valid) {mode[0] = 0x01; bound_tmp++;
if (LS2_end_valid) {mode[1] = 0x02; bound_tmp++;
if (LS3_end_valid) {mode[2] = 0x03; bound_tmp++;
if (LS4_end_valid) {mode[3] = 0x04; bound_tmp++;
if (LS5_end_valid) {mode[4] = 0x05; bound_tmp++;}
}
else {
if (LS5_end_valid) {mode[3] = 0x05; bound_tmp++;}
}
}
else { // LS1: yes, LS2: yes, LS3: no
if (LS4_end_valid) {mode[2] = 0x04; bound_tmp++;
if (LS5_end_valid) {mode[3] = 0x05; bound_tmp++;}
}
else {
if (LS5_end_valid) {mode[2] = 0x05; bound_tmp++;}
}
}
}
*/
// Reorder the mode & genotype coming from LS
if (LS1_end_valid) {
mode[0] = 0x01; bound_tmp++;
/*
genotype1 = read_channel_altera(chan_LS2Conf_LS1_genotype);
if (i == 0) {mode[0] = 0x01; bound_tmp++;}
genotype[0][i & MASK_GENOTYPE] = genotype1;
*/
if (LS2_end_valid) {
mode[1] = 0x02; bound_tmp++;
/*
if (i == 0) {mode[1] = 0x02; bound_tmp++;}
genotype[1][i & MASK_GENOTYPE] = genotype2;
*/
else { // LS1: yes, LS2: no
if (LS3_end_valid) {mode[1] = 0x03; bound_tmp++;
if (LS4_end_valid) {mode[2] = 0x04; bound_tmp++;
if (LS5_end_valid) {mode[3] = 0x05; bound_tmp++;}
}
else {
if (LS5_end_valid) {mode[2] = 0x05; bound_tmp++;}
}
}
else { // LS1: yes, LS2: no, LS3: no
if (LS4_end_valid) {mode[1] = 0x04; bound_tmp++;
if (LS5_end_valid) {mode[2] = 0x05; bound_tmp++;}
}
else {
if (LS5_end_valid) {mode[1] = 0x05; bound_tmp++;}
}
if (LS3_end_valid) {
mode[2] = 0x03; bound_tmp++;
/*
if (i == 0) {mode[2] = 0x03; bound_tmp++;}
genotype[2][i & MASK_GENOTYPE] = genotype3;
*/
}
}
}
else { // LS1: no
if (LS2_end_valid) {mode[0] = 0x02; bound_tmp++;
if (LS3_end_valid) {mode[1] = 0x03; bound_tmp++;
if (LS4_end_valid) {mode[2] = 0x04; bound_tmp++;
if (LS5_end_valid) {mode[3] = 0x05; bound_tmp++;}
}
else {
if (LS5_end_valid) {mode[2] = 0x05; bound_tmp++;}
}
}
else {
if (LS3_end_valid) {
mode[1] = 0x03; bound_tmp++;
/*
if (i == 0) {mode[1] = 0x03; bound_tmp++;}
genotype[1][i & MASK_GENOTYPE] = genotype3;
*/
else { // LS1: no, LS2: yes, LS3: no
if (LS4_end_valid) {mode[1] = 0x04; bound_tmp++;
if (LS5_end_valid) {mode[2] = 0x05; bound_tmp++;}
}
else {
if (LS5_end_valid) {mode[1] = 0x05; bound_tmp++;}
}
}
}
else {
if (LS2_end_valid) {
mode[0] = 0x02; bound_tmp++;
/*
if (i == 0) {mode[0] = 0x02; bound_tmp++;}
genotype[0][i & MASK_GENOTYPE] = genotype2;
*/
if (LS3_end_valid) {
mode[1] = 0x03; bound_tmp++;
/*
if (i == 0) {mode[1] = 0x03; bound_tmp++;}
genotype[1][i & MASK_GENOTYPE] = genotype3;
*/
else { // LS1: no, LS2: no
if (LS3_end_valid) {mode[0] = 0x03; bound_tmp++;
if (LS4_end_valid) {mode[1] = 0x04; bound_tmp++;
if (LS5_end_valid) {mode[2] = 0x05; bound_tmp++;}
}
else {
if (LS5_end_valid) {mode[1] = 0x05; bound_tmp++;}
}
}
else {
if (LS3_end_valid) {
mode[0] = 0x03; bound_tmp++;
/*
if (i == 0) {mode[0] = 0x03; bound_tmp++;}
genotype[0][i & MASK_GENOTYPE] = genotype3;
*/
else { // LS1: no, LS2: no, LS3: no
if (LS4_end_valid) {mode[0] = 0x04; bound_tmp++;
if (LS5_end_valid) {mode[1] = 0x05; bound_tmp++;}
}
else {
if (LS5_end_valid) {mode[0] = 0x05; bound_tmp++;}
}
}
}
}
/*
} // End of for-loop for (uchar i=0; i<DockConst_num_of_genes; i++) { }
*/
}
}
} // End if (active == true)
uchar bound = active ? bound_tmp : 1;
......
......@@ -485,6 +485,12 @@ while(active) {
// LS 3
case 0x03: write_channel_altera(chan_Intere2StoreLS_LS3_intere, final_interE); break;
// LS 4
case 0x04: write_channel_altera(chan_Intere2StoreLS_LS4_intere, final_interE); break;
// LS 5
case 0x05: write_channel_altera(chan_Intere2StoreLS_LS5_intere, final_interE); break;
}
// --------------------------------------------------------------
......
......@@ -225,6 +225,12 @@ while(active) {
// LS 3
case 0x03: write_channel_altera(chan_Intrae2StoreLS_LS3_intrae, intraE); break;
// LS 4
case 0x04: write_channel_altera(chan_Intrae2StoreLS_LS4_intrae, intraE); break;
// LS 5
case 0x05: write_channel_altera(chan_Intrae2StoreLS_LS5_intrae, intraE); break;
}
// --------------------------------------------------------------
......
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
__kernel __attribute__ ((max_global_work_dim(0)))
void Krnl_LS4(
unsigned short DockConst_max_num_of_iters,
#if defined (FIXED_POINT_LS4)
fixedpt DockConst_rho_lower_bound,
fixedpt DockConst_base_dmov_mul_sqrt3,
#else
float DockConst_rho_lower_bound,
float DockConst_base_dmov_mul_sqrt3,
#endif
unsigned char DockConst_num_of_genes,
#if defined (FIXED_POINT_LS4)
fixedpt DockConst_base_dang_mul_sqrt3,
#else
float DockConst_base_dang_mul_sqrt3,
#endif
unsigned char DockConst_cons_limit
)
{
bool valid = true;
while(valid) {
bool active;
bool valid_active = false;