Passing Buffer from XO Kernel to VPP_ACC - 2022.2 English

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

Document ID
UG1393
Release Date
2022-12-07
Version
2022.2 English

The following API can be used to pass an xrt::bo over to a VSC accelerator:

std::shared_ptr<...> vpp::sc::set_xrt_bo(xrt::device, xrt::bo, void* buf, int memBank);

This buf can then be used in the VSC accelerator compute() calls as long as the returned shared pointer keeps references.

Tip: Such buffers will not be auto-synced from/to the device, unlike buffers obtained by vpp_acc::alloc_buf.

Following is an example use case:

xrt::memory_group memA = 0; 
auto Abo = xrt::bo(device, bytes, memA);
auto Abuf = Abo.map();
auto Aref = vpp::sc::set_xrt_bo(device, Abo, Abuf, memA);
auto Bbp = my_acc::create_bufpool(vpp::input);
my_cc::send_while([=]()->bool {
    auto Bbuf = my_acc::alloc_buf(Bbp, bytes);
    my_acc::compute(Abuf, Bbuf, ...);
    ...