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, ...);
...