Skip to content

Commit 1e22744

Browse files
committed
[UR][DeviceASAN] Simplify shadow mapping logic for GPU device
1 parent 73adce2 commit 1e22744

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

libdevice/sanitizer_utils.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,10 @@ inline uptr MemToShadow_PVC(uptr addr, uint32_t as) {
223223

224224
auto launch_info = (__SYCL_GLOBAL__ const LaunchInfo *)__AsanLaunchInfo;
225225
if (as == ADDRESS_SPACE_GLOBAL) { // global
226-
uptr shadow_ptr;
227-
if (addr & 0xFF00000000000000) { // Device USM
228-
shadow_ptr = launch_info->GlobalShadowOffset + 0x80000000000 +
229-
((addr & 0xFFFFFFFFFFFF) >> ASAN_SHADOW_SCALE);
230-
} else { // Only consider 47bit VA
231-
shadow_ptr = launch_info->GlobalShadowOffset +
232-
((addr & 0x7FFFFFFFFFFF) >> ASAN_SHADOW_SCALE);
233-
}
226+
uptr shadow_ptr = launch_info->GlobalShadowOffset +
227+
(((((addr & 0x8000'0000'0000'0000) >> 16) + addr) &
228+
0xf'ffff'ffff'ffff) >>
229+
ASAN_SHADOW_SCALE);
234230

235231
ASAN_DEBUG(
236232
const auto shadow_offset_end = launch_info->GlobalShadowOffsetEnd;

sycl/cmake/modules/FetchUnifiedRuntime.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ if(SYCL_UR_USE_FETCH_CONTENT)
116116
CACHE PATH "Path to external '${name}' adapter source dir" FORCE)
117117
endfunction()
118118

119-
set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git")
119+
set(UNIFIED_RUNTIME_REPO "https://github.com/zhaomaosu/unified-runtime.git")
120120
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/UnifiedRuntimeTag.cmake)
121121

122122
set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES")

sycl/cmake/modules/UnifiedRuntimeTag.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# Date: Thu Oct 31 14:05:55 2024 +0000
55
# Merge pull request #2228 from nrspruit/copy_engine_refactor
66
# [L0] Refactor Copy Engine Usage checks for Performance
7-
set(UNIFIED_RUNTIME_TAG 3d58884b4939d9bd095c917f8dd823ac8486684c)
7+
set(UNIFIED_RUNTIME_TAG simplify-shadow-mapping)

0 commit comments

Comments
 (0)