Commit 38b634dd authored by Leonardo Solis's avatar Leonardo Solis

#32, removed all refs (unnecesary) to gpu

parent 649dcea1
......@@ -6,9 +6,9 @@
#include "processligand.h"
#include "getparameters.h"
// This struct is passed to the GPU global functions (OpenCL kernels) as input.
// Its members are parameters related to the ligand, the grid
// and the genetic algorithm, or they are pointers of GPU (ADM FPGA) memory areas
// Members of this struct are passed to the FPGA OpenCL kernels as inputs.
// Struct members are parameters related to the ligand, the grid
// and the genetic algorithm, or they are pointers of FPGA memory areas
// used for storing different data such as the current
// and the next population genotypes and energies, the grids,
// the evaluation counters and the random number generator states.
......@@ -70,7 +70,7 @@ typedef struct
cl_float4 ref_orientation_quats_const [MAX_NUM_OF_RUNS] __attribute__ ((aligned (XILINX_MEMALIGN)));
} kernelconstant_static;
int prepare_conststatic_fields_for_gpu(Liganddata* myligand_reference,
int prepare_conststatic_fields_for_fpga(Liganddata* myligand_reference,
Dockpars* mypars,
float* cpu_ref_ori_angles,
kernelconstant_static* KerConstStatic);
......
......@@ -13,13 +13,13 @@ using std::vector;
#define ELAPSEDSECS(stop,start) ((float) stop-start)/((float) CLOCKS_PER_SEC)
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);
int docking_with_fpga(const Gridinfo* mygrid,
/*const*/ float* cpu_floatgrids,
Dockpars* mypars,
const Liganddata* myligand_init,
const int* argc,
char** argv,
clock_t clock_start_program);
double check_progress(int* evals_of_runs,
int generation_cnt,
......
#include "calcenergy.h"
/*
int prepare_const_fields_for_gpu(Liganddata* myligand_reference,
Dockpars* mypars,
float* cpu_ref_ori_angles,
kernelconstant* KerConst)
//The function fills the constant memory field of the GPU (ADM FPGA)
//defined above (erased from here) and used during GPU docking,
int prepare_const_fields_for_fpga(Liganddata* myligand_reference,
Dockpars* mypars,
float* cpu_ref_ori_angles,
kernelconstant* KerConst)
//The function fills the constant memory field of the FPGA and are
//based on the parameters which describe the ligand,
//the docking parameters and the reference orientation angles.
//Short description of the field is as follows:
......@@ -232,7 +231,7 @@ int prepare_const_fields_for_gpu(Liganddata* myligand_reference,
}
*/
int prepare_conststatic_fields_for_gpu(Liganddata* myligand_reference,
int prepare_conststatic_fields_for_fpga(Liganddata* myligand_reference,
Dockpars* mypars,
float* cpu_ref_ori_angles,
kernelconstant_static* KerConstStatic)
......@@ -493,7 +492,7 @@ void make_reqrot_ordering(char number_of_req_rotations[MAX_NUM_OF_ATOMS],
int gen_rotlist(Liganddata* myligand, int rotlist[MAX_NUM_OF_ROTATIONS])
//The function generates the rotation list which will be stored in the constant memory field rotlist_const by
//prepare_const_fields_for_gpu(). The structure of this array is described at that function.
//prepare_const_fields_for_fpga(). The structure of this array is described at that function.
{
int atom_id, rotb_id, parallel_rot_id, rotlist_id;
char number_of_req_rotations[MAX_NUM_OF_ATOMS];
......
......@@ -83,7 +83,7 @@ int main(int argc, char* argv[])
//------------------------------------------------------------
// Starting Docking
//------------------------------------------------------------
if (docking_with_gpu(&mygrid, floatgrids.data(), &mypars, &myligand_init, &argc, argv, clock_start_program) != 0)
if (docking_with_fpga(&mygrid, floatgrids.data(), &mypars, &myligand_init, &argc, argv, clock_start_program) != 0)
return 1;
/*
......
......@@ -25,13 +25,13 @@ cl_mem mem_ref_orientation_quats_const; // float [4*MAX_NUM_OF_RUNS]; // 4*100
//// --------------------------------
//// 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)
int docking_with_fpga( 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
......@@ -241,7 +241,7 @@ filled with clock() */
Liganddata myligand_reference;
//allocating GPU memory for floatgrids,
//allocating FPGA 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]);
......@@ -293,15 +293,10 @@ filled with clock() */
// allocating memory in CPU for generation counters
vector<int,aligned_allocator<int>> cpu_gens_of_runs (size_evals_of_runs_nelems, 0);
//preparing the constant data fields for the FPGA
// -----------------------------------------------------------------------------------------------------
// 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.
//preparing the constant data fields for the FPGA (calcenergy.cpp)
// -----------------------------------------------------------------------------------------------------
kernelconstant_static KerConstStatic;
if (prepare_conststatic_fields_for_gpu(&myligand_reference, mypars, cpu_ref_ori_angles.data(), &KerConstStatic) == 1)
if (prepare_conststatic_fields_for_fpga(&myligand_reference, mypars, cpu_ref_ori_angles.data(), &KerConstStatic) == 1)
return 1;
//preparing parameter struct
......
Markdown is supported
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