Skip to content

Commit c2dc01d

Browse files
[SYCL] Fix dangling reference (#16925)
1 parent 41d4f25 commit c2dc01d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sycl/source/detail/program_manager/program_manager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -796,12 +796,12 @@ ur_program_handle_t ProgramManager::getBuiltURProgram(
796796
// built for the root device
797797
DeviceImplPtr RootDevImpl = DeviceImpl;
798798
while (!RootDevImpl->isRootDevice()) {
799-
const auto &ParentDev = detail::getSyclObjImpl(
799+
auto ParentDev = detail::getSyclObjImpl(
800800
RootDevImpl->get_info<info::device::parent_device>());
801801
// Sharing is allowed within a single context only
802802
if (!ContextImpl->hasDevice(ParentDev))
803803
break;
804-
RootDevImpl = ParentDev;
804+
RootDevImpl = std::move(ParentDev);
805805
}
806806

807807
ur_bool_t MustBuildOnSubdevice = true;

0 commit comments

Comments
 (0)