diff --git a/CHANGELOG.md b/CHANGELOG.md index c5fcaab99e36..752240a47347 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ This release is compatible with NumPy 2.5. * Updated Python Array API specification version supported to `2025.12` [#2899](https://github.com/IntelPython/dpnp/pull/2899) * Replaced references to the `dpnp.amax`/`dpnp.amin` aliases with the canonical `dpnp.max`/`dpnp.min` in docstrings and code internally [#2990](https://github.com/IntelPython/dpnp/pull/2990) * Aligned the signature of `dpnp.tensor.expand_dims` with the Python array API by making `axis` a required argument [#2988](https://github.com/IntelPython/dpnp/pull/2988) +* Removed dead code branches guarded by outdated oneMKL and DPC++ compiler version checks [#2999](https://github.com/IntelPython/dpnp/pull/2999) ### Deprecated diff --git a/dpnp/backend/extensions/fft/common.hpp b/dpnp/backend/extensions/fft/common.hpp index 44f0b43f8597..b293f14f48a9 100644 --- a/dpnp/backend/extensions/fft/common.hpp +++ b/dpnp/backend/extensions/fft/common.hpp @@ -112,12 +112,13 @@ class DescriptorWrapper const typename valT::value_type dim = get_dim(); valT fwd_strides(dim + 1); -#if INTEL_MKL_VERSION >= 20250000 - descr_.get_value(mkl_dft::config_param::FWD_STRIDES, &fwd_strides); -#else +#if defined(USE_ONEMATH) + // oneMath uses a C-style variadic API that expects a raw pointer descr_.get_value(mkl_dft::config_param::FWD_STRIDES, fwd_strides.data()); -#endif // INTEL_MKL_VERSION +#else + descr_.get_value(mkl_dft::config_param::FWD_STRIDES, &fwd_strides); +#endif // USE_ONEMATH return fwd_strides; } @@ -130,11 +131,12 @@ class DescriptorWrapper throw py::value_error( "Strides length does not match descriptor's dimension"); } -#if INTEL_MKL_VERSION >= 20250000 - descr_.set_value(mkl_dft::config_param::FWD_STRIDES, strides); -#else +#if defined(USE_ONEMATH) + // oneMath uses a C-style variadic API that expects a raw pointer descr_.set_value(mkl_dft::config_param::FWD_STRIDES, strides.data()); -#endif // INTEL_MKL_VERSION +#else + descr_.set_value(mkl_dft::config_param::FWD_STRIDES, strides); +#endif // USE_ONEMATH } // config_param::BWD_STRIDES @@ -144,12 +146,13 @@ class DescriptorWrapper const typename valT::value_type dim = get_dim(); valT bwd_strides(dim + 1); -#if INTEL_MKL_VERSION >= 20250000 - descr_.get_value(mkl_dft::config_param::BWD_STRIDES, &bwd_strides); -#else +#if defined(USE_ONEMATH) + // oneMath uses a C-style variadic API that expects a raw pointer descr_.get_value(mkl_dft::config_param::BWD_STRIDES, bwd_strides.data()); -#endif // INTEL_MKL_VERSION +#else + descr_.get_value(mkl_dft::config_param::BWD_STRIDES, &bwd_strides); +#endif // USE_ONEMATH return bwd_strides; } @@ -162,11 +165,12 @@ class DescriptorWrapper throw py::value_error( "Strides length does not match descriptor's dimension"); } -#if INTEL_MKL_VERSION >= 20250000 - descr_.set_value(mkl_dft::config_param::BWD_STRIDES, strides); -#else +#if defined(USE_ONEMATH) + // oneMath uses a C-style variadic API that expects a raw pointer descr_.set_value(mkl_dft::config_param::BWD_STRIDES, strides.data()); -#endif // INTEL_MKL_VERSION +#else + descr_.set_value(mkl_dft::config_param::BWD_STRIDES, strides); +#endif // USE_ONEMATH } // config_param::FWD_DISTANCE @@ -204,32 +208,17 @@ class DescriptorWrapper // config_param::PLACEMENT bool get_in_place() { -#if defined(USE_ONEMATH) || INTEL_MKL_VERSION >= 20250000 mkl_dft::config_value placement; descr_.get_value(mkl_dft::config_param::PLACEMENT, &placement); return (placement == mkl_dft::config_value::INPLACE); -#else - // TODO: remove branch when MKLD-10506 is implemented - DFTI_CONFIG_VALUE placement; - descr_.get_value(mkl_dft::config_param::PLACEMENT, &placement); - return (placement == DFTI_CONFIG_VALUE::DFTI_INPLACE); -#endif // USE_ONEMATH or INTEL_MKL_VERSION } void set_in_place(const bool &in_place_request) { -#if defined(USE_ONEMATH) || INTEL_MKL_VERSION >= 20250000 descr_.set_value(mkl_dft::config_param::PLACEMENT, (in_place_request) ? mkl_dft::config_value::INPLACE : mkl_dft::config_value::NOT_INPLACE); -#else - // TODO: remove branch when MKLD-10506 is implemented - descr_.set_value(mkl_dft::config_param::PLACEMENT, - (in_place_request) - ? DFTI_CONFIG_VALUE::DFTI_INPLACE - : DFTI_CONFIG_VALUE::DFTI_NOT_INPLACE); -#endif // USE_ONEMATH or INTEL_MKL_VERSION } // config_param::PRECISION @@ -244,16 +233,9 @@ class DescriptorWrapper // config_param::COMMIT_STATUS bool is_committed() { -#if defined(USE_ONEMATH) || INTEL_MKL_VERSION >= 20250000 mkl_dft::config_value committed; descr_.get_value(mkl_dft::config_param::COMMIT_STATUS, &committed); return (committed == mkl_dft::config_value::COMMITTED); -#else - // TODO: remove branch when MKLD-10506 is implemented - DFTI_CONFIG_VALUE committed; - descr_.get_value(mkl_dft::config_param::COMMIT_STATUS, &committed); - return (committed == DFTI_CONFIG_VALUE::DFTI_COMMITTED); -#endif // USE_ONEMATH or INTEL_MKL_VERSION } private: diff --git a/dpnp/backend/extensions/vm/common.hpp b/dpnp/backend/extensions/vm/common.hpp index 2303adaebc99..4e19b5e12570 100644 --- a/dpnp/backend/extensions/vm/common.hpp +++ b/dpnp/backend/extensions/vm/common.hpp @@ -46,19 +46,6 @@ #include "utils/memory_overlap.hpp" #include "utils/type_dispatch.hpp" -/** - * Version of Intel MKL at which transition to OneMKL release 2023.2.0 occurs. - * - * @note with OneMKL=2023.1.0 the call of oneapi::mkl::vm::div() was dead - * locked inside ~usm_wrapper_to_host()->{...; q_->wait_and_throw(); ...} - */ -#ifndef __INTEL_MKL_2023_2_0_VERSION_REQUIRED -#define __INTEL_MKL_2023_2_0_VERSION_REQUIRED 20230002L -#endif - -static_assert(INTEL_MKL_VERSION >= __INTEL_MKL_2023_2_0_VERSION_REQUIRED, - "OneMKL does not meet minimum version requirement"); - namespace ext_ns = ext::common; namespace py = pybind11; namespace td_ns = dpnp::tensor::type_dispatch; diff --git a/dpnp/backend/kernels/dpnp_krnl_random.cpp b/dpnp/backend/kernels/dpnp_krnl_random.cpp index faef700a0407..828212506127 100644 --- a/dpnp/backend/kernels/dpnp_krnl_random.cpp +++ b/dpnp/backend/kernels/dpnp_krnl_random.cpp @@ -41,9 +41,6 @@ #include "dpnpc_memory_adapter.hpp" #include "queue_sycl.hpp" -static_assert(INTEL_MKL_VERSION >= __INTEL_MKL_2023_0_0_VERSION_REQUIRED, - "OneMKL does not meet minimum version requirement"); - namespace mkl_blas = oneapi::mkl::blas; namespace mkl_rng = oneapi::mkl::rng; namespace mkl_vm = oneapi::mkl::vm; diff --git a/dpnp/backend/kernels/elementwise_functions/i0.hpp b/dpnp/backend/kernels/elementwise_functions/i0.hpp index a634b74b9da8..7b244dd1164d 100644 --- a/dpnp/backend/kernels/elementwise_functions/i0.hpp +++ b/dpnp/backend/kernels/elementwise_functions/i0.hpp @@ -30,14 +30,6 @@ #include -/** - * Version of SYCL DPC++ 2025.1 compiler where an issue with - * sycl::ext::intel::math::cyl_bessel_i0(x) is fully resolved. - */ -#ifndef __SYCL_COMPILER_BESSEL_I0_SUPPORT -#define __SYCL_COMPILER_BESSEL_I0_SUPPORT 20241208L -#endif - /** * Include only when targeting to Intel devices. * This header relies on intel-specific types like _iml_half_internal, @@ -47,15 +39,13 @@ #define __SYCL_EXT_INTEL_MATH_SUPPORT #endif -#if defined(__SYCL_EXT_INTEL_MATH_SUPPORT) && \ - (__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_BESSEL_I0_SUPPORT) +#if defined(__SYCL_EXT_INTEL_MATH_SUPPORT) #include #endif namespace dpnp::kernels::i0 { -#if defined(__SYCL_EXT_INTEL_MATH_SUPPORT) && \ - (__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_BESSEL_I0_SUPPORT) +#if defined(__SYCL_EXT_INTEL_MATH_SUPPORT) using sycl::ext::intel::math::cyl_bessel_i0; #else diff --git a/dpnp/backend/src/dpnp_utils.hpp b/dpnp/backend/src/dpnp_utils.hpp index 03e56e0716aa..999347b58d08 100644 --- a/dpnp/backend/src/dpnp_utils.hpp +++ b/dpnp/backend/src/dpnp_utils.hpp @@ -41,13 +41,6 @@ #include -/** - * Version of Intel MKL at which transition to OneMKL release 2023.0.0 occurs. - */ -#ifndef __INTEL_MKL_2023_0_0_VERSION_REQUIRED -#define __INTEL_MKL_2023_0_0_VERSION_REQUIRED 20230000 -#endif - /** * @defgroup BACKEND_UTILS Backend C++ library utilities * @{