Skip to content

Commit 6d2ed69

Browse files
zhaomaosupbalcer
authored andcommitted
[DeviceSanitizer] Don't report warning if write __AsanDebug failed
1 parent f31160d commit 6d2ed69

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
@@ -748,14 +748,14 @@ ur_result_t SanitizerInterceptor::prepareLaunch(
748748
}
749749

750750
// Write global variable to program
751-
auto EnqueueWriteGlobal = [Queue, Program](const char *Name,
752-
const void *Value,
753-
size_t Size) {
751+
auto EnqueueWriteGlobal = [Queue, Program](
752+
const char *Name, const void *Value,
753+
size_t Size, bool ReportWarning = true) {
754754
auto Result =
755755
getContext()->urDdiTable.Enqueue.pfnDeviceGlobalVariableWrite(
756756
Queue, Program, Name, false, Size, 0, Value, 0, nullptr,
757757
nullptr);
758-
if (Result != UR_RESULT_SUCCESS) {
758+
if (ReportWarning && Result != UR_RESULT_SUCCESS) {
759759
getContext()->logger.warning(
760760
"Failed to write device global \"{}\": {}", Name, Result);
761761
return false;
@@ -768,7 +768,7 @@ ur_result_t SanitizerInterceptor::prepareLaunch(
768768
// Because EnqueueWriteGlobal is a async write, so
769769
// we need to extend its lifetime
770770
static uint64_t Debug = Options(logger).Debug ? 1 : 0;
771-
EnqueueWriteGlobal(kSPIR_AsanDebug, &Debug, sizeof(Debug));
771+
EnqueueWriteGlobal(kSPIR_AsanDebug, &Debug, sizeof(Debug), false);
772772

773773
// Write shadow memory offset for global memory
774774
EnqueueWriteGlobal(kSPIR_AsanShadowMemoryGlobalStart,

0 commit comments

Comments
 (0)