Skip to content

[SYCL] Change kernel/program cache data structures and get rid of boost #18599

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
Jun 5, 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
8 changes: 2 additions & 6 deletions sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ if(MSVC)
endif()
endif()

include(FetchEmhash)
include(FetchUnifiedRuntime)

# The change in SYCL_MAJOR_VERSION must be accompanied with the same update in
Expand Down Expand Up @@ -213,9 +214,6 @@ install(FILES
DESTINATION "${SYCL_INCLUDE_DIR}/sycl"
COMPONENT sycl-headers)

include(AddBoostMp11Headers)
include(FetchBoostUnorderedHeaders)

# This is workaround to detect changes (add or modify) in subtree which
# are not detected by copy_directory command.
# TODO: detect and process remove header/directory case
Expand Down Expand Up @@ -250,7 +248,7 @@ add_custom_target(sycl-headers
${OUT_HEADERS_IN_SYCLCOMPAT_DIR}
${OUT_UR_HEADERS}
sycl-device-aspect-macros-header
boost_mp11-headers)
)

add_custom_command(
OUTPUT ${OUT_HEADERS_IN_SYCL_DIR}
Expand All @@ -275,7 +273,6 @@ add_custom_command(
install(DIRECTORY "${sycl_inc_dir}/sycl" DESTINATION ${SYCL_INCLUDE_DIR} COMPONENT sycl-headers)
install(DIRECTORY "${sycl_inc_dir}/CL" DESTINATION ${SYCL_INCLUDE_DIR}/ COMPONENT sycl-headers)
install(DIRECTORY "${sycl_inc_dir}/std" DESTINATION ${SYCL_INCLUDE_DIR} COMPONENT sycl-headers)
install(DIRECTORY ${BOOST_MP11_DESTINATION_DIR} DESTINATION ${SYCL_INCLUDE_DIR}/sycl/detail COMPONENT boost_mp11-headers)
install(DIRECTORY "${sycl_inc_dir}/syclcompat" DESTINATION ${SYCL_INCLUDE_DIR} COMPONENT sycl-headers)
install(FILES "${sycl_inc_dir}/syclcompat.hpp" DESTINATION ${SYCL_INCLUDE_DIR} COMPONENT sycl-headers)
install(FILES "${UNIFIED_RUNTIME_INCLUDE_DIR}/ur_api.h" DESTINATION ${SYCL_INCLUDE_DIR}
Expand Down Expand Up @@ -458,7 +455,6 @@ get_property(SYCL_TOOLCHAIN_DEPS GLOBAL PROPERTY SYCL_TOOLCHAIN_INSTALL_COMPONEN
# Listed here are component names contributing the package
set( SYCL_TOOLCHAIN_DEPLOY_COMPONENTS
append-file
boost_mp11-headers
clang
clang-offload-wrapper
clang-offload-bundler
Expand Down
54 changes: 0 additions & 54 deletions sycl/cmake/modules/AddBoostMp11Headers.cmake

This file was deleted.

101 changes: 0 additions & 101 deletions sycl/cmake/modules/FetchBoostUnorderedHeaders.cmake

This file was deleted.

21 changes: 21 additions & 0 deletions sycl/cmake/modules/FetchEmhash.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Finds or fetches emhash.
find_file(EMHASH_SYS_LOC "hash_table8.hpp" PATH_SUFFIXES "emhash")
if(NOT EMHASH_SYS_LOC)
set(EMHASH_REPO https://github.com/ktprime/emhash)
message(STATUS "Will fetch emhash from ${EMHASH_REPO}")
FetchContent_Declare(emhash
GIT_REPOSITORY ${EMHASH_REPO}
GIT_TAG 3ba9abdfdc2e0430fcc2fd8993cad31945b6a02b
SOURCE_SUBDIR emhash
)
FetchContent_MakeAvailable(emhash)

# FetchContent downloads the files into a directory with
# '-src' as the suffix and emhash has the headers in the
# top level directory in the repo, so copy the headers to a directory
# named `emhash` so source files can include with <emhash/header.hpp>
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/include/emhash)
file(GLOB HEADERS "${emhash_SOURCE_DIR}/*.h*")
file(COPY ${HEADERS} DESTINATION ${CMAKE_BINARY_DIR}/include/emhash)
set(SYCL_EMHASH_DIR ${CMAKE_BINARY_DIR}/include/ CACHE INTERNAL "")
endif()
1 change: 1 addition & 0 deletions sycl/cmake/modules/FetchUnifiedRuntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL Windows)
-DUMF_BUILD_SHARED_LIBRARY:BOOL=${UMF_BUILD_SHARED_LIBRARY}
-DUMF_LINK_HWLOC_STATICALLY:BOOL=${UMF_LINK_HWLOC_STATICALLY}
-DUMF_DISABLE_HWLOC:BOOL=${UMF_DISABLE_HWLOC}
-DSYCL_EMHASH_DIR:STRING=${SYCL_EMHASH_DIR}
# Enable d suffix in UMF
-DUMF_USE_DEBUG_POSTFIX:BOOL=ON
)
Expand Down
105 changes: 0 additions & 105 deletions sycl/cmake/modules/PreprocessBoostMp11Headers.cmake

This file was deleted.

9 changes: 9 additions & 0 deletions sycl/source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,15 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
target_include_directories(${LIB_OBJ_NAME} PRIVATE ${zstd_INCLUDE_DIR})
endif()

if (EMHASH_SYS_LOC)
# If we are using system emhash, include the system directory
# containing the emhash folder and note this location so
# other modules using emhash can find it.
cmake_path(GET EMHASH_SYS_LOC PARENT_PATH EMHASH_SYS_LOC)
set(SYCL_EMHASH_DIR ${EMHASH_SYS_LOC} CACHE INTERNAL "")
target_include_directories(${LIB_OBJ_NAME} PRIVATE ${EMHASH_SYS_LOC})
endif()

# ur_win_proxy_loader
if (WIN32)
include_directories(${LLVM_EXTERNAL_SYCL_SOURCE_DIR}/ur_win_proxy_loader)
Expand Down
2 changes: 1 addition & 1 deletion sycl/source/detail/context_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ std::optional<ur_program_handle_t> context_impl::getProgramForDevImgs(

auto KeyMappingsIt = KeyMap.find(OuterKey);
assert(KeyMappingsIt != KeyMap.end());
auto CachedProgIt = Cache.find(KeyMappingsIt->second);
auto CachedProgIt = Cache.find((*KeyMappingsIt).second);
assert(CachedProgIt != Cache.end());
BuildRes = CachedProgIt->second;
}
Expand Down
Loading