Skip to content

Commit 20223f4

Browse files
authored
Merge branch 'master' into impl_eigvalsh
2 parents aa6baff + fc317cb commit 20223f4

28 files changed

+1224
-513
lines changed

SECURITY.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Security Policy
2+
3+
## Report a Vulnerability
4+
5+
Please report security issues or vulnerabilities to the [Intel® Security Center].
6+
7+
For more information on how Intel® works to resolve security issues, see
8+
[Vulnerability Handling Guidelines].
9+
10+
[Intel® Security Center]:https://www.intel.com/content/www/us/en/security-center/default.html
11+
12+
[Vulnerability Handling Guidelines]:https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html

doc/reference/creation.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
.. _routines.creation:
22

3-
Array Creation Routines
3+
Array creation routines
44
=======================
55

66
.. https://docs.scipy.org/doc/numpy/reference/routines.array-creation.html
77
8-
Basic creation routines
8+
From shape or value
99
-----------------------
1010

1111
.. autosummary::
@@ -24,7 +24,7 @@ Basic creation routines
2424
dpnp.full_like
2525

2626

27-
Creation from other data
27+
From existing data
2828
------------------------
2929

3030
.. autosummary::
@@ -35,6 +35,7 @@ Creation from other data
3535
dpnp.asarray
3636
dpnp.asanyarray
3737
dpnp.ascontiguousarray
38+
dpnp.astype
3839
dpnp.copy
3940
dpnp.frombuffer
4041
dpnp.from_dlpack
@@ -61,7 +62,7 @@ Numerical ranges
6162
dpnp.ogrid
6263

6364

64-
Matrix creation
65+
Building matrices
6566
---------------
6667

6768
.. autosummary::
@@ -82,5 +83,4 @@ The Matrix class
8283
:toctree: generated/
8384
:nosignatures:
8485

85-
dpnp.mat
8686
dpnp.bmat

dpnp/backend/include/dpnp_iface_fptr.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,6 @@ enum class DPNPFuncName : size_t
174174
DPNP_FN_INV, /**< Used in numpy.linalg.inv() impl */
175175
DPNP_FN_INVERT, /**< Used in numpy.invert() impl */
176176
DPNP_FN_KRON, /**< Used in numpy.kron() impl */
177-
DPNP_FN_KRON_EXT, /**< Used in numpy.kron() impl, requires extra parameters
178-
*/
179177
DPNP_FN_LEFT_SHIFT, /**< Used in numpy.left_shift() impl */
180178
DPNP_FN_LOG, /**< Used in numpy.log() impl */
181179
DPNP_FN_LOG10, /**< Used in numpy.log10() impl */

dpnp/backend/kernels/dpnp_krnl_linalg.cpp

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -499,18 +499,6 @@ void (*dpnp_kron_default_c)(void *,
499499
size_t) =
500500
dpnp_kron_c<_DataType1, _DataType2, _ResultType>;
501501

502-
template <typename _DataType1, typename _DataType2, typename _ResultType>
503-
DPCTLSyclEventRef (*dpnp_kron_ext_c)(DPCTLSyclQueueRef,
504-
void *,
505-
void *,
506-
void *,
507-
shape_elem_type *,
508-
shape_elem_type *,
509-
shape_elem_type *,
510-
size_t,
511-
const DPCTLEventVectorRef) =
512-
dpnp_kron_c<_DataType1, _DataType2, _ResultType>;
513-
514502
template <typename _DataType>
515503
DPCTLSyclEventRef
516504
dpnp_matrix_rank_c(DPCTLSyclQueueRef q_ref,
@@ -890,67 +878,6 @@ void func_map_init_linalg_func(func_map_t &fmap)
890878
(void *)dpnp_kron_default_c<std::complex<double>, std::complex<double>,
891879
std::complex<double>>};
892880

893-
fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_INT][eft_INT] = {
894-
eft_INT, (void *)dpnp_kron_ext_c<int32_t, int32_t, int32_t>};
895-
fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_INT][eft_LNG] = {
896-
eft_LNG, (void *)dpnp_kron_ext_c<int32_t, int64_t, int64_t>};
897-
fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_INT][eft_FLT] = {
898-
eft_FLT, (void *)dpnp_kron_ext_c<int32_t, float, float>};
899-
fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_INT][eft_DBL] = {
900-
eft_DBL, (void *)dpnp_kron_ext_c<int32_t, double, double>};
901-
// fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_INT][eft_C128] = {
902-
// eft_C128, (void*)dpnp_kron_ext_c<int32_t, std::complex<double>,
903-
// std::complex<double>>};
904-
fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_LNG][eft_INT] = {
905-
eft_LNG, (void *)dpnp_kron_ext_c<int64_t, int32_t, int64_t>};
906-
fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_LNG][eft_LNG] = {
907-
eft_LNG, (void *)dpnp_kron_ext_c<int64_t, int64_t, int64_t>};
908-
fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_LNG][eft_FLT] = {
909-
eft_FLT, (void *)dpnp_kron_ext_c<int64_t, float, float>};
910-
fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_LNG][eft_DBL] = {
911-
eft_DBL, (void *)dpnp_kron_ext_c<int64_t, double, double>};
912-
// fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_LNG][eft_C128] = {
913-
// eft_C128, (void*)dpnp_kron_ext_c<int64_t, std::complex<double>,
914-
// std::complex<double>>};
915-
fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_FLT][eft_INT] = {
916-
eft_FLT, (void *)dpnp_kron_ext_c<float, int32_t, float>};
917-
fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_FLT][eft_LNG] = {
918-
eft_FLT, (void *)dpnp_kron_ext_c<float, int64_t, float>};
919-
fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_FLT][eft_FLT] = {
920-
eft_FLT, (void *)dpnp_kron_ext_c<float, float, float>};
921-
fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_FLT][eft_DBL] = {
922-
eft_DBL, (void *)dpnp_kron_ext_c<float, double, double>};
923-
// fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_FLT][eft_C128] = {
924-
// eft_C128, (void*)dpnp_kron_ext_c<float, std::complex<double>,
925-
// std::complex<double>>};
926-
fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_DBL][eft_INT] = {
927-
eft_DBL, (void *)dpnp_kron_ext_c<double, int32_t, double>};
928-
fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_DBL][eft_LNG] = {
929-
eft_DBL, (void *)dpnp_kron_ext_c<double, int64_t, double>};
930-
fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_DBL][eft_FLT] = {
931-
eft_DBL, (void *)dpnp_kron_ext_c<double, float, double>};
932-
fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_DBL][eft_DBL] = {
933-
eft_DBL, (void *)dpnp_kron_ext_c<double, double, double>};
934-
fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_DBL][eft_C128] = {
935-
eft_C128, (void *)dpnp_kron_ext_c<double, std::complex<double>,
936-
std::complex<double>>};
937-
// fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_C128][eft_INT] = {
938-
// eft_C128, (void*)dpnp_kron_ext_c<std::complex<double>, int32_t,
939-
// std::complex<double>>};
940-
// fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_C128][eft_LNG] = {
941-
// eft_C128, (void*)dpnp_kron_ext_c<std::complex<double>, int64_t,
942-
// std::complex<double>>};
943-
// fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_C128][eft_FLT] = {
944-
// eft_C128, (void*)dpnp_kron_ext_c<std::complex<double>, float,
945-
// std::complex<double>>};
946-
fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_C128][eft_DBL] = {
947-
eft_C128, (void *)dpnp_kron_ext_c<std::complex<double>, double,
948-
std::complex<double>>};
949-
fmap[DPNPFuncName::DPNP_FN_KRON_EXT][eft_C128][eft_C128] = {
950-
eft_C128,
951-
(void *)dpnp_kron_ext_c<std::complex<double>, std::complex<double>,
952-
std::complex<double>>};
953-
954881
fmap[DPNPFuncName::DPNP_FN_MATRIX_RANK][eft_INT][eft_INT] = {
955882
eft_INT, (void *)dpnp_matrix_rank_default_c<int32_t>};
956883
fmap[DPNPFuncName::DPNP_FN_MATRIX_RANK][eft_LNG][eft_LNG] = {

dpnp/dpnp_algo/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

22
set(dpnp_algo_pyx_deps
3-
${CMAKE_CURRENT_SOURCE_DIR}/dpnp_algo_linearalgebra.pxi
43
${CMAKE_CURRENT_SOURCE_DIR}/dpnp_algo_statistics.pxi
54
${CMAKE_CURRENT_SOURCE_DIR}/dpnp_algo_trigonometric.pxi
65
${CMAKE_CURRENT_SOURCE_DIR}/dpnp_algo_sorting.pxi

dpnp/dpnp_algo/dpnp_algo.pxd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ cdef extern from "dpnp_iface_fptr.hpp" namespace "DPNPFuncName": # need this na
7474
DPNP_FN_FMOD_EXT
7575
DPNP_FN_FULL
7676
DPNP_FN_FULL_LIKE
77-
DPNP_FN_KRON
78-
DPNP_FN_KRON_EXT
7977
DPNP_FN_MAXIMUM
8078
DPNP_FN_MAXIMUM_EXT
8179
DPNP_FN_MEDIAN

dpnp/dpnp_algo/dpnp_algo.pyx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ __all__ = [
6060

6161
include "dpnp_algo_arraycreation.pxi"
6262
include "dpnp_algo_indexing.pxi"
63-
include "dpnp_algo_linearalgebra.pxi"
6463
include "dpnp_algo_logic.pxi"
6564
include "dpnp_algo_mathematical.pxi"
6665
include "dpnp_algo_sorting.pxi"

dpnp/dpnp_algo/dpnp_algo_linearalgebra.pxi

Lines changed: 0 additions & 106 deletions
This file was deleted.

dpnp/dpnp_algo/dpnp_arraycreation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,9 @@ class dpnp_nd_grid:
289289
def __init__(
290290
self, sparse=False, device=None, usm_type="device", sycl_queue=None
291291
):
292-
dpu.validate_usm_type(usm_type, allow_none=False)
292+
dpu.validate_usm_type(usm_type, allow_none=True)
293293
self.sparse = sparse
294-
self.usm_type = usm_type
294+
self.usm_type = "device" if usm_type is None else usm_type
295295
self.sycl_queue_normalized = dpnp.get_normalized_queue_device(
296296
sycl_queue=sycl_queue, device=device
297297
)

dpnp/dpnp_array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ def astype(self, dtype, order="K", casting="unsafe", subok=True, copy=True):
540540
Array data type casting.
541541
dtype : dtype
542542
Target data type.
543-
order : {'C', 'F', 'A', 'K'}
543+
order : {"C", "F", "A", "K"}, optional
544544
Row-major (C-style) or column-major (Fortran-style) order.
545545
When ``order`` is 'A', it uses 'F' if ``a`` is column-major and uses 'C' otherwise.
546546
And when ``order`` is 'K', it keeps strides as closely as possible.

dpnp/dpnp_iface.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"array_equal",
5757
"asnumpy",
5858
"astype",
59+
"check_limitations",
5960
"check_supported_arrays_type",
6061
"convert_single_elem_array_to_scalar",
6162
"default_float_type",
@@ -232,6 +233,58 @@ def astype(x1, dtype, order="K", casting="unsafe", copy=True):
232233
return dpnp_array._create_from_usm_ndarray(array_obj)
233234

234235

236+
def check_limitations(
237+
order=None, subok=False, like=None, initial=None, where=True
238+
):
239+
"""
240+
Checking limitation kwargs for their supported values.
241+
242+
Parameter `order` is only supported with values ``"C"``, ``"F"``
243+
and ``None``.
244+
Parameter `subok` is only supported with default value ``False``.
245+
Parameter `like` is only supported with default value ``None``.
246+
Parameter `initial` is only supported with default value ``None``.
247+
Parameter `where` is only supported with default value ``True``.
248+
249+
Raises
250+
------
251+
NotImplementedError
252+
If any input kwargs is of unsupported value.
253+
254+
"""
255+
256+
if order in ("A", "a", "K", "k"):
257+
raise NotImplementedError(
258+
"Keyword argument `order` is supported only with "
259+
f"values ``'C'`` and ``'F'``, but got {order}"
260+
)
261+
if order not in ("C", "c", "F", "f", None):
262+
raise ValueError(
263+
"Unrecognized `order` keyword value, expecting "
264+
f"``'C'`` or ``'F'``, but got {order}"
265+
)
266+
if like is not None:
267+
raise NotImplementedError(
268+
"Keyword argument `like` is supported only with "
269+
f"default value ``None``, but got {like}"
270+
)
271+
if subok is not False:
272+
raise NotImplementedError(
273+
"Keyword argument `subok` is supported only with "
274+
f"default value ``False``, but got {subok}"
275+
)
276+
if initial is not None:
277+
raise NotImplementedError(
278+
"Keyword argument `initial` is only supported with "
279+
f"default value ``None``, but got {initial}"
280+
)
281+
if where is not True:
282+
raise NotImplementedError(
283+
"Keyword argument `where` is supported only with "
284+
f"default value ``True``, but got {where}"
285+
)
286+
287+
235288
def check_supported_arrays_type(*arrays, scalar_type=False, all_scalars=False):
236289
"""
237290
Return ``True`` if each array has either type of scalar,

0 commit comments

Comments
 (0)