Skip to content

Module leak #8153

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 7 commits into from
Mar 7, 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
13 changes: 12 additions & 1 deletion sycl/plugins/level_zero/pi_level_zero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3842,9 +3842,16 @@ pi_result piProgramBuild(pi_program Program, pi_uint32 NumDevices,
if (ZeResult != ZE_RESULT_SUCCESS) {
// We adjust pi_program below to avoid attempting to release zeModule when
// RT calls piProgramRelease().
ZeModule = nullptr;
Program->State = _pi_program::Invalid;
Result = mapError(ZeResult);
if (Program->ZeBuildLog) {
ZE_CALL_NOCHECK(zeModuleBuildLogDestroy, (Program->ZeBuildLog));
Copy link
Contributor

Choose a reason for hiding this comment

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

@bso-intel, @againull : this change causes a regression that build-log is destroyed before SYCL RT reads it (to report to the user). Please revert (or re-work) the patch

Program->ZeBuildLog = nullptr;
}
if (ZeModule) {
ZE_CALL_NOCHECK(zeModuleDestroy, (ZeModule));
ZeModule = nullptr;
}
} else {
// The call to zeModuleCreate does not report an error if there are
// unresolved symbols because it thinks these could be resolved later via a
Expand All @@ -3857,6 +3864,10 @@ pi_result piProgramBuild(pi_program Program, pi_uint32 NumDevices,
Result = (ZeResult == ZE_RESULT_ERROR_MODULE_LINK_FAILURE)
? PI_ERROR_BUILD_PROGRAM_FAILURE
: mapError(ZeResult);
if (ZeModule) {
ZE_CALL_NOCHECK(zeModuleDestroy, (ZeModule));
ZeModule = nullptr;
}
}
}

Expand Down