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

cleaned Krnl_GA

parent 2605cea7
......@@ -15,35 +15,18 @@
channel bool chan_GA2IGL_IC_active;
channel bool chan_GA2IGL_GG_active;
// Send genotypes from producers (IC, GG, LSs) to Conform
// Send genotypes from producers (IC, GG) to Conform
channel float chan_IC2Conf_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_GG2Conf_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
/*
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)));
channel float chan_LS2Conf_LS6_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_LS2Conf_LS7_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_LS2Conf_LS8_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_LS2Conf_LS9_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
*/
// Send ligand-atom positions from Conform to InterE & IntraE
channel float8 chan_Conf2Intere_xyz __attribute__((depth(CHAN_DEPTH_ATOMXYZ)));
#if 0
channel char2 chan_Conf2Intere_actmode;
#endif
channel char chan_Conf2Intere_actmode;
channel float8 chan_Conf2Intrae_xyz __attribute__((depth(CHAN_DEPTH_ATOMXYZ)));
#if 0
channel char2 chan_Conf2Intrae_actmode;
#endif
channel char chan_Conf2Intrae_actmode;
// Send energy values from InterE & IntraE to genotype-senders (IC, GG, LSs)
// Send energy values from InterE & IntraE to genotype-senders (IC, GG)
#if 1
channel float chan_Intere2StoreIC_intere __attribute__((depth(2)));
channel float chan_Intere2StoreGG_intere __attribute__((depth(2)));
......@@ -52,17 +35,7 @@ channel float chan_Intere2StoreGG_intere __attribute__((depth(2)));
channel float chan_Intere2StoreIC_intere __attribute__((depth(MAX_POPSIZE)));
channel float chan_Intere2StoreGG_intere __attribute__((depth(MAX_POPSIZE)));
#endif
/*
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_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)));
*/
#if 1
channel float chan_Intrae2StoreIC_intrae __attribute__((depth(2)));
channel float chan_Intrae2StoreGG_intrae __attribute__((depth(2)));
......@@ -71,34 +44,11 @@ channel float chan_Intrae2StoreGG_intrae __attribute__((depth(2)));
channel float chan_Intrae2StoreIC_intrae __attribute__((depth(MAX_POPSIZE)));
channel float chan_Intrae2StoreGG_intrae __attribute__((depth(MAX_POPSIZE)));
#endif
/*
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)));
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)));
*/
// Send PRNG outputs from generators to consumers
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 ushort16 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 float chan_PRNG2GA_LS6_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS7_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS8_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_PRNG2GA_LS9_float_prng __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
*/
// Turn-off signals to PRNG generators
......@@ -109,115 +59,16 @@ channel float chan_PRNG2GA_LS9_float_prng __attribute__((depth(CHAN_DEPTH_
channel bool chan_Arbiter_BT_ushort_float_off;
channel bool chan_Arbiter_GG_uchar_off;
channel bool chan_Arbiter_GG_float_off;
/*
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_Arbiter_LS6_float_off;
channel bool chan_Arbiter_LS7_float_off;
channel bool chan_Arbiter_LS8_float_off;
channel bool chan_Arbiter_LS9_float_off;
*/
// Send energy values and genotypes to LSs
/*
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_LS6_energy;
channel float chan_GA2LS_LS7_energy;
channel float chan_GA2LS_LS8_energy;
channel float chan_GA2LS_LS9_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 float chan_GA2LS_LS6_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_GA2LS_LS7_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_GA2LS_LS8_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_GA2LS_LS9_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
*/
// Send LS status from LSs to IGL_Arbiter
/*
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 bool chan_LS2Arbiter_LS6_end;
channel bool chan_LS2Arbiter_LS7_end;
channel bool chan_LS2Arbiter_LS8_end;
channel bool chan_LS2Arbiter_LS9_end;
*/
// Get LS-eval-count, new energy, new genotype from LSs
/*
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_LS4_evalenergy __attribute__((depth(2)));
channel float2 chan_LS2GA_LS5_evalenergy __attribute__((depth(2)));
channel float2 chan_LS2GA_LS6_evalenergy __attribute__((depth(2)));
channel float2 chan_LS2GA_LS7_evalenergy __attribute__((depth(2)));
channel float2 chan_LS2GA_LS8_evalenergy __attribute__((depth(2)));
channel float2 chan_LS2GA_LS9_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 float chan_LS2GA_LS6_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_LS2GA_LS7_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_LS2GA_LS8_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
channel float chan_LS2GA_LS9_genotype __attribute__((depth(CHAN_DEPTH_GENOTYPE)));
*/
// Turn-off signals to LSs
/*
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;
channel bool chan_GA2LS_Off6_active;
channel bool chan_GA2LS_Off7_active;
channel bool chan_GA2LS_Off8_active;
channel bool chan_GA2LS_Off9_active;
*/
// Send genotype-producer-channel selector and genotype
// from IGL_Arbiter to Conform
#if 0
channel char2 chan_IGL2Conform_actmode __attribute__((depth(9))); // active, mode
#endif
channel char chan_IGL2Conform_actmode __attribute__((depth(3))); // mode
#if 0
channel float chan_IGL2Conform_genotype __attribute__((depth(9*CHAN_DEPTH_GENOTYPE)));
#endif
// Turn-off signal to IGL_Arbiter, Conform, InterE, IntraE
channel bool chan_IGLArbiter_Off;
#if defined (FIXED_POINT_CONFORM) || \
defined (FIXED_POINT_LS1) || \
defined (FIXED_POINT_LS2) || \
defined (FIXED_POINT_LS3) || \
defined (FIXED_POINT_LS4) || \
defined (FIXED_POINT_LS5) || \
defined (FIXED_POINT_LS6) || \
defined (FIXED_POINT_LS7) || \
defined (FIXED_POINT_LS8) || \
defined (FIXED_POINT_LS9)
#if defined (FIXED_POINT_CONFORM)
#include "../defines_fixedpt.h"
typedef int3 fixedpt3;
typedef int4 fixedpt4;
#endif
......@@ -256,43 +107,6 @@ float map_angle_360(float angle)
return x;
}
#if defined (FIXED_POINT_LS1) || \
defined (FIXED_POINT_LS2) || \
defined (FIXED_POINT_LS3) || \
defined (FIXED_POINT_LS4) || \
defined (FIXED_POINT_LS5) || \
defined (FIXED_POINT_LS6) || \
defined (FIXED_POINT_LS7) || \
defined (FIXED_POINT_LS8) || \
defined (FIXED_POINT_LS9)
#define FIXEDPT_180 0xB40000
#define FIXEDPT_360 0x1680000
fixedpt fixedpt_map_angle_180(fixedpt angle)
{
fixedpt x = angle;
//while (x < 0.0f)
if (x < 0)
{ x += FIXEDPT_180; }
//while (x > 180.0f)
if (x > FIXEDPT_180)
{ x -= FIXEDPT_180; }
return x;
}
fixedpt fixedpt_map_angle_360(fixedpt angle)
{
fixedpt x = angle;
//while (x < 0.0f)
if (x < 0)
{ x += FIXEDPT_360; }
//while (x > 360.0f)
if (x > FIXEDPT_360)
{ x -= FIXEDPT_360;}
return x;
}
#endif
// Shift register sizes
// Such registers are used to reduce Initiation Interval (II)
#define SHIFT_REG_SIZE 10
......@@ -687,7 +501,7 @@ void Krnl_GA(__global float* restrict GlobPopulationCurrent,
}
// Update energy evaluations count: count LS and GG evals
eval_cnt += /*ls_eval_cnt +*/ DockConst_pop_size;
eval_cnt += DockConst_pop_size;
// Update generation count
generation_cnt++;
......@@ -705,33 +519,8 @@ void Krnl_GA(__global float* restrict GlobPopulationCurrent,
write_channel_altera(chan_Arbiter_BT_ushort_float_off, false);
write_channel_altera(chan_Arbiter_GG_uchar_off, false);
write_channel_altera(chan_Arbiter_GG_float_off, false);
/*
write_channel_altera(chan_Arbiter_LS123_ushort_off, false);
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);
write_channel_altera(chan_Arbiter_LS6_float_off, false);
write_channel_altera(chan_Arbiter_LS7_float_off, false);
write_channel_altera(chan_Arbiter_LS8_float_off, false);
write_channel_altera(chan_Arbiter_LS9_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);
write_channel_altera(chan_GA2LS_Off6_active, false);
write_channel_altera(chan_GA2LS_Off7_active, false);
write_channel_altera(chan_GA2LS_Off8_active, false);
write_channel_altera(chan_GA2LS_Off9_active, false);
mem_fence(CLK_CHANNEL_MEM_FENCE);
*/
// Turn off IGL_Arbiter, Conform, InterE, IntraE kernerls
write_channel_altera(chan_IGLArbiter_Off, false);
mem_fence(CLK_CHANNEL_MEM_FENCE);
......@@ -777,18 +566,6 @@ void Krnl_GA(__global float* restrict GlobPopulationCurrent,
#include "Krnl_PRNG.cl"
/*
#include "Krnl_LS.cl"
#include "Krnl_LS2.cl"
#include "Krnl_LS3.cl"
#include "Krnl_LS4.cl"
#include "Krnl_LS5.cl"
#include "Krnl_LS6.cl"
#include "Krnl_LS7.cl"
#include "Krnl_LS8.cl"
#include "Krnl_LS9.cl"
*/
#include "Krnl_IGL_Arbiter.cl"
#include "Krnl_Conform.cl"
#include "Krnl_InterE.cl"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment