Skip to content

[SYCL][UR] Fix P2P Access Get Info Query #15152

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

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions sycl/source/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,11 @@ bool device::ext_oneapi_can_access_peer(const device &peer,
"Unrecognized peer access attribute.");
}();
auto Plugin = impl->getPlugin();
Plugin->call(urUsmP2PPeerAccessGetInfoExp, Device, Peer, UrAttr, sizeof(int),
&value, &returnSize);
Plugin->call(urUsmP2PPeerAccessGetInfoExp, Device, Peer, UrAttr, 0, nullptr,
&returnSize);

Plugin->call(urUsmP2PPeerAccessGetInfoExp, Device, Peer, UrAttr, returnSize,
&value, nullptr);
Comment on lines +253 to +254
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raiyanla , can underlying UR adapter return more than sizeof(int) bytes of data here? If so, we'll write beyond value's storage. If not, what was the issue before?

Copy link
Contributor Author

@raiyanla raiyanla Aug 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Underlying Adapter only returns sizeof(int) max. I think the issue was possibly more with querying for both the returnSize and value at same time. I saw it was returning garbage numbers each time until this PR. All the adapters use the same helper in the implementation for this, and I'm guessing it doesn't set value properly if returnSize is being queried for at the same time. I will need to confirm when I have access to an appropriate machine though.


return value == 1;
}
Expand Down
Loading