Skip to content

[SYCL] Fix build with XPTI disabled #18269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 1, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,12 @@ if (NOT WIN32)
COMPONENT sycl-headers-extras)
endif()

if(SYCL_ENABLE_XPTI_TRACING AND
DEFINED LLVM_EXTERNAL_PROJECTS AND
(NOT "xpti" IN_LIST LLVM_EXTERNAL_PROJECTS OR NOT "xptifw" IN_LIST LLVM_EXTERNAL_PROJECTS))
message(FATAL_ERROR "SYCL_ENABLE_XPTI_TRACING=ON but XPTI is not going to be built")
endif()

if (SYCL_ENABLE_XPTI_TRACING)
if (MSVC)
set(XPTIFW_LIBS xpti xptid xptifw xptifwd)
Expand Down
4 changes: 2 additions & 2 deletions sycl/cmake/modules/FetchUnifiedRuntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ set(UR_BUILD_TESTS "${SYCL_UR_BUILD_TESTS}" CACHE BOOL "" FORCE)
set(UR_BUILD_EXAMPLES "${SYCL_UR_BUILD_TESTS}" CACHE BOOL "" FORCE)

# Here we override the defaults to unified-runtime
set(UR_BUILD_XPTI_LIBS OFF)
set(UR_BUILD_XPTI_LIBS OFF CACHE BOOL "")
set(UR_ENABLE_SYMBOLIZER ON CACHE BOOL "Enable symbolizer for sanitizer layer.")
set(UR_ENABLE_TRACING ON)
set(UR_ENABLE_TRACING ON CACHE BOOL "")

set(UR_EXTERNAL_DEPENDENCIES "sycl-headers" CACHE STRING
"List of external CMake targets for executables/libraries to depend on" FORCE)
Expand Down
2 changes: 1 addition & 1 deletion sycl/unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if (LLVM_ENABLE_ZSTD)
endif()

# TODO Enable xpti tests for Windows
if (NOT WIN32)
if (SYCL_ENABLE_XPTI_TRACING AND NOT WIN32)
add_subdirectory(xpti_trace)
endif()
add_subdirectory(sampler)
Expand Down
7 changes: 7 additions & 0 deletions unified-runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ else()
set(UR_DPCXX_DEPS "")
endif()

if(NOT UR_STANDALONE_BUILD AND
UR_ENABLE_TRACING AND
DEFINED LLVM_EXTERNAL_PROJECTS AND
(NOT "xpti" IN_LIST LLVM_EXTERNAL_PROJECTS OR NOT "xptifw" IN_LIST LLVM_EXTERNAL_PROJECTS))
message(FATAL_ERROR "UR_ENABLE_TRACING=ON but XPTI is not going to be built")
endif()

if(UR_ENABLE_TRACING)
add_compile_definitions(UR_ENABLE_TRACING)

Expand Down