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
65d4bce9
Commit
65d4bce9
authored
Aug 27, 2017
by
Leonardo Solis
Browse files
added first working version in harp2
Former-commit-id:
4b1a6b88
parent
4dfbba66
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
ofdock_taskpar_alt/Makefile
View file @
65d4bce9
...
@@ -141,10 +141,10 @@ ENABLE_K1 = YES
...
@@ -141,10 +141,10 @@ ENABLE_K1 = YES
ENABLE_K2
=
YES
ENABLE_K2
=
YES
ENABLE_K3
=
YES
ENABLE_K3
=
YES
ENABLE_K4
=
YES
ENABLE_K4
=
YES
ENABLE_K5
=
YES
ENABLE_K5
=
NO
ENABLE_K6
=
YES
ENABLE_K6
=
NO
ENABLE_K7
=
YES
ENABLE_K7
=
NO
ENABLE_K8
=
YES
ENABLE_K8
=
NO
ifeq
($(ENABLE_K1),YES)
ifeq
($(ENABLE_K1),YES)
K1
=
-DENABLE_KERNEL1
K1
=
-DENABLE_KERNEL1
...
@@ -259,8 +259,8 @@ $(TARGET_DIR)/$(TARGET) : Makefile $(SRCS) $(INCS) $(TARGET_DIR)
...
@@ -259,8 +259,8 @@ $(TARGET_DIR)/$(TARGET) : Makefile $(SRCS) $(INCS) $(TARGET_DIR)
# Docking parameters
# Docking parameters
PDB
:=
3ptb
PDB
:=
3ptb
NRUN
:=
1
0
NRUN
:=
2
0
NEV
:=
20
0000
NEV
:=
4
0000
# Device folder
# Device folder
# Device main kernel name
# Device main kernel name
...
@@ -268,6 +268,7 @@ NEV := 200000
...
@@ -268,6 +268,7 @@ NEV := 200000
DEV_DIRS
:=
device
DEV_DIRS
:=
device
DEV_SRC
:=
$(DEV_DIRS)
/Krnl_GA.cl
DEV_SRC
:=
$(DEV_DIRS)
/Krnl_GA.cl
BOARD_HARP2
:=
bdw_fpga_v1.0
BOARD_HARP2
:=
bdw_fpga_v1.0
#BOARD_HARP2 := a10gx
## Make it all: compilation (host & device) + run emulation
## Make it all: compilation (host & device) + run emulation
## Notice, it switches automatically to /bin folder
## Notice, it switches automatically to /bin folder
...
...
ofdock_taskpar_alt/device/Krnl_Conform.cl
View file @
65d4bce9
...
@@ -26,11 +26,12 @@ void Krnl_Conform(
...
@@ -26,11 +26,12 @@ void Krnl_Conform(
char
mode
=
0
;
char
mode
=
0
;
ushort
cnt
=
0
; //uint cnt = 0;
ushort
cnt
=
0
; //uint cnt = 0;
char
IC_active,
GG_active,
LS_active
;
char
IC_active,
GG_active,
LS_active
,
Off_active
;
bool
IC_valid
=
false
;
bool
IC_valid
=
false
;
bool
GG_valid
=
false
;
bool
GG_valid
=
false
;
bool
LS_valid
=
false
;
bool
LS_valid
=
false
;
char
IC_mode,
GG_mode,
LS_mode
=
0
;
bool
Off_valid
=
false
;
char
IC_mode,
GG_mode,
LS_mode,
Off_mode
=
0
;
float
phi,
theta,
genrotangle
;
float
phi,
theta,
genrotangle
;
...
@@ -59,10 +60,11 @@ while(active) {
...
@@ -59,10 +60,11 @@ while(active) {
//
--------------------------------------------------------------
//
--------------------------------------------------------------
//
Wait
for
genotypes
in
channel
//
Wait
for
genotypes
in
channel
//
--------------------------------------------------------------
//
--------------------------------------------------------------
while
((
IC_valid
==
false
)
&&
(
GG_valid
==
false
)
&&
(
LS_valid
==
false
))
{
while
((
IC_valid
==
false
)
&&
(
GG_valid
==
false
)
&&
(
LS_valid
==
false
)
&&
(
Off_valid
==
false
))
{
IC_active
=
read_channel_nb_altera
(
chan_IC2Conf_active,
&IC_valid
)
;
IC_active
=
read_channel_nb_altera
(
chan_IC2Conf_active,
&IC_valid
)
;
GG_active
=
read_channel_nb_altera
(
chan_GG2Conf_active,
&GG_valid
)
;
GG_active
=
read_channel_nb_altera
(
chan_GG2Conf_active,
&GG_valid
)
;
LS_active
=
read_channel_nb_altera
(
chan_LS2Conf_active,
&LS_valid
)
;
LS_active
=
read_channel_nb_altera
(
chan_LS2Conf_active,
&LS_valid
)
;
Off_active
=
read_channel_nb_altera
(
chan_Off2Conf_active,
&Off_valid
)
;
}
}
if
(
IC_valid
)
{
if
(
IC_valid
)
{
...
@@ -100,16 +102,31 @@ while(active) {
...
@@ -100,16 +102,31 @@ while(active) {
for
(
uchar
pipe_cnt=0
; pipe_cnt<ACTUAL_GENOTYPE_LENGTH; pipe_cnt++) {
for
(
uchar
pipe_cnt=0
; pipe_cnt<ACTUAL_GENOTYPE_LENGTH; pipe_cnt++) {
genotype[pipe_cnt]
=
read_channel_altera
(
chan_LS2Conf_genotype
)
;}
genotype[pipe_cnt]
=
read_channel_altera
(
chan_LS2Conf_genotype
)
;}
}
}
else
{
if
(
Off_valid
)
{
active
=
Off_active
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
mode
=
read_channel_altera
(
chan_Off2Conf_mode
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
cnt
=
read_channel_altera
(
chan_Off2Conf_cnt
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
for
(
uchar
pipe_cnt=0
; pipe_cnt<ACTUAL_GENOTYPE_LENGTH; pipe_cnt++) {
genotype[pipe_cnt]
=
read_channel_altera
(
chan_Off2Conf_genotype
)
;}
}
}
}
}
}
}
IC_valid
=
false
;
IC_valid
=
false
;
GG_valid
=
false
;
GG_valid
=
false
;
LS_valid
=
false
;
LS_valid
=
false
;
Off_valid
=
false
;
IC_active
=
0
;
IC_active
=
0
;
GG_active
=
0
;
GG_active
=
0
;
LS_active
=
0
;
LS_active
=
0
;
Off_active
=
0
;
#
if
defined
(
DEBUG_ACTIVE_KERNEL
)
#
if
defined
(
DEBUG_ACTIVE_KERNEL
)
if
(
active
==
0
)
{printf
(
" %-20s: %s\n"
,
"Krnl_Conform"
,
"must be disabled"
)
;}
if
(
active
==
0
)
{printf
(
" %-20s: %s\n"
,
"Krnl_Conform"
,
"must be disabled"
)
;}
...
@@ -263,12 +280,15 @@ while(active) {
...
@@ -263,12 +280,15 @@ while(active) {
//////======================================================
//////======================================================
//printf
(
"Conform: %u %u\n"
,
active,
cnt
)
;
/*
if
((
active
==
0
)
&&
(
cnt
==
(
DockConst->pop_size
-1
)))
{
if
((
active
==
0
)
&&
(
cnt
==
(
DockConst->pop_size
-1
)))
{
active
=
0
;
active
=
0
;
}
}
else
{
else
{
active
=
1
;
active
=
1
;
}
}
*/
//////======================================================
//////======================================================
//
--------------------------------------------------------------
//
--------------------------------------------------------------
...
@@ -277,9 +297,8 @@ while(active) {
...
@@ -277,9 +297,8 @@ while(active) {
write_channel_altera
(
chan_Conf2Intere_active,
active
)
;
write_channel_altera
(
chan_Conf2Intere_active,
active
)
;
write_channel_altera
(
chan_Conf2Intrae_active,
active
)
;
write_channel_altera
(
chan_Conf2Intrae_active,
active
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
/*
write_channel_altera
(
chan_Conf2Intere_mode,
mode
)
;
write_channel_altera
(
chan_Conf2Intere_mode,
mode
)
;
*/
write_channel_altera
(
chan_Conf2Intrae_mode,
mode
)
;
write_channel_altera
(
chan_Conf2Intrae_mode,
mode
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
...
...
ofdock_taskpar_alt/device/Krnl_GA.cl
View file @
65d4bce9
This diff is collapsed.
Click to expand it.
ofdock_taskpar_alt/device/Krnl_InterE.cl
View file @
65d4bce9
...
@@ -29,9 +29,7 @@ void Krnl_InterE(
...
@@ -29,9 +29,7 @@ void Krnl_InterE(
*/
*/
char
active
=
1
;
char
active
=
1
;
/*
char
mode
=
0
;
char
mode
=
0
;
*/
ushort
cnt
=
0
; //uint cnt = 0;
ushort
cnt
=
0
; //uint cnt = 0;
float
interE
;
float
interE
;
...
@@ -70,10 +68,8 @@ while(active) {
...
@@ -70,10 +68,8 @@ while(active) {
//
--------------------------------------------------------------
//
--------------------------------------------------------------
active
=
read_channel_altera
(
chan_Conf2Intere_active
)
;
active
=
read_channel_altera
(
chan_Conf2Intere_active
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
/*
mode
=
read_channel_altera
(
chan_Conf2Intere_mode
)
;
mode
=
read_channel_altera
(
chan_Conf2Intere_mode
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
*/
cnt
=
read_channel_altera
(
chan_Conf2Intere_cnt
)
;
cnt
=
read_channel_altera
(
chan_Conf2Intere_cnt
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
...
@@ -270,20 +266,40 @@ while(active) {
...
@@ -270,20 +266,40 @@ while(active) {
//////======================================================
//////======================================================
//printf
(
"InterE: %u %u\n"
,
active,
cnt
)
;
/*
if
((
active
==
0
)
&&
(
cnt
==
(
DockConst->pop_size
-1
)))
{
if
((
active
==
0
)
&&
(
cnt
==
(
DockConst->pop_size
-1
)))
{
active
=
0
;
active
=
0
;
}
}
else
{
else
{
active
=
1
;
active
=
1
;
}
}
*/
//////======================================================
//////======================================================
//
--------------------------------------------------------------
//
--------------------------------------------------------------
//
Send
intermolecular
energy
to
chanel
//
Send
intermolecular
energy
to
chanel
//
--------------------------------------------------------------
//
--------------------------------------------------------------
write_channel_altera
(
chan_Intere2Store_intere,
interE
)
;
//write_channel_altera
(
chan_Intere2Store_intere,
interE
)
;
switch
(
mode
)
{
case
1:
//
IC
write_channel_altera
(
chan_Intere2StoreIC_intere,
interE
)
;
break
;
case
2:
//
GG
write_channel_altera
(
chan_Intere2StoreGG_intere,
interE
)
;
break
;
case
3:
//
LS
write_channel_altera
(
chan_Intere2StoreLS_intere,
interE
)
;
break
;
case
4:
//
Off
write_channel_altera
(
chan_Intere2StoreOff_intere,
interE
)
;
break
;
}
/*
/*
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
write_channel_altera
(
chan_Intere2Store_active,
active
)
;
write_channel_altera
(
chan_Intere2Store_active,
active
)
;
...
...
ofdock_taskpar_alt/device/Krnl_IntraE.cl
View file @
65d4bce9
...
@@ -157,24 +157,45 @@ while(active) {
...
@@ -157,24 +157,45 @@ while(active) {
}
//
End
of
LOOP_INTRAE_1
}
//
End
of
LOOP_INTRAE_1
//////======================================================
//////======================================================
//printf
(
"IntraE: %u %u\n"
,
active,
cnt
)
;
/*
if
((
active
==
0
)
&&
(
cnt
==
(
DockConst->pop_size
-1
)))
{
if
((
active
==
0
)
&&
(
cnt
==
(
DockConst->pop_size
-1
)))
{
active
=
0
;
active
=
0
;
}
}
else
{
else
{
active
=
1
;
active
=
1
;
}
}
*/
//////======================================================
//////======================================================
//
--------------------------------------------------------------
//
--------------------------------------------------------------
//
Send
intramolecular
energy
to
channel
//
Send
intramolecular
energy
to
channel
//
--------------------------------------------------------------
//
--------------------------------------------------------------
write_channel_altera
(
chan_Intrae2Store_intrae,
intraE
)
;
//write_channel_altera
(
chan_Intrae2Store_intrae,
intraE
)
;
switch
(
mode
)
{
case
1:
//
IC
write_channel_altera
(
chan_Intrae2StoreIC_intrae,
intraE
)
;
break
;
case
2:
//
GG
write_channel_altera
(
chan_Intrae2StoreGG_intrae,
intraE
)
;
break
;
case
3:
//
LS
write_channel_altera
(
chan_Intrae2StoreLS_intrae,
intraE
)
;
break
;
case
4:
//
Off
write_channel_altera
(
chan_Intrae2StoreOff_intrae,
intraE
)
;
break
;
}
/*
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
write_channel_altera
(
chan_Intrae2Store_active,
active
)
;
write_channel_altera
(
chan_Intrae2Store_active,
active
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
write_channel_altera
(
chan_Intrae2Store_mode,
mode
)
;
write_channel_altera
(
chan_Intrae2Store_mode,
mode
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
mem_fence
(
CLK_CHANNEL_MEM_FENCE
)
;
write_channel_altera
(
chan_Intrae2Store_cnt,
cnt
)
;
write_channel_altera
(
chan_Intrae2Store_cnt,
cnt
)
;
*/
//
--------------------------------------------------------------
//
--------------------------------------------------------------
}
//
End
of
while
(
1
)
}
//
End
of
while
(
1
)
...
...
ofdock_taskpar_alt/host/src/performdocking.cpp
View file @
65d4bce9
...
@@ -355,7 +355,7 @@ filled with clock() */
...
@@ -355,7 +355,7 @@ filled with clock() */
mallocBufferObject
(
context
,
CL_MEM_READ_ONLY
,
sizeof
(
KerConstStatic
),
&
mem_KerConstStatic
);
mallocBufferObject
(
context
,
CL_MEM_READ_ONLY
,
sizeof
(
KerConstStatic
),
&
mem_KerConstStatic
);
mallocBufferObject
(
context
,
CL_MEM_READ_ONLY
,
sizeof
(
KerConstDynamic
),
&
mem_KerConstDynamic
);
mallocBufferObject
(
context
,
CL_MEM_READ_ONLY
,
sizeof
(
KerConstDynamic
),
&
mem_KerConstDynamic
);
mallocBufferObject
(
context
,
CL_MEM_READ_ONLY
,
size_floatgrids
,
&
mem_dockpars_fgrids
);
mallocBufferObject
(
context
,
CL_MEM_READ_ONLY
,
size_floatgrids
,
&
mem_dockpars_fgrids
);
mallocBufferObject
(
context
,
CL_MEM_READ_
ONLY
,
size_populations
,
&
mem_dockpars_conformations_current
);
mallocBufferObject
(
context
,
CL_MEM_READ_
WRITE
,
size_populations
,
&
mem_dockpars_conformations_current
);
mallocBufferObject
(
context
,
CL_MEM_READ_WRITE
,
size_energies
,
&
mem_dockpars_energies_current
);
mallocBufferObject
(
context
,
CL_MEM_READ_WRITE
,
size_energies
,
&
mem_dockpars_energies_current
);
mallocBufferObject
(
context
,
CL_MEM_READ_WRITE
,
size_populations
,
&
mem_dockpars_conformations_next
);
mallocBufferObject
(
context
,
CL_MEM_READ_WRITE
,
size_populations
,
&
mem_dockpars_conformations_next
);
mallocBufferObject
(
context
,
CL_MEM_READ_WRITE
,
size_energies
,
&
mem_dockpars_energies_next
);
mallocBufferObject
(
context
,
CL_MEM_READ_WRITE
,
size_energies
,
&
mem_dockpars_energies_next
);
...
@@ -374,9 +374,10 @@ filled with clock() */
...
@@ -374,9 +374,10 @@ filled with clock() */
setKernelArg
(
kernel1
,
0
,
sizeof
(
mem_dockpars_conformations_current
),
&
mem_dockpars_conformations_current
);
setKernelArg
(
kernel1
,
0
,
sizeof
(
mem_dockpars_conformations_current
),
&
mem_dockpars_conformations_current
);
setKernelArg
(
kernel1
,
1
,
sizeof
(
mem_dockpars_energies_current
),
&
mem_dockpars_energies_current
);
setKernelArg
(
kernel1
,
1
,
sizeof
(
mem_dockpars_energies_current
),
&
mem_dockpars_energies_current
);
setKernelArg
(
kernel1
,
2
,
sizeof
(
mem_dockpars_conformations_next
),
&
mem_dockpars_conformations_next
);
setKernelArg
(
kernel1
,
2
,
sizeof
(
mem_dockpars_conformations_next
),
&
mem_dockpars_conformations_next
);
setKernelArg
(
kernel1
,
3
,
sizeof
(
mem_dockpars_energies_next
),
&
mem_dockpars_energies_next
);
setKernelArg
(
kernel1
,
3
,
sizeof
(
mem_dockpars_energies_next
),
&
mem_dockpars_energies_next
);
setKernelArg
(
kernel1
,
4
,
sizeof
(
cl_mem
),
&
mem_DockparametersConst
);
setKernelArg
(
kernel1
,
4
,
sizeof
(
mem_dockpars_prng_states
),
&
mem_dockpars_prng_states
);
setKernelArg
(
kernel1
,
5
,
sizeof
(
mem_evals_and_generations_performed
),
&
mem_evals_and_generations_performed
);
setKernelArg
(
kernel1
,
5
,
sizeof
(
cl_mem
),
&
mem_DockparametersConst
);
setKernelArg
(
kernel1
,
6
,
sizeof
(
mem_evals_and_generations_performed
),
&
mem_evals_and_generations_performed
);
#endif // End of ENABLE_KERNEL1
#endif // End of ENABLE_KERNEL1
#ifdef ENABLE_KERNEL2 // Krnl_Conform
#ifdef ENABLE_KERNEL2 // Krnl_Conform
...
...
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