performdocking.cpp 63.1 KB
Newer Older
lvs's avatar
lvs committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//// ------------------------
//// Correct time measurement
//// Moved from main.cpp to performdocking.cpp
//// to skip measuring build time
//#include <sys/time.h>
//// ------------------------
#include "performdocking.h"

//// --------------------------------
//// Altera OpenCL Helper Variables
//// --------------------------------
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <cstring>
17
18
19
#include "CL/opencl.h"

/*
lvs's avatar
lvs committed
20
21
#include "AOCLUtils/aocl_utils.h"
using namespace aocl_utils;
22
*/
lvs's avatar
lvs committed
23
#define STRING_BUFFER_LEN 1024
24

25
26
27
#include "xcl2.hpp"
#include <vector>
using std::vector;
lvs's avatar
lvs committed
28

lvs's avatar
lvs committed
29
30

// Function prototypes
31

lvs's avatar
lvs committed
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
void cleanup();
static void device_info_ulong( cl_device_id device, cl_device_info param, const char* name);
static void device_info_uint ( cl_device_id device, cl_device_info param, const char* name);
static void device_info_bool ( cl_device_id device, cl_device_info param, const char* name);
static void device_info_string( cl_device_id device, cl_device_info param, const char* name);
static void display_device_info( cl_device_id device );

//// --------------------------------
//// Host constant struct
//// --------------------------------
Dockparameters dockpars;
kernelconstant_static  KerConstStatic;

//// --------------------------------
//// Device memory buffers
//// --------------------------------
48
49
50
51
52
53
cl_mem mem_KerConstStatic_InterE_atom_charges_const;
cl_mem mem_KerConstStatic_InterE_atom_types_const;

cl_mem mem_KerConstStatic_IntraE_atom_charges_const;
cl_mem mem_KerConstStatic_IntraE_atom_types_const;

Leonardo Solis's avatar
Leonardo Solis committed
54
55
56
57
58
59
60
cl_mem mem_KerConstStatic_intraE_contributors_const;

cl_mem mem_KerConstStatic_reqm_const;
cl_mem mem_KerConstStatic_reqm_hbond_const;
cl_mem mem_KerConstStatic_atom1_types_reqm_const;
cl_mem mem_KerConstStatic_atom2_types_reqm_const;

lvs's avatar
lvs committed
61
62
63
64
65
66
67
cl_mem mem_KerConstStatic_VWpars_AC_const;
cl_mem mem_KerConstStatic_VWpars_BD_const;
cl_mem mem_KerConstStatic_dspars_S_const;
cl_mem mem_KerConstStatic_dspars_V_const;
cl_mem mem_KerConstStatic_rotlist_const;
cl_mem mem_KerConstStatic_ref_coords_const;
cl_mem mem_KerConstStatic_rotbonds_moving_vectors_const;
lvs's avatar
lvs committed
68
cl_mem mem_KerConstStatic_rotbonds_unit_vectors_const;
lvs's avatar
lvs committed
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
cl_mem mem_KerConstStatic_ref_orientation_quats_const;

/*								                  // Nr elements	// Nr bytes
cl_mem mem_atom_charges_const;		// float [MAX_NUM_OF_ATOMS];			// 90	 = 90	//360
cl_mem mem_atom_types_const;		// char  [MAX_NUM_OF_ATOMS];			// 90	 = 90	//360
cl_mem mem_intraE_contributors_const;	// char  [3*MAX_INTRAE_CONTRIBUTORS];		// 3*8128=28384 //24384	
cl_mem mem_VWpars_AC_const;		// float [MAX_NUM_OF_ATYPES*MAX_NUM_OF_ATYPES];	// 14*14 = 196  //784
cl_mem mem_VWpars_BD_const;		// float [MAX_NUM_OF_ATYPES*MAX_NUM_OF_ATYPES]; // 14*14 = 196	//784
cl_mem mem_dspars_S_const;		// float [MAX_NUM_OF_ATYPES];			// 14    = 14   //56
cl_mem mem_dspars_V_const;		// float [MAX_NUM_OF_ATYPES];			// 14    = 14   //56
cl_mem mem_rotlist_const;		// int   [MAX_NUM_OF_ROTATIONS];		// 4096  = 4096 //16384
cl_mem mem_ref_coords_x_const;		// float [MAX_NUM_OF_ATOMS];			// 90    = 90   //360
cl_mem mem_ref_coords_y_const;		// float [MAX_NUM_OF_ATOMS];			// 90    = 90   //360
cl_mem mem_ref_coords_z_const;		// float [MAX_NUM_OF_ATOMS];			// 90	 = 90   //360
cl_mem mem_rotbonds_moving_vectors_const;// float [3*MAX_NUM_OF_ROTBONDS];		// 3*32  = 96   //384
cl_mem mem_rotbonds_unit_vectors_const;	// float [3*MAX_NUM_OF_ROTBONDS];		// 3*32  = 96   //384
cl_mem mem_ref_orientation_quats_const;	// float [4*MAX_NUM_OF_RUNS];			// 4*100 = 400  //1600
*/

cl_mem mem_dockpars_fgrids;
cl_mem mem_dockpars_conformations_current;
cl_mem mem_dockpars_energies_current;

cl_mem mem_evals_performed;
cl_mem mem_gens_performed;
Leonardo Solis's avatar
Leonardo Solis committed
94
95
96
97
98
99
100

#if !defined(SW_EMU)
// IMPORTANT: enable this dummy global argument only for "hw" build.
// Check ../common_xilinx/utility/boards.mk
// https://forums.xilinx.com/t5/SDAccel/ERROR-KernelCheck-83-114-in-sdx-2017-4/td-p/818135
cl_mem mem_dummy;
#endif
lvs's avatar
lvs committed
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130



//// --------------------------------
//// Docking
//// --------------------------------
int docking_with_gpu(const Gridinfo*   mygrid,
	             /*const*/ float*  cpu_floatgrids,
                           Dockpars*   mypars,
		     const Liganddata* myligand_init,
		     const int*        argc,
		           char**      argv,
		           clock_t     clock_start_program)
