@@ -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