Commit 9c260edd authored by Leonardo Solis's avatar Leonardo Solis
Browse files

#47, dummy global pointer connected to bank3 + writes assigned to bank 2


Former-commit-id: 2374721f
parent 66ced555
......@@ -159,7 +159,7 @@ opencl_LDFLAGS=-L$(OPENCL_LIB) -L$(SDA_LIB) -lxilinxopencl -pthread
# --max_memory_ports Krnl_InterE \
# --max_memory_ports Krnl_IntraE
#Krnl_GA_CLFLAGS=--max_memory_ports Krnl_GA
Krnl_GA_CLFLAGS=--max_memory_ports Krnl_GA
# https://www.xilinx.com/support/documentation/sw_manuals/xilinx2017_4/ug1023-sdaccel-user-guide.pdf
# Page 44
......@@ -173,10 +173,23 @@ opencl_LDFLAGS=-L$(OPENCL_LIB) -L$(SDA_LIB) -lxilinxopencl -pthread
# --sp Krnl_InterE_1.m_axi_gmem:bank2 \
# --sp Krnl_IntraE_1.m_axi_gmem:bank3
Krnl_GA_LDCLFLAGS+=--sp Krnl_GA_1.m_axi_gmem:bank0 \
#Krnl_GA_LDCLFLAGS+=--sp Krnl_GA_1.m_axi_gmem:bank0 \
# --sp Krnl_Conform_1.m_axi_gmem:bank0 \
# --sp Krnl_InterE_1.m_axi_gmem:bank1 \
# --sp Krnl_IntraE_1.m_axi_gmem:bank1
Krnl_GA_LDCLFLAGS+=--sp Krnl_GA_1.m_axi_gmem0:bank0 \
--sp Krnl_GA_1.m_axi_gmem1:bank2 \
--sp Krnl_GA_1.m_axi_gmem2:bank2 \
--sp Krnl_GA_1.m_axi_gmem3:bank2 \
--sp Krnl_GA_1.m_axi_gmem4:bank2 \
--sp Krnl_Conform_1.m_axi_gmem:bank0 \
--sp Krnl_InterE_1.m_axi_gmem:bank1 \
--sp Krnl_IntraE_1.m_axi_gmem:bank1
--sp Krnl_IntraE_1.m_axi_gmem:bank1 \
--sp Krnl_IGL_Arbiter_1.m_axi_gmem:bank3 \
--sp Krnl_Prng_BT_ushort_float_1.m_axi_gmem:bank3 \
--sp Krnl_Prng_GG_uchar_1.m_axi_gmem:bank3 \
--sp Krnl_Prng_GG_float_1.m_axi_gmem:bank3
##
# https://www.xilinx.com/support/documentation/sw_manuals/xilinx2017_4/ug1281-sdaccel-debugging-guide.pdf
......
......@@ -352,12 +352,18 @@ filled with clock() */
cl_mem_ext_ptr_t memExt_KerConstStatic_dspars_S_const;
cl_mem_ext_ptr_t memExt_KerConstStatic_dspars_V_const;
#if !defined(SW_EMU)
cl_mem_ext_ptr_t memExt_dummy;
#endif
// Specify Bank0 Memory for Krnl_GA & Krnl_Conform
memExt_dockpars_conformations_current_Initial.flags = XCL_MEM_DDR_BANK0;
memExt_dockpars_conformations_current_Final.flags = XCL_MEM_DDR_BANK0;
memExt_dockpars_energies_current.flags = XCL_MEM_DDR_BANK0;
memExt_evals_performed.flags = XCL_MEM_DDR_BANK0;
memExt_gens_performed.flags = XCL_MEM_DDR_BANK0;
memExt_dockpars_conformations_current_Final.flags = /*XCL_MEM_DDR_BANK0*/XCL_MEM_DDR_BANK2;
memExt_dockpars_energies_current.flags = /*XCL_MEM_DDR_BANK0*/XCL_MEM_DDR_BANK2;
memExt_evals_performed.flags = /*XCL_MEM_DDR_BANK0*/XCL_MEM_DDR_BANK2;
memExt_gens_performed.flags = /*XCL_MEM_DDR_BANK0*/XCL_MEM_DDR_BANK2;
memExt_KerConstStatic_rotlist_const.flags = XCL_MEM_DDR_BANK0;
memExt_KerConstStatic_ref_coords_const.flags = XCL_MEM_DDR_BANK0;
memExt_KerConstStatic_rotbonds_moving_vectors_const.flags = XCL_MEM_DDR_BANK0;
......@@ -380,6 +386,10 @@ filled with clock() */
memExt_KerConstStatic_dspars_S_const.flags = XCL_MEM_DDR_BANK1;
memExt_KerConstStatic_dspars_V_const.flags = XCL_MEM_DDR_BANK1;
#if !defined(SW_EMU)
memExt_dummy.flags = XCL_MEM_DDR_BANK3;
#endif
// Specifying the mapping from host arrays to Krnl_GA & Krnl_Conform
memExt_dockpars_conformations_current_Initial.obj = cpu_init_populations.data();
memExt_dockpars_conformations_current_Final.obj = cpu_final_populations.data();
......@@ -408,6 +418,12 @@ filled with clock() */
memExt_KerConstStatic_dspars_S_const.obj = &KerConstStatic.dspars_S_const[0];
memExt_KerConstStatic_dspars_V_const.obj = &KerConstStatic.dspars_V_const[0];
#if !defined(SW_EMU)
//allocating CPU memory for dummy data (one integer)
vector<int,aligned_allocator<int>> cpu_dummy (1);
memExt_dummy.obj = cpu_dummy.data();
#endif
// Setting param to zero
memExt_dockpars_conformations_current_Initial.param = 0;
memExt_dockpars_conformations_current_Final.param = 0;
......@@ -434,6 +450,10 @@ filled with clock() */
memExt_KerConstStatic_dspars_S_const.param = 0;
memExt_KerConstStatic_dspars_V_const.param = 0;
#if !defined(SW_EMU)
memExt_dummy.param = 0;
#endif
// -----------------------------------------------------------------------------------------------------
// Krnl_GA buffers
cl::Buffer mem_dockpars_conformations_current_Initial
......@@ -502,12 +522,10 @@ filled with clock() */
cl::Buffer mem_KerConstStatic_dspars_V_const (context, CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR | CL_MEM_EXT_PTR_XILINX,
MAX_NUM_OF_ATYPES*sizeof(float), &memExt_KerConstStatic_dspars_V_const);
#if !defined(SW_EMU)
//allocating CPU memory for dummy data (one integer)
vector<int,aligned_allocator<int>> cpu_dummy (1);
// IMPORTANT: enable this dummy global argument only for "hw" build.
// https://forums.xilinx.com/t5/SDAccel/ERROR-KernelCheck-83-114-in-sdx-2017-4/td-p/818135
cl::Buffer mem_dummy (context, CL_MEM_USE_HOST_PTR | CL_MEM_READ_ONLY, sizeof(int), cpu_dummy.data());
cl::Buffer mem_dummy (context, CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR | CL_MEM_EXT_PTR_XILINX,
sizeof(int), &memExt_dummy);
#endif
// -----------------------------------------------------------------------------------------------------
//Separate Read/write Buffer vector is needed to migrate data between host/device
......@@ -538,6 +556,10 @@ filled with clock() */
inBufVec.push_back(mem_KerConstStatic_dspars_S_const);
inBufVec.push_back(mem_KerConstStatic_dspars_V_const);
#if !defined(SW_EMU)
inBufVec.push_back(mem_dummy);
#endif
// Krnl_GA
outBufVec.push_back(mem_dockpars_conformations_current_Final);
outBufVec.push_back(mem_dockpars_energies_current);
......
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