Skip to content

Commit 98a5357

Browse files
authored
[DeviceASAN] Move GlobalShadowOffset, DeviceType, Debug into LaunchInfo (#15773)
UR Part: oneapi-src/unified-runtime#2224
1 parent c498567 commit 98a5357

File tree

3 files changed

+116
-181
lines changed

3 files changed

+116
-181
lines changed

libdevice/include/asan_libdevice.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// NOTE This file should be sync with
1313
// unified-runtime/source/loader/layers/sanitizer/device_sanitizer_report.hpp
1414

15+
enum class DeviceType : uint32_t { UNKNOWN = 0, CPU, GPU_PVC, GPU_DG2 };
1516
enum class DeviceSanitizerErrorType : int32_t {
1617
UNKNOWN,
1718
OUT_OF_BOUNDS,
@@ -66,14 +67,20 @@ struct LocalArgsInfo {
6667
constexpr std::size_t ASAN_MAX_NUM_REPORTS = 10;
6768

6869
struct LaunchInfo {
70+
uintptr_t GlobalShadowOffset = 0;
71+
uintptr_t GlobalShadowOffsetEnd = 0;
72+
6973
uintptr_t PrivateShadowOffset = 0;
7074
uintptr_t PrivateShadowOffsetEnd = 0;
7175

7276
uintptr_t LocalShadowOffset = 0;
7377
uintptr_t LocalShadowOffsetEnd = 0;
7478

75-
uint32_t NumLocalArgs = 0;
7679
LocalArgsInfo *LocalArgs = nullptr; // Ordered by ArgIndex
80+
uint32_t NumLocalArgs = 0;
81+
82+
DeviceType DeviceTy = DeviceType::UNKNOWN;
83+
uint32_t Debug = 0;
7784

7885
DeviceSanitizerReport SanitizerReport[ASAN_MAX_NUM_REPORTS];
7986
};
@@ -106,13 +113,6 @@ const int kPrivateLeftRedzoneMagic = (char)0xf1;
106113
const int kPrivateMidRedzoneMagic = (char)0xf2;
107114
const int kPrivateRightRedzoneMagic = (char)0xf3;
108115

109-
constexpr auto kSPIR_AsanShadowMemoryGlobalStart =
110-
"__AsanShadowMemoryGlobalStart";
111-
constexpr auto kSPIR_AsanShadowMemoryGlobalEnd = "__AsanShadowMemoryGlobalEnd";
112-
113-
constexpr auto kSPIR_DeviceType = "__DeviceType";
114-
constexpr auto kSPIR_AsanDebug = "__AsanDebug";
115-
116116
constexpr auto kSPIR_AsanDeviceGlobalCount = "__AsanDeviceGlobalCount";
117117
constexpr auto kSPIR_AsanDeviceGlobalMetadata = "__AsanDeviceGlobalMetadata";
118118

libdevice/include/sanitizer_utils.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,5 @@
1313
// Treat this header as system one to workaround frontend's restriction
1414
#pragma clang system_header
1515

16-
enum DeviceType : uint64_t { UNKNOWN, CPU, GPU_PVC, GPU_DG2 };
17-
1816
extern SPIR_GLOBAL_VAR __SYCL_GLOBAL__ uint64_t *__SYCL_LOCAL__
1917
__AsanLaunchInfo;

0 commit comments

Comments
 (0)