Skip to content

Commit 945f703

Browse files
Add support of uint64 dtype in dpnp.bincount (#2361)
Previously NumPy prohibits `uint64` dtype of input array in `numpy.bincount`. But that is going to be changed since `2.2.4` release (fixed in numpy#28355 and backported to 2.2.x branch in numpy#28420). This PR proposes to align with upcoming changes and to allow `uint64` dtype of input array in `dpnp.bincount`. Additionally, it extends the docstring of histogram-like functions to clearly notify with a warning about possible synchronization impact. acd33e4
1 parent 3d46f20 commit 945f703

File tree

718 files changed

+1515
-1467
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

718 files changed

+1515
-1467
lines changed

.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 1cdcc00f690312f80fb02f55f5f7eaa6
3+
config: dac2283778f124692e9546d30975692f
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

_modules/dpnp/dpnp_array.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
</script>
1515

1616
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
17-
<title>dpnp.dpnp_array &mdash; Data Parallel Extension for NumPy 0.18.0dev0+25.g25fb39befb1 documentation</title>
17+
<title>dpnp.dpnp_array &mdash; Data Parallel Extension for NumPy 0.18.0dev0+26.gacd33e46f1b documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
1919
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=e59714d7" />
2020

2121

2222
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2323
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
24-
<script src="../../_static/documentation_options.js?v=ae288945"></script>
24+
<script src="../../_static/documentation_options.js?v=5eed8ba3"></script>
2525
<script src="../../_static/doctools.js?v=9bcbadda"></script>
2626
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2727
<script src="../../_static/js/theme.js"></script>

_modules/dpnp/dpnp_array_api_info.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
</script>
1515

1616
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
17-
<title>dpnp.dpnp_array_api_info &mdash; Data Parallel Extension for NumPy 0.18.0dev0+25.g25fb39befb1 documentation</title>
17+
<title>dpnp.dpnp_array_api_info &mdash; Data Parallel Extension for NumPy 0.18.0dev0+26.gacd33e46f1b documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
1919
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=e59714d7" />
2020

2121

2222
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2323
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
24-
<script src="../../_static/documentation_options.js?v=ae288945"></script>
24+
<script src="../../_static/documentation_options.js?v=5eed8ba3"></script>
2525
<script src="../../_static/doctools.js?v=9bcbadda"></script>
2626
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2727
<script src="../../_static/js/theme.js"></script>

_modules/dpnp/dpnp_flatiter.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
</script>
1515

1616
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
17-
<title>dpnp.dpnp_flatiter &mdash; Data Parallel Extension for NumPy 0.18.0dev0+25.g25fb39befb1 documentation</title>
17+
<title>dpnp.dpnp_flatiter &mdash; Data Parallel Extension for NumPy 0.18.0dev0+26.gacd33e46f1b documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
1919
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=e59714d7" />
2020

2121

2222
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2323
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
24-
<script src="../../_static/documentation_options.js?v=ae288945"></script>
24+
<script src="../../_static/documentation_options.js?v=5eed8ba3"></script>
2525
<script src="../../_static/doctools.js?v=9bcbadda"></script>
2626
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2727
<script src="../../_static/js/theme.js"></script>

_modules/dpnp/dpnp_iface.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
</script>
1515

1616
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
17-
<title>dpnp.dpnp_iface &mdash; Data Parallel Extension for NumPy 0.18.0dev0+25.g25fb39befb1 documentation</title>
17+
<title>dpnp.dpnp_iface &mdash; Data Parallel Extension for NumPy 0.18.0dev0+26.gacd33e46f1b documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
1919
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=e59714d7" />
2020

2121

2222
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2323
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
24-
<script src="../../_static/documentation_options.js?v=ae288945"></script>
24+
<script src="../../_static/documentation_options.js?v=5eed8ba3"></script>
2525
<script src="../../_static/doctools.js?v=9bcbadda"></script>
2626
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2727
<script src="../../_static/js/theme.js"></script>

_modules/dpnp/dpnp_iface_arraycreation.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
</script>
1515

1616
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
17-
<title>dpnp.dpnp_iface_arraycreation &mdash; Data Parallel Extension for NumPy 0.18.0dev0+25.g25fb39befb1 documentation</title>
17+
<title>dpnp.dpnp_iface_arraycreation &mdash; Data Parallel Extension for NumPy 0.18.0dev0+26.gacd33e46f1b documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
1919
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=e59714d7" />
2020

2121

2222
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2323
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
24-
<script src="../../_static/documentation_options.js?v=ae288945"></script>
24+
<script src="../../_static/documentation_options.js?v=5eed8ba3"></script>
2525
<script src="../../_static/doctools.js?v=9bcbadda"></script>
2626
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2727
<script src="../../_static/js/theme.js"></script>

_modules/dpnp/dpnp_iface_bitwise.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
</script>
1515

1616
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
17-
<title>dpnp.dpnp_iface_bitwise &mdash; Data Parallel Extension for NumPy 0.18.0dev0+25.g25fb39befb1 documentation</title>
17+
<title>dpnp.dpnp_iface_bitwise &mdash; Data Parallel Extension for NumPy 0.18.0dev0+26.gacd33e46f1b documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
1919
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=e59714d7" />
2020

2121

2222
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2323
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
24-
<script src="../../_static/documentation_options.js?v=ae288945"></script>
24+
<script src="../../_static/documentation_options.js?v=5eed8ba3"></script>
2525
<script src="../../_static/doctools.js?v=9bcbadda"></script>
2626
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2727
<script src="../../_static/js/theme.js"></script>

_modules/dpnp/dpnp_iface_counting.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
</script>
1515

1616
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
17-
<title>dpnp.dpnp_iface_counting &mdash; Data Parallel Extension for NumPy 0.18.0dev0+25.g25fb39befb1 documentation</title>
17+
<title>dpnp.dpnp_iface_counting &mdash; Data Parallel Extension for NumPy 0.18.0dev0+26.gacd33e46f1b documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
1919
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=e59714d7" />
2020

2121

2222
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2323
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
24-
<script src="../../_static/documentation_options.js?v=ae288945"></script>
24+
<script src="../../_static/documentation_options.js?v=5eed8ba3"></script>
2525
<script src="../../_static/doctools.js?v=9bcbadda"></script>
2626
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2727
<script src="../../_static/js/theme.js"></script>

_modules/dpnp/dpnp_iface_functional.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
</script>
1515

1616
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
17-
<title>dpnp.dpnp_iface_functional &mdash; Data Parallel Extension for NumPy 0.18.0dev0+25.g25fb39befb1 documentation</title>
17+
<title>dpnp.dpnp_iface_functional &mdash; Data Parallel Extension for NumPy 0.18.0dev0+26.gacd33e46f1b documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
1919
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=e59714d7" />
2020

2121

2222
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2323
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
24-
<script src="../../_static/documentation_options.js?v=ae288945"></script>
24+
<script src="../../_static/documentation_options.js?v=5eed8ba3"></script>
2525
<script src="../../_static/doctools.js?v=9bcbadda"></script>
2626
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2727
<script src="../../_static/js/theme.js"></script>

_modules/dpnp/dpnp_iface_histograms.html

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
</script>
1515

1616
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
17-
<title>dpnp.dpnp_iface_histograms &mdash; Data Parallel Extension for NumPy 0.18.0dev0+25.g25fb39befb1 documentation</title>
17+
<title>dpnp.dpnp_iface_histograms &mdash; Data Parallel Extension for NumPy 0.18.0dev0+26.gacd33e46f1b documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
1919
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=e59714d7" />
2020

2121

2222
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2323
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
24-
<script src="../../_static/documentation_options.js?v=ae288945"></script>
24+
<script src="../../_static/documentation_options.js?v=5eed8ba3"></script>
2525
<script src="../../_static/doctools.js?v=9bcbadda"></script>
2626
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2727
<script src="../../_static/js/theme.js"></script>
@@ -378,8 +378,8 @@ <h1>Source code for dpnp.dpnp_iface_histograms</h1><div class="highlight"><pre>
378378

379379
<span class="n">mem_ev</span><span class="p">,</span> <span class="n">bc_ev</span> <span class="o">=</span> <span class="n">statistics_ext</span><span class="o">.</span><span class="n">bincount</span><span class="p">(</span>
380380
<span class="n">x_usm</span><span class="p">,</span>
381-
<span class="n">min_v</span><span class="p">,</span>
382-
<span class="n">max_v</span><span class="p">,</span>
381+
<span class="n">min_v</span><span class="o">.</span><span class="n">item</span><span class="p">(),</span>
382+
<span class="n">max_v</span><span class="o">.</span><span class="n">item</span><span class="p">(),</span>
383383
<span class="n">weights_usm</span><span class="p">,</span>
384384
<span class="n">n_usm</span><span class="p">,</span>
385385
<span class="n">depends</span><span class="o">=</span><span class="n">_manager</span><span class="o">.</span><span class="n">submitted_events</span><span class="p">,</span>
@@ -400,6 +400,11 @@ <h1>Source code for dpnp.dpnp_iface_histograms</h1><div class="highlight"><pre>
400400

401401
<span class="sd"> For full documentation refer to :obj:`numpy.bincount`.</span>
402402

403+
<span class="sd"> Warning</span>
404+
<span class="sd"> -------</span>
405+
<span class="sd"> This function synchronizes in order to calculate binning edges.</span>
406+
<span class="sd"> This may harm performance in some applications.</span>
407+
403408
<span class="sd"> Parameters</span>
404409
<span class="sd"> ----------</span>
405410
<span class="sd"> x : {dpnp.ndarray, usm_ndarray}</span>
@@ -478,10 +483,8 @@ <h1>Source code for dpnp.dpnp_iface_histograms</h1><div class="highlight"><pre>
478483

479484
<span class="k">if</span> <span class="n">x_casted_dtype</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="n">ntype_casted</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> <span class="c1"># pragma: no cover</span>
480485
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span>
481-
<span class="sa">f</span><span class="s2">&quot;function &#39;</span><span class="si">{</span><span class="n">bincount</span><span class="si">}</span><span class="s2">&#39; does not support input types &quot;</span>
482-
<span class="sa">f</span><span class="s2">&quot;(</span><span class="si">{</span><span class="n">x</span><span class="o">.</span><span class="n">dtype</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="n">ntype</span><span class="si">}</span><span class="s2">), &quot;</span>
483-
<span class="s2">&quot;and the inputs could not be coerced to any &quot;</span>
484-
<span class="s2">&quot;supported types&quot;</span>
486+
<span class="sa">f</span><span class="s2">&quot;Input types (</span><span class="si">{</span><span class="n">x</span><span class="o">.</span><span class="n">dtype</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="n">ntype</span><span class="si">}</span><span class="s2">) are not supported, &quot;</span>
487+
<span class="s2">&quot;and the inputs could not be coerced to any supported types&quot;</span>
485488
<span class="p">)</span>
486489

487490
<span class="n">x_casted</span> <span class="o">=</span> <span class="n">dpnp</span><span class="o">.</span><span class="n">asarray</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="n">x_casted_dtype</span><span class="p">,</span> <span class="n">order</span><span class="o">=</span><span class="s2">&quot;C&quot;</span><span class="p">)</span>
@@ -601,6 +604,11 @@ <h1>Source code for dpnp.dpnp_iface_histograms</h1><div class="highlight"><pre>
601604

602605
<span class="sd"> For full documentation refer to :obj:`numpy.histogram`.</span>
603606

607+
<span class="sd"> Warning</span>
608+
<span class="sd"> -------</span>
609+
<span class="sd"> This function may synchronize in order to check a monotonically increasing</span>
610+
<span class="sd"> array of bin edges. This may harm performance in some applications.</span>
611+
604612
<span class="sd"> Parameters</span>
605613
<span class="sd"> ----------</span>
606614
<span class="sd"> a : {dpnp.ndarray, usm_ndarray}</span>
@@ -704,9 +712,8 @@ <h1>Source code for dpnp.dpnp_iface_histograms</h1><div class="highlight"><pre>
704712

705713
<span class="k">if</span> <span class="n">a_bin_dtype</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="n">hist_dtype</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> <span class="c1"># pragma: no cover</span>
706714
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span>
707-
<span class="sa">f</span><span class="s2">&quot;function &#39;</span><span class="si">{</span><span class="n">histogram</span><span class="si">}</span><span class="s2">&#39; does not support input types &quot;</span>
708-
<span class="sa">f</span><span class="s2">&quot;(</span><span class="si">{</span><span class="n">a</span><span class="o">.</span><span class="n">dtype</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="n">bin_edges</span><span class="o">.</span><span class="n">dtype</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="n">ntype</span><span class="si">}</span><span class="s2">), &quot;</span>
709-
<span class="s2">&quot;and the inputs could not be coerced to any &quot;</span>
715+
<span class="sa">f</span><span class="s2">&quot;Input types (</span><span class="si">{</span><span class="n">a</span><span class="o">.</span><span class="n">dtype</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="n">bin_edges</span><span class="o">.</span><span class="n">dtype</span><span class="si">}</span><span class="s2">, </span><span class="si">{</span><span class="n">ntype</span><span class="si">}</span><span class="s2">) &quot;</span>
716+
<span class="s2">&quot;are not supported, and the inputs could not be coerced to any &quot;</span>
710717
<span class="s2">&quot;supported types&quot;</span>
711718
<span class="p">)</span>
712719

