From 904f26f19838b64cbb92f7b583ee7a1d8f0e5c5d Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Wed, 4 Nov 2026 13:35:03 +0100 Subject: [PATCH 1/2] Drop compiler version checks dead with the 2026.0 minimum DPC++ 2026.0 is now the minimum compiler, so: - DPCTLDevice__GetMaxWorkItemSizes always uses info::device::max_work_item_sizes. The __SYCL_COMPILER_MAX_WORK_ITEM_SIZE_THRESHOLD macro it checked was defined nowhere, so the #else branch was dead code. - The SUPPORTS_SYCL_COMPILATION check for 2025.1 and the fallback to registered_kernel_names (renamed to registered_names in 2025.2) are removed. DPCTLKernelBundle_CreateFromSYCLSource_Available() stays in the C-API and returns true. The FIXME in check_max_clock_frequency to assert freq > 0 after 2024.1 is replaced with the actual reason: the OpenCL CPU device still reports 0 under WSL with runtime 2026.22. --- dpctl/tests/_device_attributes_checks.py | 3 +- .../source/dpctl_sycl_device_interface.cpp | 4 -- .../dpctl_sycl_kernel_bundle_interface.cpp | 62 +------------------ 3 files changed, 4 insertions(+), 65 deletions(-) diff --git a/dpctl/tests/_device_attributes_checks.py b/dpctl/tests/_device_attributes_checks.py index 7e00831fae..b22aa971f0 100644 --- a/dpctl/tests/_device_attributes_checks.py +++ b/dpctl/tests/_device_attributes_checks.py @@ -625,7 +625,8 @@ def check_device_type(device): def check_max_clock_frequency(device): freq = device.max_clock_frequency assert isinstance(freq, int) - # FIXME: Change to freq > 0 after transition to 2024.1 + # The value may be 0, e.g. the OpenCL CPU device (runtime 2026.22) reports + # 0 under WSL, where /sys/devices/system/cpu/*/cpufreq is not available assert freq >= 0 diff --git a/libsyclinterface/source/dpctl_sycl_device_interface.cpp b/libsyclinterface/source/dpctl_sycl_device_interface.cpp index 9d4a066a02..d66d923f3f 100644 --- a/libsyclinterface/source/dpctl_sycl_device_interface.cpp +++ b/libsyclinterface/source/dpctl_sycl_device_interface.cpp @@ -62,12 +62,8 @@ DPCTLDevice__GetMaxWorkItemSizes(__dpctl_keep const DPCTLSyclDeviceRef DRef) auto D = unwrap(DRef); if (D) { try { -#if __SYCL_COMPILER_VERSION >= __SYCL_COMPILER_MAX_WORK_ITEM_SIZE_THRESHOLD auto id_sizes = D->get_info>(); -#else - auto id_sizes = D->get_info(); -#endif sizes = new size_t[dim]; for (auto i = 0ul; i < dim; ++i) { sizes[i] = id_sizes[i]; diff --git a/libsyclinterface/source/dpctl_sycl_kernel_bundle_interface.cpp b/libsyclinterface/source/dpctl_sycl_kernel_bundle_interface.cpp index 163f9efd8c..2b060115e6 100644 --- a/libsyclinterface/source/dpctl_sycl_kernel_bundle_interface.cpp +++ b/libsyclinterface/source/dpctl_sycl_kernel_bundle_interface.cpp @@ -967,53 +967,7 @@ const char *DPCTLKernelBuildLog_Get(__dpctl_keep DPCTLKernelBuildLogRef Ref) namespace syclex = sycl::ext::oneapi::experimental; -#if defined(SYCL_EXT_ONEAPI_KERNEL_COMPILER) && \ - defined(__SYCL_COMPILER_VERSION) && !defined(SUPPORTS_SYCL_COMPILATION) -// SYCL source code compilation is supported from 2025.1 onwards. -#if __SYCL_COMPILER_VERSION >= 20250317u -#define SUPPORTS_SYCL_COMPILATION 1 -#else -#define SUPPORTS_SYCL_COMPILATION 0 -#endif -#endif - -bool DPCTLKernelBundle_CreateFromSYCLSource_Available() -{ -#if (SUPPORTS_SYCL_COMPILATION > 0) - return true; -#else - return false; -#endif -} - -#if (SUPPORTS_SYCL_COMPILATION > 0) -// The property for registering names was renamed between DPC++ versions 2025.1 -// and 2025.2. The original name was `registered_kernel_names`, the new name is -// `registered_names`. To select the correct name without being overly reliant -// on the SYCL compiler version definition, we forward declare both names and -// then select the new name if it is defined (i.e., not only declared). -namespace sycl::ext::oneapi::experimental -{ -struct registered_names; -struct registered_kernel_names; -} // namespace sycl::ext::oneapi::experimental - -template -struct new_type_if_defined -{ - using type = FallbackT; -}; - -template -struct new_type_if_defined> -{ - using type = NewT; -}; - -using registered_names_property_t = - new_type_if_defined::type; -#endif +bool DPCTLKernelBundle_CreateFromSYCLSource_Available() { return true; } __dpctl_give DPCTLSyclKernelBundleRef DPCTLKernelBundle_CreateFromSYCLSource( __dpctl_keep const DPCTLSyclContextRef Ctx, @@ -1024,7 +978,6 @@ __dpctl_give DPCTLSyclKernelBundleRef DPCTLKernelBundle_CreateFromSYCLSource( __dpctl_keep DPCTLBuildOptionListRef BuildOptions, __dpctl_keep DPCTLKernelBuildLogRef BuildLog) { -#if (SUPPORTS_SYCL_COMPILATION > 0) // optional arguments and BuildLog may be NULL, which is equivalent to // passing an empty list or discarding the log // Writing to the log is routed through a helper @@ -1100,7 +1053,7 @@ __dpctl_give DPCTLSyclKernelBundleRef DPCTLKernelBundle_CreateFromSYCLSource( *SyclCtx, syclex::source_language::sycl, Src)); } - registered_names_property_t RegisteredNames; + syclex::registered_names RegisteredNames; for (const std::string &Name : KernelNames) { RegisteredNames.add(Name); } @@ -1120,16 +1073,12 @@ __dpctl_give DPCTLSyclKernelBundleRef DPCTLKernelBundle_CreateFromSYCLSource( set_build_log(e.what()); return nullptr; } -#else - return nullptr; -#endif } __dpctl_give DPCTLSyclKernelRef DPCTLKernelBundle_GetSyclKernel(__dpctl_keep DPCTLSyclKernelBundleRef KBRef, __dpctl_keep const char *KernelName) { -#if (SUPPORTS_SYCL_COMPILATION > 0) if (!KBRef) { error_handler("Input KBRef is nullptr", __FILE__, __func__, __LINE__); return nullptr; @@ -1148,16 +1097,12 @@ DPCTLKernelBundle_GetSyclKernel(__dpctl_keep DPCTLSyclKernelBundleRef KBRef, error_handler(e, __FILE__, __func__, __LINE__); return nullptr; } -#else - return nullptr; -#endif } bool DPCTLKernelBundle_HasSyclKernel(__dpctl_keep DPCTLSyclKernelBundleRef KBRef, __dpctl_keep const char *KernelName) { -#if (SUPPORTS_SYCL_COMPILATION > 0) if (!KBRef) { error_handler("Input KBRef is nullptr", __FILE__, __func__, __LINE__); return false; @@ -1175,7 +1120,4 @@ bool DPCTLKernelBundle_HasSyclKernel(__dpctl_keep DPCTLSyclKernelBundleRef error_handler(e, __FILE__, __func__, __LINE__); return false; } -#else - return false; -#endif } From 5ce6c0378ef34cc7d824d93ac953e8c070fc6509 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Wed, 4 Nov 2026 13:35:42 +0100 Subject: [PATCH 2/2] Add gh-2415 to the changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b3d0c90d1..60b0a22375 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,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) ### Maintenance +* Removed compiler version checks made obsolete by the DPC++ 2026.0 minimum [gh-2415](https://github.com/IntelPython/dpctl/pull/2415) ## [0.23.0] - Oct. 22, 2026