Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
docking
ocladock-fpga
Commits
38b634dd
Commit
38b634dd
authored
Nov 15, 2018
by
Leonardo Solis
Browse files
#32, removed all refs (unnecesary) to gpu
parent
649dcea1
Changes
5
Hide whitespace changes
Inline
Side-by-side
ofdock_taskpar_xl/host/inc/calcenergy.h
View file @
38b634dd
...
@@ -6,9 +6,9 @@
...
@@ -6,9 +6,9 @@
#include
"processligand.h"
#include
"processligand.h"
#include
"getparameters.h"
#include
"getparameters.h"
//
T
his struct
is
passed to the
GPU global functions (
OpenCL kernels
)
as input.
//
Members of t
his struct
are
passed to the
FPGA
OpenCL kernels as input
s
.
//
Its
members are parameters related to the ligand, the grid
//
Struct
members are parameters related to the ligand, the grid
// and the genetic algorithm, or they are pointers of
GPU (ADM
FPGA
)
memory areas
// and the genetic algorithm, or they are pointers of FPGA memory areas
// used for storing different data such as the current
// used for storing different data such as the current
// and the next population genotypes and energies, the grids,
// and the next population genotypes and energies, the grids,
// the evaluation counters and the random number generator states.
// the evaluation counters and the random number generator states.
...
@@ -70,7 +70,7 @@ typedef struct
...
@@ -70,7 +70,7 @@ typedef struct
cl_float4
ref_orientation_quats_const
[
MAX_NUM_OF_RUNS
]
__attribute__
((
aligned
(
XILINX_MEMALIGN
)));
cl_float4
ref_orientation_quats_const
[
MAX_NUM_OF_RUNS
]
__attribute__
((
aligned
(
XILINX_MEMALIGN
)));
}
kernelconstant_static
;
}
kernelconstant_static
;
int
prepare_conststatic_fields_for_
gpu
(
Liganddata
*
myligand_reference
,
int
prepare_conststatic_fields_for_
fpga
(
Liganddata
*
myligand_reference
,
Dockpars
*
mypars
,
Dockpars
*
mypars
,
float
*
cpu_ref_ori_angles
,
float
*
cpu_ref_ori_angles
,
kernelconstant_static
*
KerConstStatic
);
kernelconstant_static
*
KerConstStatic
);
...
...
ofdock_taskpar_xl/host/inc/performdocking.h
View file @
38b634dd
...
@@ -13,13 +13,13 @@ using std::vector;
...
@@ -13,13 +13,13 @@ using std::vector;
#define ELAPSEDSECS(stop,start) ((float) stop-start)/((float) CLOCKS_PER_SEC)
#define ELAPSEDSECS(stop,start) ((float) stop-start)/((float) CLOCKS_PER_SEC)
int
docking_with_
gpu
(
const
Gridinfo
*
mygrid
,
int
docking_with_
fpga
(
const
Gridinfo
*
mygrid
,
/*const*/
float
*
cpu_floatgrids
,
/*const*/
float
*
cpu_floatgrids
,
Dockpars
*
mypars
,
Dockpars
*
mypars
,
const
Liganddata
*
myligand_init
,
const
Liganddata
*
myligand_init
,
const
int
*
argc
,
const
int
*
argc
,
char
**
argv
,
char
**
argv
,
clock_t
clock_start_program
);
clock_t
clock_start_program
);
double
check_progress
(
int
*
evals_of_runs
,
double
check_progress
(
int
*
evals_of_runs
,
int
generation_cnt
,
int
generation_cnt
,
...
...
ofdock_taskpar_xl/host/src/calcenergy.cpp
View file @
38b634dd
#include
"calcenergy.h"
#include
"calcenergy.h"
/*
/*
int prepare_const_fields_for_gpu(Liganddata* myligand_reference,
int prepare_const_fields_for_fpga(Liganddata* myligand_reference,
Dockpars* mypars,
Dockpars* mypars,
float* cpu_ref_ori_angles,
float* cpu_ref_ori_angles,
kernelconstant* KerConst)
kernelconstant* KerConst)
//The function fills the constant memory field of the GPU (ADM FPGA)
//The function fills the constant memory field of the FPGA and are
//defined above (erased from here) and used during GPU docking,
//based on the parameters which describe the ligand,
//based on the parameters which describe the ligand,
//the docking parameters and the reference orientation angles.
//the docking parameters and the reference orientation angles.
//Short description of the field is as follows:
//Short description of the field is as follows:
...
@@ -232,7 +231,7 @@ int prepare_const_fields_for_gpu(Liganddata* myligand_reference,
...
@@ -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
,
Dockpars
*
mypars
,
float
*
cpu_ref_ori_angles
,
float
*
cpu_ref_ori_angles
,
kernelconstant_static
*
KerConstStatic
)
kernelconstant_static
*
KerConstStatic
)
...
@@ -493,7 +492,7 @@ void make_reqrot_ordering(char number_of_req_rotations[MAX_NUM_OF_ATOMS],
...
@@ -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
])
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
//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
;
int
atom_id
,
rotb_id
,
parallel_rot_id
,
rotlist_id
;
char
number_of_req_rotations
[
MAX_NUM_OF_ATOMS
];
char
number_of_req_rotations
[
MAX_NUM_OF_ATOMS
];
...
...
ofdock_taskpar_xl/host/src/main.cpp
View file @
38b634dd
...
@@ -83,7 +83,7 @@ int main(int argc, char* argv[])
...
@@ -83,7 +83,7 @@ int main(int argc, char* argv[])
//------------------------------------------------------------
//------------------------------------------------------------
// Starting Docking
// 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
;
return
1
;
/*
/*
...
...
ofdock_taskpar_xl/host/src/performdocking.cpp
View file @
38b634dd
...
@@ -25,13 +25,13 @@ cl_mem mem_ref_orientation_quats_const; // float [4*MAX_NUM_OF_RUNS]; // 4*100
...
@@ -25,13 +25,13 @@ cl_mem mem_ref_orientation_quats_const; // float [4*MAX_NUM_OF_RUNS]; // 4*100
//// --------------------------------
//// --------------------------------
//// Docking
//// Docking
//// --------------------------------
//// --------------------------------
int
docking_with_
gpu
(
const
Gridinfo
*
mygrid
,
int
docking_with_
fpga
(
const
Gridinfo
*
mygrid
,
/*const*/
float
*
cpu_floatgrids
,
/*const*/
float
*
cpu_floatgrids
,
Dockpars
*
mypars
,
Dockpars
*
mypars
,
const
Liganddata
*
myligand_init
,
const
Liganddata
*
myligand_init
,
const
int
*
argc
,
const
int
*
argc
,
char
**
argv
,
char
**
argv
,
clock_t
clock_start_program
)
clock_t
clock_start_program
)
/* The function performs the docking algorithm and generates the corresponding result files.
/* The function performs the docking algorithm and generates the corresponding result files.
parameter mygrid:
parameter mygrid:
describes the grid
describes the grid
...
@@ -241,7 +241,7 @@ filled with clock() */
...
@@ -241,7 +241,7 @@ filled with clock() */
Liganddata
myligand_reference
;
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
)
*
size_t
size_floatgrids_nbytes
=
sizeof
(
float
)
*
(
mygrid
->
num_of_atypes
+
2
)
*
(
mygrid
->
size_xyz
[
0
])
*
(
mygrid
->
size_xyz
[
1
])
*
(
mygrid
->
size_xyz
[
2
]);
(
mygrid
->
size_xyz
[
0
])
*
(
mygrid
->
size_xyz
[
1
])
*
(
mygrid
->
size_xyz
[
2
]);
...
@@ -293,15 +293,10 @@ filled with clock() */
...
@@ -293,15 +293,10 @@ filled with clock() */
// allocating memory in CPU for generation counters
// allocating memory in CPU for generation counters
vector
<
int
,
aligned_allocator
<
int
>>
cpu_gens_of_runs
(
size_evals_of_runs_nelems
,
0
);
vector
<
int
,
aligned_allocator
<
int
>>
cpu_gens_of_runs
(
size_evals_of_runs_nelems
,
0
);
//preparing the constant data fields for the FPGA
//preparing the constant data fields for the FPGA (calcenergy.cpp)
// -----------------------------------------------------------------------------------------------------
// 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.
// -----------------------------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------
kernelconstant_static
KerConstStatic
;
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
;
return
1
;
//preparing parameter struct
//preparing parameter struct
...
...
Leonardo Solis
@solis
mentioned in commit
4015eba0
·
Jan 04, 2021
mentioned in commit
4015eba0
mentioned in commit 4015eba08372a34fec599085fa825ce3149aacf0
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment