Skip to content

Commit 10490b9

Browse files
authored
Merge branch 'master' into update_docs
2 parents 638a3c4 + 713302a commit 10490b9

21 files changed

+238
-148
lines changed

.github/workflows/build-sphinx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
- name: Install dpnp dependencies
8585
run: |
8686
conda install numpy"<1.24" dpctl mkl-devel-dpcpp onedpl-devel tbb-devel dpcpp_linux-64 \
87-
cmake cython"<3" pytest ninja scikit-build sysroot_linux-64">=2.28" ${{ env.CHANNELS }}
87+
cmake cython pytest ninja scikit-build sysroot_linux-64">=2.28" ${{ env.CHANNELS }}
8888
8989
- name: Install cuPy dependencies
9090
run: conda install cupy cudatoolkit=10.0

.github/workflows/generate_coverage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
sudo apt-get install lcov
4242
- name: Install dpnp dependencies
4343
run: |
44-
conda install cython"<3" llvm cmake">=3.21" scikit-build ninja pytest pytest-cov coverage[toml] \
44+
conda install cython llvm cmake">=3.21" scikit-build ninja pytest pytest-cov coverage[toml] \
4545
dpctl dpcpp_linux-64 sysroot_linux-64">=2.28" mkl-devel-dpcpp tbb-devel onedpl-devel ${{ env.CHANNELS }}
4646
- name: Conda info
4747
run: |

conda-recipe/build.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
#!/bin/bash
22

3-
# Workaround to Klocwork overwriting LD_LIBRARY_PATH that was modified
4-
# by DPC++ compiler conda packages. Will need to be added to DPC++ compiler
5-
# activation scripts.
6-
export LDFLAGS="$LDFLAGS -Wl,-rpath,$PREFIX/lib"
7-
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PREFIX/compiler/lib/intel64_lin:$PREFIX/compiler/lib:$PREFIX/lib"
8-
93
# Intel LLVM must cooperate with compiler and sysroot from conda
104
echo "--gcc-toolchain=${BUILD_PREFIX} --sysroot=${BUILD_PREFIX}/${HOST}/sysroot -target ${HOST}" > icpx_for_conda.cfg
115
export ICPXCFG="$(pwd)/icpx_for_conda.cfg"

conda-recipe/meta.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ requirements:
99
- python
1010
- setuptools
1111
- numpy >=1.19,<1.25a0
12-
- cython <3
12+
- cython
1313
- cmake >=3.21
1414
- ninja
1515
- git
1616
- dpctl >=0.14.5
17-
- mkl-devel-dpcpp {{ environ.get('MKL_VER', '>=2023.1.0') }}
17+
- mkl-devel-dpcpp {{ environ.get('MKL_VER', '>=2023.2.0') }}
1818
- onedpl-devel
1919
- tbb-devel
2020
- wheel
2121
- scikit-build
2222
build:
2323
- {{ compiler('cxx') }}
24-
- {{ compiler('dpcpp') }} >=2023.1.0 # [not osx]
24+
- {{ compiler('dpcpp') }} >=2023.2.0 # [not osx]
2525
- sysroot_linux-64 >=2.28 # [linux]
2626
run:
2727
- python

dpnp/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ function(build_dpnp_cython_ext _trgt _src _dest)
99
if (DPNP_GENERATE_COVERAGE)
1010
target_compile_definitions(${_trgt} PRIVATE CYTHON_TRACE=1 CYTHON_TRACE_NOGIL=1)
1111
endif()
12+
target_compile_definitions(${_trgt} PRIVATE NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION)
1213
# NumPy
1314
target_include_directories(${_trgt} PRIVATE ${NumPy_INCLUDE_DIR})
1415
# Dpctl

dpnp/backend/extensions/vm/common.hpp

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@
3737
#include "utils/type_dispatch.hpp"
3838
#include "utils/type_utils.hpp"
3939

40+
#include "dpnp_utils.hpp"
41+
42+
static_assert(INTEL_MKL_VERSION >= __INTEL_MKL_2023_2_0_VERSION_REQUIRED,
43+
"OneMKL does not meet minimum version requirement");
44+
4045
// OneMKL namespace with VM functions
4146
namespace mkl_vm = oneapi::mkl::vm;
4247

@@ -272,7 +277,6 @@ bool need_to_call_unary_ufunc(sycl::queue exec_q,
272277
dpctl::tensor::usm_ndarray dst,
273278
const dispatchT &dispatch_vector)
274279
{
275-
#if INTEL_MKL_VERSION >= 20230002
276280
// check type_nums
277281
int src_typenum = src.get_typenum();
278282
int dst_typenum = dst.get_typenum();
@@ -356,16 +360,6 @@ bool need_to_call_unary_ufunc(sycl::queue exec_q,
356360
return false;
357361
}
358362
return true;
359-
#else
360-
// In OneMKL 2023.1.0 the call of oneapi::mkl::vm::div() is going to dead
361-
// lock inside ~usm_wrapper_to_host()->{...; q_->wait_and_throw(); ...}
362-
363-
(void)exec_q;
364-
(void)src;
365-
(void)dst;
366-
(void)dispatch_vector;
367-
return false;
368-
#endif // INTEL_MKL_VERSION >= 20230002
369363
}
370364

