-
Notifications
You must be signed in to change notification settings - Fork 261
API: Add getMappedPtrs #1098
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
API: Add getMappedPtrs #1098
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,4 +34,21 @@ rkey::unpackUcpRkey(const nixlUcxEp &ep, const void *rkey_buffer) { | |
| } | ||
| return rkey; | ||
| } | ||
|
|
||
| void * | ||
| rkey::getPtr(uint64_t raddr) const { | ||
| void *ptr = nullptr; | ||
| const ucs_status_t status = ucp_rkey_ptr(rkey_.get(), raddr, &ptr); | ||
|
|
||
| if (status == UCS_OK) { | ||
| return ptr; | ||
| } | ||
|
|
||
| if (status == UCS_ERR_UNREACHABLE) { | ||
| return nullptr; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should just return ptr as |
||
| } | ||
|
Comment on lines
+47
to
+49
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why don't we throw an exception in this case? |
||
|
|
||
| throw std::runtime_error(std::string("Failed to get pointer from UCX rkey: ") + | ||
| ucs_status_string(status)); | ||
| } | ||
| } // namespace nixl::ucx | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't want to modify
std::vector<void *> &ptrsin this case.