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

#28, replaced krnl refs: k36,k10,k6 to krnl_prng{bt_ushort_float,gg_uchar,gg_float}

parent 03e0ba14
......@@ -25,12 +25,34 @@ ENABLE_KRNL_CONFORM = YES
ENABLE_KRNL_INTERE = YES
ENABLE_KRNL_INTRAE = YES
# Prng kernels
ENABLE_K6 = YES
ENABLE_KRNL_PRNG_BT_USHORT_FLOAT = YES
ENABLE_KRNL_PRNG_GG_UCHAR = YES
ENABLE_KRNL_PRNG_GG_FLOAT = YES
# ls123 prng
ENABLE_K35 = YES
ENABLE_K7 = YES
# ls1 prng
ENABLE_K10 = YES
ENABLE_K14 = YES
ENABLE_K20 = YES
# prng ls4, ls5
ENABLE_K37 = YES
ENABLE_K38 = YES
# prng ls6, ls7, ls8, ls9
ENABLE_K41 = YES
ENABLE_K42 = YES
ENABLE_K43 = YES
ENABLE_K44 = YES
# Replace single Krnl_Prng_Arbiter
# See kernels 31, 32, 33, 34
......@@ -39,35 +61,26 @@ ENABLE_K10 = YES
ENABLE_K12 = YES
# disable Krnl_LS_Arbiter
ENABLE_K14 = YES
ENABLE_K15 = YES
ENABLE_K20 = YES
ENABLE_K21 = YES
# PRNGS in GA for LS2 and LS3
ENABLE_K27 = YES
# ls123 prng
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
# prng ls6, ls7, ls8, ls9
ENABLE_K41 = YES
ENABLE_K42 = YES
ENABLE_K43 = YES
ENABLE_K44 = YES
# krnl_ls6, Krnl_ls7, krnl_ls8, Krnl_ls9
ENABLE_K45 = YES
......@@ -100,23 +113,36 @@ else
KRNL_INTRAE =
endif
ifeq ($(ENABLE_K6),YES)
K6 =-DENABLE_KERNEL6
ifeq ($(ENABLE_KRNL_PRNG_BT_USHORT_FLOAT),YES)
KRNL_PRNG_BT_USHORT_FLOAT =-DENABLE_KRNL_PRNG_BT_USHORT_FLOAT
else
KRNL_PRNG_BT_USHORT_FLOAT =
endif
ifeq ($(ENABLE_KRNL_PRNG_GG_UCHAR),YES)
KRNL_PRNG_GG_UCHAR =-DENABLE_KRNL_PRNG_GG_UCHAR
else
K6 =
KRNL_PRNG_GG_UCHAR =
endif
ifeq ($(ENABLE_KRNL_PRNG_GG_FLOAT),YES)
KRNL_PRNG_GG_FLOAT =-DENABLE_KRNL_PRNG_GG_FLOAT
else
KRNL_PRNG_GG_FLOAT =
endif
ifeq ($(ENABLE_K7),YES)
K7 =-DENABLE_KERNEL7
else
K7 =
endif
ifeq ($(ENABLE_K10),YES)
K10 =-DENABLE_KERNEL10
else
K10 =
endif
ifeq ($(ENABLE_K12),YES)
K12 =-DENABLE_KERNEL12
......@@ -160,11 +186,7 @@ else
K35 =
endif
ifeq ($(ENABLE_K36),YES)
K36 =-DENABLE_KERNEL36
else
K36 =
endif
ifeq ($(ENABLE_K37),YES)
K37 =-DENABLE_KERNEL37
......@@ -251,10 +273,13 @@ ENABLE_KERNELS = $(KRNL_GA) \
$(KRNL_CONFORM) \
$(KRNL_INTERE) \
$(KRNL_INTRAE) \
$(K6) $(K7) $(K10) \
$(KRNL_PRNG_BT_USHORT_FLOAT) \
$(KRNL_PRNG_GG_UCHAR) \
$(KRNL_PRNG_GG_FLOAT) \
$(K7) \
$(K12) $(K14) $(K15) $(K20) \
$(K21) $(K27) \
$(K35) $(K36) $(K37) $(K38) $(K39) $(K40) \
$(K35) $(K37) $(K38) $(K39) $(K40) \
$(K41) $(K42) $(K43) $(K44) $(K45) $(K46) $(K47) $(K48)
# =============================
......
......@@ -63,19 +63,39 @@ static const char *name_krnl_intere = "Krnl_InterE";
static cl_command_queue command_queue_intrae = NULL;
static cl_kernel kernel_intrae = NULL;
static const char *name_krnl_intrae = "Krnl_IntraE";
#endif
#ifdef ENABLE_KERNEL10
static cl_command_queue command_queue10 = NULL;
static cl_kernel kernel10 = NULL;
static const char *name_k10 = "Krnl_Prng_GG_uchar";
#endif
#ifdef ENABLE_KERNEL6
static cl_command_queue command_queue6 = NULL;
static cl_kernel kernel6 = NULL;
static const char *name_k6 = "Krnl_Prng_GG_float";
#endif
#endif
#ifdef ENABLE_KRNL_PRNG_BT_USHORT_FLOAT
static cl_command_queue command_queue_prng_bt_ushort_float = NULL;
static cl_kernel kernel_prng_bt_ushort_float = NULL;
static const char *name_krnl_prng_bt_ushort_float = "Krnl_Prng_BT_ushort_float";
#endif
#ifdef ENABLE_KRNL_PRNG_GG_UCHAR
static cl_command_queue command_queue_prng_gg_uchar = NULL;
static cl_kernel kernel_prng_gg_uchar = NULL;
static const char *name_krnl_prng_gg_uchar = "Krnl_Prng_GG_uchar";
#endif
#ifdef ENABLE_KRNL_PRNG_GG_FLOAT
static cl_command_queue command_queue_prng_gg_float = NULL;
static cl_kernel kernel_prng_gg_float = NULL;
static const char *name_krnl_prng_gg_float = "Krnl_Prng_GG_float";
#endif
#ifdef ENABLE_KERNEL35
static cl_command_queue command_queue35 = NULL;
static cl_kernel kernel35 = NULL;
static const char *name_k35 = "Krnl_Prng_LS123_ushort";
#endif
#ifdef ENABLE_KERNEL7
static cl_command_queue command_queue7 = NULL;
......@@ -83,54 +103,18 @@ static cl_kernel kernel7 = NULL;
static const char *name_k7 = "Krnl_Prng_LS_float";
#endif
#ifdef ENABLE_KERNEL12
static cl_command_queue command_queue12 = NULL;
static cl_kernel kernel12 = NULL;
static const char *name_k12 = "Krnl_LS";
#endif
#ifdef ENABLE_KERNEL14
static cl_command_queue command_queue14 = NULL;
static cl_kernel kernel14 = NULL;
static const char *name_k14 = "Krnl_Prng_LS2_float";
#endif
#ifdef ENABLE_KERNEL15
static cl_command_queue command_queue15 = NULL;
static cl_kernel kernel15 = NULL;
static const char *name_k15 = "Krnl_LS2";
#endif
#ifdef ENABLE_KERNEL20
static cl_command_queue command_queue20 = NULL;
static cl_kernel kernel20 = NULL;
static const char *name_k20 = "Krnl_Prng_LS3_float";
#endif
#ifdef ENABLE_KERNEL21
static cl_command_queue command_queue21 = NULL;
static cl_kernel kernel21 = NULL;
static const char *name_k21 = "Krnl_LS3";
#endif
#ifdef ENABLE_KERNEL27
static cl_command_queue command_queue27 = NULL;
static cl_kernel kernel27 = NULL;
static const char *name_k27 = "Krnl_IGL_Arbiter";
#endif
#ifdef ENABLE_KERNEL35
static cl_command_queue command_queue35 = NULL;
static cl_kernel kernel35 = NULL;
static const char *name_k35 = "Krnl_Prng_LS123_ushort";
#endif
#ifdef ENABLE_KERNEL36
static cl_command_queue command_queue36 = NULL;
static cl_kernel kernel36 = NULL;
static const char *name_k36 = "Krnl_Prng_BT_ushort_float";
#endif
#endif
#ifdef ENABLE_KERNEL37
static cl_command_queue command_queue37 = NULL;
static cl_kernel kernel37 = NULL;
......@@ -141,20 +125,8 @@ static const char *name_k37 = "Krnl_Prng_LS4_float";
static cl_command_queue command_queue38 = NULL;
static cl_kernel kernel38 = NULL;
static const char *name_k38 = "Krnl_Prng_LS5_float";
#endif
#ifdef ENABLE_KERNEL39
static cl_command_queue command_queue39 = NULL;
static cl_kernel kernel39 = NULL;
static const char *name_k39 = "Krnl_LS4";
#endif
#ifdef ENABLE_KERNEL40
static cl_command_queue command_queue40 = NULL;
static cl_kernel kernel40 = NULL;
static const char *name_k40 = "Krnl_LS5";
#endif
#endif
#ifdef ENABLE_KERNEL41
static cl_command_queue command_queue41 = NULL;
static cl_kernel kernel41 = NULL;
......@@ -177,6 +149,55 @@ static const char *name_k43 = "Krnl_Prng_LS8_float";
static cl_command_queue command_queue44 = NULL;
static cl_kernel kernel44 = NULL;
static const char *name_k44 = "Krnl_Prng_LS9_float";
#endif
#ifdef ENABLE_KERNEL12
static cl_command_queue command_queue12 = NULL;
static cl_kernel kernel12 = NULL;
static const char *name_k12 = "Krnl_LS";
#endif
#ifdef ENABLE_KERNEL15
static cl_command_queue command_queue15 = NULL;
static cl_kernel kernel15 = NULL;
static const char *name_k15 = "Krnl_LS2";
#endif
#ifdef ENABLE_KERNEL21
static cl_command_queue command_queue21 = NULL;
static cl_kernel kernel21 = NULL;
static const char *name_k21 = "Krnl_LS3";
#endif
#ifdef ENABLE_KERNEL27
static cl_command_queue command_queue27 = NULL;
static cl_kernel kernel27 = NULL;
static const char *name_k27 = "Krnl_IGL_Arbiter";
#endif
#ifdef ENABLE_KERNEL39
static cl_command_queue command_queue39 = NULL;
static cl_kernel kernel39 = NULL;
static const char *name_k39 = "Krnl_LS4";
#endif
#ifdef ENABLE_KERNEL40
static cl_command_queue command_queue40 = NULL;
static cl_kernel kernel40 = NULL;
static const char *name_k40 = "Krnl_LS5";
#endif
#ifdef ENABLE_KERNEL45
......@@ -985,15 +1006,44 @@ printf("%i %i\n", dockpars.num_of_intraE_contributors, myligand_reference.num_of
/*
setKernelArg(kernel_intrae,14, sizeof(unsigned int), &square_num_of_atypes);
*/
#endif // End of ENABLE_KRNL_INTRAE
#endif // End of ENABLE_KRNL_INTRAE
#ifdef ENABLE_KRNL_PRNG_BT_USHORT_FLOAT // Krnl_PRNG_ushort_float
setKernelArg(kernel_prng_bt_ushort_float,2, sizeof(unsigned int), &dockpars.pop_size);
#if !defined(SW_EMU)
setKernelArg(kernel_prng_bt_ushort_float,3, sizeof(mem_dummy), &mem_dummy);
#endif
#endif // End of ENABLE_KRNL_PRNG_BT_USHORT_FLOAT
#ifdef ENABLE_KRNL_PRNG_GG_UCHAR // Krnl_PRNG_uchar
setKernelArg(kernel_prng_gg_uchar,1, sizeof(unsigned char), &dockpars.num_of_genes);
#if !defined(SW_EMU)
setKernelArg(kernel_prng_gg_uchar,2, sizeof(mem_dummy), &mem_dummy);
#endif
#endif // End of ENABLE_KRNL_PRNG_GG_UCHAR
#ifdef ENABLE_KERNEL6 // Krnl_PRNG_GG_float
setKernelArg(kernel6,1, sizeof(unsigned char), &dockpars.num_of_genes);
#ifdef ENABLE_KRNL_PRNG_GG_FLOAT // Krnl_PRNG_GG_float
setKernelArg(kernel_prng_gg_float,1, sizeof(unsigned char), &dockpars.num_of_genes);
#if !defined(SW_EMU)
setKernelArg(kernel6,2, sizeof(mem_dummy), &mem_dummy);
setKernelArg(kernel_prng_gg_float,2, sizeof(mem_dummy), &mem_dummy);
#endif
#endif // End of ENABLE_KERNEL6
#endif // End of ENABLE_KRNL_PRNG_GG_FLOAT
#ifdef ENABLE_KERNEL7 // Krnl_PRNG_float
......@@ -1004,13 +1054,7 @@ printf("%i %i\n", dockpars.num_of_intraE_contributors, myligand_reference.num_of
#endif
#endif // End of ENABLE_KERNEL7
#ifdef ENABLE_KERNEL10 // Krnl_PRNG_uchar
setKernelArg(kernel10,1, sizeof(unsigned char), &dockpars.num_of_genes);
#if !defined(SW_EMU)
setKernelArg(kernel10,2, sizeof(mem_dummy), &mem_dummy);
#endif
#endif // End of ENABLE_KERNEL10
// Kernel 11 has no args
......@@ -1138,13 +1182,7 @@ unsigned char Host_cons_limit = (unsigned char) dockpars.cons_limit;
#endif
#endif // End of ENABLE_KERNEL35
#ifdef ENABLE_KERNEL36 // Krnl_PRNG_ushort_float
setKernelArg(kernel36,2, sizeof(unsigned int), &dockpars.pop_size);
#if !defined(SW_EMU)
setKernelArg(kernel36,3, sizeof(mem_dummy), &mem_dummy);
#endif
#endif // End of ENABLE_KERNEL36
#ifdef ENABLE_KERNEL37 // Krnl_PRNG_LS4_float
setKernelArg(kernel37,1, sizeof(unsigned char), &dockpars.num_of_genes);
......@@ -1400,19 +1438,38 @@ unsigned char Host_cons_limit = (unsigned char) dockpars.cons_limit;
*/
setKernelArg(kernel_conform,8, sizeof(unsigned short), &run_cnt);
#endif // End of ENABLE_KRNL_CONFORM
#ifdef ENABLE_KRNL_PRNG_BT_USHORT_FLOAT // Krnl_Prng_BT_ushort_float
setKernelArg(kernel_prng_bt_ushort_float,0, sizeof(unsigned int), &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 14]);
setKernelArg(kernel_prng_bt_ushort_float,1, sizeof(unsigned int), &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 15]);
#endif // End of ENABLE_KRNL_PRNG_BT_USHORT_FLOAT
#ifdef ENABLE_KRNL_PRNG_GG_UCHAR // Krnl_Prng_GG_uchar
setKernelArg(kernel_prng_gg_uchar,0, sizeof(unsigned int), &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 2]);
#endif // End of ENABLE_KRNL_PRNG_GG_UCHAR
#ifdef ENABLE_KRNL_PRNG_GG_FLOAT // Krnl_PRNG_GG_float
setKernelArg(kernel_prng_gg_float,0, sizeof(unsigned int), &cpu_prng_seeds[num_of_prng_blocks * run_cnt]);
#endif // End of ENABLE_KRNL_PRNG_GG_FLOAT
#ifdef ENABLE_KERNEL6 // Krnl_PRNG_GG_float
setKernelArg(kernel6,0, sizeof(unsigned int), &cpu_prng_seeds[num_of_prng_blocks * run_cnt]);
#endif // End of ENABLE_KERNEL6
#ifdef ENABLE_KERNEL7 // Krnl_PRNG_LS_float
setKernelArg(kernel7,0, sizeof(unsigned int), &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 1]);
#endif // End of ENABLE_KERNEL7
#ifdef ENABLE_KERNEL10 // Krnl_Prng_GG_uchar
setKernelArg(kernel10,0, sizeof(unsigned int), &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 2]);
#endif // End of ENABLE_KERNEL10
#ifdef ENABLE_KERNEL14 // Krnl_PRNG_LS2_float
setKernelArg(kernel14,0, sizeof(unsigned int), &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 3]);
......@@ -1434,10 +1491,7 @@ unsigned char Host_cons_limit = (unsigned char) dockpars.cons_limit;
setKernelArg(kernel35,8, sizeof(unsigned int), &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 13]);
#endif // End of ENABLE_KERNEL35
#ifdef ENABLE_KERNEL36 // Krnl_Prng_BT_ushort_float
setKernelArg(kernel36,0, sizeof(unsigned int), &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 14]);
setKernelArg(kernel36,1, sizeof(unsigned int), &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 15]);
#endif // End of ENABLE_KERNEL36
#ifdef ENABLE_KERNEL37 // Krnl_PRNG_LS4_float
setKernelArg(kernel37,0, sizeof(unsigned int), &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 16]);
......@@ -1480,19 +1534,32 @@ unsigned char Host_cons_limit = (unsigned char) dockpars.cons_limit;
#ifdef ENABLE_KRNL_INTRAE
runKernelTask(command_queue_intrae,kernel_intrae,NULL,NULL);
#endif // ENABLE_KRNL_INTRAE
#endif // ENABLE_KRNL_INTRAE
#ifdef ENABLE_KRNL_PRNG_BT_USHORT_FLOAT
runKernelTask(command_queue_prng_bt_ushort_float,kernel_prng_bt_ushort_float,NULL,NULL);
#endif // ENABLE_KRNL_PRNG_BT_USHORT_FLOAT
#ifdef ENABLE_KRNL_PRNG_GG_UCHAR
runKernelTask(command_queue_prng_gg_uchar,kernel_prng_gg_uchar,NULL,NULL);
#endif // ENABLE_KRNL_PRNG_GG_UCHAR
#ifdef ENABLE_KRNL_PRNG_GG_FLOAT
runKernelTask(command_queue_prng_gg_float,kernel_prng_gg_float,NULL,NULL);
#endif // ENABLE_KRNL_PRNG_GG_FLOAT
#ifdef ENABLE_KERNEL6
runKernelTask(command_queue6,kernel6,NULL,NULL);
#endif // ENABLE_KERNEL6
#ifdef ENABLE_KERNEL7
runKernelTask(command_queue7,kernel7,NULL,NULL);
#endif // ENABLE_KERNEL7
#ifdef ENABLE_KERNEL10
runKernelTask(command_queue10,kernel10,NULL,NULL);
#endif // ENABLE_KERNEL10
#ifdef ENABLE_KERNEL12
runKernelTask(command_queue12,kernel12,NULL,NULL);
......@@ -1522,10 +1589,6 @@ unsigned char Host_cons_limit = (unsigned char) dockpars.cons_limit;
runKernelTask(command_queue35,kernel35,NULL,NULL);
#endif // ENABLE_KERNEL35
#ifdef ENABLE_KERNEL36
runKernelTask(command_queue36,kernel36,NULL,NULL);
#endif // ENABLE_KERNEL36
#ifdef ENABLE_KERNEL37
runKernelTask(command_queue37,kernel37,NULL,NULL);
#endif // ENABLE_KERNEL37
......@@ -1593,19 +1656,30 @@ unsigned char Host_cons_limit = (unsigned char) dockpars.cons_limit;
#ifdef ENABLE_KRNL_INTRAE
clFinish(command_queue_intrae);
#endif
#ifdef ENABLE_KRNL_PRNG_BT_USHORT_FLOAT
clFinish(command_queue_prng_bt_ushort_float);
#endif
#ifdef ENABLE_KRNL_PRNG_GG_UCHAR
clFinish(command_queue_prng_gg_uchar);
#endif
#ifdef ENABLE_KERNEL6
clFinish(command_queue6);
#endif
#ifdef ENABLE_KRNL_PRNG_GG_FLOAT
clFinish(command_queue_prng_gg_float);
#endif
#ifdef ENABLE_KERNEL7
clFinish(command_queue7);
#endif
#ifdef ENABLE_KERNEL10
clFinish(command_queue10);
#endif
#ifdef ENABLE_KERNEL12
clFinish(command_queue12);
......@@ -1635,10 +1709,6 @@ unsigned char Host_cons_limit = (unsigned char) dockpars.cons_limit;
clFinish(command_queue35);
#endif
#ifdef ENABLE_KERNEL36
clFinish(command_queue36);
#endif
#ifdef ENABLE_KERNEL37
clFinish(command_queue37);
#endif
......@@ -1994,14 +2064,35 @@ bool init() {
checkError(status, "Failed to create command queue intrae");
kernel_intrae = clCreateKernel(program, name_krnl_intrae, &status);
checkError(status, "Failed to create kernel intrae");
#endif
#endif
#ifdef ENABLE_KRNL_PRNG_BT_USHORT_FLOAT
command_queue_prng_bt_ushort_float = clCreateCommandQueue(context, device, 0, &status);
checkError(status, "Failed to create command queue prng_bt_ushort_float");
kernel_prng_bt_ushort_float = clCreateKernel(program, name_krnl_prng_bt_ushort_float, &status);
checkError(status, "Failed to create kernel prng_bt_ushort_float");
#endif
#ifdef ENABLE_KRNL_PRNG_GG_UCHAR
command_queue_prng_gg_uchar = clCreateCommandQueue(context, device, 0, &status);
checkError(status, "Failed to create command queue prng_gg_uchar");
kernel_prng_gg_uchar = clCreateKernel(program, name_krnl_prng_gg_uchar, &status);
checkError(status, "Failed to create kernel prng_gg_uchar");
#endif
#ifdef ENABLE_KERNEL6
command_queue6 = clCreateCommandQueue(context, device, 0, &status);
checkError(status, "Failed to create command queue6");
kernel6 = clCreateKernel(program, name_k6, &status);
checkError(status, "Failed to create kernel");
#ifdef ENABLE_KRNL_PRNG_GG_FLOAT
command_queue_prng_gg_float = clCreateCommandQueue(context, device, 0, &status);
checkError(status, "Failed to create command queue prng_gg_float");
kernel_prng_gg_float = clCreateKernel(program, name_krnl_prng_gg_float, &status);
checkError(status, "Failed to create kernel prng_gg_float");
#endif
#ifdef ENABLE_KERNEL7
command_queue7 = clCreateCommandQueue(context, device, 0, &status);
......@@ -2010,12 +2101,7 @@ bool init() {
checkError(status, "Failed to create kernel");
#endif
#ifdef ENABLE_KERNEL10
command_queue10 = clCreateCommandQueue(context, device, 0, &status);
checkError(status, "Failed to create command queue10");
kernel10 = clCreateKernel(program, name_k10, &status);
checkError(status, "Failed to create kernel");
#endif