pyopencl 2025.2.2__cp311-cp311-macosx_10_14_x86_64.whl → 2025.2.4__cp311-cp311-macosx_10_14_x86_64.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/array.py CHANGED
@@ -59,6 +59,7 @@ from pyopencl.compyte.array import (
59
59
  equal_strides as _equal_strides,
60
60
  f_contiguous_strides as _f_contiguous_strides,
61
61
  )
62
+ from pyopencl.typing import Allocator
62
63
 
63
64
 
64
65
  if TYPE_CHECKING:
@@ -66,8 +67,6 @@ if TYPE_CHECKING:
66
67
 
67
68
  from numpy.typing import DTypeLike, NDArray
68
69
 
69
- from pyopencl.typing import Allocator
70
-
71
70
 
72
71
  SCALAR_CLASSES = (Number, np.bool_, bool)
73
72
 
@@ -3404,4 +3403,39 @@ def cumsum(a, output_dtype=None, queue: cl.CommandQueue | None = None,
3404
3403
 
3405
3404
  # }}}
3406
3405
 
3406
+
3407
+ __all__ = [
3408
+ "Allocator",
3409
+ "Array",
3410
+ "all",
3411
+ "any",
3412
+ "arange",
3413
+ "as_strided",
3414
+ "concatenate",
3415
+ "cumsum",
3416
+ "diff",
3417
+ "dot",
3418
+ "empty_like",
3419
+ "hstack",
3420
+ "if_positive",
3421
+ "logical_and",
3422
+ "logical_not",
3423
+ "logical_or",
3424
+ "maximum",
3425
+ "minimum",
3426
+ "multi_put",
3427
+ "multi_take",
3428
+ "multi_take_put",
3429
+ "reshape",
3430
+ "stack",
3431
+ "subset_dot",
3432
+ "sum",
3433
+ "take",
3434
+ "to_device",
3435
+ "transpose",
3436
+ "vdot",
3437
+ "zeros",
3438
+ "zeros_like",
3439
+ ]
3440
+
3407
3441
  # vim: foldmethod=marker
@@ -48,8 +48,8 @@ class DTypeRegistry:
48
48
  self.name_to_dtype = {}
49
49
 
50
50
  def get_or_register_dtype(self,
51
- c_names: str | Sequence[str],
52
- dtype: DTypeLike | None = None):
51
+ names: str | Sequence[str],
52
+ dtype: DTypeLike | None = None) -> np.dtype[Any]:
53
53
  """Get or register a :class:`numpy.dtype` associated with the C type names
54
54
  in the string list *c_names*. If *dtype* is `None`, no registration is
55
55
  performed, and the :class:`numpy.dtype` must already have been registered.
@@ -66,12 +66,12 @@ class DTypeRegistry:
66
66
  .. versionadded:: 2012.2
67
67
  """
68
68
 
69
- if isinstance(c_names, str):
70
- c_names = [c_names]
69
+ if isinstance(names, str):
70
+ names = [names]
71
71
 
72
72
  if dtype is None:
73
73
  from pytools import single_valued
74
- return single_valued(self.name_to_dtype[name] for name in c_names)
74
+ return single_valued(self.name_to_dtype[name] for name in names)
75
75
 
76
76
  dtype = np.dtype(dtype)
77
77
 
@@ -86,7 +86,7 @@ class DTypeRegistry:
86
86
  assert existing_dtype == dtype
87
87
  dtype = existing_dtype
88
88
 
89
- for nm in c_names:
89
+ for nm in names:
90
90
  try:
91
91
  name_dtype = self.name_to_dtype[nm]
92
92
  except KeyError:
@@ -97,14 +97,14 @@ class DTypeRegistry:
97
97
  f"name '{nm}' already registered to different dtype")
98
98
 
99
99
  if not existed:
100
- self.dtype_to_name[dtype] = c_names[0]
100
+ self.dtype_to_name[dtype] = names[0]
101
101
  if str(dtype) not in self.dtype_to_name:
