Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible Typo in Documentation #8796

Open
ept221 opened this issue Feb 28, 2025 · 0 comments
Open

Possible Typo in Documentation #8796

ept221 opened this issue Feb 28, 2025 · 0 comments

Comments

@ept221
Copy link

ept221 commented Feb 28, 2025

In the documentation for the XRT native APIs, under section ii Data Transfer Between Host and Device by Buffer Map API, there appears to be a typo:

The API xrt::bo::map() allows mapping the host-side buffer backing pointer to a user pointer. The host code can subsequently exercise the user pointer for the data reads and writes. However, after writing to the mapped pointer (or before reading from the mapped pointer) the API xrt::bo::sync() should be used with direction flag for the DMA operation.

It seems to me that the host-side buffer backing pointer and the user pointer are the same thing, and from the given code example that follows, it appears that what is really meant is a device-side buffer backing pointer and the user pointer:

auto input_buffer = xrt::bo(device, buffer_size_in_bytes, bank_grp_idx_0);
auto input_buffer_mapped = input_buffer.map<int*>();

for (auto i=0;i<data_size;++i) {
 input_buffer_mapped[i] = i;
}

input_buffer.sync(XCL_BO_SYNC_BO_TO_DEVICE);

If I misunderstood what's happening, I would love some insight!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant