cancel
Showing results for 
Search instead for 
Did you mean: 
Observer
Observer
348 Views
Registered: ‎06-30-2019

How to make a buffer stay in global memory?

I am developing an accelerator for database query execution. I have an index and 4 kernels. I wonder: 1. I put the index into a buffer. I would like to make this buffer shared by the 4 kernels. Can this be done? If I just enqueue this buffer to every kernel, will there be 4 copies of this buffer or only one? 2. There are several iterations in the algorithm. In each iteration the shared buffer ( the index ) doesn't change while other input buffers do. How to make the shared buffer always stay in global memory?
0 Kudos
6 Replies
Highlighted
Xilinx Employee
Xilinx Employee
298 Views
Registered: ‎10-19-2015

Re: How to make a buffer stay in global memory?

Hi @662ldd 

Have you looked at the Sdaccel programmers guide (UG1277 v2019.1)? There is a section on connecting kernel ports to global memory. 

It is possible to connect more than one kernel to a single DDR bank, but only one kernel can access the bank at a time. 

Specify kernel port to global memory connection during the linking stage with the --sp switch.

How would you queue the buffer to every kernel? 

Regards,

M

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Highlighted
Observer
Observer
279 Views
Registered: ‎06-30-2019

Re: How to make a buffer stay in global memory?

Thanks for your reply! This is how I am planning to do: 1st. enqueue the buffer I want to share among kernels. 2nd.set this buffer as the arguement of every kernel respectively. 3rd. enqueue the kernels and every kernels can read from the shared buffer. Based on your reply, one buffer have only one bank access at a time. Does it mean that what I am going to do is impossible?
0 Kudos
Highlighted
Observer
Observer
272 Views
Registered: ‎06-30-2019

Re: How to make a buffer stay in global memory?

Thanks for your reply! @mcertosi

My last post seems to have some format errors. So I repost here.

This is how I am planning to do:

1st. enqueue the buffer I want to share among kernels.

2nd.set this buffer as the arguement of every kernel respectively.

3rd. enqueue the kernels and every kernels can read from the shared buffer.

Based on your reply, one buffer have only one bank access at a time. Does it mean that what I am going to do is impossible?

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
263 Views
Registered: ‎10-19-2015

Re: How to make a buffer stay in global memory?

Hi @662ldd 

From the documentation it seems like what you are trying to do is possible, but if your kernels are operating independent of each other you might run into bottleneck problems when two kernels want to access the shared buffer at the same time. This would force one of the kernels to wait while the other is serviced. 

How large is your shared buffer? Could you place it in on-chip BRAM?

Regards,

M

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Highlighted
Observer
Observer
230 Views
Registered: ‎06-30-2019

Re: How to make a buffer stay in global memory?

Thanks for your reply @mcertosi

The data I would like to share is quite large and is divided into several shared buffers. However, at each iteration only 2 of them are needed.  The total size will be about 10G so BRAM may be not enough.

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
191 Views
Registered: ‎10-19-2015

Re: How to make a buffer stay in global memory?

Hi @662ldd 

Looks like your only option is to place the buffer in shared global ddr memory. 

Did this work? You could try to check this in hardware emulation to speed up the debug cycle. 

Regards,

M

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos