Skip to content

Commit c6b0a24

Browse files
authored
Merge pull request #1210 from AllanZyne/sanitizer-pr-cpu-local
[DeviceSanitizer] Support detecting out-of-bounds error on CPU Device & Static Local Memory
2 parents 5d5c810 + 0631330 commit c6b0a24

File tree

7 files changed

+401
-76
lines changed

7 files changed

+401
-76
lines changed

CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,15 @@ if(UR_ENABLE_TRACING)
126126
endif()
127127

128128
if(UR_ENABLE_SANITIZER)
129-
add_compile_definitions(UR_ENABLE_SANITIZER)
129+
if(APPLE)
130+
message(WARNING "Sanitizer layer isn't supported on macOS")
131+
set(UR_ENABLE_SANITIZER OFF)
132+
elseif(WIN32)
133+
message(WARNING "Sanitizer layer isn't supported on Windows")
134+
set(UR_ENABLE_SANITIZER OFF)
135+
else()
136+
add_compile_definitions(UR_ENABLE_SANITIZER)
137+
endif()
130138
endif()
131139

132140
if(UR_USE_ASAN)

source/loader/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,14 @@ if(UR_ENABLE_SANITIZER)
114114
${CMAKE_CURRENT_SOURCE_DIR}/layers/sanitizer/ur_sanitizer_layer.hpp
115115
${CMAKE_CURRENT_SOURCE_DIR}/layers/sanitizer/ur_sanddi.cpp
116116
)
117+
118+
target_sources(ur_loader
119+
PRIVATE
120+
${CMAKE_CURRENT_SOURCE_DIR}/layers/sanitizer/linux/san_utils.cpp
121+
)
122+
117123
target_include_directories(ur_loader PRIVATE
124+
"${CMAKE_CURRENT_SOURCE_DIR}/layers/sanitizer"
118125
"${CMAKE_CURRENT_SOURCE_DIR}/../"
119126
)
120127
endif()

0 commit comments

Comments
 (0)