Commit c15a9736 authored by Leonardo Solis's avatar Leonardo Solis
Browse files

#31, party ported opencl setup: several changes

compiles but errors are detected in swemu
parent 12af7ce0
......@@ -113,7 +113,7 @@ CXXFLAGS:=-Wall -O0 -g -std=c++14 $(OTHER_FLAGS)
# Host Application
hostbin_SRCS=$(wildcard ../common/src/AOCLUtils/*.cpp wrapcl/src/*.cpp host/src/*.cpp) \
hostbin_SRCS=$(wildcard ./host/src/*.cpp) \
$(oclHelper_SRCS) \
$(xcl2_SRCS)
......@@ -391,8 +391,8 @@ kerrpt-sw:
# Compile for sw and hw emulation
kerswemu:
make all TARGETS=sw_emu DEVICES=$(BOARD)
cp ./xclbin/$(XCLBINS).sw_emu.*.xclbin .
mv ./$(XCLBINS).sw_emu.*.xclbin ./$(XCLBINS).xclbin
#cp ./xclbin/$(XCLBINS).sw_emu.*.xclbin .
#mv ./$(XCLBINS).sw_emu.*.xclbin ./$(XCLBINS).xclbin
@echo $(newline)
@echo "==============================================================================="
@echo "INFO: sw emulation file created under: \"./xclbin/$(XCLBINS).sw_emu.*.xclbin\" "
......
......@@ -24,7 +24,11 @@
#include "Kernels.h"
//#include "ImportBinary.h"
//#include "ImportSource.h"
#include "BufferObjects.h"
#include "BufferObjects.h"
#include "xcl2.hpp"
#include <vector>
using std::vector;
#define ELAPSEDSECS(stop,start) ((float) stop-start)/((float) CLOCKS_PER_SEC)
......
......@@ -16,6 +16,10 @@
#include "miscellaneous.h"
// Added for allocating fgrids
#include <vector>
using std::vector;
#define getvalue_4Darr(mempoi, grinf, t, z, y, x) *(mempoi + (grinf).size_xyz[0] * (y + (grinf).size_xyz[1] * (z + (grinf).size_xyz[2]*t)) + x)
#define getvalue_4Darr_withsize(mempoi, gridsize_xyz, t, z, y, x) *(mempoi + gridsize_xyz[0]*(y + gridsize_xyz[1] * (z + gridsize_xyz[2]*t)) + x)
//The macro helps to access the grid point values
......@@ -41,6 +45,6 @@ typedef struct
int get_gridinfo(const char*, Gridinfo*);
int get_gridvalues_f(const Gridinfo* mygrid,
float** fgrids);
float* fgrids);
#endif /* PROCESSGRID_H_ */
......@@ -26,8 +26,6 @@ int main(int argc, char* argv[])
Liganddata myligand_init;
Dockpars mypars;
float* floatgrids;
clock_t clock_start_program, clock_stop_program;
......@@ -57,6 +55,11 @@ int main(int argc, char* argv[])
if (get_gridinfo(mypars.fldfile, &mygrid) != 0)
return 1;
//allocating CPU memory for floatgrids
size_t size_fgrid_nelems = (mygrid.num_of_atypes+2) * mygrid.size_xyz[0] * mygrid.size_xyz[1] * mygrid.size_xyz[2];
vector<float,aligned_allocator<float>> floatgrids(size_fgrid_nelems);
// Filling the atom types filed of myligand according to the grid types
if (init_liganddata(mypars.ligandfile, &myligand_init, &mygrid) != 0)
return 1;
......@@ -66,7 +69,7 @@ int main(int argc, char* argv[])
return 1;
//Reading the grid files and storing values in the memory region pointed by floatgrids
if (get_gridvalues_f(&mygrid, &floatgrids) != 0)
if (get_gridvalues_f(&mygrid, floatgrids.data()) != 0)
return 1;
//------------------------------------------------------------
......@@ -85,7 +88,7 @@ int main(int argc, char* argv[])
print_ref_lig_energies_f(myligand_init,
mypars.smooth,
mygrid,
floatgrids,
floatgrids.data(),
mypars.coeffs.scaled_AD4_coeff_elec,
mypars.coeffs.AD4_coeff_desolv,
mypars.qasp);
......@@ -94,11 +97,9 @@ int main(int argc, char* argv[])
//------------------------------------------------------------
// Starting Docking
//------------------------------------------------------------
if (docking_with_gpu(&mygrid, floatgrids, &mypars, &myligand_init, &argc, argv, clock_start_program) != 0)
if (docking_with_gpu(&mygrid, floatgrids.data(), &mypars, &myligand_init, &argc, argv, clock_start_program) != 0)
return 1;
if(floatgrids) {free(floatgrids);}
/*
clock_stop_program = clock();
printf("Program run time: %.3f sec\n", ELAPSEDSECS(clock_stop_program, clock_start_program));
......
#include "processgrid.h"
#include "AOCLUtils/aocl_utils.h"
using namespace aocl_utils;
int get_gridinfo(const char* fldfilename, Gridinfo* mygrid)
{
......@@ -99,7 +96,7 @@ int get_gridinfo(const char* fldfilename, Gridinfo* mygrid)
return 0;
}
int get_gridvalues_f(const Gridinfo* mygrid, float** fgrids)
int get_gridvalues_f(const Gridinfo* mygrid, float* fgrids)
//The function reads the grid point values from the .map files
//that correspond to the receptor given by the first parameter.
//It allocates the proper amount of memory and stores the data there,
......@@ -112,23 +109,13 @@ int get_gridvalues_f(const Gridinfo* mygrid, float** fgrids)
char tempstr [128];
float* mypoi;
/*
*fgrids = (float*) malloc((sizeof(float))*(mygrid->num_of_atypes+2)*
(mygrid->size_xyz[0])*
(mygrid->size_xyz[1])*
(mygrid->size_xyz[2]));
*/
*fgrids = (float*) alignedMalloc((sizeof(float))*(mygrid->num_of_atypes+2)*
(mygrid->size_xyz[0])*
(mygrid->size_xyz[1])*
(mygrid->size_xyz[2]));
if (*fgrids == NULL)
if (fgrids == NULL)
{
printf("Error: not enough memory!\n");
return 1;
}
mypoi = *fgrids;
mypoi = fgrids;
for (t=0; t < mygrid->num_of_atypes+2; t++)
{
......
  • Errors in swemu:

    emconfigutil --platform /home/wimi/lvs/DSA_SDACCEL_AWS_VU9P/xilinx_aws-vu9p-f1-04261818_dynamic_5_0/xilinx_aws-vu9p-f1-04261818_dynamic_5_0.xpfm --nd 1
    
    ****** configutil v2017.4 (64-bit)
      **** SW Build 2086221 on Fri Dec 15 20:54:30 MST 2017
        ** Copyright 1986-2017 Xilinx, Inc. All Rights Reserved.
    
    INFO: [ConfigUtil 60-895]    Target platform: /home/wimi/lvs/DSA_SDACCEL_AWS_VU9P/xilinx_aws-vu9p-f1-04261818_dynamic_5_0/xilinx_aws-vu9p-f1-04261818_dynamic_5_0.xpfm
    emulation configuration file `emconfig.json` is created in current working directory 
    XCL_EMULATION_MODE=sw_emu ./hostbin \
    	-ffile input/1stp/derived/1stp_protein.maps.fld \
    	-lfile input/1stp/derived/1stp_ligand.pdbqt \
    	-psize 150 -nrun 10 -nev 800000 -ngen 27000 -gfpop 1
    Found Platform
    Platform Name: Xilinx
    Found Device=xilinx_aws-vu9p-f1-04261818_dynamic_5_0
    XCLBIN File Name: Krnl_GA
    INFO: Importing xclbin/Krnl_GA.sw_emu.xilinx_aws-vu9p-f1-04261818_dynamic_5_0.xclbin
    Loading: 'xclbin/Krnl_GA.sw_emu.xilinx_aws-vu9p-f1-04261818_dynamic_5_0.xclbin'
    WARNING: unaligned host pointer '0x7ffc880a5600' detected, this leads to extra memcpy
    WARNING: unaligned host pointer '0x7ffc880a5800' detected, this leads to extra memcpy
    WARNING: unaligned host pointer '0x7ffc880a5a00' detected, this leads to extra memcpy
    WARNING: unaligned host pointer '0x7ffc88090180' detected, this leads to extra memcpy
    WARNING: unaligned host pointer '0x7ffc88090180' detected, this leads to extra memcpy
    WARNING: unaligned host pointer '0x7ffc8809ff00' detected, this leads to extra memcpy
    WARNING: unaligned host pointer '0x7ffc8809ff80' detected, this leads to extra memcpy
    WARNING: unaligned host pointer '0x7ffc880a0080' detected, this leads to extra memcpy
    WARNING: unaligned host pointer '0x7ffc880a0400' detected, this leads to extra memcpy
    WARNING: unaligned host pointer '0x7ffc880a0800' detected, this leads to extra memcpy
    WARNING: unaligned host pointer '0x7ffc880a0b40' detected, this leads to extra memcpy
    WARNING: unaligned host pointer '0x7ffc880a0b80' detected, this leads to extra memcpy
    ERROR: Invalid scalar argument size, expected 1 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_GA", argument index 15.
    
    ERROR: Invalid scalar argument size, expected 1 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_Conform", argument index 6.
    
    ERROR: Invalid scalar argument size, expected 1 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_Prng_GG_uchar", argument index 1.
    
    ERROR: Invalid scalar argument size, expected 1 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_Prng_GG_float", argument index 1.
    
    ERROR: Invalid scalar argument size, expected 1 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_Prng_LS_float", argument index 1.
    
    ERROR: Invalid scalar argument size, expected 1 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_Prng_LS2_float", argument index 1.
    
    ERROR: Invalid scalar argument size, expected 1 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_Prng_LS3_float", argument index 1.
    
    ERROR: Invalid scalar argument size, expected 1 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_Prng_LS4_float", argument index 1.
    
    ERROR: Invalid scalar argument size, expected 1 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_Prng_LS5_float", argument index 1.
    
    ERROR: Invalid scalar argument size, expected 1 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_Prng_LS6_float", argument index 1.
    
    ERROR: Invalid scalar argument size, expected 1 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_Prng_LS7_float", argument index 1.
    
    ERROR: Invalid scalar argument size, expected 1 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_Prng_LS8_float", argument index 1.
    
    ERROR: Invalid scalar argument size, expected 1 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_Prng_LS9_float", argument index 1.
    
    ERROR: Invalid scalar argument size, expected 1 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_LS", argument index 3.
    
    ERROR: Invalid scalar argument size, expected 1 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_LS2", argument index 3.
    
    ERROR: Invalid scalar argument size, expected 1 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_LS3", argument index 3.
    
    ERROR: Invalid scalar argument size, expected 1 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_LS4", argument index 3.
    
    ERROR: Invalid scalar argument size, expected 1 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_LS5", argument index 3.
    
    ERROR: Invalid scalar argument size, expected 1 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_LS6", argument index 3.
    
    ERROR: Invalid scalar argument size, expected 1 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_LS7", argument index 3.
    
    ERROR: Invalid scalar argument size, expected 1 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_LS8", argument index 3.
    
    ERROR: Invalid scalar argument size, expected 1 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_LS9", argument index 3.
    
    Docking runs to be executed: 10
    Execution run:  1ERROR: Invalid scalar argument size, expected 2 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_GA", argument index 16.
    
    ERROR: Invalid scalar argument size, expected 2 got 4
    ERROR: clSetKernelArg() for kernel "Krnl_Conform", argument index 8.
    
    ERROR: Kernel arg 'DockConst_num_of_genes' is not set
    ERROR: Kernel arg 'DockConst_num_of_genes' is not set
    ERROR: Kernel arg 'DockConst_num_of_genes' is not set
    ERROR: Kernel arg 'DockConst_num_of_genes' is not set
    ERROR: Kernel arg 'DockConst_num_of_genes' is not set
    ERROR: Kernel arg 'DockConst_num_of_genes' is not set
    ERROR: Kernel arg 'DockConst_num_of_genes' is not set
    ERROR: Kernel arg 'DockConst_num_of_genes' is not set
    ERROR: Kernel arg 'DockConst_num_of_genes' is not set
    ERROR: Kernel arg 'DockConst_num_of_genes' is not set
    ERROR: Kernel arg 'DockConst_num_of_genes' is not set
    ERROR: Kernel arg 'DockConst_num_of_genes' is not set
    ERROR: Kernel arg 'DockConst_num_of_genes' is not set
    ERROR: Kernel arg 'DockConst_num_of_genes' is not set
    ERROR: Kernel arg 'DockConst_num_of_genes' is not set
    ERROR: Kernel arg 'DockConst_num_of_genes' is not set
    ERROR: Kernel arg 'DockConst_num_of_genes' is not set
    ERROR: Kernel arg 'DockConst_num_of_genes' is not set
    ERROR: Kernel arg 'DockConst_num_of_genes' is not set
    ERROR: Kernel arg 'DockConst_num_of_genes' is not set
    ERROR: Kernel arg 'DockConst_num_of_genes' is not set
    ERROR: Kernel arg 'DockConst_num_of_genes' is not set
    ^Cmake: *** [swemu] Interrupt
  • mentioned in commit 0f7b2a04

    Toggle commit list
  • mentioned in commit 4ea7a602

    Toggle commit list
  • mentioned in commit da08a6a0

    Toggle commit list
  • mentioned in commit 0f29771b

    Toggle commit list
  • mentioned in commit 740a515a

    Toggle commit list
  • mentioned in commit 03926704

    Toggle commit list
Supports Markdown
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