102
- self.dtype_to_name[str(dtype)] = c_names[0]
102
+ self.dtype_to_name[str(dtype)] = names[0]
103
103
 
104
104
  return dtype
105
105
 
106
- def dtype_to_ctype(self, dtype: np.dtype[Any]) -> str:
107
- if dtype is None: # pyright: ignore[reportUnnecessaryComparison]
106
+ def dtype_to_ctype(self, dtype: DTypeLike) -> str:
107
+ if dtype is None:
108
108
  raise ValueError("dtype may not be None")
109
109
 
110
110
  dtype = np.dtype(dtype)
@@ -160,12 +160,6 @@ def fill_registry_with_c_types(
160
160
  f"{i64_name} unsigned int"],
161
161
  np.uint64)
162
162
 
163
- # https://github.com/numpy/numpy/issues/2610
164
- if is_64_bit:
165
- reg.get_or_register_dtype([f"unsigned {i64_name}"], np.uintp)
166
- else:
167
- reg.get_or_register_dtype(["unsigned"], np.uintp)
168
-
169
163
  reg.get_or_register_dtype("float", np.float32)
170
164
  reg.get_or_register_dtype("double", np.float64)
171
165
 
@@ -40,6 +40,9 @@ 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"
43
46
 
44
47
  # This reports even cycles that are qualified by 'if TYPE_CHECKING'. Not what
45
48
  # we care about at this moment.
pyopencl/typing.py CHANGED
@@ -55,3 +55,7 @@ KernelArg: TypeAlias = """
55
55
  | None"""
56
56
 
57
57
  Allocator: TypeAlias = "Callable[[int], _cl.MemoryObjectHolder | _cl.SVMPointer]"
