File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
sycl/plugins/unified_runtime/ur/adapters/level_zero Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -654,6 +654,18 @@ UR_APIEXPORT ur_result_t UR_APICALL urProgramGetBuildInfo(
654654 if (PropSizeRet) {
655655 *PropSizeRet = LogSize;
656656 }
657+ if (PropValue) {
658+ // When the program build fails in piProgramBuild(), we delayed cleaning
659+ // up the build log because RT later calls this routine to get the
660+ // failed build log.
661+ // To avoid memory leaks, we should clean up the failed build log here
662+ // because RT does not create sycl::program when piProgramBuild() fails,
663+ // thus it won't call piProgramRelease() to clean up the build log.
664+ if (Program->State == ur_program_handle_t_::Invalid) {
665+ ZE_CALL_NOCHECK (zeModuleBuildLogDestroy, (Program->ZeBuildLog ));
666+ Program->ZeBuildLog = nullptr ;
667+ }
668+ }
657669 return UR_RESULT_SUCCESS;
658670 }
659671
You can’t perform that action at this time.
0 commit comments