From 95a4cb59eec5f43ae240d54c2902eee05e9032f0 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Tue, 25 Jul 2023 03:41:24 -0500 Subject: [PATCH] Pinned DPC++ and OneMKL versions to 2023.2 release --- conda-recipe/meta.yaml | 4 +-- dpnp/backend/extensions/vm/common.hpp | 28 ++++--------------- .../kernels/dpnp_krnl_mathematical.cpp | 13 ++------- dpnp/backend/kernels/dpnp_krnl_random.cpp | 4 +-- dpnp/backend/src/dpnp_utils.hpp | 14 ++++++++-- 5 files changed, 24 insertions(+), 39 deletions(-) diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 227fe0e7bb88..5d6d39fd1133 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -14,14 +14,14 @@ requirements: - ninja - git - dpctl >=0.14.5 - - mkl-devel-dpcpp {{ environ.get('MKL_VER', '>=2023.1.0') }} + - mkl-devel-dpcpp {{ environ.get('MKL_VER', '>=2023.2.0') }} - onedpl-devel - tbb-devel - wheel - scikit-build build: - {{ compiler('cxx') }} - - {{ compiler('dpcpp') }} >=2023.1.0 # [not osx] + - {{ compiler('dpcpp') }} >=2023.2.0 # [not osx] - sysroot_linux-64 >=2.28 # [linux] run: - python diff --git a/dpnp/backend/extensions/vm/common.hpp b/dpnp/backend/extensions/vm/common.hpp index 787e9cd47bd5..db68df60967b 100644 --- a/dpnp/backend/extensions/vm/common.hpp +++ b/dpnp/backend/extensions/vm/common.hpp @@ -37,6 +37,11 @@ #include "utils/type_dispatch.hpp" #include "utils/type_utils.hpp" +#include "dpnp_utils.hpp" + +static_assert(INTEL_MKL_VERSION >= __INTEL_MKL_2023_2_0_VERSION_REQUIRED, + "OneMKL does not meet minimum version requirement"); + // OneMKL namespace with VM functions namespace mkl_vm = oneapi::mkl::vm; @@ -272,7 +277,6 @@ bool need_to_call_unary_ufunc(sycl::queue exec_q, dpctl::tensor::usm_ndarray dst, const dispatchT &dispatch_vector) { -#if INTEL_MKL_VERSION >= 20230002 // check type_nums int src_typenum = src.get_typenum(); int dst_typenum = dst.get_typenum(); @@ -356,16 +360,6 @@ bool need_to_call_unary_ufunc(sycl::queue exec_q, return false; } return true; -#else - // In OneMKL 2023.1.0 the call of oneapi::mkl::vm::div() is going to dead - // lock inside ~usm_wrapper_to_host()->{...; q_->wait_and_throw(); ...} - - (void)exec_q; - (void)src; - (void)dst; - (void)dispatch_vector; - return false; -#endif // INTEL_MKL_VERSION >= 20230002 } template @@ -375,7 +369,6 @@ bool need_to_call_binary_ufunc(sycl::queue exec_q, dpctl::tensor::usm_ndarray dst, const dispatchT &dispatch_vector) { -#if INTEL_MKL_VERSION >= 20230002 // check type_nums int src1_typenum = src1.get_typenum(); int src2_typenum = src2.get_typenum(); @@ -465,17 +458,6 @@ bool need_to_call_binary_ufunc(sycl::queue exec_q, return false; } return true; -#else - // In OneMKL 2023.1.0 the call of oneapi::mkl::vm::div() is going to dead - // lock inside ~usm_wrapper_to_host()->{...; q_->wait_and_throw(); ...} - - (void)exec_q; - (void)src1; - (void)src2; - (void)dst; - (void)dispatch_vector; - return false; -#endif // INTEL_MKL_VERSION >= 20230002 } template = __SYCL_COMPILER_VECTOR_ABS_CHANGED, + "SYCL DPC++ compiler does not meet minimum version requirement"); + template class dpnp_around_c_kernel; @@ -180,18 +183,8 @@ DPCTLSyclEventRef sycl::vec<_DataType_input, vec_sz> data_vec = sg.load(input_ptrT(&array1[start])); -#if (__SYCL_COMPILER_VERSION < __SYCL_COMPILER_VECTOR_ABS_CHANGED) - // sycl::abs() returns unsigned integers only, so explicit - // casting to signed ones is required - using result_absT = typename cl::sycl::detail::make_unsigned< - _DataType_output>::type; - sycl::vec<_DataType_output, vec_sz> res_vec = - dpnp_vec_cast<_DataType_output, result_absT, vec_sz>( - sycl::abs(data_vec)); -#else sycl::vec<_DataType_output, vec_sz> res_vec = sycl::abs(data_vec); -#endif sg.store(result_ptrT(&result[start]), res_vec); } diff --git a/dpnp/backend/kernels/dpnp_krnl_random.cpp b/dpnp/backend/kernels/dpnp_krnl_random.cpp index ea4336880fbe..a6ed5794c244 100644 --- a/dpnp/backend/kernels/dpnp_krnl_random.cpp +++ b/dpnp/backend/kernels/dpnp_krnl_random.cpp @@ -37,8 +37,8 @@ #include "dpnpc_memory_adapter.hpp" #include "queue_sycl.hpp" -static_assert(INTEL_MKL_VERSION >= __INTEL_MKL_2023_VERSION_REQUIRED, - "MKL does not meet minimum version requirement"); +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; diff --git a/dpnp/backend/src/dpnp_utils.hpp b/dpnp/backend/src/dpnp_utils.hpp index 2276c2f38233..34547f76f769 100644 --- a/dpnp/backend/src/dpnp_utils.hpp +++ b/dpnp/backend/src/dpnp_utils.hpp @@ -64,8 +64,18 @@ /** * Version of Intel MKL at which transition to OneMKL release 2023.0.0 occurs. */ -#ifndef __INTEL_MKL_2023_VERSION_REQUIRED -#define __INTEL_MKL_2023_VERSION_REQUIRED 20230000 +#ifndef __INTEL_MKL_2023_0_0_VERSION_REQUIRED +#define __INTEL_MKL_2023_0_0_VERSION_REQUIRED 20230000 +#endif + +/** + * 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 /**