58
+
59
+
60
+ __all__ = [
61
+ ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyopencl
3
- Version: 2025.2.2
3
+ Version: 2025.2.4
4
4
  Summary: Python wrapper for OpenCL
5
5
  Author-Email: Andreas Kloeckner <inform@tiker.net>
6
6
  License-Expression: MIT
@@ -17,17 +17,16 @@ pyopencl/_cluda.py,sha256=kjI6pW9M-zGCVDsautsKsYMs1U9v73_W5riUjdzmKA0,2111
17
17
  pyopencl/_cl.cpython-311-darwin.so,sha256=RuLOtAhB9ruXI0dWpivVjPOYgfXHhmNYZ5DsvXnysm0,552192
18
18
  pyopencl/_mymako.py,sha256=1xp0pWcE57hpIDKw915CvOGQpC-Jral02Inykx_k198,657
19
19
  pyopencl/_monkeypatch.py,sha256=bBJjQYW6XdiurbG_jgTzJg5BtDteuNVqRQ3Fuzx-Gbk,34845
20
- pyopencl/typing.py,sha256=DbU4i2J3fMXRqK49rbsaOpMz7xsaeTMY66iMsc6ZOmo,1970
21
- pyopencl/array.py,sha256=_6HR45dN7bH9uiTDPXqbco8ZDKlddkOIzLMV14j_LWg,111551
20
+ pyopencl/typing.py,sha256=LN50UCqujen7SE5cforFvJLoEd3KNEKygxuQiZV4YoQ,1986
21
+ pyopencl/array.py,sha256=kqCowsSiDxdbcpuSYK2bgwbRlBvkSCsOQBfroHVYkiE,112042
22
22
  pyopencl/bitonic_sort.py,sha256=FpTfCf_s22O-SgPWBoXZjCG_k1afm7uUwnO9N7jubgg,8052
23
23
  pyopencl/bitonic_sort_templates.py,sha256=316nsWdr7jpg9g8SmZk8KCoHmHKabjvOdBaufxQPw8Y,16188
24
24
  pyopencl/clrandom.py,sha256=Ox_Eebq5fcjsBXpa68C1kt8Ca6CPi5tXwXhEhLY_yP8,13081
25
- pyopencl/compyte/pyproject.toml,sha256=yISxFxhotloFnx_Adffvnr0w2samJwGonr64Eq2YDQo,1145
25
+ pyopencl/compyte/pyproject.toml,sha256=WmDOFf4Z22yumhUw8tEet-XBtqO36K4eL9nbr4xpzlw,1280
26
26
  pyopencl/compyte/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
- pyopencl/compyte/dtypes.py,sha256=NIv-oOc-DO6YLvX34grMUdefqWVl6QbxztWsGcvnuvA,10803
27
+ pyopencl/compyte/dtypes.py,sha256=S_cGvFOq07fgwloCq9pxjzlDpxPbwwRb-pb1TOH77nU,10546
28
28
  pyopencl/compyte/.gitignore,sha256=HVYtbKRtOCPWZavrgYqO2u7UKFiE7g7ympmuQzKbBBw,168
29
29
  pyopencl/compyte/array.py,sha256=t1XORyCQ4zRe_KUnoo4LH1W5XOcGXaf5xvGtgOPDzyg,8035
30
- pyopencl/compyte/.basedpyright/baseline.json,sha256=3HQHk-43Nuqf3UVXVCQli6nXbrqnrQvQtsZPjuLR61g,37643
31
30
  pyopencl/characterize/__init__.py,sha256=AaDNS1p2RtXqGf6tA--GB9FRp-fzavbpgulrAW_BE2Y,14565
32
31
  pyopencl/characterize/performance.py,sha256=i8X1jWlyL1bUD7wuDoSlk1CckJkT6zAVPefziQwmNXU,6903
33
32
  pyopencl/cl/pyopencl-bessel-y.cl,sha256=VDy8l4lVxO8VcJR_maeGu_Qjnw27j28zBwhaTKDhBBg,12297
@@ -41,7 +40,7 @@ pyopencl/cl/pyopencl-random123/threefry.cl,sha256=2WmQGxx5gPSv22UL9_MlXv0eMug91k
41
40
  pyopencl/cl/pyopencl-random123/philox.cl,sha256=vYcQH7Vw13Q3qkW5Nhy1HTUDbWLGKoloE1YP0VWk6vU,21740
42
41
  pyopencl/cl/pyopencl-random123/array.h,sha256=nIV0zDWYuybldNgtsh79icNtDXHYdDsSpFaWIvDTyw4,17088
43
42
  pyopencl/cl/pyopencl-random123/openclfeatures.h,sha256=pAPbl7JkQgJxulSuGGevpaI43P7PwiH2mYxtNfHq59M,2881
44
- pyopencl-2025.2.2.dist-info/RECORD,,
45
- pyopencl-2025.2.2.dist-info/WHEEL,sha256=mqJDGYVejwV_naQG6UvE-ScUkMo330KYGIQ2UQZE62k,143
46
- pyopencl-2025.2.2.dist-info/METADATA,sha256=PtweID2xOHA7p_vJBtyUejmEOn9Mw0_s1mlTWubMAH8,4756
47
- pyopencl-2025.2.2.dist-info/licenses/LICENSE,sha256=wiBvs-UC54bB5DswWuvB66B96b4hkYw_VLt8IR0cBPI,15284
43
+ pyopencl-2025.2.4.dist-info/RECORD,,
44
+ pyopencl-2025.2.4.dist-info/WHEEL,sha256=mqJDGYVejwV_naQG6UvE-ScUkMo330KYGIQ2UQZE62k,143
45
+ pyopencl-2025.2.4.dist-info/METADATA,sha256=eDa4Y8wB7m8VTYu2x8JpG8sRIiasx7ZPXA-HHsklghM,4756
46
+ pyopencl-2025.2.4.dist-info/licenses/LICENSE,sha256=wiBvs-UC54bB5DswWuvB66B96b4hkYw_VLt8IR0cBPI,15284