pyopencl 2025.2.5__tar.gz → 2025.2.7__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.5 → pyopencl-2025.2.7}/.gitignore +0 -4
  2. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/PKG-INFO +3 -4
  3. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/doc/algorithm.rst +7 -0
  4. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/doc/array.rst +9 -0
  5. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/doc/conf.py +12 -1
  6. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/doc/index.rst +6 -2
  7. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/doc/runtime.rst +9 -5
  8. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/doc/runtime_queue.rst +9 -0
  9. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/_cl.pyi +10 -7
  10. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/_monkeypatch.py +40 -5
  11. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/algorithm.py +1 -1
  12. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/array.py +214 -125
  13. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/cache.py +1 -1
  14. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/characterize/__init__.py +2 -4
  15. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/clmath.py +0 -1
  16. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/cltypes.py +42 -27
  17. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/compyte/array.py +9 -39
  18. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/compyte/dtypes.py +9 -11
  19. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/compyte/pyproject.toml +0 -3
  20. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/elementwise.py +223 -113
  21. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/scan.py +30 -25
  22. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/tools.py +327 -212
  23. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyproject.toml +9 -12
  24. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/src/wrap_cl.hpp +1 -0
  25. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/src/wrap_cl_part_2.cpp +4 -4
  26. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/test/test_algorithm.py +3 -0
  27. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/test/test_array.py +8 -3
  28. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/test/test_clrandom.py +3 -3
  29. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/test/test_wrapper.py +1 -1
  30. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/.gitlab-ci.yml +0 -0
  31. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/.gitmodules +0 -0
  32. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/.test-conda-env-py3.yml +0 -0
  33. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/CITATION.cff +0 -0
  34. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/CMakeLists.txt +0 -0
  35. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/LICENSE +0 -0
  36. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/README.rst +0 -0
  37. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/contrib/cldis.py +0 -0
  38. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/contrib/fortran-to-opencl/README +0 -0
  39. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/contrib/fortran-to-opencl/translate.py +0 -0
  40. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/contrib/pyopencl.vim +0 -0
  41. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/doc/.gitignore +0 -0
  42. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/doc/Makefile +0 -0
  43. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/doc/howto.rst +0 -0
  44. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/doc/make_constants.py +0 -0
  45. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/doc/misc.rst +0 -0
  46. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/doc/runtime_const.rst +0 -0
  47. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/doc/runtime_gl.rst +0 -0
  48. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/doc/runtime_memory.rst +0 -0
  49. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/doc/runtime_platform.rst +0 -0
  50. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/doc/runtime_program.rst +0 -0
  51. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/doc/subst.rst +0 -0
  52. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/doc/tools.rst +0 -0
  53. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/doc/types.rst +0 -0
  54. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/.gitignore +0 -0
  55. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/black-hole-accretion.py +0 -0
  56. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/demo-struct-reduce.py +0 -0
  57. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/demo.py +0 -0
  58. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/demo_array.py +0 -0
  59. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/demo_array_svm.py +0 -0
  60. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/demo_elementwise.py +0 -0
  61. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/demo_elementwise_complex.py +0 -0
  62. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/demo_mandelbrot.py +0 -0
  63. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/demo_meta_codepy.py +0 -0
  64. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/demo_meta_template.py +0 -0
  65. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/dump-performance.py +0 -0
  66. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/dump-properties.py +0 -0
  67. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/gl_interop_demo.py +0 -0
  68. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/gl_particle_animation.py +0 -0
  69. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/image_filters_using_image2d_t.py +0 -0
  70. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/ipython-demo.ipynb +0 -0
  71. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/median-filter.py +0 -0
  72. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/n-body.py +0 -0
  73. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/narray.py +0 -0
  74. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/noisyImage.jpg +0 -0
  75. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/pi-monte-carlo.py +0 -0
  76. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/svm.py +0 -0
  77. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/examples/transpose.py +0 -0
  78. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/__init__.py +0 -0
  79. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/_cluda.py +0 -0
  80. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/_mymako.py +0 -0
  81. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/bitonic_sort.py +0 -0
  82. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/bitonic_sort_templates.py +0 -0
  83. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/capture_call.py +0 -0
  84. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/characterize/performance.py +0 -0
  85. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/cl/pyopencl-airy.cl +0 -0
  86. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/cl/pyopencl-bessel-j-complex.cl +0 -0
  87. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/cl/pyopencl-bessel-j.cl +0 -0
  88. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/cl/pyopencl-bessel-y.cl +0 -0
  89. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/cl/pyopencl-complex.h +0 -0
  90. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/cl/pyopencl-eval-tbl.cl +0 -0
  91. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/cl/pyopencl-hankel-complex.cl +0 -0
  92. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/cl/pyopencl-random123/array.h +0 -0
  93. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/cl/pyopencl-random123/openclfeatures.h +0 -0
  94. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/cl/pyopencl-random123/philox.cl +0 -0
  95. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/cl/pyopencl-random123/threefry.cl +0 -0
  96. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/clrandom.py +0 -0
  97. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/compyte/.gitignore +0 -0
  98. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/compyte/__init__.py +0 -0
  99. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/invoker.py +0 -0
  100. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/ipython_ext.py +0 -0
  101. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/py.typed +0 -0
  102. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/reduction.py +0 -0
  103. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/typing.py +0 -0
  104. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/pyopencl/version.py +0 -0
  105. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/scripts/build-ocl-macos.sh +0 -0
  106. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/scripts/build-ocl-windows.sh +0 -0
  107. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/scripts/build-ocl.sh +0 -0
  108. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/src/bitlog.cpp +0 -0
  109. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/src/bitlog.hpp +0 -0
  110. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/src/clinfo_ext.h +0 -0
  111. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/src/mempool.hpp +0 -0
  112. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/src/pyopencl_ext.h +0 -0
  113. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/src/tools.hpp +0 -0
  114. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/src/wrap_cl.cpp +0 -0
  115. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/src/wrap_cl_part_1.cpp +0 -0
  116. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/src/wrap_constants.cpp +0 -0
  117. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/src/wrap_helpers.hpp +0 -0
  118. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/src/wrap_mempool.cpp +0 -0
  119. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/stubgen/stubgen.py +0 -0
  120. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/test/add-vectors-32.spv +0 -0
  121. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/test/add-vectors-64.spv +0 -0
  122. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/test/empty-header.h +0 -0
  123. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/test/test_arrays_in_structs.py +0 -0
  124. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/test/test_clmath.py +0 -0
  125. {pyopencl-2025.2.5 → pyopencl-2025.2.7}/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.5