371365
template <typename dispatchT>
@@ -375,7 +369,6 @@ bool need_to_call_binary_ufunc(sycl::queue exec_q,
375369
dpctl::tensor::usm_ndarray dst,
376370
const dispatchT &dispatch_vector)
377371
{
378-
#if INTEL_MKL_VERSION >= 20230002
379372
// check type_nums
380373
int src1_typenum = src1.get_typenum();
381374
int src2_typenum = src2.get_typenum();
@@ -465,17 +458,6 @@ bool need_to_call_binary_ufunc(sycl::queue exec_q,
465458
return false;
466459
}
467460
return true;
468-
#else
469-
// In OneMKL 2023.1.0 the call of oneapi::mkl::vm::div() is going to dead
470-
// lock inside ~usm_wrapper_to_host()->{...; q_->wait_and_throw(); ...}
471-
472-
(void)exec_q;
473-
(void)src1;
474-
(void)src2;
475-
(void)dst;
476-
(void)dispatch_vector;
477-
return false;
478-
#endif // INTEL_MKL_VERSION >= 20230002
479461
}
480462

481463
template <typename dispatchT,

dpnp/backend/kernels/dpnp_krnl_common.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,17 +1167,17 @@ void func_map_init_linalg(func_map_t &fmap)
11671167
eft_DBL, (void *)dpnp_eig_default_c<double, double>};
11681168

11691169
fmap[DPNPFuncName::DPNP_FN_EIG_EXT][eft_INT][eft_INT] = {
1170-
get_default_floating_type<>(),
1170+
get_default_floating_type(),
11711171
(void *)dpnp_eig_ext_c<
1172-
int32_t, func_type_map_t::find_type<get_default_floating_type<>()>>,
1172+
int32_t, func_type_map_t::find_type<get_default_floating_type()>>,
11731173
get_default_floating_type<std::false_type>(),
11741174
(void *)dpnp_eig_ext_c<
11751175
int32_t, func_type_map_t::find_type<
11761176
get_default_floating_type<std::false_type>()>>};
11771177
fmap[DPNPFuncName::DPNP_FN_EIG_EXT][eft_LNG][eft_LNG] = {
1178-
get_default_floating_type<>(),
1178+
get_default_floating_type(),
11791179
(void *)dpnp_eig_ext_c<
1180-
int64_t, func_type_map_t::find_type<get_default_floating_type<>()>>,
1180+
int64_t, func_type_map_t::find_type<get_default_floating_type()>>,
11811181
get_default_floating_type<std::false_type>(),
11821182
(void *)dpnp_eig_ext_c<
11831183
int64_t, func_type_map_t::find_type<
@@ -1197,17 +1197,17 @@ void func_map_init_linalg(func_map_t &fmap)
11971197
eft_DBL, (void *)dpnp_eigvals_default_c<double, double>};
11981198

11991199
fmap[DPNPFuncName::DPNP_FN_EIGVALS_EXT][eft_INT][eft_INT] = {
1200-
get_default_floating_type<>(),
1200+
get_default_floating_type(),
12011201
(void *)dpnp_eigvals_ext_c<
1202-
int32_t, func_type_map_t::find_type<get_default_floating_type<>()>>,
1202+
int32_t, func_type_map_t::find_type<get_default_floating_type()>>,
12031203
get_default_floating_type<std::false_type>(),
12041204
(void *)dpnp_eigvals_ext_c<
12051205
int32_t, func_type_map_t::find_type<
12061206
get_default_floating_type<std::false_type>()>>};
12071207
fmap[DPNPFuncName::DPNP_FN_EIGVALS_EXT][eft_LNG][eft_LNG] = {
1208-
get_default_floating_type<>(),
1208+
get_default_floating_type(),
12091209
(void *)dpnp_eigvals_ext_c<
1210-
int64_t, func_type_map_t::find_type<get_default_floating_type<>()>>,
1210+
int64_t, func_type_map_t::find_type<get_default_floating_type()>>,
12111211
get_default_floating_type<std::false_type>(),
12121212
(void *)dpnp_eigvals_ext_c<
12131213
int64_t, func_type_map_t::find_type<

dpnp/backend/kernels/dpnp_krnl_linalg.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -879,17 +879,17 @@ void func_map_init_linalg_func(func_map_t &fmap)
879879
eft_DBL, (void *)dpnp_inv_default_c<double, double>};
880880