@@ -771,6 +778,11 @@ <h1>Source code for dpnp.dpnp_iface_histograms</h1><div class="highlight"><pre>
771778

772779
<span class="sd"> For full documentation refer to :obj:`numpy.histogram_bin_edges`.</span>
773780

781+
<span class="sd"> Warning</span>
782+
<span class="sd"> -------</span>
783+
<span class="sd"> This function may synchronize in order to check a monotonically increasing</span>
784+
<span class="sd"> array of bin edges. This may harm performance in some applications.</span>
785+
774786
<span class="sd"> Parameters</span>
775787
<span class="sd"> ----------</span>
776788
<span class="sd"> a : {dpnp.ndarray, usm_ndarray}</span>
@@ -859,6 +871,13 @@ <h1>Source code for dpnp.dpnp_iface_histograms</h1><div class="highlight"><pre>
859871
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
860872
<span class="sd"> Compute the bi-dimensional histogram of two data samples.</span>
861873

874+
<span class="sd"> For full documentation refer to :obj:`numpy.histogram2d`.</span>
875+
876+
<span class="sd"> Warning</span>
877+
<span class="sd"> -------</span>
878+
<span class="sd"> This function may synchronize in order to check a monotonically increasing</span>
879+
<span class="sd"> array of bin edges. This may harm performance in some applications.</span>
880+
862881
<span class="sd"> Parameters</span>
863882
<span class="sd"> ----------</span>
864883
<span class="sd"> x : {dpnp.ndarray, usm_ndarray} of shape (N,)</span>
@@ -1190,6 +1209,11 @@ <h1>Source code for dpnp.dpnp_iface_histograms</h1><div class="highlight"><pre>
11901209