/* The function performs the docking algorithm and generates the corresponding result files.
parameter mygrid:
		describes the grid
		filled with get_gridinfo()
parameter cpu_floatgrids:
		points to the memory region containing the grids
		filled with get_gridvalues_f()
parameter mypars:
		describes the docking parameters
		filled with get_commandpars()
parameter myligand_init:
		describes the ligands
		filled with get_liganddata()
parameters argc and argv:
		are the corresponding command line arguments parameter clock_start_program:
		contains the state of the clock tick counter at the beginning of the program
filled with clock() */
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
{
	// The get_xil_devices will return vector of Xilinx Devices 
	std::vector<cl::Device> devices = xcl::get_xil_devices();
	cl::Device device = devices[0];

	//Creating Context and Command Queue for selected Device 
	cl::Context context(device);
    	std::string device_name = device.getInfo<CL_DEVICE_NAME>(); 
	std::cout << "Found Device=" << device_name.c_str() << std::endl;

	#ifdef ENABLE_KRNL_GA
	cl::CommandQueue command_queue_ga			(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_CONFORM
	cl::CommandQueue command_queue_conform			(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_INTERE
	cl::CommandQueue command_queue_intere			(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_INTRAE
	cl::CommandQueue command_queue_intrae			(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_PRNG_BT_USHORT_FLOAT
	cl::CommandQueue command_queue_prng_bt_ushort_float	(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_PRNG_GG_UCHAR
	cl::CommandQueue command_queue_prng_gg_uchar		(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_PRNG_GG_FLOAT
	cl::CommandQueue command_queue_prng_gg_float		(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_PRNG_LS123_USHORT
	cl::CommandQueue command_queue_prng_ls123_ushort	(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_PRNG_LS_FLOAT
	cl::CommandQueue command_queue_prng_ls_float		(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_PRNG_LS2_FLOAT
	cl::CommandQueue command_queue_prng_ls2_float		(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_PRNG_LS3_FLOAT
	cl::CommandQueue command_queue_prng_ls3_float		(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_PRNG_LS4_FLOAT
	cl::CommandQueue command_queue_prng_ls4_float		(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_PRNG_LS5_FLOAT
	cl::CommandQueue command_queue_prng_ls5_float		(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_PRNG_LS6_FLOAT
	cl::CommandQueue command_queue_prng_ls6_float		(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_PRNG_LS7_FLOAT
	cl::CommandQueue command_queue_prng_ls7_float		(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_PRNG_LS8_FLOAT
	cl::CommandQueue command_queue_prng_ls8_float		(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_PRNG_LS9_FLOAT
	cl::CommandQueue command_queue_prng_ls9_float		(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_LS
	cl::CommandQueue command_queue_ls			(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_LS2
	cl::CommandQueue command_queue_ls2			(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_LS3
	cl::CommandQueue command_queue_ls3			(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_LS4
	cl::CommandQueue command_queue_ls4			(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_LS5
	cl::CommandQueue command_queue_ls5			(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_LS6
	cl::CommandQueue command_queue_ls6			(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif	
	#ifdef ENABLE_KRNL_LS7
	cl::CommandQueue command_queue_ls7			(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_LS8
	cl::CommandQueue command_queue_ls8			(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_LS9
	cl::CommandQueue command_queue_ls9			(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif
	#ifdef ENABLE_KRNL_IGL_ARBITER
	cl::CommandQueue command_queue_igl_arbiter		(context, device, CL_QUEUE_PROFILING_ENABLE);
	#endif

    	// import_binary() command will find the OpenCL binary file created using the 
    	// xocc compiler load into OpenCL Binary and return as Binaries
    	// OpenCL and it can contain many functions which can be executed on the
   	// device.
    	std::string binaryFile = xcl::find_binary_file(device_name,"Krnl_GA");
    	cl::Program::Binaries bins = xcl::import_binary_file(binaryFile);
    	devices.resize(1);
    	cl::Program program(context, devices, bins);

    	// This call will extract a kernel out of the program we loaded in the
    	// previous line. A kernel is an OpenCL function that is executed on the
    	// FPGA. This function is defined in the device/Krnl_GA.cl file.
	#ifdef ENABLE_KRNL_GA
	cl::Kernel kernel_ga			(program, "Krnl_GA");
	#endif
	#ifdef ENABLE_KRNL_CONFORM
	cl::Kernel kernel_conform		(program, "Krnl_Conform");
	#endif
	#ifdef ENABLE_KRNL_INTERE
	cl::Kernel kernel_intere		(program, "Krnl_InterE");
	#endif
	#ifdef ENABLE_KRNL_INTRAE
	cl::Kernel kernel_intrae		(program, "Krnl_IntraE");
	#endif
	#ifdef ENABLE_KRNL_PRNG_BT_USHORT_FLOAT
	cl::Kernel kernel_prng_bt_ushort_float	(program, "Krnl_Prng_BT_ushort_float");
	#endif
	#ifdef ENABLE_KRNL_PRNG_GG_UCHAR
	cl::Kernel kernel_prng_gg_uchar		(program, "Krnl_Prng_GG_uchar");
	#endif
	#ifdef ENABLE_KRNL_PRNG_GG_FLOAT
	cl::Kernel kernel_prng_gg_float		(program, "Krnl_Prng_GG_float");
	#endif
	#ifdef ENABLE_KRNL_PRNG_LS123_USHORT
	cl::Kernel kernel_prng_ls123_ushort	(program, "Krnl_Prng_LS123_ushort");
	#endif
	#ifdef ENABLE_KRNL_PRNG_LS_FLOAT
	cl::Kernel kernel_prng_ls_float		(program, "Krnl_Prng_LS_float");
	#endif
	#ifdef ENABLE_KRNL_PRNG_LS2_FLOAT
	cl::Kernel kernel_prng_ls2_float	(program, "Krnl_Prng_LS2_float");
	#endif
	#ifdef ENABLE_KRNL_PRNG_LS3_FLOAT
	cl::Kernel kernel_prng_ls3_float	(program, "Krnl_Prng_LS3_float");
	#endif
	#ifdef ENABLE_KRNL_PRNG_LS4_FLOAT
	cl::Kernel kernel_prng_ls4_float	(program, "Krnl_Prng_LS4_float");
	#endif
	#ifdef ENABLE_KRNL_PRNG_LS5_FLOAT
	cl::Kernel kernel_prng_ls5_float	(program, "Krnl_Prng_LS5_float");
	#endif
	#ifdef ENABLE_KRNL_PRNG_LS6_FLOAT
	cl::Kernel kernel_prng_ls6_float	(program, "Krnl_Prng_LS6_float");
	#endif
	#ifdef ENABLE_KRNL_PRNG_LS7_FLOAT
	cl::Kernel kernel_prng_ls7_float	(program, "Krnl_Prng_LS7_float");
	#endif
	#ifdef ENABLE_KRNL_PRNG_LS8_FLOAT
	cl::Kernel kernel_prng_ls8_float	(program, "Krnl_Prng_LS8_float");
	#endif
	#ifdef ENABLE_KRNL_PRNG_LS9_FLOAT
	cl::Kernel kernel_prng_ls9_float	(program, "Krnl_Prng_LS9_float");
	#endif
	#ifdef ENABLE_KRNL_LS
	cl::Kernel kernel_ls			(program, "Krnl_LS");
	#endif
	#ifdef ENABLE_KRNL_LS2
	cl::Kernel kernel_ls2			(program, "Krnl_LS2");
	#endif
	#ifdef ENABLE_KRNL_LS3
	cl::Kernel kernel_ls3			(program, "Krnl_LS3");
	#endif
	#ifdef ENABLE_KRNL_LS4
	cl::Kernel kernel_ls4			(program, "Krnl_LS4");
	#endif
	#ifdef ENABLE_KRNL_LS5
	cl::Kernel kernel_ls5			(program, "Krnl_LS5");
	#endif
	#ifdef ENABLE_KRNL_LS6
	cl::Kernel kernel_ls6			(program, "Krnl_LS6");
	#endif
	#ifdef ENABLE_KRNL_LS7
	cl::Kernel kernel_ls7			(program, "Krnl_LS7");
	#endif
	#ifdef ENABLE_KRNL_LS8
	cl::Kernel kernel_ls8			(program, "Krnl_LS8");
	#endif
	#ifdef ENABLE_KRNL_LS9
	cl::Kernel kernel_ls9			(program, "Krnl_LS9");
	#endif
	#ifdef ENABLE_KRNL_IGL_ARBITER
	cl::Kernel kernel_igl_arbiter		(program, "Krnl_IGL_Arbiter");
	#endif
lvs's avatar
lvs committed
316

317
318
319
	clock_t clock_start_docking;
	clock_t	clock_stop_docking;
	clock_t clock_stop_program_before_clustering;
lvs's avatar
lvs committed
320

321
322
323
324
	Liganddata myligand_reference;

 	//allocating GPU memory for floatgrids,
	size_t size_floatgrids_nbytes = (sizeof(float)) * (mygrid->num_of_atypes+2) * (mygrid->size_xyz[0]) * (mygrid->size_xyz[1]) * (mygrid->size_xyz[2]);
lvs's avatar
lvs committed
325

326
327
	size_t size_populations_nbytes = mypars->num_of_runs * mypars->pop_size * ACTUAL_GENOTYPE_LENGTH * sizeof(float);
	size_t size_populations_nelems = mypars->num_of_runs * mypars->pop_size * ACTUAL_GENOTYPE_LENGTH;
lvs's avatar
lvs committed
328

329
330
	size_t size_energies_nbytes = mypars->num_of_runs * mypars->pop_size * sizeof(float);
	size_t size_energies_nelems = mypars->num_of_runs * mypars->pop_size;
lvs's avatar
lvs committed
331

332
333
334
335
336
	//allocating and initializing CPU memory for initial population
	vector<float,aligned_allocator<float>> cpu_init_populations (size_populations_nelems, 0.0f);

	//allocating CPU memory for final population
	vector<float,aligned_allocator<float>> cpu_final_populations (size_populations_nelems);
lvs's avatar
lvs committed
337

338
339
340
341
342
343
344
345
	//allocating CPU memory for results
	vector<float,aligned_allocator<float>> cpu_energies (size_energies_nelems);

	//allocating CPU memory for resulting ligands
	vector<Ligandresult,aligned_allocator<Ligandresult>> cpu_result_ligands (mypars->num_of_runs);

	//allocating memory in CPU for reference orientation angles
	vector<float,aligned_allocator<float>> cpu_ref_ori_angles (mypars->num_of_runs*3);
lvs's avatar
lvs committed
346
347
348
349

	//generating initial populations and random orientation angles of reference ligand
	//(ligand will be moved to origo and scaled as well)
	myligand_reference = *myligand_init;
350
351
352
353
354
355
356
357
358
359
360
361
	gen_initpop_and_reflig(mypars, cpu_init_populations, cpu_ref_ori_angles, &myligand_reference, mygrid);

	//allocating memory in CPU for pseudorandom number generator seeds
	const unsigned int num_of_prng_blocks = 25;
	size_t size_prng_seeds_nelems = num_of_prng_blocks * mypars->num_of_runs;
	vector<unsigned int,aligned_allocator<unsigned int>> cpu_prng_seeds (size_prng_seeds_nelems);
	
	//initializing seed generator
	genseed(time(NULL));	

	//generating seeds (for each thread during GA)
	for (unsigned int i=0; i<size_prng_seeds_nelems; i++) {
lvs's avatar
lvs committed
362
363
		cpu_prng_seeds[i] = genseed(0u);
	}
364
365
366
367

	size_t size_evals_of_runs_nbytes = mypars->num_of_runs*sizeof(int);
	size_t size_evals_of_runs_nelems = mypars->num_of_runs;

lvs's avatar
lvs committed
368
	// allocating memory in CPU for evaluation counters
369
370
371
372
	vector<int,aligned_allocator<int>> cpu_evals_of_runs (size_evals_of_runs_nelems, 0);
	
	// allocating memory in CPU for generation counters
	vector<int,aligned_allocator<int>> cpu_gens_of_runs (size_evals_of_runs_nelems, 0);
lvs's avatar
lvs committed
373
374
375
376
377
378
379
380
381
382
383
384

	//preparing the constant data fields for the GPU
	// ----------------------------------------------------------------------
	// The original function does CUDA calls initializing const Kernel data.
	// We create a struct to hold those constants
	// and return them <here> (<here> = where prepare_const_fields_for_gpu() is called),
	// so we can send them to Kernels from <here>, instead of from calcenergy.cpp as originally.
	// ----------------------------------------------------------------------
	if (prepare_conststatic_fields_for_gpu(&myligand_reference, mypars, cpu_ref_ori_angles, &KerConstStatic) == 1)
		return 1;

	//preparing parameter struct
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
	dockpars.num_of_atoms  			= ((unsigned char) myligand_reference.num_of_atoms);
	dockpars.num_of_atypes 			= ((unsigned char) myligand_reference.num_of_atypes);
	dockpars.num_of_intraE_contributors 	= ((unsigned int) myligand_reference.num_of_intraE_contributors);
	dockpars.gridsize_x    			= ((unsigned char)  mygrid->size_xyz[0]);
	dockpars.gridsize_y    			= ((unsigned char)  mygrid->size_xyz[1]);
	dockpars.gridsize_z    			= ((unsigned char)  mygrid->size_xyz[2]);
	dockpars.g1	       			= dockpars.gridsize_x ;
	dockpars.g2	       			= dockpars.gridsize_x * dockpars.gridsize_y;
	dockpars.g3	       			= dockpars.gridsize_x * dockpars.gridsize_y * dockpars.gridsize_z;
	dockpars.grid_spacing  			= ((float) mygrid->spacing);
	dockpars.rotbondlist_length 		= ((unsigned int) NUM_OF_THREADS_PER_BLOCK*(myligand_reference.num_of_rotcyc));
	dockpars.coeff_elec    			= ((float) mypars->coeffs.scaled_AD4_coeff_elec);
	dockpars.coeff_desolv  			= ((float) mypars->coeffs.AD4_coeff_desolv);

	dockpars.num_of_energy_evals 		= (unsigned int) mypars->num_of_energy_evals;
	dockpars.num_of_generations  		= (unsigned int) mypars->num_of_generations;

	dockpars.pop_size      			= (unsigned int) mypars->pop_size;
	dockpars.num_of_genes  			= (unsigned int)(myligand_reference.num_of_rotbonds + 6);
	dockpars.tournament_rate 		= (mypars->tournament_rate)/100;
	dockpars.crossover_rate  		= (mypars->crossover_rate)/100;
	dockpars.mutation_rate   		= (mypars->mutation_rate)/100;
	dockpars.abs_max_dang    		= mypars->abs_max_dang;
	dockpars.abs_max_dmov    		= mypars->abs_max_dmov;
	dockpars.lsearch_rate    		= mypars->lsearch_rate;
	dockpars.num_of_lsentities 		= (unsigned int) (mypars->lsearch_rate/100.0*mypars->pop_size + 0.5);
	dockpars.rho_lower_bound   		= mypars->rho_lower_bound;
	dockpars.base_dmov_mul_sqrt3 		= mypars->base_dmov_mul_sqrt3;
	dockpars.base_dang_mul_sqrt3 		= mypars->base_dang_mul_sqrt3;
	dockpars.cons_limit        		= (unsigned int) mypars->cons_limit;
	dockpars.max_num_of_iters  		= (unsigned int) mypars->max_num_of_iters;
	dockpars.qasp 				= mypars->qasp;
	dockpars.smooth 			= mypars->smooth;
lvs's avatar
lvs committed
418
419
420
421
422
423
424
425
426
427

	// these variables hold multiplications between kernel-constants
	// better calculate them here and then pass them to Krnl_GA
	const float two_absmaxdmov = 2.0 * dockpars.abs_max_dmov;
	const float two_absmaxdang = 2.0 * dockpars.abs_max_dang;

	// these variables hold multiplications between kernel-constants
	// better calculate them here and then pass them to Krnl_InterE and Krnl_InterE2
	const unsigned int mul_tmp2 = dockpars.num_of_atypes * dockpars.g3;
	const unsigned int mul_tmp3 = (dockpars.num_of_atypes + 1) * dockpars.g3;
428

429
430
431
432
	// -----------------------------------------------------------------------------------------------------
	// Hardware specific
	// Specifiying exact memory bank from host code
	// Only valid if 4 banks are available (AWS)
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
	cl_mem_ext_ptr_t d_bank0_ext; // Krnl_GA
	cl_mem_ext_ptr_t d_bank1_ext; // Krnl_Conform
	cl_mem_ext_ptr_t d_bank2_ext; // Krnl_InterE
	cl_mem_ext_ptr_t d_bank3_ext; // Krnl_IntraE

	d_bank0_ext.flags = XCL_MEM_DDR_BANK0;
	d_bank0_ext.obj   = NULL;
	d_bank0_ext.param = 0;

	d_bank1_ext.flags = XCL_MEM_DDR_BANK1;
	d_bank1_ext.obj   = NULL;
	d_bank1_ext.param = 0;

	d_bank2_ext.flags = XCL_MEM_DDR_BANK2;
	d_bank2_ext.obj   = NULL;
	d_bank2_ext.param = 0;

	d_bank3_ext.flags = XCL_MEM_DDR_BANK3;
	d_bank3_ext.obj   = NULL;
	d_bank3_ext.param = 0;

454
455
456
457
458
459
	// Replacing common buffer creation with 
	// a Xilinx-specific where DDR banks can be specified
	mallocBufferObject(context,CL_MEM_READ_WRITE | CL_MEM_EXT_PTR_XILINX,size_populations,  	&d_bank0_ext,	&mem_dockpars_conformations_current);	// GA
	mallocBufferObject(context,CL_MEM_READ_WRITE | CL_MEM_EXT_PTR_XILINX,size_energies,    		&d_bank0_ext,	&mem_dockpars_energies_current);	// GA
	mallocBufferObject(context,CL_MEM_WRITE_ONLY | CL_MEM_EXT_PTR_XILINX,size_evals_of_runs,  	&d_bank0_ext,	&mem_evals_performed);			// GA				
	mallocBufferObject(context,CL_MEM_WRITE_ONLY | CL_MEM_EXT_PTR_XILINX,size_evals_of_runs,  	&d_bank0_ext,	&mem_gens_performed);			// GA
460

461
462
463
464
465
466
	mallocBufferObject(context,CL_MEM_READ_ONLY | CL_MEM_EXT_PTR_XILINX, MAX_NUM_OF_ROTATIONS*sizeof(int), 			&d_bank0_ext/*&d_bank1_ext*/, &mem_KerConstStatic_rotlist_const);			// Conform
	mallocBufferObject(context,CL_MEM_READ_ONLY | CL_MEM_EXT_PTR_XILINX, MAX_NUM_OF_ATOMS*sizeof(cl_float3), 		&d_bank0_ext/*&d_bank1_ext*/, &mem_KerConstStatic_ref_coords_const); 			// Conform
	mallocBufferObject(context,CL_MEM_READ_ONLY | CL_MEM_EXT_PTR_XILINX, MAX_NUM_OF_ROTBONDS*sizeof(cl_float3), 		&d_bank0_ext/*&d_bank1_ext*/, &mem_KerConstStatic_rotbonds_moving_vectors_const);	// Conform
	mallocBufferObject(context,CL_MEM_READ_ONLY | CL_MEM_EXT_PTR_XILINX, MAX_NUM_OF_ROTBONDS*sizeof(cl_float3), 		&d_bank0_ext/*&d_bank1_ext*/, &mem_KerConstStatic_rotbonds_unit_vectors_const);		// Conform
	mallocBufferObject(context,CL_MEM_READ_ONLY | CL_MEM_EXT_PTR_XILINX, MAX_NUM_OF_RUNS*sizeof(cl_float4),			&d_bank0_ext/*&d_bank1_ext*/, &mem_KerConstStatic_ref_orientation_quats_const);		// Conform

Leonardo Solis's avatar
Leonardo Solis committed
467
468
	mallocBufferObject(context,CL_MEM_READ_ONLY | CL_MEM_EXT_PTR_XILINX, MAX_NUM_OF_ATOMS*sizeof(float),                    &d_bank1_ext/*&d_bank2_ext*/, &mem_KerConstStatic_InterE_atom_charges_const);	// InterE
  	mallocBufferObject(context,CL_MEM_READ_ONLY | CL_MEM_EXT_PTR_XILINX, MAX_NUM_OF_ATOMS*sizeof(char),                     &d_bank1_ext/*&d_bank2_ext*/, &mem_KerConstStatic_InterE_atom_types_const);	// InterE
469
	mallocBufferObject(context,CL_MEM_READ_ONLY | CL_MEM_EXT_PTR_XILINX,size_floatgrids,   		&d_bank1_ext/*&d_bank2_ext*/,	&mem_dockpars_fgrids);	// InterE
470

Leonardo Solis's avatar
Leonardo Solis committed
471
472
473
474
475
476
	mallocBufferObject(context,CL_MEM_READ_ONLY | CL_MEM_EXT_PTR_XILINX, MAX_NUM_OF_ATOMS*sizeof(float),                    &d_bank1_ext/*&d_bank3_ext*/, &mem_KerConstStatic_IntraE_atom_charges_const);	// IntraE
  	mallocBufferObject(context,CL_MEM_READ_ONLY | CL_MEM_EXT_PTR_XILINX, MAX_NUM_OF_ATOMS*sizeof(char),                     &d_bank1_ext/*&d_bank3_ext*/, &mem_KerConstStatic_IntraE_atom_types_const);	// IntraE
	mallocBufferObject(context,CL_MEM_READ_ONLY | CL_MEM_EXT_PTR_XILINX, MAX_INTRAE_CONTRIBUTORS*sizeof(cl_char3),          &d_bank1_ext/*&d_bank3_ext*/, &mem_KerConstStatic_intraE_contributors_const);	// IntraE
        mallocBufferObject(context,CL_MEM_READ_ONLY | CL_MEM_EXT_PTR_XILINX, ATYPE_NUM*sizeof(float),			        &d_bank1_ext/*&d_bank3_ext*/, &mem_KerConstStatic_reqm_const);			// IntraE
	mallocBufferObject(context,CL_MEM_READ_ONLY | CL_MEM_EXT_PTR_XILINX, ATYPE_NUM*sizeof(float),			        &d_bank1_ext/*&d_bank3_ext*/, &mem_KerConstStatic_reqm_hbond_const);		// IntraE
  	mallocBufferObject(context,CL_MEM_READ_ONLY | CL_MEM_EXT_PTR_XILINX, ATYPE_NUM*sizeof(unsigned int),		        &d_bank1_ext/*&d_bank3_ext*/, &mem_KerConstStatic_atom1_types_reqm_const);	// IntraE
477
  	mallocBufferObject(context,CL_MEM_READ_ONLY | CL_MEM_EXT_PTR_XILINX, ATYPE_NUM*sizeof(unsigned int),                    &d_bank1_ext/*&d_bank3_ext*/, &mem_KerConstStatic_atom2_types_reqm_const);	// IntraE
Leonardo Solis's avatar
Leonardo Solis committed
478
479
480
	mallocBufferObject(context,CL_MEM_READ_ONLY | CL_MEM_EXT_PTR_XILINX, MAX_NUM_OF_ATYPES*MAX_NUM_OF_ATYPES*sizeof(float), &d_bank1_ext/*&d_bank3_ext*/, &mem_KerConstStatic_VWpars_AC_const);		// IntraE
	mallocBufferObject(context,CL_MEM_READ_ONLY | CL_MEM_EXT_PTR_XILINX, MAX_NUM_OF_ATYPES*MAX_NUM_OF_ATYPES*sizeof(float), &d_bank1_ext/*&d_bank3_ext*/, &mem_KerConstStatic_VWpars_BD_const);		// IntraE
	mallocBufferObject(context,CL_MEM_READ_ONLY | CL_MEM_EXT_PTR_XILINX, MAX_NUM_OF_ATYPES*sizeof(float), 		        &d_bank1_ext/*&d_bank3_ext*/, &mem_KerConstStatic_dspars_S_const);		// IntraE
481
482
	mallocBufferObject(context,CL_MEM_READ_ONLY | CL_MEM_EXT_PTR_XILINX, MAX_NUM_OF_ATYPES*sizeof(float), 			&d_bank1_ext/*&d_bank3_ext*/, &mem_KerConstStatic_dspars_V_const);		// IntraE
	// -----------------------------------------------------------------------------------------------------
lvs's avatar
lvs committed
483

484
485
486
487
	memcopyBufferObjectToDevice(command_queue_ga,mem_KerConstStatic_InterE_atom_charges_const,            &KerConstStatic.atom_charges_const[0],            MAX_NUM_OF_ATOMS*sizeof(float));
	memcopyBufferObjectToDevice(command_queue_ga,mem_KerConstStatic_InterE_atom_types_const,              &KerConstStatic.atom_types_const[0],              MAX_NUM_OF_ATOMS*sizeof(char));
	memcopyBufferObjectToDevice(command_queue_ga,mem_KerConstStatic_IntraE_atom_charges_const,            &KerConstStatic.atom_charges_const[0],            MAX_NUM_OF_ATOMS*sizeof(float));
	memcopyBufferObjectToDevice(command_queue_ga,mem_KerConstStatic_IntraE_atom_types_const,              &KerConstStatic.atom_types_const[0],              MAX_NUM_OF_ATOMS*sizeof(char));
488
	memcopyBufferObjectToDevice(command_queue_ga,mem_KerConstStatic_intraE_contributors_const,     	      &KerConstStatic.intraE_contributors_const[0],     MAX_INTRAE_CONTRIBUTORS*sizeof(cl_char3));
Leonardo Solis's avatar
Leonardo Solis committed
489

490
	memcopyBufferObjectToDevice(command_queue_ga,mem_KerConstStatic_reqm_const,         	       &KerConstStatic.reqm_const,           	           ATYPE_NUM*sizeof(float));
491
492
493
  	memcopyBufferObjectToDevice(command_queue_ga,mem_KerConstStatic_reqm_hbond_const,              &KerConstStatic.reqm_hbond_const,                 ATYPE_NUM*sizeof(float));
  	memcopyBufferObjectToDevice(command_queue_ga,mem_KerConstStatic_atom1_types_reqm_const,        &KerConstStatic.atom1_types_reqm_const,           ATYPE_NUM*sizeof(unsigned int));
  	memcopyBufferObjectToDevice(command_queue_ga,mem_KerConstStatic_atom2_types_reqm_const,        &KerConstStatic.atom2_types_reqm_const,           ATYPE_NUM*sizeof(unsigned int));
494

495
496
497
498
499
	memcopyBufferObjectToDevice(command_queue_ga,mem_KerConstStatic_VWpars_AC_const,               &KerConstStatic.VWpars_AC_const[0],               MAX_NUM_OF_ATYPES*MAX_NUM_OF_ATYPES*sizeof(float));
	memcopyBufferObjectToDevice(command_queue_ga,mem_KerConstStatic_VWpars_BD_const,               &KerConstStatic.VWpars_BD_const[0],               MAX_NUM_OF_ATYPES*MAX_NUM_OF_ATYPES*sizeof(float));
	memcopyBufferObjectToDevice(command_queue_ga,mem_KerConstStatic_dspars_S_const,                &KerConstStatic.dspars_S_const[0], 	       MAX_NUM_OF_ATYPES*sizeof(float));
	memcopyBufferObjectToDevice(command_queue_ga,mem_KerConstStatic_dspars_V_const,                &KerConstStatic.dspars_V_const[0], 	       MAX_NUM_OF_ATYPES*sizeof(float));
	memcopyBufferObjectToDevice(command_queue_ga,mem_KerConstStatic_rotlist_const,                 &KerConstStatic.rotlist_const[0], 		       MAX_NUM_OF_ROTATIONS*sizeof(int));
500
	memcopyBufferObjectToDevice(command_queue_ga,mem_KerConstStatic_ref_coords_const, 	       &KerConstStatic.ref_coords_const[0],              MAX_NUM_OF_ATOMS*sizeof(cl_float3));
501
502
503
504
	memcopyBufferObjectToDevice(command_queue_ga,mem_KerConstStatic_rotbonds_moving_vectors_const, &KerConstStatic.rotbonds_moving_vectors_const[0], MAX_NUM_OF_ROTBONDS*sizeof(cl_float3));
	memcopyBufferObjectToDevice(command_queue_ga,mem_KerConstStatic_rotbonds_unit_vectors_const,   &KerConstStatic.rotbonds_unit_vectors_const[0],   MAX_NUM_OF_ROTBONDS*sizeof(cl_float3));
	memcopyBufferObjectToDevice(command_queue_ga,mem_KerConstStatic_ref_orientation_quats_const,   &KerConstStatic.ref_orientation_quats_const[0],   MAX_NUM_OF_RUNS*sizeof(cl_float4));
	memcopyBufferObjectToDevice(command_queue_ga,mem_dockpars_fgrids, 	cpu_floatgrids,       size_floatgrids);
lvs's avatar
lvs committed
505
506
507


	clock_start_docking = clock();
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527

	int narg;
	#ifdef ENABLE_KRNL_GA
	narg = 0;
	kernel_ga.setArg(narg++, mem_dockpars_conformations_current);
	kernel_ga.setArg(narg++, mem_dockpars_energies_current);
	kernel_ga.setArg(narg++, mem_evals_performed);
	kernel_ga.setArg(narg++, mem_gens_performed);
	kernel_ga.setArg(narg++, dockpars.pop_size);
	kernel_ga.setArg(narg++, dockpars.num_of_energy_evals);
	kernel_ga.setArg(narg++, dockpars.num_of_generations);
	kernel_ga.setArg(narg++, dockpars.tournament_rate);
	kernel_ga.setArg(narg++, dockpars.mutation_rate);
	kernel_ga.setArg(narg++, dockpars.abs_max_dmov);
	kernel_ga.setArg(narg++, dockpars.abs_max_dang);
	kernel_ga.setArg(narg++, two_absmaxdmov);
	kernel_ga.setArg(narg++, two_absmaxdang);
	kernel_ga.setArg(narg++, dockpars.crossover_rate);
	kernel_ga.setArg(narg++, dockpars.num_of_lsentities);
	kernel_ga.setArg(narg++, dockpars.num_of_genes);
lvs's avatar
lvs committed
528
529
	#endif

530
531
532
533
534
535
536
537
538
539
540
541
542
543
	#ifdef ENABLE_KRNL_CONFORM
	narg = 0;
	kernel_conform.setArg(narg++, mem_KerConstStatic_rotlist_const);
	kernel_conform.setArg(narg++, mem_KerConstStatic_ref_coords_const);
	kernel_conform.setArg(narg++, mem_KerConstStatic_rotbonds_moving_vectors_const);
	kernel_conform.setArg(narg++, mem_KerConstStatic_rotbonds_unit_vectors_const);
	kernel_conform.setArg(narg++, dockpars.rotbondlist_length);
	kernel_conform.setArg(narg++, dockpars.num_of_atoms);
	kernel_conform.setArg(narg++, dockpars.num_of_genes);
	kernel_conform.setArg(narg++, mem_KerConstStatic_ref_orientation_quats_const);
	kernel_conform.setArg(narg++, KerConstDynamic.ref_orientation_quats_const[0]);
	kernel_conform.setArg(narg++, KerConstDynamic.ref_orientation_quats_const[1]);
	kernel_conform.setArg(narg++, KerConstDynamic.ref_orientation_quats_const[2]);
	kernel_conform.setArg(narg++, KerConstDynamic.ref_orientation_quats_const[3]);	
lvs's avatar
lvs committed
544
545
546
547
	#endif

	unsigned char gridsizex_minus1 = dockpars.gridsize_x - 1;
	unsigned char gridsizey_minus1 = dockpars.gridsize_y - 1;
lvs's avatar
lvs committed
548
	unsigned char gridsizez_minus1 = dockpars.gridsize_z - 1;
lvs's avatar
lvs committed
549
550
	float fgridsizex_minus1 = (float) gridsizex_minus1;
	float fgridsizey_minus1 = (float) gridsizey_minus1;
lvs's avatar
lvs committed
551
552
	float fgridsizez_minus1 = (float) gridsizez_minus1;

553
554
555
556
557
558
559
560
561
562
563
564
565
566
	#ifdef ENABLE_KRNL_INTERE
	narg = 0;
	kernel_intere.setArg(narg++, mem_dockpars_fgrids);
	kernel_intere.setArg(narg++, mem_KerConstStatic_InterE_atom_charges_const);
	kernel_intere.setArg(narg++, mem_KerConstStatic_InterE_atom_types_const);
	kernel_intere.setArg(narg++, dockpars.g1);
	kernel_intere.setArg(narg++, dockpars.g2);
	kernel_intere.setArg(narg++, dockpars.g3);
	kernel_intere.setArg(narg++, dockpars.num_of_atoms);
	kernel_intere.setArg(narg++, fgridsizex_minus1);
	kernel_intere.setArg(narg++, fgridsizey_minus1);
	kernel_intere.setArg(narg++, fgridsizez_minus1);
	kernel_intere.setArg(narg++, mul_tmp2);
	kernel_intere.setArg(narg++, mul_tmp3);
lvs's avatar
lvs committed
567
	#endif
lvs's avatar
lvs committed
568

569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
	#ifdef ENABLE_KRNL_INTRAE
	narg = 0;
	kernel_intrae.setArg(narg++, mem_KerConstStatic_IntraE_atom_charges_const);
	kernel_intrae.setArg(narg++, mem_KerConstStatic_IntraE_atom_types_const);
	kernel_intrae.setArg(narg++, mem_KerConstStatic_intraE_contributors_const);
	kernel_intrae.setArg(narg++, dockpars.smooth);
	kernel_intrae.setArg(narg++, mem_KerConstStatic_reqm_const);
	kernel_intrae.setArg(narg++, mem_KerConstStatic_reqm_hbond_const);
	kernel_intrae.setArg(narg++, mem_KerConstStatic_atom1_types_reqm_const);
	kernel_intrae.setArg(narg++, mem_KerConstStatic_atom2_types_reqm_const);
	kernel_intrae.setArg(narg++, mem_KerConstStatic_VWpars_AC_const);
	kernel_intrae.setArg(narg++, mem_KerConstStatic_VWpars_BD_const);
	kernel_intrae.setArg(narg++, mem_KerConstStatic_dspars_S_const);
	kernel_intrae.setArg(narg++, mem_KerConstStatic_dspars_V_const);
	kernel_intrae.setArg(narg++, dockpars.num_of_atoms);
	kernel_intrae.setArg(narg++, dockpars.num_of_intraE_contributors);
	kernel_intrae.setArg(narg++, dockpars.grid_spacing);
	kernel_intrae.setArg(narg++, dockpars.num_of_atypes);
	kernel_intrae.setArg(narg++, dockpars.coeff_elec);
	kernel_intrae.setArg(narg++, dockpars.qasp);
	kernel_intrae.setArg(narg++, dockpars.coeff_desolv);
	#endif

	#ifdef ENABLE_KRNL_PRNG_BT_USHORT_FLOAT
593
594
595
596
597
	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
598
	#endif // End of ENABLE_KRNL_PRNG_BT_USHORT_FLOAT
599

600
	#ifdef ENABLE_KRNL_PRNG_GG_UCHAR
601
602
603
604
605
	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
606
	#endif // End of ENABLE_KRNL_PRNG_GG_UCHAR
lvs's avatar
lvs committed
607

608
	#ifdef ENABLE_KRNL_PRNG_GG_FLOAT
609
	setKernelArg(kernel_prng_gg_float,1, sizeof(unsigned char),  &dockpars.num_of_genes);
Leonardo Solis's avatar
Leonardo Solis committed
610
611

	#if !defined(SW_EMU)
612
	setKernelArg(kernel_prng_gg_float,2, sizeof(mem_dummy),   &mem_dummy);
Leonardo Solis's avatar
Leonardo Solis committed
613
	#endif
614
	#endif // End of ENABLE_KRNL_PRNG_GG_FLOAT
615

616
	#ifdef ENABLE_KRNL_PRNG_LS123_USHORT
617
618
619
620
621
	setKernelArg(kernel_prng_ls123_ushort,9, sizeof(unsigned int),  &dockpars.pop_size);

	#if !defined(SW_EMU)
	setKernelArg(kernel_prng_ls123_ushort,10, sizeof(mem_dummy),   &mem_dummy);
	#endif
622
	#endif // End of ENABLE_KRNL_PRNG_LS123_USHORT
623

624
	#ifdef ENABLE_KRNL_PRNG_LS_FLOAT
625
626
627
628
629
	setKernelArg(kernel_prng_ls_float,1, sizeof(unsigned char),  &dockpars.num_of_genes);

	#if !defined(SW_EMU)
	setKernelArg(kernel_prng_ls_float,2, sizeof(mem_dummy),   &mem_dummy);
	#endif
630
	#endif // End of ENABLE_KRNL_PRNG_LS_FLOAT
631

632
	#ifdef ENABLE_KRNL_PRNG_LS2_FLOAT
633
634
635
636
637
	setKernelArg(kernel_prng_ls2_float,1, sizeof(unsigned char),  &dockpars.num_of_genes);

	#if !defined(SW_EMU)
	setKernelArg(kernel_prng_ls2_float,2, sizeof(mem_dummy),   &mem_dummy);
	#endif
638
	#endif // End of ENABLE_KRNL_PRNG_LS2_FLOAT
639

640
	#ifdef ENABLE_KRNL_PRNG_LS3_FLOAT
641
642
643
644
645
	setKernelArg(kernel_prng_ls3_float,1, sizeof(unsigned char),  &dockpars.num_of_genes);

	#if !defined(SW_EMU)
	setKernelArg(kernel_prng_ls3_float,2, sizeof(mem_dummy),   &mem_dummy);
	#endif
646
	#endif // End of ENABLE_KRNL_PRNG_LS3_FLOAT
647

648
	#ifdef ENABLE_KRNL_PRNG_LS4_FLOAT
649
650
651
652
653
	setKernelArg(kernel_prng_ls4_float,1, sizeof(unsigned char),  &dockpars.num_of_genes);

	#if !defined(SW_EMU)
	setKernelArg(kernel_prng_ls4_float,2, sizeof(mem_dummy),   &mem_dummy);
	#endif
654
	#endif // End of ENABLE_KRNL_PRNG_LS4_FLOAT
655

656
	#ifdef ENABLE_KRNL_PRNG_LS5_FLOAT
657
658
659
660
661
	setKernelArg(kernel_prng_ls5_float,1, sizeof(unsigned char),  &dockpars.num_of_genes);

	#if !defined(SW_EMU)
	setKernelArg(kernel_prng_ls5_float,2, sizeof(mem_dummy),   &mem_dummy);
	#endif
662
	#endif // End of ENABLE_KRNL_PRNG_LS5_FLOAT
663

664
	#ifdef ENABLE_KRNL_PRNG_LS6_FLOAT
665
666
667
668
669
	setKernelArg(kernel_prng_ls6_float,1, sizeof(unsigned char),  &dockpars.num_of_genes);

	#if !defined(SW_EMU)
	setKernelArg(kernel_prng_ls6_float,2, sizeof(mem_dummy),   &mem_dummy);
	#endif
670
	#endif // End of ENABLE_KRNL_PRNG_LS6_FLOAT
671

672
	#ifdef ENABLE_KRNL_PRNG_LS7_FLOAT
673
	setKernelArg(kernel_prng_ls7_float,1, sizeof(unsigned char),  &dockpars.num_of_genes);
674

675
676
677
	#if !defined(SW_EMU)
	setKernelArg(kernel_prng_ls7_float,2, sizeof(mem_dummy),   &mem_dummy);
	#endif
678
	#endif // End of ENABLE_KRNL_PRNG_LS7_FLOAT
679

680
	#ifdef ENABLE_KRNL_PRNG_LS8_FLOAT
681
	setKernelArg(kernel_prng_ls8_float,1, sizeof(unsigned char),  &dockpars.num_of_genes);
682

683
684
685
	#if !defined(SW_EMU)
	setKernelArg(kernel_prng_ls8_float,2, sizeof(mem_dummy),   &mem_dummy);
	#endif
686
	#endif // End of ENABLE_KRNL_PRNG_LS8_FLOAT
687

688
	#ifdef ENABLE_KRNL_PRNG_LS9_FLOAT
689
	setKernelArg(kernel_prng_ls9_float,1, sizeof(unsigned char),  &dockpars.num_of_genes);
690

691
692
693
	#if !defined(SW_EMU)
	setKernelArg(kernel_prng_ls9_float,2, sizeof(mem_dummy),   &mem_dummy);
	#endif
694
	#endif // End of ENABLE_KRNL_PRNG_LS9_FLOAT
695

696
697
	unsigned short Host_max_num_of_iters = (unsigned short)dockpars.max_num_of_iters;
	unsigned char  Host_cons_limit       = (unsigned char) dockpars.cons_limit;
698

699
	#if !defined(SW_EMU)
700

701
	#endif
702

703
704
705
706
707
708
709
	#ifdef ENABLE_KRNL_LS
	setKernelArg(kernel_ls,0, sizeof(unsigned short),  	&Host_max_num_of_iters);
	setKernelArg(kernel_ls,1, sizeof(float),  		&dockpars.rho_lower_bound);
	setKernelArg(kernel_ls,2, sizeof(float),  		&dockpars.base_dmov_mul_sqrt3);
	setKernelArg(kernel_ls,3, sizeof(unsigned char), 	&dockpars.num_of_genes);
	setKernelArg(kernel_ls,4, sizeof(float),  		&dockpars.base_dang_mul_sqrt3);
	setKernelArg(kernel_ls,5, sizeof(unsigned char),   	&Host_cons_limit);
Leonardo Solis's avatar
Leonardo Solis committed
710
	#if !defined(SW_EMU)
711
	setKernelArg(kernel_ls,6, sizeof(mem_dummy),   		&mem_dummy);
lvs's avatar
lvs committed
712
	#endif
713
714
715
716
717
718
719
720
721
	#endif // End of ENABLE_KRNL_LS

	#ifdef ENABLE_KRNL_LS2
	setKernelArg(kernel_ls2,0, sizeof(unsigned short),  	&Host_max_num_of_iters);
	setKernelArg(kernel_ls2,1, sizeof(float),  		&dockpars.rho_lower_bound);
	setKernelArg(kernel_ls2,2, sizeof(float),  		&dockpars.base_dmov_mul_sqrt3);
	setKernelArg(kernel_ls2,3, sizeof(unsigned char), 	&dockpars.num_of_genes);
	setKernelArg(kernel_ls2,4, sizeof(float),  		&dockpars.base_dang_mul_sqrt3);
	setKernelArg(kernel_ls2,5, sizeof(unsigned char),   	&Host_cons_limit);
Leonardo Solis's avatar
Leonardo Solis committed
722
	#if !defined(SW_EMU)
723
	setKernelArg(kernel_ls2,6, sizeof(mem_dummy),   	&mem_dummy);
Leonardo Solis's avatar
Leonardo Solis committed
724
	#endif
725
726
727
728
729
730
731
732
733
	#endif // End of ENABLE_KRNL_LS2

	#ifdef ENABLE_KRNL_LS3
	setKernelArg(kernel_ls3,0, sizeof(unsigned short),  	&Host_max_num_of_iters);
	setKernelArg(kernel_ls3,1, sizeof(float),  		&dockpars.rho_lower_bound);
	setKernelArg(kernel_ls3,2, sizeof(float),  		&dockpars.base_dmov_mul_sqrt3);
	setKernelArg(kernel_ls3,3, sizeof(unsigned char), 	&dockpars.num_of_genes);
	setKernelArg(kernel_ls3,4, sizeof(float),  		&dockpars.base_dang_mul_sqrt3);
	setKernelArg(kernel_ls3,5, sizeof(unsigned char),   	&Host_cons_limit);
Leonardo Solis's avatar
Leonardo Solis committed
734
	#if !defined(SW_EMU)
735
	setKernelArg(kernel_ls3,6, sizeof(mem_dummy),   	&mem_dummy);
lvs's avatar
lvs committed
736
	#endif
737
738
739
740
741
742
743
744
745
	#endif // End of ENABLE_KRNL_LS3

	#ifdef ENABLE_KRNL_LS4
	setKernelArg(kernel_ls4,0, sizeof(unsigned short),  	&Host_max_num_of_iters);
	setKernelArg(kernel_ls4,1, sizeof(float),  	  	&dockpars.rho_lower_bound);
	setKernelArg(kernel_ls4,2, sizeof(float),  	  	&dockpars.base_dmov_mul_sqrt3);
	setKernelArg(kernel_ls4,3, sizeof(unsigned char),   	&dockpars.num_of_genes);
	setKernelArg(kernel_ls4,4, sizeof(float),  	  	&dockpars.base_dang_mul_sqrt3);
	setKernelArg(kernel_ls4,5, sizeof(unsigned char),   	&Host_cons_limit);
Leonardo Solis's avatar
Leonardo Solis committed
746
	#if !defined(SW_EMU)
747
	setKernelArg(kernel_ls4,6, sizeof(mem_dummy),   	&mem_dummy);
Leonardo Solis's avatar
Leonardo Solis committed
748
	#endif
749
750
751
752
753
754
755
756
757
	#endif // End of ENABLE_KRNL_LS4

	#ifdef ENABLE_KRNL_LS5
	setKernelArg(kernel_ls5,0, sizeof(unsigned short),  	&Host_max_num_of_iters);
	setKernelArg(kernel_ls5,1, sizeof(float),  	  	&dockpars.rho_lower_bound);
	setKernelArg(kernel_ls5,2, sizeof(float),  	  	&dockpars.base_dmov_mul_sqrt3);
	setKernelArg(kernel_ls5,3, sizeof(unsigned char),   	&dockpars.num_of_genes);
	setKernelArg(kernel_ls5,4, sizeof(float),  	  	&dockpars.base_dang_mul_sqrt3);
	setKernelArg(kernel_ls5,5, sizeof(unsigned char),  	&Host_cons_limit);
Leonardo Solis's avatar
Leonardo Solis committed
758
	#if !defined(SW_EMU)
759
	setKernelArg(kernel_ls5,6, sizeof(mem_dummy),   	&mem_dummy);
Leonardo Solis's avatar
Leonardo Solis committed
760
	#endif
761
762
763
764
765
766
767
768
769
	#endif // End of ENABLE_KRNL_LS5

	#ifdef ENABLE_KRNL_LS6
	setKernelArg(kernel_ls6,0, sizeof(unsigned short),  	&Host_max_num_of_iters);
	setKernelArg(kernel_ls6,1, sizeof(float),  	  	&dockpars.rho_lower_bound);
	setKernelArg(kernel_ls6,2, sizeof(float),  	  	&dockpars.base_dmov_mul_sqrt3);
	setKernelArg(kernel_ls6,3, sizeof(unsigned char),   	&dockpars.num_of_genes);
	setKernelArg(kernel_ls6,4, sizeof(float),  	  	&dockpars.base_dang_mul_sqrt3);
	setKernelArg(kernel_ls6,5, sizeof(unsigned char),   	&Host_cons_limit);
Leonardo Solis's avatar
Leonardo Solis committed
770
	#if !defined(SW_EMU)
771
	setKernelArg(kernel_ls6,6, sizeof(mem_dummy),   	&mem_dummy);
Leonardo Solis's avatar
Leonardo Solis committed
772
	#endif
773
774
775
776
777
778
779
780
781
	#endif // End of ENABLE_KRNL_LS6

	#ifdef ENABLE_KRNL_LS7
	setKernelArg(kernel_ls7,0, sizeof(unsigned short),  	&Host_max_num_of_iters);
	setKernelArg(kernel_ls7,1, sizeof(float),  	  	&dockpars.rho_lower_bound);
	setKernelArg(kernel_ls7,2, sizeof(float),  	  	&dockpars.base_dmov_mul_sqrt3);
	setKernelArg(kernel_ls7,3, sizeof(unsigned char),   	&dockpars.num_of_genes);
	setKernelArg(kernel_ls7,4, sizeof(float),  	  	&dockpars.base_dang_mul_sqrt3);
	setKernelArg(kernel_ls7,5, sizeof(unsigned char),   	&Host_cons_limit);
Leonardo Solis's avatar
Leonardo Solis committed
782
	#if !defined(SW_EMU)
783
	setKernelArg(kernel_ls7,6, sizeof(mem_dummy),   	&mem_dummy);
Leonardo Solis's avatar
Leonardo Solis committed
784
	#endif
785
786
787
788
789
790
791
792
793
	#endif // End of ENABLE_KRNL_LS7

	#ifdef ENABLE_KRNL_LS8
	setKernelArg(kernel_ls8,0, sizeof(unsigned short),  	&Host_max_num_of_iters);
	setKernelArg(kernel_ls8,1, sizeof(float),  	  	&dockpars.rho_lower_bound);
	setKernelArg(kernel_ls8,2, sizeof(float),  	  	&dockpars.base_dmov_mul_sqrt3);
	setKernelArg(kernel_ls8,3, sizeof(unsigned char),   	&dockpars.num_of_genes);
	setKernelArg(kernel_ls8,4, sizeof(float),  	  	&dockpars.base_dang_mul_sqrt3);
	setKernelArg(kernel_ls8,5, sizeof(unsigned char),   	&Host_cons_limit);
Leonardo Solis's avatar
Leonardo Solis committed
794
	#if !defined(SW_EMU)
795
	setKernelArg(kernel_ls8,6, sizeof(mem_dummy),   	&mem_dummy);
Leonardo Solis's avatar
Leonardo Solis committed
796
	#endif
797
798
799
800
801
802
803
804
805
	#endif // End of ENABLE_KRNL_LS8

	#ifdef ENABLE_KRNL_LS9
	setKernelArg(kernel_ls9,0, sizeof(unsigned short),  	&Host_max_num_of_iters);
	setKernelArg(kernel_ls9,1, sizeof(float),  	  	&dockpars.rho_lower_bound);
	setKernelArg(kernel_ls9,2, sizeof(float),  	  	&dockpars.base_dmov_mul_sqrt3);
	setKernelArg(kernel_ls9,3, sizeof(unsigned char),   	&dockpars.num_of_genes);
	setKernelArg(kernel_ls9,4, sizeof(float),  	 	&dockpars.base_dang_mul_sqrt3);
	setKernelArg(kernel_ls9,5, sizeof(unsigned char),   	&Host_cons_limit);
Leonardo Solis's avatar
Leonardo Solis committed
806
	#if !defined(SW_EMU)
807
	setKernelArg(kernel_ls9,6, sizeof(mem_dummy),   	&mem_dummy);
Leonardo Solis's avatar
Leonardo Solis committed
808
	#endif
809
	#endif // End of ENABLE_KRNL_LS9
810

811
	#ifdef ENABLE_KRNL_IGL_ARBITER
812
	#if !defined(SW_EMU)
813
	setKernelArg(kernel_igl_arbiter,0, sizeof(mem_dummy),   &mem_dummy);
814
	#endif
815
	#endif // End of ENABLE_KRNL_IGL_ARBITER
lvs's avatar
lvs committed
816

817
	memcopyBufferObjectToDevice(command_queue_ga,mem_dockpars_conformations_current, 	cpu_init_populations, size_populations);
lvs's avatar
lvs committed
818
819
820

	printf("Docking runs to be executed: %u\n", mypars->num_of_runs); 
	printf("Execution run: ");
lvs's avatar
lvs committed
821
822
823
824

	for (unsigned int run_cnt = 0; run_cnt < mypars->num_of_runs; run_cnt++)
	{
		printf(" %u", run_cnt+1); 
lvs's avatar
lvs committed
825
		fflush(stdout);
lvs's avatar
lvs committed
826

827
		#ifdef ENABLE_KRNL_GA
lvs's avatar
lvs committed
828
829
		unsigned int Host_Offset_Pop = run_cnt * dockpars.pop_size * ACTUAL_GENOTYPE_LENGTH;
		unsigned int Host_Offset_Ene = run_cnt * dockpars.pop_size;
830
831
832
		setKernelArg(kernel_ga,16,  sizeof(unsigned short), &run_cnt);
		setKernelArg(kernel_ga,17,  sizeof(unsigned int),   &Host_Offset_Pop);
		setKernelArg(kernel_ga,18,  sizeof(unsigned int),   &Host_Offset_Ene);
lvs's avatar
lvs committed
833
		#endif
834
835
836
837

		#ifdef ENABLE_KRNL_CONFORM
		setKernelArg(kernel_conform,8,  sizeof(unsigned short), &run_cnt);
		#endif // End of ENABLE_KRNL_CONFORM
838

839
		#ifdef ENABLE_KRNL_PRNG_BT_USHORT_FLOAT
840
841
		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]);
842
		#endif // End of ENABLE_KRNL_PRNG_BT_USHORT_FLOAT
843

844
		#ifdef ENABLE_KRNL_PRNG_GG_UCHAR
845
		setKernelArg(kernel_prng_gg_uchar,0, sizeof(unsigned int),   &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 2]);
846
		#endif // End of ENABLE_KRNL_PRNG_GG_UCHAR
847

848
		#ifdef ENABLE_KRNL_PRNG_GG_FLOAT
849
		setKernelArg(kernel_prng_gg_float,0, sizeof(unsigned int),   &cpu_prng_seeds[num_of_prng_blocks * run_cnt]);
850
		#endif // End of ENABLE_KRNL_PRNG_GG_FLOAT
851

852
		#ifdef ENABLE_KRNL_PRNG_LS123_USHORT
853
854
855
856
857
858
859
860
861
		setKernelArg(kernel_prng_ls123_ushort,0, sizeof(unsigned int),   &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 5]);
		setKernelArg(kernel_prng_ls123_ushort,1, sizeof(unsigned int),   &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 6]);
		setKernelArg(kernel_prng_ls123_ushort,2, sizeof(unsigned int),   &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 7]);
		setKernelArg(kernel_prng_ls123_ushort,3, sizeof(unsigned int),   &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 8]);
		setKernelArg(kernel_prng_ls123_ushort,4, sizeof(unsigned int),   &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 9]);
		setKernelArg(kernel_prng_ls123_ushort,5, sizeof(unsigned int),   &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 10]);
		setKernelArg(kernel_prng_ls123_ushort,6, sizeof(unsigned int),   &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 11]);
		setKernelArg(kernel_prng_ls123_ushort,7, sizeof(unsigned int),   &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 12]);
		setKernelArg(kernel_prng_ls123_ushort,8, sizeof(unsigned int),   &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 13]);
862
		#endif // End of ENABLE_KRNL_PRNG_LS123_USHORT
863

864
		#ifdef ENABLE_KRNL_PRNG_LS_FLOAT
865
		setKernelArg(kernel_prng_ls_float,0, sizeof(unsigned int),   &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 1]);
866
		#endif // End of ENABLE_KRNL_PRNG_LS_FLOAT
867

868
		#ifdef ENABLE_KRNL_PRNG_LS2_FLOAT
869
		setKernelArg(kernel_prng_ls2_float,0, sizeof(unsigned int),   &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 3]);
870
		#endif // End of ENABLE_KRNL_PRNG_LS2_FLOAT
871

872
		#ifdef ENABLE_KRNL_PRNG_LS3_FLOAT
873
		setKernelArg(kernel_prng_ls3_float,0, sizeof(unsigned int),   &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 4]);
874
		#endif // End of ENABLE_KRNL_PRNG_LS3_FLOAT
875

876
		#ifdef ENABLE_KRNL_PRNG_LS4_FLOAT
877
		setKernelArg(kernel_prng_ls4_float,0, sizeof(unsigned int),   &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 16]);
878
		#endif // End of ENABLE_KRNL_PRNG_LS4_FLOAT
879

880
		#ifdef ENABLE_KRNL_PRNG_LS5_FLOAT
881
		setKernelArg(kernel_prng_ls5_float,0, sizeof(unsigned int),   &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 17]);
882
		#endif // End of ENABLE_KRNL_PRNG_LS5_FLOAT
883

884
		#ifdef ENABLE_KRNL_PRNG_LS6_FLOAT
885
		setKernelArg(kernel_prng_ls6_float,0, sizeof(unsigned int),   &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 18]);
886
		#endif // End of ENABLE_KRNL_PRNG_LS6_FLOAT
887

888
		#ifdef ENABLE_KRNL_PRNG_LS7_FLOAT
889
		setKernelArg(kernel_prng_ls7_float,0, sizeof(unsigned int),   &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 19]);
890
		#endif // End of ENABLE_KRNL_PRNG_LS7_FLOAT
891

892
		#ifdef ENABLE_KRNL_PRNG_LS8_FLOAT
893
		setKernelArg(kernel_prng_ls8_float,0, sizeof(unsigned int),   &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 20]);
894
		#endif // End of ENABLE_KRNL_PRNG_LS8_FLOAT
895

896
		#ifdef ENABLE_KRNL_PRNG_LS9_FLOAT
897
		setKernelArg(kernel_prng_ls9_float,0, sizeof(unsigned int),   &cpu_prng_seeds[num_of_prng_blocks * run_cnt + 21]);
898
		#endif // End of ENABLE_KRNL_PRNG_LS9_FLOAT
lvs's avatar
lvs committed
899

900
		#ifdef ENABLE_KRNL_GA
901
		command_queue_ga.enqueueTask(kernel_ga);
902
		#endif
903
904
		#ifdef ENABLE_KRNL_CONFORM
		command_queue_conform.enqueueTask(kernel_conform);
905
		#endif
906
907
		#ifdef ENABLE_KRNL_INTERE
		command_queue_intere.enqueueTask(kernel_intere);
908
		#endif
909
910
		#ifdef ENABLE_KRNL_INTRAE
		command_queue_intrae.enqueueTask(kernel_intrae);
911
		#endif
912
913
		#ifdef ENABLE_KRNL_PRNG_BT_USHORT_FLOAT
		command_queue_prng_bt_ushort_float.enqueueTask(kernel_prng_bt_ushort_float);
914
		#endif
915
916
917
918
919
		#ifdef ENABLE_KRNL_PRNG_GG_UCHAR
		command_queue_prng_gg_uchar.enqueueTask(kernel_prng_gg_uchar);
		#endif
		#ifdef ENABLE_KRNL_PRNG_GG_FLOAT
		command_queue_prng_gg_float.enqueueTask(kernel_prng_gg_float);
920
		#endif
921
922
923
924
925
		#ifdef ENABLE_KRNL_PRNG_LS123_USHORT
		command_queue_prng_ls123_ushort.enqueueTask(kernel_prng_ls123_ushort);
		#endif
		#ifdef ENABLE_KRNL_PRNG_LS_FLOAT
		command_queue_prng_ls_float.enqueueTask(kernel_prng_ls_float);
926
		#endif
927
928
		#ifdef ENABLE_KRNL_PRNG_LS2_FLOAT
		command_queue_prng_ls2_float.enqueueTask(kernel_prng_ls2_float);
929
		#endif
930
931
		#ifdef ENABLE_KRNL_PRNG_LS3_FLOAT
		command_queue_prng_ls3_float.enqueueTask(kernel_prng_ls3_float);
932
		#endif
933
934
		#ifdef ENABLE_KRNL_PRNG_LS4_FLOAT
		command_queue_prng_ls4_float.enqueueTask(kernel_prng_ls4_float);
935
		#endif
936
937
		#ifdef ENABLE_KRNL_PRNG_LS5_FLOAT
		command_queue_prng_ls5_float.enqueueTask(kernel_prng_ls5_float);
938
		#endif
939
940
		#ifdef ENABLE_KRNL_PRNG_LS6_FLOAT
		command_queue_prng_ls6_float.enqueueTask(kernel_prng_ls6_float);
941
		#endif
942
943
		#ifdef ENABLE_KRNL_PRNG_LS7_FLOAT
		command_queue_prng_ls7_float.enqueueTask(kernel_prng_ls7_float);
944
		#endif
945
946
		#ifdef ENABLE_KRNL_PRNG_LS8_FLOAT
		command_queue_prng_ls8_float.enqueueTask(kernel_prng_ls8_float);
947
		#endif
948
949
		#ifdef ENABLE_KRNL_PRNG_LS9_FLOAT
		command_queue_prng_ls9_float.enqueueTask(kernel_prng_ls9_float);
950
		#endif
951
952
		#ifdef ENABLE_KRNL_LS
		command_queue_ls.enqueueTask(kernel_ls);
953
		#endif
954
955
956
957
958
		#ifdef ENABLE_KRNL_LS2
		command_queue_ls2.enqueueTask(kernel_ls2);
		#endif
		#ifdef ENABLE_KRNL_LS3
		command_queue_ls3.enqueueTask(kernel_ls3);
959
		#endif
960
961
		#ifdef ENABLE_KRNL_LS4
		command_queue_ls4.enqueueTask(kernel_ls4);
962
		#endif
963
964
		#ifdef ENABLE_KRNL_LS5
		command_queue_ls5.enqueueTask(kernel_ls5);
965
		#endif
966
967
		#ifdef ENABLE_KRNL_LS6
		command_queue_ls6.enqueueTask(kernel_ls6);
968
		#endif
969
970
		#ifdef ENABLE_KRNL_LS7
		command_queue_ls7.enqueueTask(kernel_ls7);
971
		#endif
972
973
		#ifdef ENABLE_KRNL_LS8
		command_queue_ls8.enqueueTask(kernel_ls8);
974
		#endif
975
976
		#ifdef ENABLE_KRNL_LS9
		command_queue_ls9.enqueueTask(kernel_ls9);
977
		#endif
978
979
		#ifdef ENABLE_KRNL_IGL_ARBITER
		command_queue_igl_arbiter.enqueueTask(kernel_igl_arbiter);
980
		#endif
lvs's avatar
lvs committed
981

982
		#ifdef ENABLE_KRNL_GA	
983
		command_queue_ga.finish(); 
lvs's avatar
lvs committed
984
		#endif
985
		#ifdef ENABLE_KRNL_CONFORM	
986
		command_queue_conform.finish(); 
lvs's avatar
lvs committed
987
		#endif
988
		#ifdef ENABLE_KRNL_INTERE	
989
		command_queue_intere.finish(); 
lvs's avatar
lvs committed
990
		#endif
991
		#ifdef ENABLE_KRNL_INTRAE	
992
		command_queue_intrae.finish(); 
993
994
		#endif
		#ifdef ENABLE_KRNL_PRNG_BT_USHORT_FLOAT
995
		command_queue_prng_bt_ushort_float.finish();
996
997
		#endif
		#ifdef ENABLE_KRNL_PRNG_GG_UCHAR
998
		command_queue_prng_gg_uchar.finish();
lvs's avatar
lvs committed
999
		#endif
1000
		#ifdef ENABLE_KRNL_PRNG_GG_FLOAT
For faster browsing, not all history is shown. View entire blame