pyopencl 2025.2.4__tar.gz → 2025.2.6__tar.gz

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.

Files changed (125) hide show
  1. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/.gitignore +0 -4
  2. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/PKG-INFO +3 -4
  3. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/doc/algorithm.rst +7 -0
  4. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/doc/array.rst +7 -0
  5. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/doc/conf.py +2 -1
  6. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/doc/runtime.rst +9 -5
  7. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/doc/runtime_queue.rst +9 -0
  8. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/_cl.pyi +10 -7
  9. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/_monkeypatch.py +51 -10
  10. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/algorithm.py +1 -1
  11. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/array.py +210 -125
  12. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/cache.py +1 -1
  13. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/characterize/__init__.py +2 -4
  14. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/clmath.py +0 -1
  15. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/cltypes.py +42 -27
  16. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/elementwise.py +226 -112
  17. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/scan.py +30 -25
  18. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/tools.py +328 -213
  19. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyproject.toml +20 -20
  20. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/src/wrap_cl.hpp +1 -0
  21. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/src/wrap_cl_part_2.cpp +4 -4
  22. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/test/test_algorithm.py +3 -0
  23. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/test/test_array.py +7 -2
  24. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/test/test_clrandom.py +3 -3
  25. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/test/test_wrapper.py +1 -1
  26. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/.gitlab-ci.yml +0 -0
  27. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/.gitmodules +0 -0
  28. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/.test-conda-env-py3.yml +0 -0
  29. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/CITATION.cff +0 -0
  30. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/CMakeLists.txt +0 -0
  31. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/LICENSE +0 -0
  32. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/README.rst +0 -0
  33. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/contrib/cldis.py +0 -0
  34. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/contrib/fortran-to-opencl/README +0 -0
  35. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/contrib/fortran-to-opencl/translate.py +0 -0
  36. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/contrib/pyopencl.vim +0 -0
  37. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/doc/.gitignore +0 -0
  38. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/doc/Makefile +0 -0
  39. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/doc/howto.rst +0 -0
  40. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/doc/index.rst +0 -0
  41. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/doc/make_constants.py +0 -0
  42. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/doc/misc.rst +0 -0
  43. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/doc/runtime_const.rst +0 -0
  44. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/doc/runtime_gl.rst +0 -0
  45. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/doc/runtime_memory.rst +0 -0
  46. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/doc/runtime_platform.rst +0 -0
  47. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/doc/runtime_program.rst +0 -0
  48. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/doc/subst.rst +0 -0
  49. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/doc/tools.rst +0 -0
  50. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/doc/types.rst +0 -0
  51. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/.gitignore +0 -0
  52. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/black-hole-accretion.py +0 -0
  53. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/demo-struct-reduce.py +0 -0
  54. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/demo.py +0 -0
  55. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/demo_array.py +0 -0
  56. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/demo_array_svm.py +0 -0
  57. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/demo_elementwise.py +0 -0
  58. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/demo_elementwise_complex.py +0 -0
  59. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/demo_mandelbrot.py +0 -0
  60. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/demo_meta_codepy.py +0 -0
  61. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/demo_meta_template.py +0 -0
  62. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/dump-performance.py +0 -0
  63. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/dump-properties.py +0 -0
  64. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/gl_interop_demo.py +0 -0
  65. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/gl_particle_animation.py +0 -0
  66. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/image_filters_using_image2d_t.py +0 -0
  67. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/ipython-demo.ipynb +0 -0
  68. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/median-filter.py +0 -0
  69. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/n-body.py +0 -0
  70. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/narray.py +0 -0
  71. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/noisyImage.jpg +0 -0
  72. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/pi-monte-carlo.py +0 -0
  73. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/svm.py +0 -0
  74. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/examples/transpose.py +0 -0
  75. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/__init__.py +0 -0
  76. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/_cluda.py +0 -0
  77. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/_mymako.py +0 -0
  78. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/bitonic_sort.py +0 -0
  79. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/bitonic_sort_templates.py +0 -0
  80. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/capture_call.py +0 -0
  81. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/characterize/performance.py +0 -0
  82. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/cl/pyopencl-airy.cl +0 -0
  83. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/cl/pyopencl-bessel-j-complex.cl +0 -0
  84. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/cl/pyopencl-bessel-j.cl +0 -0
  85. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/cl/pyopencl-bessel-y.cl +0 -0
  86. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/cl/pyopencl-complex.h +0 -0
  87. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/cl/pyopencl-eval-tbl.cl +0 -0
  88. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/cl/pyopencl-hankel-complex.cl +0 -0
  89. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/cl/pyopencl-random123/array.h +0 -0
  90. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/cl/pyopencl-random123/openclfeatures.h +0 -0
  91. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/cl/pyopencl-random123/philox.cl +0 -0
  92. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/cl/pyopencl-random123/threefry.cl +0 -0
  93. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/clrandom.py +0 -0
  94. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/compyte/.gitignore +0 -0
  95. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/compyte/__init__.py +0 -0
  96. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/compyte/array.py +0 -0
  97. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/compyte/dtypes.py +0 -0
  98. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/compyte/pyproject.toml +0 -0
  99. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/invoker.py +0 -0
  100. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/ipython_ext.py +0 -0
  101. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/py.typed +0 -0
  102. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/reduction.py +0 -0
  103. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/typing.py +0 -0
  104. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/pyopencl/version.py +0 -0
  105. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/scripts/build-ocl-macos.sh +0 -0
  106. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/scripts/build-ocl-windows.sh +0 -0
  107. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/scripts/build-ocl.sh +0 -0
  108. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/src/bitlog.cpp +0 -0
  109. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/src/bitlog.hpp +0 -0
  110. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/src/clinfo_ext.h +0 -0
  111. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/src/mempool.hpp +0 -0
  112. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/src/pyopencl_ext.h +0 -0
  113. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/src/tools.hpp +0 -0
  114. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/src/wrap_cl.cpp +0 -0
  115. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/src/wrap_cl_part_1.cpp +0 -0
  116. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/src/wrap_constants.cpp +0 -0
  117. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/src/wrap_helpers.hpp +0 -0
  118. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/src/wrap_mempool.cpp +0 -0
  119. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/stubgen/stubgen.py +0 -0
  120. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/test/add-vectors-32.spv +0 -0
  121. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/test/add-vectors-64.spv +0 -0
  122. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/test/empty-header.h +0 -0
  123. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/test/test_arrays_in_structs.py +0 -0
  124. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/test/test_clmath.py +0 -0
  125. {pyopencl-2025.2.4 → pyopencl-2025.2.6}/test/test_enqueue_copy.py +0 -0
