Skip to content

Commit e08b06f

Browse files
authored
[SYCL][P2P] Fix info query for P2P (#15873)
There has been some confusion I think originating in the fact that L0 backend returned bool type instead of int for P2P queries. This issue is fixed here oneapi-src/unified-runtime#2246 This PR correspondingly updates the dpc++ runtime. Fixes #15841 --------- Signed-off-by: JackAKirk <[email protected]>
1 parent acf2ca8 commit e08b06f

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

sycl/source/device.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,6 @@ bool device::ext_oneapi_can_access_peer(const device &peer,
234234
return true;
235235
}
236236

237-
size_t returnSize = 0;
238-
int value = 0;
239-
240237
ur_exp_peer_info_t UrAttr = [&]() {
241238
switch (attr) {
242239
case ext::oneapi::peer_access::access_supported:
@@ -248,11 +245,9 @@ bool device::ext_oneapi_can_access_peer(const device &peer,
248245
"Unrecognized peer access attribute.");
249246
}();
250247
auto Adapter = impl->getAdapter();
248+
int value = 0;
251249
Adapter->call<detail::UrApiKind::urUsmP2PPeerAccessGetInfoExp>(
252-
Device, Peer, UrAttr, 0, nullptr, &returnSize);
253-
254-
Adapter->call<detail::UrApiKind::urUsmP2PPeerAccessGetInfoExp>(
255-
Device, Peer, UrAttr, returnSize, &value, nullptr);
250+
Device, Peer, UrAttr, sizeof(int), &value, nullptr);
256251

257252
return value == 1;
258253
}

0 commit comments

Comments
 (0)