Skip to content

Commit dcec6ff

Browse files
Merge branch 'master' into gold/2021
2 parents 07a0564 + 9320691 commit dcec6ff

File tree

7 files changed

+48
-28
lines changed

7 files changed

+48
-28
lines changed

conda-recipe/meta.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ requirements:
88
host:
99
- python
1010
- setuptools
11-
- numpy >=1.15 # [win or osx or py>=38]
12-
- numpy 1.17 # [linux and py==37]
11+
- numpy 1.19.5
1312
- cython
1413
- cmake 3.19
1514
- dpctl >=0.10

dpnp/backend/kernels/dpnp_krnl_common.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -567,9 +567,9 @@ void dpnp_matmul_c(void* result_out,
567567
}
568568

569569
cl::sycl::event event;
570-
DPNPC_ptr_adapter<_DataType> input1_ptr(input1_in, size_m * size_k, true);
571-
DPNPC_ptr_adapter<_DataType> input2_ptr(input2_in, size_k * size_n, true);
572-
DPNPC_ptr_adapter<_DataType> result_ptr(result_out, size_m * size_n, true, true);
570+
DPNPC_ptr_adapter<_DataType> input1_ptr(input1_in, size_m * size_k);
571+
DPNPC_ptr_adapter<_DataType> input2_ptr(input2_in, size_k * size_n);
572+
DPNPC_ptr_adapter<_DataType> result_ptr(result_out, size_m * size_n, false, true);
573573
_DataType* array_1 = input1_ptr.get_ptr();
574574
_DataType* array_2 = input2_ptr.get_ptr();
575575
_DataType* result = result_ptr.get_ptr();

dpnp/dpnp_array.py

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,19 @@ def conjugate(self):
414414
# 'copy',
415415
# 'ctypes',
416416
# 'cumprod',
417-
# 'cumsum',
417+
418+
def cumsum(self, axis=None, dtype=None, out=None):
419+
"""
420+
Return the cumulative sum of the elements along the given axis.
421+
422+
See Also
423+
--------
424+
:obj:`dpnp.cumsum`
425+
426+
"""
427+
428+
return dpnp.cumsum(self, axis=axis, dtype=dtype, out=out)
429+
418430
# 'data',
419431

