diff --git a/CHANGELOG.md b/CHANGELOG.md index a9eb1d2f1f..d3fa840adf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Removed stale `select_host_device` and `has_host_device` names from `dpctl.__all__`, which made `from dpctl import *` fail with `AttributeError` [gh-2410](https://github.com/IntelPython/dpctl/pull/2410) * A USM allocation that fails now drops the references held for offloaded tasks that have completed, and is attempted once more if that released anything, so that memory only waiting to be given up is not reported as unavailable [gh-2359](https://github.com/IntelPython/dpctl/pull/2359) * `dpctl.SyclPlatform.get_devices` no longer prints Unified Runtime warnings for `device_type="custom"` on non-OpenCL platforms, where custom devices are not supported [gh-2306](https://github.com/IntelPython/dpctl/pull/2306) +* Fixed building with the open source DPC++ compiler and CMake 4.5 or newer, which identifies it as `DPClang` instead of `Clang` [gh-2433](https://github.com/IntelPython/dpctl/pull/2433) ### Maintenance * Removed the `-fno-sycl-id-queries-fit-in-int` compile option, which none of the `dpctl` extensions need since `dpctl.tensor` moved to `dpnp` [gh-2413](https://github.com/IntelPython/dpctl/pull/2413) diff --git a/cmake/IntelSYCLConfig.cmake b/cmake/IntelSYCLConfig.cmake index 5994c35b1d..a0cf766fe1 100644 --- a/cmake/IntelSYCLConfig.cmake +++ b/cmake/IntelSYCLConfig.cmake @@ -102,8 +102,10 @@ if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "x") endif() # Check for known compiler family that supports SYCL +# (CMake 4.5 and newer identify the open source DPC++ 7.0 and newer as DPClang) if( NOT "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang" AND + NOT "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xDPClang" AND NOT "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xIntelLLVM") set(IntelSYCL_FOUND False) set(SYCL_REASON_FAILURE "Unsupported compiler family ${CMAKE_CXX_COMPILER_ID} and compiler ${CMAKE_CXX_COMPILER}!!") @@ -247,6 +249,7 @@ set(SYCL_LINK_FLAGS "") # Based on Compiler ID, add support for SYCL if( "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang" OR + "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xDPClang" OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xIntelLLVM") list(APPEND SYCL_FLAGS "-fsycl") list(APPEND SYCL_LINK_FLAGS "-fsycl") diff --git a/cmake/WindowsClangClLinkRules.cmake b/cmake/WindowsClangClLinkRules.cmake index d900d7e383..71ceffa903 100644 --- a/cmake/WindowsClangClLinkRules.cmake +++ b/cmake/WindowsClangClLinkRules.cmake @@ -8,7 +8,7 @@ if(CMAKE_GENERATOR MATCHES "Visual Studio") endif() foreach(_lang C CXX) - if(NOT CMAKE_${_lang}_COMPILER_ID STREQUAL "Clang" + if(NOT CMAKE_${_lang}_COMPILER_ID MATCHES "^(Clang|DPClang)$" OR NOT CMAKE_${_lang}_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC" OR CMAKE_${_lang}_LINK_MODE STREQUAL "DRIVER") continue() diff --git a/dpctl/CMakeLists.txt b/dpctl/CMakeLists.txt index dab02b8117..069e75d11c 100644 --- a/dpctl/CMakeLists.txt +++ b/dpctl/CMakeLists.txt @@ -7,7 +7,7 @@ find_package(Cython REQUIRED) if(WIN32) # clang-cl reads -Wall as /Wall, i.e. -Weverything - if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + if(CMAKE_CXX_COMPILER_ID MATCHES "^(Clang|DPClang)$") set(_dpctl_wall_flag "/W3 ") else() set(_dpctl_wall_flag "-Wall ") diff --git a/libsyclinterface/CMakeLists.txt b/libsyclinterface/CMakeLists.txt index 87e4ceb23b..dabd73095c 100644 --- a/libsyclinterface/CMakeLists.txt +++ b/libsyclinterface/CMakeLists.txt @@ -182,7 +182,7 @@ set(CMAKE_CXX_STANDARD 17) if(WIN32) # clang-cl reads -Wall as /Wall, i.e. -Weverything - if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + if(CMAKE_CXX_COMPILER_ID MATCHES "^(Clang|DPClang)$") set(_dpctl_wall_flag "/W3 ") else() set(_dpctl_wall_flag "-Wall ")