Skip to content

Commit e8182b8

Browse files
authored
Merge pull request #2035 from zhaomaosu/dont-report-warning-for-asan-debug
[DeviceSanitizer] Don't report warning if write __AsanDebug failed
2 parents 1264ec6 + 6d2ed69 commit e8182b8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

source/loader/layers/sanitizer/asan_interceptor.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -760,14 +760,14 @@ ur_result_t SanitizerInterceptor::prepareLaunch(
760760
}
761761

762762
// Write global variable to program
763-
auto EnqueueWriteGlobal = [Queue, Program](const char *Name,
764-
const void *Value,
765-
size_t Size) {
763+
auto EnqueueWriteGlobal = [Queue, Program](
764+
const char *Name, const void *Value,
765+
size_t Size, bool ReportWarning = true) {
766766
auto Result =
767767
getContext()->urDdiTable.Enqueue.pfnDeviceGlobalVariableWrite(
768768
Queue, Program, Name, false, Size, 0, Value, 0, nullptr,
769769
nullptr);
770-
if (Result != UR_RESULT_SUCCESS) {
770+
if (ReportWarning && Result != UR_RESULT_SUCCESS) {
771771
getContext()->logger.warning(
772772
"Failed to write device global \"{}\": {}", Name, Result);
773773
return false;
@@ -780,7 +780,7 @@ ur_result_t SanitizerInterceptor::prepareLaunch(
780780
// Because EnqueueWriteGlobal is a async write, so
781781
// we need to extend its lifetime
782782
static uint64_t Debug = Options(logger).Debug ? 1 : 0;
783-
EnqueueWriteGlobal(kSPIR_AsanDebug, &Debug, sizeof(Debug));
783+
EnqueueWriteGlobal(kSPIR_AsanDebug, &Debug, sizeof(Debug), false);
784784

785785
// Write shadow memory offset for global memory
786786
EnqueueWriteGlobal(kSPIR_AsanShadowMemoryGlobalStart,

0 commit comments

Comments
 (0)