@@ -10,7 +10,6 @@ _skbuild
10
10
  *.pyc
11
11
  build
12
12
  *.prof
13
- doc/hedge-notes.pdf
14
13
  *.vtk
15
14
  *.silo
16
15
  *.session
@@ -73,7 +72,4 @@ wheelhouse
73
72
  memray-*.bin
74
73
  memray-*.html
75
74
 
76
- .pylintrc.yml
77
- .run-pylint.py
78
-
79
75
  pyopencl/_cl_gen.pyi
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyopencl
3
- Version: 2025.2.4
3
+ Version: 2025.2.6
4
4
  Summary: Python wrapper for OpenCL
5
5
  Author-Email: Andreas Kloeckner <inform@tiker.net>
6
6
  License-Expression: MIT
@@ -30,11 +30,10 @@ Requires-Dist: oclgrind-binary-distribution>=18.3; extra == "oclgrind"
30
30
  Provides-Extra: pocl
31
31
  Requires-Dist: pocl-binary-distribution>=1.2; extra == "pocl"
32
32
  Provides-Extra: test
33
- Requires-Dist: ruff; extra == "test"
33
+ Requires-Dist: basedpyright; extra == "test"
34
34
  Requires-Dist: mako; extra == "test"
35
- Requires-Dist: mypy; extra == "test"
36
- Requires-Dist: pylint; extra == "test"
37
35
  Requires-Dist: pytest>=7; extra == "test"