11911210
<span class="sd"> For full documentation refer to :obj:`numpy.histogramdd`.</span>
11921211

1212+
<span class="sd"> Warning</span>
1213+
<span class="sd"> -------</span>
1214+
<span class="sd"> This function may synchronize in order to check a monotonically increasing</span>
1215+
<span class="sd"> array of bin edges. This may harm performance in some applications.</span>
1216+
11931217
<span class="sd"> Parameters</span>
11941218
<span class="sd"> ----------</span>
11951219
<span class="sd"> sample : {dpnp.ndarray, usm_ndarray}</span>

_modules/dpnp/dpnp_iface_indexing.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
</script>
1515

1616
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
17-
<title>dpnp.dpnp_iface_indexing &mdash; Data Parallel Extension for NumPy 0.18.0dev0+25.g25fb39befb1 documentation</title>
17+
<title>dpnp.dpnp_iface_indexing &mdash; Data Parallel Extension for NumPy 0.18.0dev0+26.gacd33e46f1b documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
1919
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=e59714d7" />
2020

2121

2222
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2323
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
24-
<script src="../../_static/documentation_options.js?v=ae288945"></script>
24+
<script src="../../_static/documentation_options.js?v=5eed8ba3"></script>
2525
<script src="../../_static/doctools.js?v=9bcbadda"></script>
2626
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2727
<script src="../../_static/js/theme.js"></script>

0 commit comments

Comments
 (0)