881881
fmap[DPNPFuncName::DPNP_FN_INV_EXT][eft_INT][eft_INT] = {
882-
get_default_floating_type<>(),
882+
get_default_floating_type(),
883883
(void *)dpnp_inv_ext_c<
884-
int32_t, func_type_map_t::find_type<get_default_floating_type<>()>>,
884+
int32_t, func_type_map_t::find_type<get_default_floating_type()>>,
885885
get_default_floating_type<std::false_type>(),
886886
(void *)dpnp_inv_ext_c<
887887
int32_t, func_type_map_t::find_type<
888888
get_default_floating_type<std::false_type>()>>};
889889
fmap[DPNPFuncName::DPNP_FN_INV_EXT][eft_LNG][eft_LNG] = {
890-
get_default_floating_type<>(),
890+
get_default_floating_type(),
891891
(void *)dpnp_inv_ext_c<
892-
int64_t, func_type_map_t::find_type<get_default_floating_type<>()>>,
892+
int64_t, func_type_map_t::find_type<get_default_floating_type()>>,
893893
get_default_floating_type<std::false_type>(),
894894
(void *)dpnp_inv_ext_c<
895895
int64_t, func_type_map_t::find_type<
@@ -1051,17 +1051,17 @@ void func_map_init_linalg_func(func_map_t &fmap)
10511051
// eft_C128, (void*)dpnp_qr_c<std::complex<double>, std::complex<double>>};
10521052

10531053
fmap[DPNPFuncName::DPNP_FN_QR_EXT][eft_INT][eft_INT] = {
1054-
get_default_floating_type<>(),
1054+
get_default_floating_type(),
10551055
(void *)dpnp_qr_ext_c<
1056-
int32_t, func_type_map_t::find_type<get_default_floating_type<>()>>,
1056+
int32_t, func_type_map_t::find_type<get_default_floating_type()>>,
10571057
get_default_floating_type<std::false_type>(),
10581058
(void *)dpnp_qr_ext_c<
10591059
int32_t, func_type_map_t::find_type<
10601060
get_default_floating_type<std::false_type>()>>};
10611061
fmap[DPNPFuncName::DPNP_FN_QR_EXT][eft_LNG][eft_LNG] = {
1062-
get_default_floating_type<>(),
1062+
get_default_floating_type(),
10631063
(void *)dpnp_qr_ext_c<
1064-
int64_t, func_type_map_t::find_type<get_default_floating_type<>()>>,
1064+
int64_t, func_type_map_t::find_type<get_default_floating_type()>>,
10651065
get_default_floating_type<std::false_type>(),
10661066
(void *)dpnp_qr_ext_c<
10671067
int64_t, func_type_map_t::find_type<
@@ -1086,10 +1086,10 @@ void func_map_init_linalg_func(func_map_t &fmap)
10861086
std::complex<double>, double>};
10871087

10881088
fmap[DPNPFuncName::DPNP_FN_SVD_EXT][eft_INT][eft_INT] = {
1089-
get_default_floating_type<>(),
1089+
get_default_floating_type(),
10901090
(void *)dpnp_svd_ext_c<
1091-
int32_t, func_type_map_t::find_type<get_default_floating_type<>()>,
1092-
func_type_map_t::find_type<get_default_floating_type<>()>>,
1091+
int32_t, func_type_map_t::find_type<get_default_floating_type()>,
1092+
func_type_map_t::find_type<get_default_floating_type()>>,
10931093
get_default_floating_type<std::false_type>(),
10941094
(void *)
10951095
dpnp_svd_ext_c<int32_t,
@@ -1098,10 +1098,10 @@ void func_map_init_linalg_func(func_map_t &fmap)
10981098
func_type_map_t::find_type<
10991099
get_default_floating_type<std::false_type>()>>};
11001100
fmap[DPNPFuncName::DPNP_FN_SVD_EXT][eft_LNG][eft_LNG] = {
1101-
get_default_floating_type<>(),
1101+
get_default_floating_type(),
11021102
(void *)dpnp_svd_ext_c<
1103-
int64_t, func_type_map_t::find_type<get_default_floating_type<>()>,
1104-
func_type_map_t::find_type<get_default_floating_type<>()>>,
1103+
int64_t, func_type_map_t::find_type<get_default_floating_type()>,
1104+
func_type_map_t::find_type<get_default_floating_type()>>,
11051105
get_default_floating_type<std::false_type>(),
11061106
(void *)
11071107
dpnp_svd_ext_c<int64_t,

dpnp/backend/kernels/dpnp_krnl_mathematical.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
#include "dpnpc_memory_adapter.hpp"
3636
#include "queue_sycl.hpp"
3737

38+
static_assert(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_VECTOR_ABS_CHANGED,
39+
"SYCL DPC++ compiler does not meet minimum version requirement");
40+
3841
template <typename _KernelNameSpecialization>
3942
class dpnp_around_c_kernel;
4043

@@ -180,18 +183,8 @@ DPCTLSyclEventRef
180183
sycl::vec<_DataType_input, vec_sz> data_vec =
181184
sg.load<vec_sz>(input_ptrT(&array1[start]));
182185

183-
#if (__SYCL_COMPILER_VERSION < __SYCL_COMPILER_VECTOR_ABS_CHANGED)
184-
// sycl::abs() returns unsigned integers only, so explicit
185-
// casting to signed ones is required
186-
using result_absT = typename cl::sycl::detail::make_unsigned<
187-
_DataType_output>::type;
188-
sycl::vec<_DataType_output, vec_sz> res_vec =
189-
dpnp_vec_cast<_DataType_output, result_absT, vec_sz>(
190-
sycl::abs(data_vec));
191-
#else
192186
sycl::vec<_DataType_output, vec_sz> res_vec =
193187
sycl::abs(data_vec);
194-
#endif
195188

196189
sg.store<vec_sz>(result_ptrT(&result[start]), res_vec);
197190
}

dpnp/backend/kernels/dpnp_krnl_random.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
#include "dpnpc_memory_adapter.hpp"
3838
#include "queue_sycl.hpp"
3939

40-
static_assert(INTEL_MKL_VERSION >= __INTEL_MKL_2023_VERSION_REQUIRED,
41-
"MKL does not meet minimum version requirement");
40+
static_assert(INTEL_MKL_VERSION >= __INTEL_MKL_2023_0_0_VERSION_REQUIRED,
41+
"OneMKL does not meet minimum version requirement");
4242

4343
namespace mkl_blas = oneapi::mkl::blas;
4444
namespace mkl_rng = oneapi::mkl::rng;

dpnp/backend/kernels/dpnp_krnl_statistics.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,9 +1330,21 @@ void func_map_init_statistics(func_map_t &fmap)
13301330
eft_DBL, (void *)dpnp_median_default_c<double, double>};
13311331