420432
def diagonal(input, offset=0, axis1=0, axis2=1):
@@ -586,7 +598,19 @@ def ndim(self):
586598
# 'newbyteorder',
587599
# 'nonzero',
588600
# 'partition',
589-
# 'prod',
601+
602+
def prod(self, axis=None, dtype=None, out=None, keepdims=False, initial=None, where=True):
603+
"""
604+
Returns the prod along a given axis.
605+
606+
.. seealso::
607+
:obj:`dpnp.prod` for full documentation,
608+
:meth:`dpnp.dparray.sum`
609+
610+
"""
611+
612+
return dpnp.prod(self, axis, dtype, out, keepdims, initial, where)
613+
590614
# 'ptp',
591615
# 'put',
592616
# 'ravel',
@@ -722,7 +746,17 @@ def sum(self, axis=None, dtype=None, out=None, keepdims=False, initial=0, where=
722746
return dpnp.sum(self, axis, dtype, out, keepdims, initial, where)
723747

724748
# 'swapaxes',
725-
# 'take',
749+
750+
def take(self, indices, axis=None, out=None, mode='raise'):
751+
"""
752+
Take elements from an array.
753+
754+
For full documentation refer to :obj:`numpy.take`.
755+
756+
"""
757+
758+
return dpnp.take(self, indices, axis, out, mode)
759+
726760
# 'tobytes',
727761
# 'tofile',
728762
# 'tolist',

dpnp/dpnp_iface.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ def get_dpnp_descriptor(ext_obj, copy_when_strides=True):
211211
# then this behavior can be disabled with setting "copy_when_strides"
212212
if copy_when_strides and getattr(ext_obj, "strides", None) is not None:
213213
# TODO: replace this workaround when usm_ndarray will provide such functionality
214-
ext_obj = array(ext_obj)
214+
shape_offsets = tuple(numpy.prod(ext_obj.shape[i+1:], dtype=numpy.int64) for i in range(ext_obj.ndim))
215+
if ext_obj.strides != shape_offsets:
216+
ext_obj = array(ext_obj)
215217

216218
dpnp_desc = dpnp_descriptor(ext_obj)
217219
if dpnp_desc.is_valid:

dpnp/random/dpnp_iface_random.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,7 @@ def shuffle(x1):
13021302
13031303
"""
13041304

1305-
x1_desc = dpnp.get_dpnp_descriptor(x1)
1305+
x1_desc = dpnp.get_dpnp_descriptor(x1, copy_when_strides=False)
13061306
if x1_desc:
13071307
if not dpnp.is_type_supported(x1_desc.dtype):
13081308
pass

tests/skipped_tests.tbl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -546,9 +546,6 @@ tests/third_party/cupy/indexing_tests/test_indexing.py::TestIndexing::test_diago
546546
tests/third_party/cupy/indexing_tests/test_indexing.py::TestIndexing::test_diagonal_negative3
547547
tests/third_party/cupy/indexing_tests/test_indexing.py::TestIndexing::test_diagonal_negative4
548548
tests/third_party/cupy/indexing_tests/test_indexing.py::TestIndexing::test_diagonal_negative5
549-
tests/third_party/cupy/indexing_tests/test_indexing.py::TestIndexing::test_take_by_array
550-
tests/third_party/cupy/indexing_tests/test_indexing.py::TestIndexing::test_take_by_scalar
551-
tests/third_party/cupy/indexing_tests/test_indexing.py::TestIndexing::test_take_no_axis
552549
tests/third_party/cupy/indexing_tests/test_insert.py::TestDiagIndicesFromRaises_param_4_{shape=(-1,)}::test_non_equal_dims
553550
tests/third_party/cupy/indexing_tests/test_insert.py::TestFillDiagonal_param_0_{shape=(3, 3), val=1, wrap=True}::test_columnar_slice
554551
tests/third_party/cupy/indexing_tests/test_insert.py::TestFillDiagonal_param_11_{shape=(2, 2, 2), val=0, wrap=False}::test_1darray
@@ -893,9 +890,6 @@ tests/third_party/cupy/math_tests/test_rounding.py::TestRoundExtreme_param_6_{de
893890
tests/third_party/cupy/math_tests/test_rounding.py::TestRounding::test_fix
894891
tests/third_party/cupy/math_tests/test_rounding.py::TestRounding::test_rint
895892
tests/third_party/cupy/math_tests/test_rounding.py::TestRounding::test_rint_negative
896-
tests/third_party/cupy/math_tests/test_sumprod.py::TestSumprod::test_prod_all
897-
tests/third_party/cupy/math_tests/test_sumprod.py::TestSumprod::test_prod_axis
898-
tests/third_party/cupy/math_tests/test_sumprod.py::TestSumprod::test_prod_dtype
899893
tests/third_party/cupy/math_tests/test_sumprod.py::TestSumprod::test_sum_all
900894
tests/third_party/cupy/math_tests/test_sumprod.py::TestSumprod::test_sum_all2
901895
tests/third_party/cupy/math_tests/test_sumprod.py::TestSumprod::test_sum_all_keepdims
@@ -919,9 +913,6 @@ tests/third_party/cupy/math_tests/test_sumprod.py::TestCumprod::test_ndarray_cum
919913
tests/third_party/cupy/math_tests/test_sumprod.py::TestDiff::test_diff_1dim
920914
tests/third_party/cupy/math_tests/test_sumprod.py::TestDiff::test_diff_1dim_with_n
921915
tests/third_party/cupy/math_tests/test_sumprod.py::TestDiff::test_diff_2dim_without_axis
922-
tests/third_party/cupy/math_tests/test_sumprod.py::TestCumsum_param_0_{axis=0}::test_ndarray_cumsum_axis
923-
tests/third_party/cupy/math_tests/test_sumprod.py::TestCumsum_param_1_{axis=1}::test_ndarray_cumsum_axis
924-
tests/third_party/cupy/math_tests/test_sumprod.py::TestCumsum_param_2_{axis=2}::test_ndarray_cumsum_axis
925916
tests/third_party/cupy/math_tests/test_sumprod.py::TestCumprod::test_cumprod_arraylike
926917
tests/third_party/cupy/math_tests/test_sumprod.py::TestCumprod::test_cumprod_huge_array
927918
tests/third_party/cupy/math_tests/test_sumprod.py::TestCumprod::test_cumprod_numpy_array

tests/skipped_tests_gpu.tbl

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
tests/test_random.py::TestPermutationsTestShuffle::test_shuffle1[lambda x: dpnp.asarray([[i, i] for i in x])]
2+
tests/third_party/cupy/indexing_tests/test_indexing.py::TestChoose::test_choose
3+
14
tests/test_arraymanipulation.py::TestConcatenate::test_concatenate
25
tests/test_histograms.py::TestHistogram::test_density
36
tests/test_indexing.py::test_take_along_axis
@@ -709,9 +712,6 @@ tests/third_party/cupy/indexing_tests/test_indexing.py::TestIndexing::test_diago
709712
tests/third_party/cupy/indexing_tests/test_indexing.py::TestIndexing::test_diagonal_negative3
710713
tests/third_party/cupy/indexing_tests/test_indexing.py::TestIndexing::test_diagonal_negative4
711714
tests/third_party/cupy/indexing_tests/test_indexing.py::TestIndexing::test_diagonal_negative5
712-
tests/third_party/cupy/indexing_tests/test_indexing.py::TestIndexing::test_take_by_array
713-
tests/third_party/cupy/indexing_tests/test_indexing.py::TestIndexing::test_take_by_scalar
714-
tests/third_party/cupy/indexing_tests/test_indexing.py::TestIndexing::test_take_no_axis
715715
tests/third_party/cupy/indexing_tests/test_insert.py::TestDiagIndicesFromRaises_param_4_{shape=(-1,)}::test_non_equal_dims
716716
tests/third_party/cupy/indexing_tests/test_insert.py::TestFillDiagonal_param_0_{shape=(3, 3), val=1, wrap=True}::test_columnar_slice
717717
tests/third_party/cupy/indexing_tests/test_insert.py::TestFillDiagonal_param_11_{shape=(2, 2, 2), val=0, wrap=False}::test_1darray
@@ -1068,9 +1068,6 @@ tests/third_party/cupy/math_tests/test_rounding.py::TestRoundExtreme_param_6_{de
10681068
tests/third_party/cupy/math_tests/test_rounding.py::TestRounding::test_fix
10691069
tests/third_party/cupy/math_tests/test_rounding.py::TestRounding::test_rint
10701070
tests/third_party/cupy/math_tests/test_rounding.py::TestRounding::test_rint_negative
1071-
tests/third_party/cupy/math_tests/test_sumprod.py::TestSumprod::test_prod_all
1072-
tests/third_party/cupy/math_tests/test_sumprod.py::TestSumprod::test_prod_axis
1073-
tests/third_party/cupy/math_tests/test_sumprod.py::TestSumprod::test_prod_dtype
10741071
tests/third_party/cupy/math_tests/test_sumprod.py::TestSumprod::test_sum_all_transposed
10751072
tests/third_party/cupy/math_tests/test_sumprod.py::TestSumprod::test_sum_all_transposed2
10761073
tests/third_party/cupy/math_tests/test_sumprod.py::TestSumprod::test_sum_axes
@@ -1091,9 +1088,6 @@ tests/third_party/cupy/math_tests/test_sumprod.py::TestCumprod::test_ndarray_cum
10911088
tests/third_party/cupy/math_tests/test_sumprod.py::TestDiff::test_diff_1dim
10921089
tests/third_party/cupy/math_tests/test_sumprod.py::TestDiff::test_diff_1dim_with_n
10931090
tests/third_party/cupy/math_tests/test_sumprod.py::TestDiff::test_diff_2dim_without_axis
1094-
tests/third_party/cupy/math_tests/test_sumprod.py::TestCumsum_param_0_{axis=0}::test_ndarray_cumsum_axis
1095-
tests/third_party/cupy/math_tests/test_sumprod.py::TestCumsum_param_1_{axis=1}::test_ndarray_cumsum_axis
1096-
tests/third_party/cupy/math_tests/test_sumprod.py::TestCumsum_param_2_{axis=2}::test_ndarray_cumsum_axis
10971091
tests/third_party/cupy/math_tests/test_sumprod.py::TestCumprod::test_cumprod_arraylike
10981092
tests/third_party/cupy/math_tests/test_sumprod.py::TestCumprod::test_cumprod_huge_array
10991093
tests/third_party/cupy/math_tests/test_sumprod.py::TestCumprod::test_cumprod_numpy_array

0 commit comments

Comments
 (0)