Build: Upgrade DPC++ compiler to 5.2 release

This commit is contained in:
Xavier Hallade
2024-05-24 20:34:28 +02:00
committed by Xavier Hallade
parent 98dd62ebda
commit d8b3f852b9
8 changed files with 278 additions and 257 deletions

View File

@@ -158,6 +158,7 @@ download_source(ICDLOADER)
download_source(MP11)
download_source(SPIRV_HEADERS)
download_source(UNIFIED_RUNTIME)
download_source(UNIFIED_MEMORY_FRAMEWORK)
download_source(IGC)
download_source(IGC_LLVM)
download_source(IGC_OPENCL_CLANG)

View File

@@ -41,9 +41,11 @@ set(DPCPP_EXTRA_ARGS
-DOpenCL_LIBRARY_SRC=file://${PACKAGE_DIR}/${ICDLOADER_FILE}
-DBOOST_MP11_SOURCE_DIR=${BUILD_DIR}/mp11/src/external_mp11/
-DLEVEL_ZERO_LIBRARY=${LIBDIR}/level-zero/lib/${LIBPREFIX}ze_loader${SHAREDLIBEXT}
-DLEVEL_ZERO_INCLUDE_DIR=${LIBDIR}/level-zero/include
-DLEVEL_ZERO_INCLUDE_DIR=${LIBDIR}/level-zero/include/level_zero
-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=${BUILD_DIR}/spirvheaders/src/external_spirvheaders/
-DUNIFIED_RUNTIME_SOURCE_DIR=${BUILD_DIR}/unifiedruntime/src/external_unifiedruntime/
-DSYCL_PI_UR_USE_FETCH_CONTENT=OFF
-DSYCL_PI_UR_SOURCE_DIR=${BUILD_DIR}/unifiedruntime/src/external_unifiedruntime/
-DFETCHCONTENT_SOURCE_DIR_UNIFIED-MEMORY-FRAMEWORK=${BUILD_DIR}/unifiedmemoryframework/src/external_unifiedmemoryframework/
# Below here is copied from an invocation of buildbot/config.py
-DLLVM_ENABLE_ASSERTIONS=ON
-DLLVM_TARGETS_TO_BUILD=X86
@@ -69,6 +71,8 @@ set(DPCPP_EXTRA_ARGS
-DXPTI_ENABLE_WERROR=OFF
-DSYCL_CLANG_EXTRA_FLAGS=
-DSYCL_ENABLE_PLUGINS=level_zero
-DSYCL_ENABLE_KERNEL_FUSION=OFF
-DSYCL_ENABLE_MAJOR_RELEASE_PREVIEW_LIB=OFF
-DCMAKE_INSTALL_RPATH=\$ORIGIN
-DPython3_ROOT_DIR=${LIBDIR}/python/
-DPython3_EXECUTABLE=${PYTHON_BINARY}
@@ -120,6 +124,7 @@ add_dependencies(
external_level-zero
external_spirvheaders
external_unifiedruntime
external_unifiedmemoryframework
)
if(BUILD_MODE STREQUAL Release AND WIN32)
@@ -133,6 +138,9 @@ if(BUILD_MODE STREQUAL Release AND WIN32)
COMMAND ${CMAKE_COMMAND} -E rm -f ${HARVEST_TARGET}/dpcpp/bin/lld.exe
COMMAND ${CMAKE_COMMAND} -E rm -f ${HARVEST_TARGET}/dpcpp/bin/lld-link.exe
COMMAND ${CMAKE_COMMAND} -E rm -f ${HARVEST_TARGET}/dpcpp/bin/wasm-ld.exe
COMMAND ${CMAKE_COMMAND} -E rm -f ${HARVEST_TARGET}/dpcpp/bin/pi_unified_runtime.dll
COMMAND ${CMAKE_COMMAND} -E rm -f ${HARVEST_TARGET}/dpcpp/bin/ur_adapter_level_zero.dll
COMMAND ${CMAKE_COMMAND} -E rm -f ${HARVEST_TARGET}/dpcpp/bin/ur_loader.dll
DEPENDEES install
)
endif()

View File

@@ -71,3 +71,13 @@ ExternalProject_Add(external_unifiedruntime
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)
ExternalProject_Add(external_unifiedmemoryframework
URL file://${PACKAGE_DIR}/${UNIFIED_MEMORY_FRAMEWORK_FILE}
URL_HASH ${UNIFIED_MEMORY_FRAMEWORK_HASH_TYPE}=${UNIFIED_MEMORY_FRAMEWORK_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/unifiedmemoryframework
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)

View File

@@ -320,7 +320,12 @@ else()
harvest(libglu/lib mesa/lib "*${SHAREDLIBEXT}*")
harvest(mesa/lib64 mesa/lib "*${SHAREDLIBEXT}*")
harvest(dpcpp dpcpp "*")
harvest(dpcpp/bin dpcpp/bin "*")
harvest(dpcpp/include dpcpp/include "*")
harvest(dpcpp/lib dpcpp/lib "libsycl*")
# avoid harvesting libpi_unified_runtime and libur_ as they're optional.
harvest(dpcpp/lib dpcpp/lib "libpi_level_zero*")
harvest(dpcpp/lib/clang dpcpp/lib/clang "*")
harvest(igc dpcpp/lib/igc "*")
harvest(ocloc dpcpp/lib/ocloc "*")
endif()

View File

@@ -646,15 +646,15 @@ set(OPENPGL_HASH 4192a4096ee3e3d31878cd013f8de23418c8037c576537551f946c4811931c5
set(OPENPGL_HASH_TYPE SHA256)
set(OPENPGL_FILE openpgl-${OPENPGL_VERSION}.tar.gz)
set(LEVEL_ZERO_VERSION 1.15.8)
set(LEVEL_ZERO_VERSION 1.16.1)
set(LEVEL_ZERO_URI https://codeload.github.com/oneapi-src/level-zero/tar.gz/refs/tags/v${LEVEL_ZERO_VERSION})
set(LEVEL_ZERO_HASH 80663dbd4d01d9519185c6e568f2e836bfea7484363f4da8cf5cf77c3bf58602)
set(LEVEL_ZERO_HASH f341dd6355d8da6ee9c29031642b8e8e4259f91c13c72d318c81663af048817e)
set(LEVEL_ZERO_HASH_TYPE SHA256)
set(LEVEL_ZERO_FILE level-zero-${LEVEL_ZERO_VERSION}.tar.gz)
set(DPCPP_VERSION 2022-12)
set(DPCPP_URI https://github.com/intel/llvm/archive/refs/tags/${DPCPP_VERSION}.tar.gz)
set(DPCPP_HASH 13151d5ae79f7c9c4a9b072a0c486ae7b3c4993e301bb1268c92214451025790)
set(DPCPP_VERSION d2817d6d317db1143bb227168e85c409d5ab7c82) # tip of sycl-rel_5_2_0 as of 2024.05.24
set(DPCPP_URI https://github.com/intel/llvm/archive/${DPCPP_VERSION}.tar.gz)
set(DPCPP_HASH 86cbff157b79e29a6ebb96ba79c96f64b4296c33fcd896f60a5579955fca5724)
set(DPCPP_HASH_TYPE SHA256)
set(DPCPP_FILE DPCPP-${DPCPP_VERSION}.tar.gz)
@@ -667,50 +667,57 @@ set(DPCPP_FILE DPCPP-${DPCPP_VERSION}.tar.gz)
# will take care of building them, unpack is being done in dpcpp_deps.cmake
# Source llvm/lib/SYCLLowerIR/CMakeLists.txt
set(VCINTRINSICS_VERSION 782fbf7301dc73acaa049a4324c976ad94f587f7)
set(VCINTRINSICS_VERSION da892e1982b6c25b9a133f85b4ac97142d8a3def)
set(VCINTRINSICS_URI https://github.com/intel/vc-intrinsics/archive/${VCINTRINSICS_VERSION}.tar.gz)
set(VCINTRINSICS_HASH f4c0ccad8c1f77760364c551c65e8e1cf194d058889fa46d3b1b2d19ec4dc33f)
set(VCINTRINSICS_HASH 06b85bd988059939770eb6e6e6194562d17c5f5a5df9947af18696b3b1fe92f3)
set(VCINTRINSICS_HASH_TYPE SHA256)
set(VCINTRINSICS_FILE vc-intrinsics-${VCINTRINSICS_VERSION}.tar.gz)
# Source opencl/CMakeLists.txt
set(OPENCLHEADERS_VERSION dcd5bede6859d26833cd85f0d6bbcee7382dc9b3)
set(OPENCLHEADERS_VERSION 9ddb236e6eb3cf844f9e2f81677e1045f9bf838e)
set(OPENCLHEADERS_URI https://github.com/KhronosGroup/OpenCL-Headers/archive/${OPENCLHEADERS_VERSION}.tar.gz)
set(OPENCLHEADERS_HASH ca8090359654e94f2c41e946b7e9d826253d795ae809ce7c83a7d3c859624693)
set(OPENCLHEADERS_HASH 9db682a1b0037ef54c50ba8fa3fa73182e552fc1ad0119a771bebf68e43ea739)
set(OPENCLHEADERS_HASH_TYPE SHA256)
set(OPENCLHEADERS_FILE opencl_headers-${OPENCLHEADERS_VERSION}.tar.gz)
# Source opencl/CMakeLists.txt
set(ICDLOADER_VERSION 792682ad3d877ab38573b997808bab3b43902b70)
set(ICDLOADER_VERSION 9a3e962f16f5097d2054233ad8b6dad51b6f41b7)
set(ICDLOADER_URI https://github.com/KhronosGroup/OpenCL-ICD-Loader/archive/${ICDLOADER_VERSION}.tar.gz)
set(ICDLOADER_HASH b33a0320d94bf300efa1da97931ded506d27813bd1148da6858fe79d412d1ea2)
set(ICDLOADER_HASH 5e2979be5692caf11a4afc2fd7995a54c94a03d0f7ee2959f03f98f7689b677b)
set(ICDLOADER_HASH_TYPE SHA256)
set(ICDLOADER_FILE icdloader-${ICDLOADER_VERSION}.tar.gz)
# Source sycl/cmake/modules/AddBoostMp11Headers.cmake
# Using external MP11 here, getting AddBoostMp11Headers.cmake to recognize
# our copy in boost directly was more trouble than it was worth.
set(MP11_VERSION 7bc4e1ae9b36ec8ee635c3629b59ec525bbe82b9)
set(MP11_VERSION ef7608b463298b881bc82eae4f45a4385ed74fca)
set(MP11_URI https://github.com/boostorg/mp11/archive/${MP11_VERSION}.tar.gz)
set(MP11_HASH 071ee2bd3952ec89882edb3af25dd1816f6b61723f66e42eea32f4d02ceef426)
set(MP11_HASH ec2d68858dd4d04f9a1e3960fc94a58440715e1b3e746cc495438116715343e2)
set(MP11_HASH_TYPE SHA256)
set(MP11_FILE mp11-${MP11_VERSION}.tar.gz)
# Source llvm-spirv/CMakeLists.txt (repo)
# Source llvm-spirv/spirv-headers-tag.conf (hash)
set(SPIRV_HEADERS_VERSION 5a121866927a16ab9d49bed4788b532c7fcea766)
set(SPIRV_HEADERS_VERSION b73e168ca5e123dcf3dea8a34b19a5130f421ae1)
set(SPIRV_HEADERS_URI https://github.com/KhronosGroup/SPIRV-Headers/archive/${SPIRV_HEADERS_VERSION}.tar.gz)
set(SPIRV_HEADERS_HASH ec8ecb471a62672697846c436501638ab25447ae9d4a6761e0bfe8a9a839502a)
set(SPIRV_HEADERS_HASH 11d835c60297b26532c05c3f3b581ba7a2787b5ae7399e94f72c392169216f11)
set(SPIRV_HEADERS_HASH_TYPE SHA256)
set(SPIRV_HEADERS_FILE SPIR-V-Headers-${SPIRV_HEADERS_VERSION}.tar.gz)
# Source llvm/sycl/plugins/unified_runtime/CMakeLists.txt
set(UNIFIED_RUNTIME_VERSION fd711c920acc4434cb52ff18b078c082d9d7f44d)
# Source sycl/plugins/unified_runtime/CMakeLists.txt
set(UNIFIED_RUNTIME_VERSION ec634ff05b067d7922ec45059dda94665e5dcd9b)
set(UNIFIED_RUNTIME_URI https://github.com/oneapi-src/unified-runtime/archive/${UNIFIED_RUNTIME_VERSION}.tar.gz)
set(UNIFIED_RUNTIME_HASH 535ca2ee78f68c5e7e62b10f1bbabd909179488885566e6d9b1fc50e8a1be65f)
set(UNIFIED_RUNTIME_HASH ff15574aba6225d0c8a32f71866126551dee1aaacfa7894b8fdcc5e52e0f5da9)
set(UNIFIED_RUNTIME_HASH_TYPE SHA256)
set(UNIFIED_RUNTIME_FILE unified-runtime-${UNIFIED_RUNTIME_VERSION}.tar.gz)
# Source unified-runtime/source/common/CMakeList.txt
set(UNIFIED_MEMORY_FRAMEWORK_VERSION 9bf7a0dc4dff76844e10edbb5c6e9d917536ef6d)
set(UNIFIED_MEMORY_FRAMEWORK_URI https://github.com/oneapi-src/unified-memory-framework/archive/${UNIFIED_MEMORY_FRAMEWORK_VERSION}.tar.gz)
set(UNIFIED_MEMORY_FRAMEWORK_HASH 7ff7d0be7be6e59693d238eab02b5a9741c820d3d995446781dcd7a2adaa28e9)
set(UNIFIED_MEMORY_FRAMEWORK_HASH_TYPE SHA256)
set(UNIFIED_MEMORY_FRAMEWORK_FILE unified-memory-framework-${UNIFIED_MEMORY_FRAMEWORK_VERSION}.tar.gz)
######################
### DPCPP DEPS END ###
######################

View File

@@ -34,246 +34,234 @@ diff -Naur llvm-sycl-nightly-20220208.orig/libdevice/cmake/modules/SYCLLibdevice
libsycldevice-obj
libsycldevice-spv)
diff --git a/sycl/source/detail/program_manager/program_manager.cpp b/sycl/source/detail/program_manager/program_manager.cpp
index 17eeaafae194..09e6d2217aaa 100644
--- a/sycl/source/detail/program_manager/program_manager.cpp
+++ b/sycl/source/detail/program_manager/program_manager.cpp
@@ -1647,46 +1647,120 @@ ProgramManager::getSYCLDeviceImagesWithCompatibleState(
}
assert(BinImages.size() > 0 && "Expected to find at least one device image");
diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt
index 00ce045f43c3..e044262e628e 100644
--- a/sycl/CMakeLists.txt
+++ b/sycl/CMakeLists.txt
@@ -188,7 +188,6 @@ install(FILES
COMPONENT sycl-headers)
+ // Ignore images with incompatible state. Image is considered compatible
+ // with a target state if an image is already in the target state or can
+ // be brought to target state by compiling/linking/building.
+ //
+ // Example: an image in "executable" state is not compatible with
+ // "input" target state - there is no operation to convert the image it
+ // to "input" state. An image in "input" state is compatible with
+ // "executable" target state because it can be built to get into
+ // "executable" state.
+ for (auto It = BinImages.begin(); It != BinImages.end();) {
+ if (getBinImageState(*It) > TargetState)
+ It = BinImages.erase(It);
+ else
+ ++It;
+ }
+
std::vector<device_image_plain> SYCLDeviceImages;
- for (RTDeviceBinaryImage *BinImage : BinImages) {
- const bundle_state ImgState = getBinImageState(BinImage);
include(AddBoostMp11Headers)
-include(FetchBoostUnorderedHeaders)
# This is workaround to detect changes (add or modify) in subtree which
# are not detected by copy_directory command.
diff --git a/sycl/cmake/modules/FetchBoostUnorderedHeaders.cmake b/sycl/cmake/modules/FetchBoostUnorderedHeaders.cmake
deleted file mode 100644
index a0f446055026..000000000000
--- a/sycl/cmake/modules/FetchBoostUnorderedHeaders.cmake
+++ /dev/null
@@ -1,129 +0,0 @@
-# Fetches the unordered boost module and its dependencies
-function(add_boost_module_headers)
- cmake_parse_arguments(
- BOOST_MODULE # prefix
- "" # options
- "NAME;SRC_DIR;GIT_TAG;" # one value keywords
- "" # multi-value keywords
- ${ARGN}) # arguments
-
- // Ignore images with incompatible state. Image is considered compatible
- // with a target state if an image is already in the target state or can
- // be brought to target state by compiling/linking/building.
- //
- // Example: an image in "executable" state is not compatible with
- // "input" target state - there is no operation to convert the image it
- // to "input" state. An image in "input" state is compatible with
- // "executable" target state because it can be built to get into
- // "executable" state.
- if (ImgState > TargetState)
- continue;
- for (const sycl::device &Dev : Devs) {
+ // If a non-input state is requested, we can filter out some compatible
+ // images and return only those with the highest compatible state for each
+ // device-kernel pair. This map tracks how many kernel-device pairs need each
+ // image, so that any unneeded ones are skipped.
+ // TODO this has no effect if the requested state is input, consider having
+ // a separate branch for that case to avoid unnecessary tracking work.
+ struct DeviceBinaryImageInfo {
+ std::shared_ptr<std::vector<sycl::kernel_id>> KernelIDs;
+ bundle_state State = bundle_state::input;
+ int RequirementCounter = 0;
+ };
+ std::unordered_map<RTDeviceBinaryImage *, DeviceBinaryImageInfo> ImageInfoMap;
+
+ for (const sycl::device &Dev : Devs) {
+ // Track the highest image state for each requested kernel.
+ using StateImagesPairT =
+ std::pair<bundle_state, std::vector<RTDeviceBinaryImage *>>;
+ using KernelImageMapT =
+ std::map<kernel_id, StateImagesPairT, LessByNameComp>;
+ KernelImageMapT KernelImageMap;
+ if (!KernelIDs.empty())
+ for (const kernel_id &KernelID : KernelIDs)
+ KernelImageMap.insert({KernelID, {}});
+
+ for (RTDeviceBinaryImage *BinImage : BinImages) {
if (!compatibleWithDevice(BinImage, Dev) ||
!doesDevSupportImgAspects(Dev, *BinImage))
continue;
- std::shared_ptr<std::vector<sycl::kernel_id>> KernelIDs;
- // Collect kernel names for the image
- {
- std::lock_guard<std::mutex> KernelIDsGuard(m_KernelIDsMutex);
- KernelIDs = m_BinImg2KernelIDs[BinImage];
- // If the image does not contain any non-service kernels we can skip it.
- if (!KernelIDs || KernelIDs->empty())
- continue;
+ auto InsertRes = ImageInfoMap.insert({BinImage, {}});
+ DeviceBinaryImageInfo &ImgInfo = InsertRes.first->second;
+ if (InsertRes.second) {
+ ImgInfo.State = getBinImageState(BinImage);
+ // Collect kernel names for the image
+ {
+ std::lock_guard<std::mutex> KernelIDsGuard(m_KernelIDsMutex);
+ ImgInfo.KernelIDs = m_BinImg2KernelIDs[BinImage];
+ }
}
+ const bundle_state ImgState = ImgInfo.State;
+ const std::shared_ptr<std::vector<sycl::kernel_id>> &ImageKernelIDs =
+ ImgInfo.KernelIDs;
+ int &ImgRequirementCounter = ImgInfo.RequirementCounter;
- DeviceImageImplPtr Impl = std::make_shared<detail::device_image_impl>(
- BinImage, Ctx, Devs, ImgState, KernelIDs, /*PIProgram=*/nullptr);
+ // If the image does not contain any non-service kernels we can skip it.
+ if (!ImageKernelIDs || ImageKernelIDs->empty())
+ continue;
- SYCLDeviceImages.push_back(
- createSyclObjFromImpl<device_image_plain>(Impl));
- break;
+ // Update tracked information.
+ for (kernel_id &KernelID : *ImageKernelIDs) {
+ StateImagesPairT *StateImagesPair;
+ // If only specific kernels are requested, ignore the rest.
+ if (!KernelIDs.empty()) {
+ auto It = KernelImageMap.find(KernelID);
+ if (It == KernelImageMap.end())
+ continue;
+ StateImagesPair = &It->second;
+ } else
+ StateImagesPair = &KernelImageMap[KernelID];
+
+ auto &[KernelImagesState, KernelImages] = *StateImagesPair;
+
+ if (KernelImages.empty()) {
+ KernelImagesState = ImgState;
+ KernelImages.push_back(BinImage);
+ ++ImgRequirementCounter;
+ } else if (KernelImagesState < ImgState) {
+ for (RTDeviceBinaryImage *Img : KernelImages) {
+ auto It = ImageInfoMap.find(Img);
+ assert(It != ImageInfoMap.end());
+ assert(It->second.RequirementCounter > 0);
+ --(It->second.RequirementCounter);
+ }
+ KernelImages.clear();
+ KernelImages.push_back(BinImage);
+ KernelImagesState = ImgState;
+ ++ImgRequirementCounter;
+ } else if (KernelImagesState == ImgState) {
+ KernelImages.push_back(BinImage);
+ ++ImgRequirementCounter;
+ }
+ }
}
}
+ for (const auto &ImgInfoPair : ImageInfoMap) {
+ if (ImgInfoPair.second.RequirementCounter == 0)
+ continue;
+
+ DeviceImageImplPtr Impl = std::make_shared<detail::device_image_impl>(
+ ImgInfoPair.first, Ctx, Devs, ImgInfoPair.second.State,
+ ImgInfoPair.second.KernelIDs, /*PIProgram=*/nullptr);
+
+ SYCLDeviceImages.push_back(createSyclObjFromImpl<device_image_plain>(Impl));
+ }
+
return SYCLDeviceImages;
}
diff --git a/sycl/source/detail/pi.cpp b/sycl/source/detail/pi.cpp
index fb228cd85979..94e8438ee964 100644
--- a/sycl/source/detail/pi.cpp
+++ b/sycl/source/detail/pi.cpp
@@ -635,45 +635,47 @@ static uint16_t getELFHeaderType(const unsigned char *ImgData, size_t ImgSize) {
RT::PiDeviceBinaryType getBinaryImageFormat(const unsigned char *ImgData,
size_t ImgSize) {
// Top-level magic numbers for the recognized binary image formats.
- struct {
- RT::PiDeviceBinaryType Fmt;
- const uint32_t Magic;
- } Fmts[] = {{PI_DEVICE_BINARY_TYPE_SPIRV, 0x07230203},
- {PI_DEVICE_BINARY_TYPE_LLVMIR_BITCODE, 0xDEC04342},
- // 'I', 'N', 'T', 'C' ; Intel native
- {PI_DEVICE_BINARY_TYPE_NATIVE, 0x43544E49}};
- if (NOT DEFINED BOOST_MODULE_SRC_DIR)
- set(BOOST_MODULE_GIT_REPO "https://github.com/boostorg/${BOOST_MODULE_NAME}.git")
- message(STATUS "Source dir not set for boost module ${BOOST_MODULE_NAME}, downloading headers from ${BOOST_MODULE_GIT_REPO}")
-
- if (ImgSize >= sizeof(Fmts[0].Magic)) {
- detail::remove_const_t<decltype(Fmts[0].Magic)> Hdr = 0;
- std::copy(ImgData, ImgData + sizeof(Hdr), reinterpret_cast<char *>(&Hdr));
- set(BOOST_MODULE_FULL_NAME "boost_${BOOST_MODULE_NAME}")
- FetchContent_Declare(${BOOST_MODULE_FULL_NAME}
- GIT_REPOSITORY ${BOOST_MODULE_GIT_REPO}
- GIT_TAG ${BOOST_MODULE_GIT_TAG}
- )
- FetchContent_GetProperties(${BOOST_MODULE_FULL_NAME})
- FetchContent_MakeAvailable(${BOOST_MODULE_FULL_NAME})
-
- // Check headers for direct formats.
- for (const auto &Fmt : Fmts) {
- if (Hdr == Fmt.Magic)
- return Fmt.Fmt;
- }
- set(BOOST_MODULE_SRC_DIR ${${BOOST_MODULE_FULL_NAME}_SOURCE_DIR})
- else (NOT DEFINED BOOST_MODULE_SRC_DIR)
- message(STATUS "Using boost/${BOOST_MODULE_NAME} headers from ${BOOST_MODULE_SRC_DIR}")
- endif(NOT DEFINED BOOST_MODULE_SRC_DIR)
-
- // ELF e_type for recognized binary image formats.
- struct {
- RT::PiDeviceBinaryType Fmt;
- const uint16_t Magic;
- } ELFFmts[] = {{PI_DEVICE_BINARY_TYPE_NATIVE, 0xFF04}, // OpenCL executable
- {PI_DEVICE_BINARY_TYPE_NATIVE, 0xFF12}}; // ZEBIN executable
- set(BOOST_UNORDERED_INCLUDE_DIRS ${BOOST_UNORDERED_INCLUDE_DIRS} "${BOOST_MODULE_SRC_DIR}/include" PARENT_SCOPE)
-endfunction(add_boost_module_headers)
-
- // ELF files need to be parsed separately. The header type ends after 18
- // bytes.
- if (Hdr == 0x464c457F && ImgSize >= 18) {
- uint16_t HdrType = getELFHeaderType(ImgData, ImgSize);
- for (const auto &ELFFmt : ELFFmts) {
- if (HdrType == ELFFmt.Magic)
- return ELFFmt.Fmt;
- }
- // Newer ZEBIN format does not have a special header type, but can instead
- // be identified by having a required .ze_info section.
- if (checkELFSectionPresent(".ze_info", ImgData, ImgSize))
- return PI_DEVICE_BINARY_TYPE_NATIVE;
- }
+ auto MatchMagicNumber = [&](auto Number) {
+ return ImgSize >= sizeof(Number) &&
+ std::memcmp(ImgData, &Number, sizeof(Number)) == 0;
+ };
+
+ if (MatchMagicNumber(uint32_t{0x07230203}))
+ return PI_DEVICE_BINARY_TYPE_SPIRV;
+
+ if (MatchMagicNumber(uint32_t{0xDEC04342}))
+ return PI_DEVICE_BINARY_TYPE_LLVMIR_BITCODE;
+
+ if (MatchMagicNumber(uint32_t{0x43544E49}))
+ // 'I', 'N', 'T', 'C' ; Intel native
+ return PI_DEVICE_BINARY_TYPE_LLVMIR_BITCODE;
+
+ // Check for ELF format, size requirements include data we'll read in case of
+ // succesful match.
+ if (ImgSize >= 18 && MatchMagicNumber(uint32_t{0x464c457F})) {
+ uint16_t ELFHdrType = getELFHeaderType(ImgData, ImgSize);
+ if (ELFHdrType == 0xFF04)
+ // OpenCL executable.
+ return PI_DEVICE_BINARY_TYPE_NATIVE;
+
+ if (ELFHdrType == 0xFF12)
+ // ZEBIN executable.
+ return PI_DEVICE_BINARY_TYPE_NATIVE;
+
+ // Newer ZEBIN format does not have a special header type, but can instead
+ // be identified by having a required .ze_info section.
+ if (checkELFSectionPresent(".ze_info", ImgData, ImgSize))
+ return PI_DEVICE_BINARY_TYPE_NATIVE;
}
+
+ // "ar" format is used to pack binaries for multiple devices, e.g. via
+ //
+ // -Xsycl-target-backend=spir64_gen "-device acm-g10,acm-g11"
+ //
+ // option.
+ if (MatchMagicNumber(std::array{'!', '<', 'a', 'r', 'c', 'h', '>', '\n'}))
+ return PI_DEVICE_BINARY_TYPE_NATIVE;
+
return PI_DEVICE_BINARY_TYPE_NONE;
}
-set(BOOST_UNORDERED_GIT_TAG bd24dfd284dbc70e7521915af0d8d049f74a1e85)
-# Author: joaquintides <joaquin@tid.es>
-# Date: Tue Jul 18 18:19:13 2023 +0200
-#
-# updated concurrent map benchmark plots
-add_boost_module_headers(NAME "unordered" SRC_DIR ${BOOST_UNORDERED_SOURCE_DIR} GIT_TAG ${BOOST_UNORDERED_GIT_TAG})
-
-set(BOOST_ASSERT_GIT_TAG 02256c84fd0cd58a139d9dc1b25b5019ca976ada)
-# Author: Peter Dimov <pdimov@gmail.com>
-# Date: Thu Jun 22 18:11:58 2023 +0300
-#
-# Do not use std::source_location::current under nvcc. Fixes #32.
-add_boost_module_headers(NAME "assert" SRC_DIR ${BOOST_ASSERT_SOURCE_DIR} GIT_TAG ${BOOST_ASSERT_GIT_TAG})
-
-set(BOOST_CONFIG_GIT_TAG a1cf5d531405e62927b0257b5cbecc66a545b508)
-# Merge: f5726a26 a1edcd56
-# Author: jzmaddock <john@johnmaddock.co.uk>
-# Date: Sat Apr 15 13:20:12 2023 +0100
-#
-# Merge pull request #475 from boostorg/ci_2023_04
-add_boost_module_headers(NAME "config" SRC_DIR ${BOOST_CONFIG_SOURCE_DIR} GIT_TAG ${BOOST_CONFIG_GIT_TAG})
-
-set(BOOST_CONTAINER_HASH_GIT_TAG 226eb066e949adbf37b220e993d64ecefeeaae99)
-# Author: Peter Dimov <pdimov@gmail.com>
-# Date: Thu Jun 29 14:38:53 2023 +0300
-#
-# Update .drone.jsonnet
-add_boost_module_headers(NAME "container_hash" SRC_DIR ${BOOST_CONTAINER_HASH_SOURCE_DIR} GIT_TAG ${BOOST_CONTAINER_HASH_GIT_TAG})
-
-set(BOOST_CORE_GIT_TAG 216999e552e7f73e63c7bcc88b8ce9c179bbdbe2)
-# Author: Peter Dimov <pdimov@gmail.com>
-# Date: Sun Jun 25 13:46:53 2023 +0300
-#
-# Avoid -Wsign-conversion warning in checked_delete.hpp
-add_boost_module_headers(NAME "core" SRC_DIR ${BOOST_CORE_SOURCE_DIR} GIT_TAG ${BOOST_CORE_GIT_TAG})
-
-# Describe is a dependency of container_hash
-set(BOOST_DESCRIBE_GIT_TAG a0eafb08100eb15a57b6dae6d270c0012a56aa21)
-# Merge: 1692c3e b54fda5
-# Author: Peter Dimov <pdimov@gmail.com>
-# Date: Sun May 21 04:51:35 2023 +0300
-#
-# Merge branch 'fix-deprecated-inline-static-variables' of https://github.com/Romain-Geissler-1A/describe into feature/pr-40
-add_boost_module_headers(NAME "describe" SRC_DIR ${BOOST_DESCRIBE_SOURCE_DIR} GIT_TAG ${BOOST_DESCRIBE_GIT_TAG})
-
-set(BOOST_MOVE_GIT_TAG f1fbb45134065deebe95249c616a967d4b66c809)
-# Author: Ion Gaztañaga <igaztanaga@gmail.com>
-# Date: Mon Mar 13 13:32:29 2023 +0100
-#
-# Use [[msvc::intrinsic] attribute if available in move/forward in order to improve debug experience
-add_boost_module_headers(NAME "move" SRC_DIR ${BOOST_MOVE_SOURCE_DIR} GIT_TAG ${BOOST_MOVE_GIT_TAG})
-
-# Reuse mp11 fetched earlier for DPC++ headers
-set(BOOST_UNORDERED_INCLUDE_DIRS ${BOOST_UNORDERED_INCLUDE_DIRS} "${BOOST_MP11_SOURCE_DIR}/include/")
-
-set(BOOST_PREDEF_GIT_TAG 392e4e767469e3469c9390f0d9cca16724dc3fc8)
-# Merge: a12c7fd 499d28e
-# Author: Rene Rivera <grafikrobot@gmail.com>
-# Date: Sun Feb 27 14:44:35 2022 -0600
-#
-# Release 1.14.
-add_boost_module_headers(NAME "predef" SRC_DIR ${BOOST_PREDEF_SOURCE_DIR} GIT_TAG ${BOOST_PREDEF_GIT_TAG})
-
-set(BOOST_PREPROCESSOR_GIT_TAG 667e87b3392db338a919cbe0213979713aca52e3)
-# Author: Peter Dimov <pdimov@gmail.com>
-# Date: Tue Aug 16 20:59:52 2022 +0300
-#
-# Change C test names to not conflict with the C++ ones
-add_boost_module_headers(NAME "preprocessor" SRC_DIR ${BOOST_PREPROCESSOR_SOURCE_DIR} GIT_TAG ${BOOST_PREPROCESSOR_GIT_TAG})
-
-set(BOOST_STATIC_ASSERT_GIT_TAG 45eec41c293bc5cd36ec3ed83671f70bc1aadc9f)
-# Merge: ba72d33 a1abfec
-# Author: jzmaddock <john@johnmaddock.co.uk>
-# Date: Tue Mar 8 09:35:50 2022 +0000
-#
-# Merge pull request #15 from sdarwin/githubactions
-add_boost_module_headers(NAME "static_assert" SRC_DIR ${BOOST_STATIC_ASSERT_SOURCE_DIR} GIT_TAG ${BOOST_STATIC_ASSERT_GIT_TAG})
-
-set(BOOST_THROW_EXCEPTION_GIT_TAG 23dd41e920ecd91237500ac6428f7d392a7a875c)
-# Author: Peter Dimov <pdimov@gmail.com>
-# Date: Sun Jun 25 16:12:57 2023 +0300
-#
-# Update ci.yml
-add_boost_module_headers(NAME "throw_exception" SRC_DIR ${BOOST_THROW_EXCEPTION_SOURCE_DIR} GIT_TAG ${BOOST_THROW_EXCEPTION_GIT_TAG})
-
-set(BOOST_TUPLE_GIT_TAG 500e4fa0a2845b96c0dd919e7485e0f216438a01)
-# Merge: aa16ae3 ded3c1d
-# Author: Joel de Guzman <djowel@gmail.com>
-# Date: Thu Dec 30 23:20:18 2021 +0800
-#
-# Merge pull request #21 from igaztanaga/patch-1
-add_boost_module_headers(NAME "tuple" SRC_DIR ${BOOST_TUPLE_SOURCE_DIR} GIT_TAG ${BOOST_TUPLE_GIT_TAG})
-
-set(BOOST_TYPE_TRAITS_GIT_TAG 89f5011b4a79d91e42735670e39f72cb25c86c72)
-# Merge: 55feb75 1ebd31e
-# Author: John Maddock <john@johnmaddock.co.uk>
-# Date: Fri Feb 24 18:02:30 2023 +0000
-#
-# Merge branch 'develop'
-add_boost_module_headers(NAME "type_traits" SRC_DIR ${BOOST_TYPE_TRAITS_SOURCE_DIR} GIT_TAG ${BOOST_TYPE_TRAITS_GIT_TAG})
diff --git a/sycl/source/CMakeLists.txt b/sycl/source/CMakeLists.txt
index ead8f2c83ab7..6fb8305a1a88 100644
--- a/sycl/source/CMakeLists.txt
+++ b/sycl/source/CMakeLists.txt
@@ -69,8 +69,6 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
target_link_libraries(${LIB_NAME} PRIVATE ${ARG_XPTI_LIB})
endif()
- target_include_directories(${LIB_OBJ_NAME} PRIVATE ${BOOST_UNORDERED_INCLUDE_DIRS})
-
# pi_win_proxy_loader
if (WIN32)
include_directories(${LLVM_EXTERNAL_SYCL_SOURCE_DIR}/pi_win_proxy_loader)
diff --git a/sycl/source/detail/kernel_program_cache.hpp b/sycl/source/detail/kernel_program_cache.hpp
index 87a41d9fe105..c0a572b4d144 100644
--- a/sycl/source/detail/kernel_program_cache.hpp
+++ b/sycl/source/detail/kernel_program_cache.hpp
@@ -18,12 +18,10 @@
#include <atomic>
#include <condition_variable>
+#include <map>
#include <mutex>
#include <type_traits>
-#include <boost/unordered/unordered_flat_map.hpp>
-#include <boost/unordered_map.hpp>
-
// For testing purposes
class MockKernelProgramCache;
@@ -113,8 +111,8 @@ public:
std::pair<std::uintptr_t, sycl::detail::pi::PiDevice>;
struct ProgramCache {
- ::boost::unordered_map<ProgramCacheKeyT, ProgramBuildResultPtr> Cache;
- ::boost::unordered_multimap<CommonProgramKeyT, ProgramCacheKeyT> KeyMap;
+ std::map<ProgramCacheKeyT, ProgramBuildResultPtr> Cache;
+ std::multimap<CommonProgramKeyT, ProgramCacheKeyT> KeyMap;
size_t size() const noexcept { return Cache.size(); }
};
@@ -138,10 +136,8 @@ public:
};
using KernelBuildResultPtr = std::shared_ptr<KernelBuildResult>;
- using KernelByNameT =
- ::boost::unordered_map<std::string, KernelBuildResultPtr>;
- using KernelCacheT =
- ::boost::unordered_map<sycl::detail::pi::PiProgram, KernelByNameT>;
+ using KernelByNameT = std::map<std::string, KernelBuildResultPtr>;
+ using KernelCacheT = std::map<sycl::detail::pi::PiProgram, KernelByNameT>;
using KernelFastCacheKeyT =
std::tuple<SerializedObj, sycl::detail::pi::PiDevice, std::string,
@@ -149,13 +145,7 @@ public:
using KernelFastCacheValT =
std::tuple<sycl::detail::pi::PiKernel, std::mutex *,
const KernelArgMask *, sycl::detail::pi::PiProgram>;
- // This container is used as a fast path for retrieving cached kernels.
- // unordered_flat_map is used here to reduce lookup overhead.
- // The slow path is used only once for each newly created kernel, so the
- // higher overhead of insertion that comes with unordered_flat_map is more
- // of an issue there. For that reason, those use regular unordered maps.
- using KernelFastCacheT =
- ::boost::unordered_flat_map<KernelFastCacheKeyT, KernelFastCacheValT>;
+ using KernelFastCacheT = std::map<KernelFastCacheKeyT, KernelFastCacheValT>;
~KernelProgramCache() = default;
diff --git a/sycl/unittests/CMakeLists.txt b/sycl/unittests/CMakeLists.txt
index 71d2413c2974..0c55c870c4b8 100644
--- a/sycl/unittests/CMakeLists.txt
+++ b/sycl/unittests/CMakeLists.txt
@@ -1,6 +1,5 @@
add_custom_target(SYCLUnitTests)
set_target_properties(SYCLUnitTests PROPERTIES FOLDER "SYCL tests")
-include_directories(${BOOST_UNORDERED_INCLUDE_DIRS})
foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
--
2.30.1.windows.1

View File

@@ -414,6 +414,7 @@ if(DEFINED LIBDIR)
${SYCL_ROOT_DIR}/lib/libsycl.so
${SYCL_ROOT_DIR}/lib/libsycl.so.*
${SYCL_ROOT_DIR}/lib/libpi_*.so
${SYCL_ROOT_DIR}/lib/libur_*.so
)
list(FILTER _sycl_runtime_libraries EXCLUDE REGEX ".*\.py")
list(REMOVE_ITEM _sycl_runtime_libraries "${SYCL_ROOT_DIR}/lib/libpi_opencl.so")

View File

@@ -1309,6 +1309,7 @@ if(WITH_CYCLES AND (WITH_CYCLES_DEVICE_ONEAPI OR (WITH_CYCLES_EMBREE AND EMBREE_
file(GLOB _sycl_pi_runtime_libraries_glob
${SYCL_ROOT_DIR}/bin/pi_*.dll
${SYCL_ROOT_DIR}/bin/ur_*.dll
)
list(REMOVE_ITEM _sycl_pi_runtime_libraries_glob "${SYCL_ROOT_DIR}/bin/pi_opencl.dll")
list(APPEND _sycl_runtime_libraries ${_sycl_pi_runtime_libraries_glob})