Possible Typo in Documentation
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 686
- Forks
- 549
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 70
Description
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!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open the XRT native APIs documentation at the linked section, “Data Transfer Between Host and Device by Buffer Map API,” and compare the wording with the C++ example using xrt::bo::map() and xrt::bo::sync(). Confirm whether “host-side buffer backing pointer” should describe the device-side buffer backing pointer, then update the wording or clarify it so it matches the example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100