36
+ Requires-Dist: ruff; extra == "test"
38
37
  Description-Content-Type: text/x-rst
39
38
 
40
39
  PyOpenCL: Pythonic Access to OpenCL, with Arrays and Algorithms
@@ -24,6 +24,13 @@ Here's a usage example:
24
24
  :download:`examples/demo_elementwise.py <../examples/demo_elementwise.py>`
25
25
  in the PyOpenCL distribution.)
26
26
 
27
+ References
28
+ ^^^^^^^^^^
29
+
30
+ .. class:: WaitList
31
+
32
+ See :class:`pyopencl.WaitList`.
33
+
27
34
  .. _custom-reductions:
28
35
 
29
36
  Sums and counts ("reduce")
@@ -308,3 +308,10 @@ Generating Arrays of Random Numbers
308
308
  -----------------------------------
309
309
 
310
310
  .. automodule:: pyopencl.clrandom
311
+
312
+ Type Aliases
313
+ ------------
314
+
315
+ .. class:: cl.Device
316
+
317
+ See :class:`pyopencl.Device`.
@@ -18,10 +18,11 @@ version = ".".join(str(x) for x in ver_dic["VERSION"])
18
18
  # The full version, including alpha/beta/rc tags.
19
19
  release = ver_dic["VERSION_TEXT"]
20
20
 
21
-
22
21
  nitpick_ignore = [
22
+ ("py:class", r"builtins.slice"),
23
23
  ("py:class", r"numpy._typing._dtype_like._SupportsDType"),
24
24
  ("py:class", r"numpy._typing._dtype_like._DTypeDict"),
25
+ ("py:class", r"pytest.Metafunc"),
25
26
  ]
26
27
 
27
28
  intersphinx_mapping = {
@@ -55,10 +55,6 @@ References
55
55
  These are only here because Sphinx, our documentation tool, struggles to
56
56
  resolve them.
57
57
 
58
- .. class:: WaitList
59
-
60
- A :class:`Sequence` of :class:`Event`\ s or *None*.
61
-
62
58
  .. class:: NDArray
63
59
 
64
60
  See :data:`numpy.typing.NDArray`.
@@ -75,6 +71,10 @@ resolve them.
75
71
 
76
72
  A generic type variable, used for a return type.
77
73
 
74
+ .. class:: HashableT
75
+
76
+ An invariant type variable that is bound to :class:`Hashable`.
77
+
78
78
  .. class:: P
79
79
 
80
80
  A :class:`~typing.ParamSpec`.
@@ -95,7 +95,7 @@ resolve them.
95
95
 
96
96
  .. class:: WaitList
97
97
 
98
- A :class:`Sequence` of :class:`Event`\ s or *None*.
98
+ See :class:`pyopencl.WaitList`.
99
99
 
100
100
  .. class:: Context
101
101
 
@@ -109,6 +109,10 @@ resolve them.
109
109
 
110
110
  See :class:`pyopencl.Event`.
111
111
 
112
+ .. class:: KernelArg
113
+
114
+ A union of allowed kernel arguments.
115
+
112
116
  .. currentmodule:: cl_tools
113
117
  ..
114
118
  .. class:: AllocatorBase
@@ -116,6 +116,15 @@ Event
116
116
 
117
117
  |comparable|
118
118
 
119
+ .. autodata:: WaitList
120
+ :noindex:
121
+
122
+ A :class:`Sequence` of :class:`Event`\ s or *None*.
123
+
124
+ .. class:: WaitList
125
+
126
+ See above.
127
+
119
128
  .. class:: ProfilingInfoGetter
120
129
 
121
130
  .. attribute:: info
@@ -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
@@ -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
 
@@ -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,