Commit 754508be authored by Leonardo Solis's avatar Leonardo Solis
Browse files

added unroll attributes

parent eac11d6f
......@@ -634,7 +634,7 @@ include $(COMMON_REPO)/utility/rules.mk
# Automate test
# "exe" and "xclbin" are rules from "rules.mk"
emu:
XCL_EMULATION_MODE=sw_emu ./hostbin -ffile input/1stp/derived/1stp_protein.maps.fld -lfile input/1stp/derived/1stp_ligand.pdbqt -nrun 50 -nev 200000
XCL_EMULATION_MODE=sw_emu ./hostbin -ffile input/1stp/derived/1stp_protein.maps.fld -lfile input/1stp/derived/1stp_ligand.pdbqt -nrun 2 -nev 2000000
debug:
XCL_EMULATION_MODE=sw_emu xgdb -args ./hostbin -ffile input/1stp/derived/1stp_protein.maps.fld -lfile input/1stp/derived/1stp_ligand.pdbqt -nrun 1 -nev 100 -lsit 10 -psize 10
......@@ -481,7 +481,11 @@ while(active) {
float3 tmp_coords[2];
#endif
/*
#pragma unroll
*/
__attribute__((opencl_unroll_hint))
LOOP_CONFORM_OUT:
for (uchar i=0; i<2; i++) {
tmp_coords[i] = loc_coords[pipe_cnt+i];
}
......
......@@ -616,7 +616,11 @@ void Krnl_GA(
// Shift register to reduce II (initially II=6) of best entity for-loop
float shift_reg[SHIFT_REG_SIZE];
/*
#pragma unroll
*/
__attribute__((opencl_unroll_hint))
LOOP_GA_SHIFT:
for (uchar i=0; i<SHIFT_REG_SIZE; i++) {
shift_reg[i] = 0.0f;
}
......@@ -636,7 +640,11 @@ void Krnl_GA(
//if (pop_cnt>0) {
shift_reg[SHIFT_REG_SIZE_MINUS_ONE] = loc_energies[best_entity];
/*
#pragma unroll
*/
__attribute__((opencl_unroll_hint))
LOOP_GA_SHIFT_MINUS_ONE:
for (uchar j=0; j<SHIFT_REG_SIZE_MINUS_ONE; j++) {
shift_reg[j] = shift_reg[j+1];
}
......@@ -655,7 +663,11 @@ void Krnl_GA(
// Elitism: copying the best entity to new population
// ---------------------------------------------------
if (new_pop_cnt == 1) {
/*
#pragma unroll
*/
__attribute__((opencl_unroll_hint))
LOOP_GA_ELITISM:
for (uchar gene_cnt=0; gene_cnt<ACTUAL_GENOTYPE_LENGTH; gene_cnt++) {
LocalPopNext[0][gene_cnt & MASK_GENOTYPE] = LocalPopCurr[best_entity][gene_cnt & MASK_GENOTYPE];
}
......
......@@ -103,7 +103,11 @@ while(active) {
//float shift_intraE[33];
fixedpt64 shift_intraE[33];
/*
#pragma unroll
*/
__attribute__((opencl_unroll_hint))
LOOP_INTRAE_SHIFT_INIT:
for (uchar i=0; i<33; i++) {
//shift_intraE[i] = 0.0f;
shift_intraE[i] = 0;
......@@ -191,7 +195,11 @@ while(active) {
fixedpt64_fromfloat(partialE3) +
fixedpt64_fromfloat(partialE4);
/*
#pragma unroll
*/
__attribute__((opencl_unroll_hint))
LOOP_INTRAE_SHIFT:
for (uchar j=0; j<32; j++) {
shift_intraE[j] = shift_intraE[j+1];
}
......@@ -204,7 +212,11 @@ while(active) {
#if defined (FIXED_POINT_INTRAE)
fixedpt64 fixpt_intraE = 0;
/*
#pragma unroll
*/
__attribute__((opencl_unroll_hint))
LOOP_INTRAE_SHIFT_RED:
for (uchar j=0; j<32; j++) {
//intraE += shift_intraE[j];
fixpt_intraE += shift_intraE[j];
......
......@@ -32,7 +32,11 @@ void Krnl_Prng_BT_ushort_float(unsigned int Host_seed1,
uint u_tmp[4]; // used as short in GA
float f_tmp[4];
/*
#pragma unroll
*/
__attribute__((opencl_unroll_hint))
LOOP_PRNG_BT_USHORT_FLOAT:
for(uchar i=0; i<4; i++) {
uchar2 lsb;
......@@ -98,7 +102,11 @@ void Krnl_Prng_GG_uchar(unsigned int Host_seed,
uchar tmp[2];
/*
#pragma unroll
*/
__attribute__((opencl_unroll_hint))
LOOP_PRNG_GG_UCHAR:
for(uchar i=0; i<2; i++) {
uchar lsb;
lsb = lfsr & 0x01u;
......@@ -223,7 +231,11 @@ void Krnl_Prng_LS123_ushort(unsigned int Host_seed1,
ushort tmp[9];
/*
#pragma unroll
*/
__attribute__((opencl_unroll_hint))
LOOP_PRNG_LS123_USHORT:
for (uint i=0; i<9; i++){
uchar lsb[9];
lsb [i] = lfsr[i] & 0x01u;
......
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