Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions libdevice/sanitizer/asan_rtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ static __SYCL_CONSTANT__ const char __generic_to[] =

#define ASAN_DEBUG(X) \
do { \
auto launch_info = (__SYCL_GLOBAL__ const LaunchInfo *)__AsanLaunchInfo; \
auto launch_info = \
(__SYCL_GLOBAL__ const AsanRuntimeData *)__AsanLaunchInfo; \
if (launch_info->Debug) { \
X; \
} \
Expand Down Expand Up @@ -125,7 +126,7 @@ inline void ConvertGenericPointer(uptr &addr, uint32_t &as) {
}

inline uptr MemToShadow_CPU(uptr addr) {
auto launch_info = (__SYCL_GLOBAL__ const LaunchInfo *)__AsanLaunchInfo;
auto launch_info = (__SYCL_GLOBAL__ const AsanRuntimeData *)__AsanLaunchInfo;
return launch_info->GlobalShadowOffset + (addr >> ASAN_SHADOW_SCALE);
}

Expand All @@ -134,7 +135,7 @@ inline uptr MemToShadow_DG2(uptr addr, uint32_t as) {
ConvertGenericPointer(addr, as);
}

auto launch_info = (__SYCL_GLOBAL__ const LaunchInfo *)__AsanLaunchInfo;
auto launch_info = (__SYCL_GLOBAL__ const AsanRuntimeData *)__AsanLaunchInfo;
if (as == ADDRESS_SPACE_GLOBAL) { // global
uptr shadow_ptr;
if (addr & 0xFFFF000000000000ULL) { // Device USM
Expand Down Expand Up @@ -214,7 +215,7 @@ inline uptr MemToShadow_PVC(uptr addr, uint32_t as) {
ConvertGenericPointer(addr, as);
}

auto launch_info = (__SYCL_GLOBAL__ const LaunchInfo *)__AsanLaunchInfo;
auto launch_info = (__SYCL_GLOBAL__ const AsanRuntimeData *)__AsanLaunchInfo;
if (as == ADDRESS_SPACE_GLOBAL) { // global
uptr shadow_ptr;
if (addr & 0xFF00000000000000) { // Device USM
Expand Down Expand Up @@ -301,7 +302,7 @@ inline uptr MemToShadow(uptr addr, uint32_t as) {
#elif defined(__LIBDEVICE_DG2__)
shadow_ptr = MemToShadow_DG2(addr, as);
#else
auto launch_info = (__SYCL_GLOBAL__ const LaunchInfo *)__AsanLaunchInfo;
auto launch_info = (__SYCL_GLOBAL__ const AsanRuntimeData *)__AsanLaunchInfo;
if (launch_info->DeviceTy == DeviceType::CPU) {
shadow_ptr = MemToShadow_CPU(addr);
} else if (launch_info->DeviceTy == DeviceType::GPU_PVC) {
Expand Down Expand Up @@ -379,12 +380,12 @@ void __asan_internal_report_save(ErrorType error_type) {
__spirv_BuiltInWorkgroupId.y * __spirv_BuiltInNumWorkgroups.z +
__spirv_BuiltInWorkgroupId.z;

auto &SanitizerReport = ((__SYCL_GLOBAL__ LaunchInfo *)__AsanLaunchInfo)
auto &SanitizerReport = ((__SYCL_GLOBAL__ AsanRuntimeData *)__AsanLaunchInfo)
->Report[WG_LID % ASAN_MAX_NUM_REPORTS];

if (atomicCompareAndSet(
&(((__SYCL_GLOBAL__ LaunchInfo *)__AsanLaunchInfo)->ReportFlag), 1,
0) == 0 &&
&(((__SYCL_GLOBAL__ AsanRuntimeData *)__AsanLaunchInfo)->ReportFlag),
1, 0) == 0 &&
atomicCompareAndSet(&SanitizerReport.Flag, Desired, Expected) ==
Expected) {
SanitizerReport.ErrorTy = error_type;
Expand Down Expand Up @@ -415,13 +416,13 @@ void __asan_internal_report_save(
__spirv_BuiltInWorkgroupId.y * __spirv_BuiltInNumWorkgroups.z +
__spirv_BuiltInWorkgroupId.z;

auto &SanitizerReport = ((__SYCL_GLOBAL__ LaunchInfo *)__AsanLaunchInfo)
auto &SanitizerReport = ((__SYCL_GLOBAL__ AsanRuntimeData *)__AsanLaunchInfo)
->Report[WG_LID % ASAN_MAX_NUM_REPORTS];

if ((is_recover ||
atomicCompareAndSet(
&(((__SYCL_GLOBAL__ LaunchInfo *)__AsanLaunchInfo)->ReportFlag), 1,
0) == 0) &&
&(((__SYCL_GLOBAL__ AsanRuntimeData *)__AsanLaunchInfo)->ReportFlag),
1, 0) == 0) &&
atomicCompareAndSet(&SanitizerReport.Flag, Desired, Expected) ==
Expected) {

Expand Down Expand Up @@ -853,7 +854,7 @@ __asan_set_shadow_dynamic_local(uptr ptr, uint32_t num_args) {

ASAN_DEBUG(__spirv_ocl_printf(__mem_set_shadow_dynamic_local_begin));

auto *launch_info = (__SYCL_GLOBAL__ const LaunchInfo *)__AsanLaunchInfo;
auto *launch_info = (__SYCL_GLOBAL__ const AsanRuntimeData *)__AsanLaunchInfo;
if (num_args != launch_info->NumLocalArgs) {
__spirv_ocl_printf(__mem_report_arg_count_incorrect, num_args,
launch_info->NumLocalArgs);
Expand Down Expand Up @@ -887,7 +888,7 @@ __asan_unpoison_shadow_dynamic_local(uptr ptr, uint32_t num_args) {

ASAN_DEBUG(__spirv_ocl_printf(__mem_unpoison_shadow_dynamic_local_begin));

auto *launch_info = (__SYCL_GLOBAL__ const LaunchInfo *)__AsanLaunchInfo;
auto *launch_info = (__SYCL_GLOBAL__ const AsanRuntimeData *)__AsanLaunchInfo;
if (num_args != launch_info->NumLocalArgs) {
__spirv_ocl_printf(__mem_report_arg_count_incorrect, num_args,
launch_info->NumLocalArgs);
Expand Down Expand Up @@ -926,7 +927,7 @@ DEVICE_EXTERN_C_NOINLINE void __asan_set_shadow_private(uptr begin, uptr size,

ASAN_DEBUG(__spirv_ocl_printf(__mem_set_shadow_private_begin));

auto *launch_info = (__SYCL_GLOBAL__ const LaunchInfo *)__AsanLaunchInfo;
auto *launch_info = (__SYCL_GLOBAL__ const AsanRuntimeData *)__AsanLaunchInfo;
if (launch_info->PrivateShadowOffset == 0)
return;

Expand Down
2 changes: 1 addition & 1 deletion sycl/cmake/modules/FetchUnifiedRuntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ if(SYCL_UR_USE_FETCH_CONTENT)
CACHE PATH "Path to external '${name}' adapter source dir" FORCE)
endfunction()

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

set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES")
Expand Down
14 changes: 7 additions & 7 deletions sycl/cmake/modules/UnifiedRuntimeTag.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# commit 2bea25d7d5404ce82f36caf91c359f65b25187d7
# Merge: 0b5d8f9e e578228a
# Author: Kenneth Benzie (Benie) <k.benzie@codeplay.com>
# Date: Tue Dec 3 12:41:16 2024 +0000
# Merge pull request #2298 from Bensuo/ewan/cuda_update_local_size
# Improve CUDA/HIP local argument handling
set(UNIFIED_RUNTIME_TAG 2bea25d7d5404ce82f36caf91c359f65b25187d7)
# commit dbd168cbed2d2590b47904728cd5762f1c2f4c6b (HEAD, origin/main, origin/HEAD)
# Merge: 694c1b9a 27ad3f7d
# Author: Piotr Balcer <piotr.balcer@intel.com>
# Date: Mon Oct 28 16:29:45 2024 +0100
# Merge pull request #2242 from nrspruit/sysman_env_disable
# [L0] Enable Sysman Thru Env by default and have zesInit be optional
set(UNIFIED_RUNTIME_TAG use-device-usm-for-rtl-data)
Loading