13321332
fmap[DPNPFuncName::DPNP_FN_MEDIAN_EXT][eft_INT][eft_INT] = {
1333-
eft_DBL, (void *)dpnp_median_ext_c<int32_t, double>};
1333+
get_default_floating_type(),
1334+
(void *)dpnp_median_ext_c<
1335+
int32_t, func_type_map_t::find_type<get_default_floating_type()>>,
1336+
get_default_floating_type<std::false_type>(),
1337+
(void *)dpnp_median_ext_c<
1338+
int32_t, func_type_map_t::find_type<
1339+
get_default_floating_type<std::false_type>()>>};
13341340
fmap[DPNPFuncName::DPNP_FN_MEDIAN_EXT][eft_LNG][eft_LNG] = {
1335-
eft_DBL, (void *)dpnp_median_ext_c<int64_t, double>};
1341+
get_default_floating_type(),
1342+
(void *)dpnp_median_ext_c<
1343+
int64_t, func_type_map_t::find_type<get_default_floating_type()>>,
1344+
get_default_floating_type<std::false_type>(),
1345+
(void *)dpnp_median_ext_c<
1346+
int64_t, func_type_map_t::find_type<
1347+
get_default_floating_type<std::false_type>()>>};
13361348
fmap[DPNPFuncName::DPNP_FN_MEDIAN_EXT][eft_FLT][eft_FLT] = {
13371349
eft_FLT, (void *)dpnp_median_ext_c<float, float>};
13381350
fmap[DPNPFuncName::DPNP_FN_MEDIAN_EXT][eft_DBL][eft_DBL] = {

dpnp/backend/src/dpnp_utils.hpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,18 @@
6464
/**
6565
* Version of Intel MKL at which transition to OneMKL release 2023.0.0 occurs.
6666
*/
67-
#ifndef __INTEL_MKL_2023_VERSION_REQUIRED
68-
#define __INTEL_MKL_2023_VERSION_REQUIRED 20230000
67+
#ifndef __INTEL_MKL_2023_0_0_VERSION_REQUIRED
68+
#define __INTEL_MKL_2023_0_0_VERSION_REQUIRED 20230000
69+
#endif
70+
71+
/**
72+
* Version of Intel MKL at which transition to OneMKL release 2023.2.0 occurs.
73+
*
74+
* @note with OneMKL=2023.1.0 the call of oneapi::mkl::vm::div() was dead
75+
* locked inside ~usm_wrapper_to_host()->{...; q_->wait_and_throw(); ...}
76+
*/
77+
#ifndef __INTEL_MKL_2023_2_0_VERSION_REQUIRED
78+
#define __INTEL_MKL_2023_2_0_VERSION_REQUIRED 20230002L
6979
#endif
7080

7181
/**

0 commit comments

Comments
 (0)