Skip to content

Commit 907f154

Browse files
authored
Merge pull request #1878 from yingcong-wu/yc/240719-fix-debug-async-write
[DeviceSanitizer] Extend a variable lifetime to fix a flaky failure
2 parents 9b20964 + 279f580 commit 907f154

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

source/loader/layers/sanitizer/asan_interceptor.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,9 @@ ur_result_t SanitizerInterceptor::prepareLaunch(
709709

710710
// Write debug
711711
// We use "uint64_t" here because EnqueueWriteGlobal will fail when it's "uint32_t"
712-
uint64_t Debug = Options(logger).Debug ? 1 : 0;
712+
// Because EnqueueWriteGlobal is a async write, so
713+
// we need to extend its lifetime
714+
static uint64_t Debug = Options(logger).Debug ? 1 : 0;
713715
EnqueueWriteGlobal(kSPIR_AsanDebug, &Debug, sizeof(Debug));
714716

715717
// Write shadow memory offset for global memory

0 commit comments

Comments
 (0)