pyopencl 2025.2.4__cp313-cp313-win_amd64.whl → 2025.2.6__cp313-cp313-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.

Binary file
pyopencl/_cl.pyi CHANGED
@@ -20,7 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
20
  THE SOFTWARE.
21
21
  """
22
22
 
23
- from collections.abc import Callable, Sequence
23
+ from collections.abc import Callable, Hashable, Sequence
24
24
  from enum import IntEnum, auto
25
25
  from typing import TYPE_CHECKING, Generic, Literal, overload
26
26
 
@@ -591,12 +591,12 @@ class kernel_arg_type_qualifier(IntEnum): # noqa: N801
591
591
  to_string = classmethod(pyopencl._monkeypatch.to_string)
592
592
 
593
593
  class kernel_work_group_info(IntEnum): # noqa: N801
594
- WORK_GROUP_SIZE = auto()
595
- COMPILE_WORK_GROUP_SIZE = auto()
596
- LOCAL_MEM_SIZE = auto()
597
- PREFERRED_WORK_GROUP_SIZE_MULTIPLE = auto()
598
- PRIVATE_MEM_SIZE = auto()
599
- GLOBAL_WORK_SIZE = auto()
594
+ WORK_GROUP_SIZE = 0x11B0
595
+ COMPILE_WORK_GROUP_SIZE = 0x11B1
596
+ LOCAL_MEM_SIZE = 0x11B2
597
+ PREFERRED_WORK_GROUP_SIZE_MULTIPLE = 0x11B3
598
+ PRIVATE_MEM_SIZE = 0x11B4
599
+ GLOBAL_WORK_SIZE = 0x11B5
600
600
  to_string = classmethod(pyopencl._monkeypatch.to_string)
601
601
 
602
602
  class kernel_sub_group_info(IntEnum): # noqa: N801
@@ -837,6 +837,9 @@ class Device:
837
837
 
838
838
  __repr__ = pyopencl._monkeypatch.device_repr
839
839
 
840
+ @property
841
+ def hashable_model_and_version_identifier(self) -> Hashable: ...
842
+
840
843
  type: device_type
841
844
  vendor_id: int
842
845
  max_compute_units: int
pyopencl/_monkeypatch.py CHANGED
@@ -27,9 +27,11 @@ from sys import intern
27
27
  from typing import (
28
28
  TYPE_CHECKING,
29
29
  Any,
30
+ Literal,
30
31
  TextIO,
31
32
  TypeVar,
32
33
  cast,
34
+ overload,
33
35
  )
34
36
  from warnings import warn
35
37
 
@@ -196,6 +198,12 @@ class ProfilingInfoGetter:
196
198
  def __getattr__(self, name: str):
197
199
  info_cls = _cl.profiling_info
198
200
 
201
+ if not name.islower():
202
+ warn(f"Using non-lower-case attributes with Event.profile "
203
+ f"is deprecated. Got: '{name}', expected: '{name.lower()}'. "
204
+ "This will stop working in 2026.",
205
+ DeprecationWarning, stacklevel=2)
206
+
199
207
  try:
200
208
  inf_attr = getattr(info_cls, name.upper())
201
209
  except AttributeError as err:
@@ -204,18 +212,18 @@ class ProfilingInfoGetter:
204
212
  else:
205
213
  return self.event.get_profiling_info(inf_attr)
206
214
 
207
- QUEUED: int # pyright: ignore[reportUninitializedInstanceVariable]
208
- SUBMIT: int # pyright: ignore[reportUninitializedInstanceVariable]
209
- START: int # pyright: ignore[reportUninitializedInstanceVariable]
210
- END: int # pyright: ignore[reportUninitializedInstanceVariable]
211
- COMPLETE: int # pyright: ignore[reportUninitializedInstanceVariable]
215
+ queued: int # pyright: ignore[reportUninitializedInstanceVariable]
216
+ submit: int # pyright: ignore[reportUninitializedInstanceVariable]
217
+ start: int # pyright: ignore[reportUninitializedInstanceVariable]
218
+ end: int # pyright: ignore[reportUninitializedInstanceVariable]
219
+ complete: int # pyright: ignore[reportUninitializedInstanceVariable]
212
220
 
213
221
 
214
222
  kernel_old_get_info = _cl.Kernel.get_info
215
223
  kernel_old_get_work_group_info = _cl.Kernel.get_work_group_info
216
224
 
217
225
 
218
- def kernel_set_arg_types(self: _cl.Kernel, arg_types):
226
+ def kernel_set_arg_types(self: _cl.Kernel, arg_types) -> None:
219
227
  arg_types = tuple(arg_types)
220
228
 
221
229
  # {{{ arg counting bug handling
@@ -253,7 +261,42 @@ def kernel_set_arg_types(self: _cl.Kernel, arg_types):
253
261
  devs=self.context.devices))
254
262
 
255
263
 
256
- def kernel_get_work_group_info(self: _cl.Kernel, param: int, device: _cl.Device):
264
+ @overload
265
+ def kernel_get_work_group_info(
266
+ self: _cl.Kernel,
267
+ param: Literal[
268
+ _cl.kernel_work_group_info.WORK_GROUP_SIZE,
269
+ _cl.kernel_work_group_info.PREFERRED_WORK_GROUP_SIZE_MULTIPLE,
270
+ _cl.kernel_work_group_info.LOCAL_MEM_SIZE,
271
+ _cl.kernel_work_group_info.PRIVATE_MEM_SIZE,
272
+ ],
273
+ device: _cl.Device
274
+ ) -> int: ...
275
+
276
+ @overload
277
+ def kernel_get_work_group_info(
278
+ self: _cl.Kernel,
279
+ param: Literal[
280
+ _cl.kernel_work_group_info.COMPILE_WORK_GROUP_SIZE,
281
+ _cl.kernel_work_group_info.GLOBAL_WORK_SIZE,
282
+ ],
283
+ device: _cl.Device
284
+ ) -> Sequence[int]: ...
285
+
286
+
287
+ @overload
288
+ def kernel_get_work_group_info(
289
+ self: _cl.Kernel,
290
+ param: int,
291
+ device: _cl.Device
292
+ ) -> object: ...
293
+
294
+
295
+ def kernel_get_work_group_info(
296
+ self: _cl.Kernel,
297
+ param: int,
298
+ device: _cl.Device
299
+ ) -> object:
257
300
  try:
258
301
  wg_info_cache = self._wg_info_cache
259
302
  except AttributeError:
@@ -405,9 +448,7 @@ def image_init(self: _cl.Image,
405
448
  else:
406
449
  raise ValueError("images cannot have more than three dimensions")
407
450
 
408
- desc = _cl.ImageDescriptor() \
409
- # pylint: disable=possibly-used-before-assignment
410
-
451
+ desc = _cl.ImageDescriptor()
411
452
  desc.image_type = image_type
412
453
  desc.shape = shape # also sets desc.array_size
413
454
 
pyopencl/algorithm.py CHANGED
@@ -1235,7 +1235,7 @@ class ListOfListsBuilder:
1235
1235
  queue, (n_objects + 1,), index_dtype, allocator=allocator)
1236
1236
  info_record.compressed_indices[0] = 0
1237
1237
 
1238
- compress_events[name] = compress_kernel( # pylint: disable=possibly-used-before-assignment
1238
+ compress_events[name] = compress_kernel(
1239
1239
  info_record.starts,
1240
1240
  compressed_counts,
1241
1241
  info_record.nonempty_indices,