Passing a Buffer from VPP_ACC to XO Kernel - 2023.2 English

Vitis Unified Software Platform Documentation: Application Acceleration Development (UG1393)

Document ID
UG1393
Release Date
2023-12-13
Version
2023.2 English

To go from the VSC accelerator buffer to an xrt:bo use the following code:

xrt::bo vpp::sc::get_xrt_bo(void* buf);
Tip: Be aware though that the lifetime of such a buffer will be fully controlled by the VSC runtime layer. The lifetime of a VSC buffer starts from the time it gets allocated in an iteration of the send_while loop, using vpp_acc::alloc_buf, until the end of the corresponding receive_all iteration.

For example:

Acc::send_while([=]()->bool {
    auto* Abuf = Acc::alloc_buf(Abp, size);
    xrt::bo Abo = vpp::sc::get_xrt_bo(Abuf);
    auto run = xo_kernel(Abo, ...);
    run.wait();
    ...