Skip to content

Commit bb7cf82

Browse files
authored
[DevSAN] Construct ProgramInfo even if program link failed (#20760)
Otherwise, we may meet problem when trying to release the program
1 parent 81d32f5 commit bb7cf82

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ ur_result_t urProgramLink(
369369
if (UrRes != UR_RESULT_SUCCESS) {
370370
auto Devices = GetDevices(hContext);
371371
PrintUrBuildLogIfError(UrRes, *phProgram, Devices.data(), Devices.size());
372+
UR_CALL(getMsanInterceptor()->insertProgram(*phProgram));
372373
return UrRes;
373374
}
374375

@@ -405,6 +406,7 @@ ur_result_t urProgramLinkExp(
405406
phPrograms, pOptions, phProgram);
406407
if (UrRes != UR_RESULT_SUCCESS) {
407408
PrintUrBuildLogIfError(UrRes, *phProgram, phDevices, numDevices);
409+
UR_CALL(getMsanInterceptor()->insertProgram(*phProgram));
408410
return UrRes;
409411
}
410412

unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ ur_result_t urProgramLink(
199199
if (UrRes != UR_RESULT_SUCCESS) {
200200
auto Devices = GetDevices(hContext);
201201
PrintUrBuildLogIfError(UrRes, *phProgram, Devices.data(), Devices.size());
202+
UR_CALL(getTsanInterceptor()->insertProgram(*phProgram));
202203
return UrRes;
203204
}
204205
UR_CALL(getTsanInterceptor()->insertProgram(*phProgram));
@@ -364,6 +365,7 @@ ur_result_t urProgramLinkExp(
364365
phProgram);
365366
if (UrRes != UR_RESULT_SUCCESS) {
366367
PrintUrBuildLogIfError(UrRes, *phProgram, phDevices, numDevices);
368+
UR_CALL(getTsanInterceptor()->insertProgram(*phProgram));
367369
return UrRes;
368370
}
369371

0 commit comments

Comments
 (0)