Skip to content

Commit a164b01

Browse files
committed
Remove spurious bump of ref count on devices.
Signed-off-by: James Brodman <[email protected]>
1 parent 8ed0a4c commit a164b01

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sycl/source/detail/usm/usm_impl.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,9 @@ device get_pointer_device(const void *Ptr, const context &Ctxt) {
297297
PI_CALL(piextUSMGetMemAllocInfo)(PICtx, Ptr, PI_MEM_ALLOC_DEVICE,
298298
sizeof(pi_device), &DeviceId, nullptr);
299299

300-
for (const auto D : CtxImpl->getDevices()) {
301-
// Try to find the real sycl device used in the context
302-
if (detail::pi::cast<pi_device>(D.get()) == DeviceId)
300+
for (const device &Dev : CtxImpl->getDevices()) {
301+
// Try to find the vreal sycl device used in the context
302+
if (detail::getSyclObjImpl(Dev)->getHandleRef()) == DeviceId)
303303
return D;
304304
}
305305

0 commit comments

Comments
 (0)