Skip to content

[SYCL] Fix Coverity issues after #16228 #16313

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 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion sycl/source/detail/kernel_bundle_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class kernel_bundle_impl {
detail::ProgramManager::getInstance().build(DevImgWithDeps,
MDevices, PropList);
MDeviceImages.emplace_back(BuiltImg);
MUniqueDeviceImages.push_back(BuiltImg);
MUniqueDeviceImages.emplace_back(BuiltImg);
break;
}
case bundle_state::input:
Expand Down
16 changes: 9 additions & 7 deletions sycl/source/detail/program_manager/program_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ ur_program_handle_t ProgramManager::getBuiltURProgram(
std::copy(DeviceImagesToLink.begin(), DeviceImagesToLink.end(),
std::back_inserter(AllImages));

return getBuiltURProgram(AllImages, Context, {Device});
return getBuiltURProgram(std::move(AllImages), Context, {Device});
}

ur_program_handle_t ProgramManager::getBuiltURProgram(
Expand Down Expand Up @@ -2400,7 +2400,8 @@ ProgramManager::getSYCLDeviceImagesWithCompatibleState(
std::vector<device_image_plain> Images;
const std::set<RTDeviceBinaryImage *> &Deps = ImgInfoPair.second.Deps;
Images.reserve(Deps.size() + 1);
Images.push_back(createSyclObjFromImpl<device_image_plain>(MainImpl));
Images.push_back(
createSyclObjFromImpl<device_image_plain>(std::move(MainImpl)));
for (RTDeviceBinaryImage *Dep : Deps) {
std::shared_ptr<std::vector<sycl::kernel_id>> DepKernelIDs;
{
Expand All @@ -2414,7 +2415,8 @@ ProgramManager::getSYCLDeviceImagesWithCompatibleState(
Dep, Ctx, Devs, ImgInfoPair.second.State, DepKernelIDs,
/*PIProgram=*/nullptr);

Images.push_back(createSyclObjFromImpl<device_image_plain>(DepImpl));
Images.push_back(
createSyclObjFromImpl<device_image_plain>(std::move(DepImpl)));
}
SYCLDeviceImages.push_back(std::move(Images));
}
Expand Down Expand Up @@ -2600,7 +2602,7 @@ ProgramManager::compile(const DevImgPlainWithDeps &ImgWithDeps,
getSyclObjImpl(ObjectImpl->get_context())));

CompiledImages.push_back(
createSyclObjFromImpl<device_image_plain>(ObjectImpl));
createSyclObjFromImpl<device_image_plain>(std::move(ObjectImpl)));
}
return CompiledImages;
}
Expand Down Expand Up @@ -2775,14 +2777,14 @@ ProgramManager::build(const DevImgPlainWithDeps &DevImgWithDeps,
SpecConstMap = MainInputImpl->get_spec_const_data_ref();
}

ur_program_handle_t ResProgram =
getBuiltURProgram(BinImgs, Context, Devs, &DevImgWithDeps, SpecConstBlob);
ur_program_handle_t ResProgram = getBuiltURProgram(
std::move(BinImgs), Context, Devs, &DevImgWithDeps, SpecConstBlob);

DeviceImageImplPtr ExecImpl = std::make_shared<detail::device_image_impl>(
MainInputImpl->get_bin_image_ref(), Context, Devs,
bundle_state::executable, std::move(KernelIDs), ResProgram,
std::move(SpecConstMap), std::move(SpecConstBlob));
return createSyclObjFromImpl<device_image_plain>(ExecImpl);
return createSyclObjFromImpl<device_image_plain>(std::move(ExecImpl));
}

// When caching is enabled, the returned UrKernel will already have
Expand Down
Loading