Commit 0621b2fd authored by Leonardo Solis's avatar Leonardo Solis

improved Makefile to separately compile .xo krnl objs

parent 56d2c37d
This diff is collapsed.
#include "defines_krnls.h"
// --------------------------------------------------------------------------
// Conform changes the conformation of the ligand according to
// the genotype fed by any producer logic/kernel (IC, GG, LSs).
......
//IC: initial calculation of energy of populations
//GG: genetic generation
//LS: local search
//OFF: turn off
#include "../defines.h"
#define PIPE_DEPTH_16 16
#define PIPE_DEPTH_64 64
// Status of pipe operation
// Success: 0
// Failure: negative value, e.g.: -1, -2, etc
// Important: the evaluation of failure of "pipe-expr"
// must be done: (pipe-expr != PIPE_STATUS_SUCCESS),
// as a failure is characterize by any negative integer number.
typedef int nb_pipe_status;
#define PIPE_STATUS_SUCCESS 0
#define PIPE_STATUS_FAILURE -1
// Send active signal to IGL_Arbiter
// Resized to valid SDAccel depths: 16, 32, ...
pipe char pipe_ga2igl_ic_active __attribute__((xcl_reqd_pipe_depth(PIPE_DEPTH_16)));
// Send genotypes from producer (IC) to Conform
pipe float pipe_ic2conf_genotype __attribute__((xcl_reqd_pipe_depth(PIPE_DEPTH_64)));
// Send ligand-atom positions from Conform to InterE & IntraE
// Resized to valid SDAccel depths: 16, 32, ...
pipe float8 pipe_conf2intere_xyz __attribute__((xcl_reqd_pipe_depth(PIPE_DEPTH_64)));
pipe char pipe_conf2intere_actmode __attribute__((xcl_reqd_pipe_depth(PIPE_DEPTH_16)));
pipe float8 pipe_conf2intrae_xyz __attribute__((xcl_reqd_pipe_depth(PIPE_DEPTH_64)));
pipe char pipe_conf2intrae_actmode __attribute__((xcl_reqd_pipe_depth(PIPE_DEPTH_16)));
// Send energy values from InterE & IntraE to genotype-senders (IC, GG, LSs)
// Resized to valid SDAccel depths: 16, 32, ...
pipe float pipe_intere2storeic_intere __attribute__((xcl_reqd_pipe_depth(PIPE_DEPTH_16)));
pipe float pipe_intrae2storeic_intrae __attribute__((xcl_reqd_pipe_depth(PIPE_DEPTH_16)));
// Send genotype-producer-pipe selector and genotype
// from IGL_Arbiter to Conform
// Resized to valid SDAccel depths: 16, 32, ...
pipe char pipe_igl2conform_actmode __attribute__((xcl_reqd_pipe_depth(PIPE_DEPTH_16))); // active, mode
// Turn-off signal to IGL_Arbiter, Conform, InterE, IntraE
// Resized to valid SDAccel depths: 16, 32, ...
pipe int pipe_iglarbiter_off __attribute__((xcl_reqd_pipe_depth(PIPE_DEPTH_16)));
#include "defines_krnls.h"
// --------------------------------------------------------------------------
// Lamarckian Genetic-Algorithm (GA): GA + LS (Local Search)
......@@ -200,7 +152,7 @@ void Krnl_GA(
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
#include "Krnl_Conform.cl"
#include "Krnl_InterE.cl"
#include "Krnl_IntraE.cl"
//#include "Krnl_Conform.cl"
//#include "Krnl_InterE.cl"
//#include "Krnl_IntraE.cl"
#include "defines_krnls.h"
// --------------------------------------------------------------------------
// InterE calculates the intermolecular energy of a ligand given by
// ligand xyz-positions, and a receptor represented as a grid.
......
#include "defines_krnls.h"
// sqrt7 ////https://www.codeproject.com/Articles/69941/Best-Square-Root-Method-Algorithm-Function-Precisi
__attribute__((always_inline))
float sqrt_custom(const float x)
......
//IC: initial calculation of energy of populations
//GG: genetic generation
//LS: local search
//OFF: turn off
#include "../defines.h"
#define PIPE_DEPTH_16 16
#define PIPE_DEPTH_64 64
// Status of pipe operation
// Success: 0
// Failure: negative value, e.g.: -1, -2, etc
// Important: the evaluation of failure of "pipe-expr"
// must be done: (pipe-expr != PIPE_STATUS_SUCCESS),
// as a failure is characterize by any negative integer number.
typedef int nb_pipe_status;
#define PIPE_STATUS_SUCCESS 0
#define PIPE_STATUS_FAILURE -1
// Send active signal to IGL_Arbiter
// Resized to valid SDAccel depths: 16, 32, ...
pipe char pipe_ga2igl_ic_active __attribute__((xcl_reqd_pipe_depth(PIPE_DEPTH_16)));
// Send genotypes from producer (IC) to Conform
pipe float pipe_ic2conf_genotype __attribute__((xcl_reqd_pipe_depth(PIPE_DEPTH_64)));
// Send ligand-atom positions from Conform to InterE & IntraE
// Resized to valid SDAccel depths: 16, 32, ...
pipe float8 pipe_conf2intere_xyz __attribute__((xcl_reqd_pipe_depth(PIPE_DEPTH_64)));
pipe char pipe_conf2intere_actmode __attribute__((xcl_reqd_pipe_depth(PIPE_DEPTH_16)));
pipe float8 pipe_conf2intrae_xyz __attribute__((xcl_reqd_pipe_depth(PIPE_DEPTH_64)));
pipe char pipe_conf2intrae_actmode __attribute__((xcl_reqd_pipe_depth(PIPE_DEPTH_16)));
// Send energy values from InterE & IntraE to genotype-senders (IC, GG, LSs)
// Resized to valid SDAccel depths: 16, 32, ...
pipe float pipe_intere2storeic_intere __attribute__((xcl_reqd_pipe_depth(PIPE_DEPTH_16)));
pipe float pipe_intrae2storeic_intrae __attribute__((xcl_reqd_pipe_depth(PIPE_DEPTH_16)));
// Send genotype-producer-pipe selector and genotype
// from IGL_Arbiter to Conform
// Resized to valid SDAccel depths: 16, 32, ...
pipe char pipe_igl2conform_actmode __attribute__((xcl_reqd_pipe_depth(PIPE_DEPTH_16))); // active, mode
// Turn-off signal to IGL_Arbiter, Conform, InterE, IntraE
// Resized to valid SDAccel depths: 16, 32, ...
pipe int pipe_iglarbiter_off __attribute__((xcl_reqd_pipe_depth(PIPE_DEPTH_16)));
......@@ -76,7 +76,7 @@ filled with clock() */
// 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");
std::string binaryFile = xcl::find_binary_file(device_name,"docking");
cl::Program::Binaries bins = xcl::import_binary_file(binaryFile);
devices.resize(1);
cl::Program program(context, devices, bins);
......
  • Runtime on AWS after xclbin was already loaded in a previous run (other parameters were not modified):

    #runs Runtime (s)
    10 6.285
    20 6.755
    40 7.975
    80 10.568
    100 11.999
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