Host Buffer Alignment - 2019.2 English

Vitis Guidance Messaging (UG1315)

Document ID
UG1315
Release Date
2019-10-30
Version
2019.2 English

Description

While creating a buffer in the host code, ensure the memory pointer is page-aligned.

Explanation

Xilinx® Runtime (XRT) prefers page-aligned memory for efficient data transfer to and from the FPGA. If the buffer pointer is not aligned to a page boundary, XRT performs extra memcpy to make it aligned. This extra memcpy operation can be avoided if host-code memory is aligned to page-boundary.

Resolution

Use posix_memalign, aligned_alloc, _aligned_malloc, and so on to align the cl_buffer host pointer aligned to the Page boundary.