pyopencl 2025.2.6__cp310-cp310-win_amd64.whl → 2025.2.7__cp310-cp310-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pyopencl might be problematic. Click here for more details.
- pyopencl/_cl.cp310-win_amd64.pyd +0 -0
- pyopencl/array.py +5 -1
- pyopencl/compyte/array.py +9 -39
- pyopencl/compyte/dtypes.py +9 -11
- pyopencl/compyte/pyproject.toml +0 -3
- pyopencl/tools.py +1 -1
- {pyopencl-2025.2.6.dist-info → pyopencl-2025.2.7.dist-info}/METADATA +1 -1
- {pyopencl-2025.2.6.dist-info → pyopencl-2025.2.7.dist-info}/RECORD +10 -10
- {pyopencl-2025.2.6.dist-info → pyopencl-2025.2.7.dist-info}/WHEEL +1 -1
- {pyopencl-2025.2.6.dist-info → pyopencl-2025.2.7.dist-info}/licenses/LICENSE +0 -0
pyopencl/_cl.cp310-win_amd64.pyd
CHANGED
|
Binary file
|
pyopencl/array.py
CHANGED
|
@@ -40,6 +40,7 @@ from typing import (
|
|
|
40
40
|
Literal,
|
|
41
41
|
ParamSpec,
|
|
42
42
|
TypeAlias,
|
|
43
|
+
TypeVar,
|
|
43
44
|
cast,
|
|
44
45
|
)
|
|
45
46
|
from warnings import warn
|
|
@@ -75,6 +76,9 @@ else:
|
|
|
75
76
|
_SVMPointer_or_nothing = ()
|
|
76
77
|
|
|
77
78
|
|
|
79
|
+
ArrayT = TypeVar("ArrayT", bound="Array")
|
|
80
|
+
|
|
81
|
+
|
|
78
82
|
class _NoValue:
|
|
79
83
|
pass
|
|
80
84
|
|
|
@@ -2424,7 +2428,7 @@ def empty_like(
|
|
|
2424
2428
|
allocator=allocator)
|
|
2425
2429
|
|
|
2426
2430
|
|
|
2427
|
-
def zeros_like(ary):
|
|
2431
|
+
def zeros_like(ary: ArrayT) -> ArrayT:
|
|
2428
2432
|
"""Make a new, zero-initialized :class:`Array` having the same properties
|
|
2429
2433
|
as *other_ary*.
|
|
2430
2434
|
"""
|
pyopencl/compyte/array.py
CHANGED
|
@@ -63,7 +63,7 @@ def equal_strides(
|
|
|
63
63
|
if len(strides1) != len(strides2) or len(strides2) != len(shape):
|
|
64
64
|
return False
|
|
65
65
|
|
|
66
|
-
for s, st1, st2 in zip(shape, strides1, strides2):
|
|
66
|
+
for s, st1, st2 in zip(shape, strides1, strides2, strict=True):
|
|
67
67
|
if s != 1 and st1 != st2:
|
|
68
68
|
return False
|
|
69
69
|
|
|
@@ -98,30 +98,27 @@ class ArrayIsh(Protocol):
|
|
|
98
98
|
|
|
99
99
|
|
|
100
100
|
class ArrayFlags:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
forc: bool
|
|
104
|
-
|
|
105
|
-
def __init__(self, ary: ArrayIsh):
|
|
106
|
-
self.f_contiguous = is_f_contiguous_strides(
|
|
101
|
+
def __init__(self, ary: ArrayIsh) -> None:
|
|
102
|
+
self.f_contiguous: bool = is_f_contiguous_strides(
|
|
107
103
|
ary.strides, ary.dtype.itemsize, ary.shape)
|
|
108
|
-
self.c_contiguous = is_c_contiguous_strides(
|
|
104
|
+
self.c_contiguous: bool = is_c_contiguous_strides(
|
|
109
105
|
ary.strides, ary.dtype.itemsize, ary.shape)
|
|
110
|
-
self.forc = self.f_contiguous or self.c_contiguous
|
|
106
|
+
self.forc: bool = self.f_contiguous or self.c_contiguous
|
|
111
107
|
|
|
112
108
|
@override
|
|
113
|
-
def __repr__(self):
|
|
109
|
+
def __repr__(self) -> str:
|
|
114
110
|
return (
|
|
115
111
|
f" C_CONTIGUOUS : {self.c_contiguous}\n"
|
|
116
112
|
f" F_CONTIGUOUS : {self.f_contiguous}"
|
|
117
113
|
)
|
|
118
114
|
|
|
119
115
|
@override
|
|
120
|
-
def __str__(self):
|
|
116
|
+
def __str__(self) -> str:
|
|
121
117
|
return repr(self)
|
|
122
118
|
|
|
123
119
|
|
|
124
|
-
def get_common_dtype(obj1, obj2,
|
|
120
|
+
def get_common_dtype(obj1: ArrayIsh, obj2: ArrayIsh,
|
|
121
|
+
allow_double: bool) -> np.dtype[Any]:
|
|
125
122
|
# Yes, numpy behaves differently depending on whether
|
|
126
123
|
# we're dealing with arrays or scalars.
|
|
127
124
|
|
|
@@ -143,33 +140,6 @@ def get_common_dtype(obj1, obj2, allow_double):
|
|
|
143
140
|
return result
|
|
144
141
|
|
|
145
142
|
|
|
146
|
-
def bound(a):
|
|
147
|
-
high = a.bytes
|
|
148
|
-
low = a.bytes
|
|
149
|
-
|
|
150
|
-
for stri, shp in zip(a.strides, a.shape):
|
|
151
|
-
if stri < 0:
|
|
152
|
-
low += (stri)*(shp-1)
|
|
153
|
-
else:
|
|
154
|
-
high += (stri)*(shp-1)
|
|
155
|
-
return low, high
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
def may_share_memory(a, b):
|
|
159
|
-
# When this is called with a an ndarray and b
|
|
160
|
-
# a sparse matrix, numpy.may_share_memory fails.
|
|
161
|
-
if a is b:
|
|
162
|
-
return True
|
|
163
|
-
if a.__class__ is b.__class__:
|
|
164
|
-
a_l, a_h = bound(a)
|
|
165
|
-
b_l, b_h = bound(b)
|
|
166
|
-
if b_l >= a_h or a_l >= b_h:
|
|
167
|
-
return False
|
|
168
|
-
return True
|
|
169
|
-
else:
|
|
170
|
-
return False
|
|
171
|
-
|
|
172
|
-
|
|
173
143
|
# {{{ as_strided implementation
|
|
174
144
|
|
|
175
145
|
try:
|
pyopencl/compyte/dtypes.py
CHANGED
|
@@ -26,8 +26,8 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
|
26
26
|
OTHER DEALINGS IN THE SOFTWARE.
|
|
27
27
|
"""
|
|
28
28
|
|
|
29
|
-
from collections.abc import Sequence
|
|
30
|
-
from typing import Any,
|
|
29
|
+
from collections.abc import Callable, Sequence
|
|
30
|
+
from typing import Any, TypeVar
|
|
31
31
|
|
|
32
32
|
import numpy as np
|
|
33
33
|
from numpy.typing import DTypeLike
|
|
@@ -40,14 +40,12 @@ class TypeNameNotKnown(RuntimeError): # noqa: N818
|
|
|
40
40
|
# {{{ registry
|
|
41
41
|
|
|
42
42
|
class DTypeRegistry:
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
def __init__(self) -> None:
|
|
44
|
+
self.dtype_to_name: dict[np.dtype[Any] | str, str] = {}
|
|
45
|
+
self.name_to_dtype: dict[str, np.dtype[Any]] = {}
|
|
45
46
|
|
|
46
|
-
def
|
|
47
|
-
|
|
48
|
-
self.name_to_dtype = {}
|
|
49
|
-
|
|
50
|
-
def get_or_register_dtype(self,
|
|
47
|
+
def get_or_register_dtype(
|
|
48
|
+
self,
|
|
51
49
|
names: str | Sequence[str],
|
|
52
50
|
dtype: DTypeLike | None = None) -> np.dtype[Any]:
|
|
53
51
|
"""Get or register a :class:`numpy.dtype` associated with the C type names
|
|
@@ -227,7 +225,7 @@ dtype_to_ctype = TYPE_REGISTRY.dtype_to_ctype
|
|
|
227
225
|
get_or_register_dtype = TYPE_REGISTRY.get_or_register_dtype
|
|
228
226
|
|
|
229
227
|
|
|
230
|
-
def _fill_dtype_registry(respect_windows, include_bool=True):
|
|
228
|
+
def _fill_dtype_registry(respect_windows: bool, include_bool: bool = True) -> None:
|
|
231
229
|
fill_registry_with_c_types(
|
|
232
230
|
TYPE_REGISTRY, respect_windows, include_bool)
|
|
233
231
|
|
|
@@ -244,7 +242,7 @@ def parse_c_arg_backend(
|
|
|
244
242
|
scalar_arg_factory: Callable[[np.dtype[Any], str], ArgTypeT],
|
|
245
243
|
vec_arg_factory: Callable[[np.dtype[Any], str], ArgTypeT],
|
|
246
244
|
name_to_dtype: Callable[[str], np.dtype[Any]] | DTypeRegistry | None = None,
|
|
247
|
-
):
|
|
245
|
+
) -> ArgTypeT:
|
|
248
246
|
if isinstance(name_to_dtype, DTypeRegistry):
|
|
249
247
|
name_to_dtype_clbl = name_to_dtype.name_to_dtype.__getitem__
|
|
250
248
|
elif name_to_dtype is None:
|
pyopencl/compyte/pyproject.toml
CHANGED
|
@@ -40,9 +40,6 @@ reportUnnecessaryIsInstance = "none"
|
|
|
40
40
|
reportUnusedCallResult = "none"
|
|
41
41
|
reportExplicitAny = "none"
|
|
42
42
|
reportUnreachable = "hint"
|
|
43
|
-
# array.py looks like stdlib array, but pyright doesn't know this
|
|
44
|
-
# won't ever be a top-level anything.
|
|
45
|
-
reportShadowedImports = "none"
|
|
46
43
|
|
|
47
44
|
# This reports even cycles that are qualified by 'if TYPE_CHECKING'. Not what
|
|
48
45
|
# we care about at this moment.
|
pyopencl/tools.py
CHANGED
|
@@ -772,7 +772,7 @@ def pytest_generate_tests_for_pyopencl(metafunc: pytest.Metafunc) -> None:
|
|
|
772
772
|
functions, and they will automatically be run for each OpenCL device/platform
|
|
773
773
|
in the system, as appropriate.
|
|
774
774
|
|
|
775
|
-
The following two environment
|
|
775
|
+
The following two environment variables is also supported to control
|
|
776
776
|
device/platform choice::
|
|
777
777
|
|
|
778
778
|
PYOPENCL_TEST=0:0,1;intel=i5,i7
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
pyopencl/__init__.py,sha256=JAui3XXEV-mVuAeufIOvmvg4TwagUkNsppoJewozayg,65173
|
|
2
|
-
pyopencl/_cl.cp310-win_amd64.pyd,sha256=
|
|
2
|
+
pyopencl/_cl.cp310-win_amd64.pyd,sha256=fuOKkFyIjZvgwmMe4ZRTpykPey_AP7kwwnvH6WT7PBU,615936
|
|
3
3
|
pyopencl/_cl.pyi,sha256=SGu_16V6dWwG789Ij-jEz6O_m6aM0ss-th19AA32v48,58338
|
|
4
4
|
pyopencl/_cluda.py,sha256=zlp4ECLzlQOF5ERjXeDJ6j5wYsxPm3VAYwd7adnNYo0,2168
|
|
5
5
|
pyopencl/_monkeypatch.py,sha256=_YryVZpIlNTohXdwunFrlNwQvHpLhNhCer6OQhuxero,37184
|
|
6
6
|
pyopencl/_mymako.py,sha256=Ki5F6iY5oAdm_R6Mll-ltbO-DZF37FDEINimG2HRyRY,674
|
|
7
7
|
pyopencl/algorithm.py,sha256=hPGATjvxCvO3jcjTfe0N_8p0X1NGpmgrQ8byyrfAKRs,52773
|
|
8
|
-
pyopencl/array.py,sha256=
|
|
8
|
+
pyopencl/array.py,sha256=Jb_WMmjTyxq_T87lq6CeIVl11EOoESINdJLHvMVobv0,118325
|
|
9
9
|
pyopencl/bitonic_sort.py,sha256=RQUC8tpezdTQGzSEFyue86gVjc76vLKDwaNkqi4afa8,8297
|
|
10
10
|
pyopencl/bitonic_sort_templates.py,sha256=RQaGOQf7f3f4FPX80h4rxOq3_gAq0e6OKaZIuBjcoUI,16785
|
|
11
11
|
pyopencl/cache.py,sha256=LA0TlwF7kFzlCdk6WUlTUZcB8IVZ6x7mUANUs7OfeRM,16524
|
|
@@ -28,19 +28,19 @@ pyopencl/clrandom.py,sha256=ozqtoMU9-68DaLDR6SEpjq0rPZ-UeqQuJU-vlp_y2eA,13493
|
|
|
28
28
|
pyopencl/cltypes.py,sha256=FKqmaOys5RtunjO42MmKbZnOH9Yzo4PHcbplCWQHbfc,6923
|
|
29
29
|
pyopencl/compyte/.gitignore,sha256=PFMRSJycIqPtcpEn7VqbcenWJqHFDuYtwQm_tLbADt8,189
|
|
30
30
|
pyopencl/compyte/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
|
-
pyopencl/compyte/array.py,sha256=
|
|
32
|
-
pyopencl/compyte/dtypes.py,sha256=
|
|
33
|
-
pyopencl/compyte/pyproject.toml,sha256=
|
|
31
|
+
pyopencl/compyte/array.py,sha256=feaVKsaqFvyp6yvo_-SAsKZG_EmDKTHRsSvy_LgdEx0,7704
|
|
32
|
+
pyopencl/compyte/dtypes.py,sha256=Uf6tieINuB9KycVHbAo5Wv4OgPp_0CVAYLVxFeCrMTo,10882
|
|
33
|
+
pyopencl/compyte/pyproject.toml,sha256=8re-fbz4SCLNmZJFiBIlo5F2OKdjaAdBEH9QYCHjNZE,1194
|
|
34
34
|
pyopencl/elementwise.py,sha256=_fGuVXrz9lbp2xj6foZVVOAOeYR1TZrDS5OrHRwbeW0,45109
|
|
35
35
|
pyopencl/invoker.py,sha256=hMmVaXOgmOjTjCI6Evjx4x_c8FrbBPlClFGCqirAtOE,14123
|
|
36
36
|
pyopencl/ipython_ext.py,sha256=Hfx5go15On4B0CRDuZcsa3d-lme4-xPNHPdgEa9fbJ8,2021
|
|
37
37
|
pyopencl/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
38
|
pyopencl/reduction.py,sha256=QypvaTblYw0oKcNv_Gs-pYz96RvcQa2GouAkVhvft58,27459
|
|
39
39
|
pyopencl/scan.py,sha256=W0o2wj-nUku6XhI7goWfZrElvtZ8yQ0VC8MwiH6vtiQ,67896
|
|
40
|
-
pyopencl/tools.py,sha256=
|
|
40
|
+
pyopencl/tools.py,sha256=ChNT8ysjVjw1n66A_A4fozOoBENU7xv5Ne4x1XHSjoM,53639
|
|
41
41
|
pyopencl/typing.py,sha256=d1xGKJTTi1TYa6HKD01N-Zd-QrdbBd4Dr5MPHrpoXmw,2047
|
|
42
42
|
pyopencl/version.py,sha256=Z5G_fsr_KVWqiYzK_pOQ2PbAO20wrFlEuqqKBGiAv4I,315
|
|
43
|
-
pyopencl-2025.2.
|
|
44
|
-
pyopencl-2025.2.
|
|
45
|
-
pyopencl-2025.2.
|
|
46
|
-
pyopencl-2025.2.
|
|
43
|
+
pyopencl-2025.2.7.dist-info/METADATA,sha256=ewTbQ2052noPrpeGZheceiEOTHkRWUMHkgqnv8Q7VVE,4725
|
|
44
|
+
pyopencl-2025.2.7.dist-info/WHEEL,sha256=hrGeChGtn46HBGmzasO9QQDSLelRN-tUarBSv4gFcsI,106
|
|
45
|
+
pyopencl-2025.2.7.dist-info/licenses/LICENSE,sha256=jib9h6nV8oAvCkKPKDecpLakmQi1SktCn4YXmllgySY,15566
|
|
46
|
+
pyopencl-2025.2.7.dist-info/RECORD,,
|
|
File without changes
|