3
+ Version: 2025.2.7
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")
@@ -132,6 +132,8 @@ never directly.
132
132
  The :class:`Array` Class
133
133
  ------------------------
134
134
 
135
+ .. autoclass:: ArrayT
136
+
135
137
  .. autoclass:: Array
136
138
 
137
139
  .. autoexception:: ArrayHasOffsetError
@@ -308,3 +310,10 @@ Generating Arrays of Random Numbers
308
310
  -----------------------------------
309
311
 
310
312
  .. automodule:: pyopencl.clrandom
313
+
314
+ Type Aliases
315
+ ------------
316
+
317
+ .. class:: cl.Device
318
+
319
+ See :class:`pyopencl.Device`.
@@ -1,5 +1,7 @@
1
1
  from urllib.request import urlopen
2
2
 
3
+ from sphinx.application import Sphinx
4
+
3
5
 
4
6
  _conf_url = \
5
7
  "https://raw.githubusercontent.com/inducer/sphinxconfig/main/sphinxconfig.py"
@@ -18,10 +20,11 @@ version = ".".join(str(x) for x in ver_dic["VERSION"])
18
20
  # The full version, including alpha/beta/rc tags.
19
21
  release = ver_dic["VERSION_TEXT"]
20
22
 
21
-
22
23
  nitpick_ignore = [
24
+ ("py:class", r"builtins.slice"),
23
25
  ("py:class", r"numpy._typing._dtype_like._SupportsDType"),
24
26
  ("py:class", r"numpy._typing._dtype_like._DTypeDict"),
27
+ ("py:class", r"pytest.Metafunc"),
25
28
  ]
