@@ -799,9 +799,9 @@ ur_program_handle_t ProgramManager::getBuiltURProgram(
799799 RootDevImpl->getHandleRef (), UR_DEVICE_INFO_BUILD_ON_SUBDEVICE,
800800 sizeof (ur_bool_t ), &MustBuildOnSubdevice, nullptr );
801801
802- DeviceImplPtr Dev = (MustBuildOnSubdevice == true ) ? DeviceImpl : RootDevImpl;
803802 auto Context = createSyclObjFromImpl<context>(ContextImpl);
804- auto Device = createSyclObjFromImpl<device>(Dev);
803+ auto Device = createSyclObjFromImpl<device>(
804+ MustBuildOnSubdevice == true ? DeviceImpl : RootDevImpl);
805805 const RTDeviceBinaryImage &Img =
806806 getDeviceImage (KernelName, Context, Device, JITCompilationIsRequired);
807807
@@ -822,7 +822,7 @@ ur_program_handle_t ProgramManager::getBuiltURProgram(
822822 std::copy (DeviceImagesToLink.begin (), DeviceImagesToLink.end (),
823823 std::back_inserter (AllImages));
824824
825- return getBuiltURProgram (AllImages, Context, {Device});
825+ return getBuiltURProgram (AllImages, Context, {std::move ( Device) });
826826}
827827
828828ur_program_handle_t ProgramManager::getBuiltURProgram (
@@ -1000,7 +1000,7 @@ ur_program_handle_t ProgramManager::getBuiltURProgram(
10001000 }
10011001 }
10021002 // Change device in the cache key to reduce copying of spec const data.
1003- CacheKey.second = Subset;
1003+ CacheKey.second = std::move ( Subset) ;
10041004 bool DidInsert = Cache.insertBuiltProgram (CacheKey, ResProgram);
10051005 if (DidInsert) {
10061006 // For every cached copy of the program, we need to increment its
0 commit comments