Skip to content

[SYCL] Fix kernel_compiler leak. #12120

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 1 commit into from
Dec 8, 2023
Merged
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
6 changes: 2 additions & 4 deletions sycl/source/detail/kernel_bundle_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,7 @@ class kernel_bundle_impl {
const PluginPtr &Plugin = ContextImpl->getPlugin();
Plugin->call<PiApiKind::piProgramCreate>(
ContextImpl->getHandleRef(), spirv.data(), spirv.size(), &PiProgram);

Plugin->call<PiApiKind::piProgramRetain>(PiProgram);
// program created by piProgramCreate is implicitly retained.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
// program created by piProgramCreate is implicitly retained.
// Program created by piProgramCreate is implicitly retained.


std::vector<pi::PiDevice> DeviceVec;
DeviceVec.reserve(Devices.size());
Expand Down Expand Up @@ -437,8 +436,7 @@ class kernel_bundle_impl {
const PluginPtr &Plugin = ContextImpl->getPlugin();
sycl::detail::pi::PiKernel PiKernel = nullptr;
Plugin->call<PiApiKind::piKernelCreate>(PiProgram, Name.c_str(), &PiKernel);

Plugin->call<PiApiKind::piKernelRetain>(PiKernel);
// Kernel created by piKernelCreate is implicitly retained.

std::shared_ptr<kernel_impl> KernelImpl = std::make_shared<kernel_impl>(
PiKernel, detail::getSyclObjImpl(MContext), Self);
Expand Down