26
29
 
27
30
  intersphinx_mapping = {
@@ -30,3 +33,11 @@ intersphinx_mapping = {
30
33
  "mako": ("https://docs.makotemplates.org/en/latest", None),
31
34
  "pytools": ("https://documen.tician.de/pytools", None),
32
35
  }
36
+
37
+ sphinxconfig_missing_reference_aliases: dict[str, str] = {
38
+ "np.dtype": "class:numpy.dtype",
39
+ }
40
+
41
+
42
+ def setup(app: Sphinx) -> None:
43
+ app.connect("missing-reference", process_autodoc_missing_reference) # noqa: F821
@@ -61,8 +61,8 @@ Tutorials
61
61
  `Problem set 2 <https://tiker.net/pub/simula-pyopencl-probset2.pdf>`__
62
62
  * Ian Johnson's `PyOpenCL tutorial <https://web.archive.org/web/20170907175053/http://enja.org:80/2011/02/22/adventures-in-pyopencl-part-1-getting-started-with-python>`__.
63
63
 
64
- Software that works with or enhances PyOpenCL
65
- =============================================
64
+ Software related to PyOpenCL
65
+ ============================
66
66
 
67
67
  * Jon Roose's `pyclblas <https://pyclblas.readthedocs.io/en/latest/index.html>`__
68
68
  (`code <https://github.com/jroose/pyclblas>`__)
@@ -97,6 +97,10 @@ Software that works with or enhances PyOpenCL
97
97
  * Vincent Favre-Nicolin's `pyvkfft <https://github.com/vincefn/pyvkfft/>`__
98
98
  makes `vkfft <https://github.com/DTolm/VkFFT>`__ accessible from PyOpenCL.
99
99
 
100
+ * Want something like PyOpenCL but for Apple's `Metal <https://en.wikipedia.org/wiki/Metal_(API)>`__?
101
+ Sean True's `PyMetallic <https://github.com/seantrue/pymetallic/>`__ may be
102
+ worth considering.
103
+
100
104
  If you know of a piece of software you feel that should be on this list, please
101
105
  let me know, or, even better, send a patch!
102
106
 
@@ -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
 
@@ -221,7 +223,7 @@ kernel_old_get_info = _cl.Kernel.get_info
221
223
  kernel_old_get_work_group_info = _cl.Kernel.get_work_group_info
222
224
 
223
225
 
224
- def kernel_set_arg_types(self: _cl.Kernel, arg_types):
226
+ def kernel_set_arg_types(self: _cl.Kernel, arg_types) -> None:
225
227
  arg_types = tuple(arg_types)
226
228
 
227
229
  # {{{ arg counting bug handling
@@ -259,7 +261,42 @@ def kernel_set_arg_types(self: _cl.Kernel, arg_types):
259
261
  devs=self.context.devices))
260
262
 
261
263
 
262
- 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:
263
300
  try:
264
301
  wg_info_cache = self._wg_info_cache
265
302
  except AttributeError:
@@ -411,9 +448,7 @@ def image_init(self: _cl.Image,
411
448
  else:
412
449
  raise ValueError("images cannot have more than three dimensions")
413
450
 
414
- desc = _cl.ImageDescriptor() \
415
- # pylint: disable=possibly-used-before-assignment
416
-
451
+ desc = _cl.ImageDescriptor()
417
452
  desc.image_type = image_type
418
453
  desc.shape = shape # also sets desc.array_size
419
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,