pyopencl 2024.2.2__cp311-cp311-macosx_11_0_arm64.whl → 2024.2.4__cp311-cp311-macosx_11_0_arm64.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.

Files changed (102) hide show
  1. pyopencl/__init__.py +16 -4
  2. pyopencl/_cl.cpython-311-darwin.so +0 -0
  3. pyopencl/algorithm.py +3 -1
  4. pyopencl/bitonic_sort.py +2 -0
  5. pyopencl/characterize/__init__.py +23 -0
  6. pyopencl/compyte/.git +1 -0
  7. pyopencl/compyte/.github/workflows/autopush.yml +21 -0
  8. pyopencl/compyte/.github/workflows/ci.yml +30 -0
  9. pyopencl/compyte/.gitignore +21 -0
  10. pyopencl/compyte/ndarray/Makefile +31 -0
  11. pyopencl/compyte/ndarray/gpu_ndarray.h +35 -0
  12. pyopencl/compyte/ndarray/pygpu_language.h +207 -0
  13. pyopencl/compyte/ndarray/pygpu_language_cuda.cu +622 -0
  14. pyopencl/compyte/ndarray/pygpu_language_opencl.cpp +317 -0
  15. pyopencl/compyte/ndarray/pygpu_ndarray.cpp +1546 -0
  16. pyopencl/compyte/ndarray/pygpu_ndarray.h +71 -0
  17. pyopencl/compyte/ndarray/pygpu_ndarray_object.h +232 -0
  18. pyopencl/compyte/setup.cfg +9 -0
  19. pyopencl/tools.py +60 -56
  20. pyopencl/version.py +7 -3
  21. {pyopencl-2024.2.2.dist-info → pyopencl-2024.2.4.dist-info}/METADATA +14 -14
  22. pyopencl-2024.2.4.dist-info/RECORD +59 -0
  23. {pyopencl-2024.2.2.dist-info → pyopencl-2024.2.4.dist-info}/WHEEL +1 -1
  24. pyopencl-2024.2.2.data/data/CITATION.cff +0 -74
  25. pyopencl-2024.2.2.data/data/CMakeLists.txt +0 -83
  26. pyopencl-2024.2.2.data/data/Makefile.in +0 -21
  27. pyopencl-2024.2.2.data/data/README.rst +0 -70
  28. pyopencl-2024.2.2.data/data/README_SETUP.txt +0 -34
  29. pyopencl-2024.2.2.data/data/aksetup_helper.py +0 -1013
  30. pyopencl-2024.2.2.data/data/configure.py +0 -6
  31. pyopencl-2024.2.2.data/data/contrib/cldis.py +0 -91
  32. pyopencl-2024.2.2.data/data/contrib/fortran-to-opencl/README +0 -29
  33. pyopencl-2024.2.2.data/data/contrib/fortran-to-opencl/translate.py +0 -1441
  34. pyopencl-2024.2.2.data/data/contrib/pyopencl.vim +0 -84
  35. pyopencl-2024.2.2.data/data/doc/Makefile +0 -23
  36. pyopencl-2024.2.2.data/data/doc/algorithm.rst +0 -214
  37. pyopencl-2024.2.2.data/data/doc/array.rst +0 -305
  38. pyopencl-2024.2.2.data/data/doc/conf.py +0 -26
  39. pyopencl-2024.2.2.data/data/doc/howto.rst +0 -105
  40. pyopencl-2024.2.2.data/data/doc/index.rst +0 -137
  41. pyopencl-2024.2.2.data/data/doc/make_constants.py +0 -561
  42. pyopencl-2024.2.2.data/data/doc/misc.rst +0 -885
  43. pyopencl-2024.2.2.data/data/doc/runtime.rst +0 -51
  44. pyopencl-2024.2.2.data/data/doc/runtime_const.rst +0 -30
  45. pyopencl-2024.2.2.data/data/doc/runtime_gl.rst +0 -78
  46. pyopencl-2024.2.2.data/data/doc/runtime_memory.rst +0 -527
  47. pyopencl-2024.2.2.data/data/doc/runtime_platform.rst +0 -184
  48. pyopencl-2024.2.2.data/data/doc/runtime_program.rst +0 -364
  49. pyopencl-2024.2.2.data/data/doc/runtime_queue.rst +0 -182
  50. pyopencl-2024.2.2.data/data/doc/subst.rst +0 -36
  51. pyopencl-2024.2.2.data/data/doc/tools.rst +0 -4
  52. pyopencl-2024.2.2.data/data/doc/types.rst +0 -42
  53. pyopencl-2024.2.2.data/data/examples/black-hole-accretion.py +0 -2227
  54. pyopencl-2024.2.2.data/data/examples/demo-struct-reduce.py +0 -75
  55. pyopencl-2024.2.2.data/data/examples/demo.py +0 -39
  56. pyopencl-2024.2.2.data/data/examples/demo_array.py +0 -32
  57. pyopencl-2024.2.2.data/data/examples/demo_array_svm.py +0 -37
  58. pyopencl-2024.2.2.data/data/examples/demo_elementwise.py +0 -34
  59. pyopencl-2024.2.2.data/data/examples/demo_elementwise_complex.py +0 -53
  60. pyopencl-2024.2.2.data/data/examples/demo_mandelbrot.py +0 -183
  61. pyopencl-2024.2.2.data/data/examples/demo_meta_codepy.py +0 -56
  62. pyopencl-2024.2.2.data/data/examples/demo_meta_template.py +0 -55
  63. pyopencl-2024.2.2.data/data/examples/dump-performance.py +0 -38
  64. pyopencl-2024.2.2.data/data/examples/dump-properties.py +0 -86
  65. pyopencl-2024.2.2.data/data/examples/gl_interop_demo.py +0 -84
  66. pyopencl-2024.2.2.data/data/examples/gl_particle_animation.py +0 -218
  67. pyopencl-2024.2.2.data/data/examples/ipython-demo.ipynb +0 -203
  68. pyopencl-2024.2.2.data/data/examples/median-filter.py +0 -99
  69. pyopencl-2024.2.2.data/data/examples/n-body.py +0 -1070
  70. pyopencl-2024.2.2.data/data/examples/narray.py +0 -37
  71. pyopencl-2024.2.2.data/data/examples/noisyImage.jpg +0 -0
  72. pyopencl-2024.2.2.data/data/examples/pi-monte-carlo.py +0 -1166
  73. pyopencl-2024.2.2.data/data/examples/svm.py +0 -82
  74. pyopencl-2024.2.2.data/data/examples/transpose.py +0 -229
  75. pyopencl-2024.2.2.data/data/pytest.ini +0 -3
  76. pyopencl-2024.2.2.data/data/src/bitlog.cpp +0 -51
  77. pyopencl-2024.2.2.data/data/src/bitlog.hpp +0 -83
  78. pyopencl-2024.2.2.data/data/src/clinfo_ext.h +0 -134
  79. pyopencl-2024.2.2.data/data/src/mempool.hpp +0 -444
  80. pyopencl-2024.2.2.data/data/src/pyopencl_ext.h +0 -77
  81. pyopencl-2024.2.2.data/data/src/tools.hpp +0 -90
  82. pyopencl-2024.2.2.data/data/src/wrap_cl.cpp +0 -61
  83. pyopencl-2024.2.2.data/data/src/wrap_cl.hpp +0 -5853
  84. pyopencl-2024.2.2.data/data/src/wrap_cl_part_1.cpp +0 -369
  85. pyopencl-2024.2.2.data/data/src/wrap_cl_part_2.cpp +0 -702
  86. pyopencl-2024.2.2.data/data/src/wrap_constants.cpp +0 -1274
  87. pyopencl-2024.2.2.data/data/src/wrap_helpers.hpp +0 -213
  88. pyopencl-2024.2.2.data/data/src/wrap_mempool.cpp +0 -738
  89. pyopencl-2024.2.2.data/data/test/add-vectors-32.spv +0 -0
  90. pyopencl-2024.2.2.data/data/test/add-vectors-64.spv +0 -0
  91. pyopencl-2024.2.2.data/data/test/empty-header.h +0 -1
  92. pyopencl-2024.2.2.data/data/test/test_algorithm.py +0 -1180
  93. pyopencl-2024.2.2.data/data/test/test_array.py +0 -2392
  94. pyopencl-2024.2.2.data/data/test/test_arrays_in_structs.py +0 -100
  95. pyopencl-2024.2.2.data/data/test/test_clmath.py +0 -529
  96. pyopencl-2024.2.2.data/data/test/test_clrandom.py +0 -75
  97. pyopencl-2024.2.2.data/data/test/test_enqueue_copy.py +0 -271
  98. pyopencl-2024.2.2.data/data/test/test_wrapper.py +0 -1565
  99. pyopencl-2024.2.2.dist-info/LICENSE +0 -282
  100. pyopencl-2024.2.2.dist-info/RECORD +0 -123
  101. pyopencl-2024.2.2.dist-info/top_level.txt +0 -1
  102. {pyopencl-2024.2.2.data/data → pyopencl-2024.2.4.dist-info/licenses}/LICENSE +0 -0
@@ -1,885 +0,0 @@
1
- Installation
2
- ============
3
-
4
- Installing from Conda Forge
5
- ---------------------------
6
-
7
- Installing PyOpenCL
8
- ^^^^^^^^^^^^^^^^^^^
9
-
10
- By far the easiest way to install PyOpenCL is to use the packages available in
11
- `Conda Forge <https://conda-forge.org/>`__. Conda Forge is a repository of
12
- community-maintained packages for the `Conda <https://conda.io/en/latest>`__
13
- package manager. The following instructions are aimed at Linux and macOS.
14
- The analogous steps for Windows should also work.
15
-
16
- Install a version of
17
- `miniforge <https://github.com/conda-forge/miniforge#miniforge3>`__
18
- that fits your system::
19
-
20
- curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
21
- bash ./Miniforge3-*.sh
22
- # (answer questions, pick install location)
23
-
24
- Then run::
25
-
26
- source /WHERE/YOU/INSTALLED/MINIFORGE/bin/activate root
27
- conda install pyopencl
28
-
29
- You can install these pieces of software in your user account and
30
- do not need root/administrator privileges.
31
-
32
- .. note::
33
-
34
- This installs a conda environment based on Conda Forge. This is not
35
- interchangeable with a conda environment based on the (more common)
36
- anaconda. If you have an existing conda environment sitting around, just
37
- following the instructions below will likely not work. Instead, the
38
- suggested approach is to create new environment from scratch, starting with
39
- miniforge, above.
40
-
41
- Enabling access to CPUs and GPUs via (Py)OpenCL
42
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43
-
44
- Note that PyOpenCL is no fun (i.e. cannot run code) without an OpenCL device
45
- driver (a so-called "ICD", for "installable client driver") that provides access
46
- to hardware through OpenCL. If you get an error message like
47
- ``pyopencl._cl.LogicError: clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHR``,
48
- that means PyOpenCL installed successfully, but you have no OpenCL drivers installed.
49
-
50
- Note that drivers (ICDs) are separate pieces of software from PyOpenCL. They
51
- might be provided by your hardware vendor (e.g. for Nvidia or AMD GPUs). If
52
- you have such hardware, see below for instructions on how to make those work
53
- with PyOpenCL from Conda Forge.
54
-
55
- It is important to note that OpenCL is not restricted to GPUs. In fact, no special
56
- hardware is required to use OpenCL for computation--your existing CPU is enough.
57
- On Linux or macOS, type::
58
-
59
- conda install pocl
60
-
61
- to install a CPU-based OpenCL driver.
62
- On macOS, PoCL can offer a marked robustness (and, sometimes, performance)
63
- improvement over the OpenCL drivers built into the operating system.
64
-
65
- On Linux and Windows, you can use Intel's CPU OpenCL runtime::
66
-
67
- conda install intel-opencl-rt
68
-
69
- On Linux Intel Broadwell or newer processors with an Intel graphics card, you
70
- can use NEO::
71
-
72
- conda install intel-compute-runtime
73
-
74
- On Linux Intel Sandybridge or newer processors with an Intel graphics card, you
75
- can use Beignet::
76
-
77
- conda install beignet
78
-
79
- On Linux, Windows and macOS, you can use Oclgrind to detect memory access errors::
80
-
81
- conda install oclgrind
82
-
83
- You are now ready to run code based on PyOpenCL, such as the `code
84
- examples <https://github.com/inducer/pyopencl/tree/main/examples>`__.
85
-
86
- Using vendor-supplied OpenCL drivers (mainly on Linux)
87
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
88
-
89
- The instructions above help you get a basic OpenCL environment going that
90
- will work independently of whether you have specialized hardware (such as GPUs
91
- or FPGAs) available. If you *do* have such hardware, read on for how to make
92
- it work.
93
-
94
- On Linux, PyOpenCL finds which drivers are installed by looking for files with
95
- the extension ``.icd`` in a directory. PyOpenCL as installed from Conda will
96
- look for these files in
97
- :file:`/WHERE/YOU/INSTALLED/MINICONDA/etc/OpenCL/vendors`. They are just
98
- simple text files containing either just the file names or the fully
99
- qualified path names of the shared library providing the OpenCL driver.
100
-
101
- .. note::
102
-
103
- If you ran the commands above in a
104
- `Conda environment <https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html>`__
105
- (i.e. if the environment indicator on your command line prompt says anything other
106
- than ``(root)``), then you may need to use a path like the following instead:
107
-
108
- :file:`/WHERE/YOU/INSTALLED/MINICONDA/envs/ENVIRONMENTNAME/etc/OpenCL/vendors`
109
-
110
- Note that you should replace ``ENVIRONMENTNAME`` with the name of your environment,
111
- shown between parentheses on your command line prompt.
112
- This path (for the currently-active conda environment) can be obtained from the
113
- environment variable ``CONDA_PREFIX``, i.e.,
114
-
115
- :file:`$CONDA_PREFIX/etc/OpenCL/vendors` (once the Conda environment is activated).
116
-
117
- On Linux, if you have other OpenCL drivers installed (such as for your GPU),
118
- those will be in :file:`/etc/OpenCL/vendors`. You can make them work with PyOpenCL
119
- from Conda Forge by using the command::
120
-
121
- conda install ocl-icd-system
122
-
123
- will make sure these system-wide ICDs are also visible in your conda environment.
124
- As an alternative, one may manually copy ICD files from :file:`/etc/OpenCL/vendors`
125
- into, e.g., :file:`$CONDA_PREFIX/etc/OpenCL/vendors`.
126
-
127
- If you are looking for more information, see `ocl-icd
128
- <https://github.com/OCL-dev/ocl-icd>`__ and its documentation. Ocl-icd is the
129
- "ICD loader" used by PyOpenCL when installed from Conda Forge on Linux.
130
- It represents the code behind :file:`libOpenCL.so`.
131
-
132
- On macOS, using the command::
133
-
134
- conda install ocl_icd_wrapper_apple
135
-
136
- will make sure that the Apple provided CPU and GPU implementations are available.
137
-
138
- On Windows, the packaging of PyOpenCL for Conda Forge relies on the
139
- `Khronos ICD Loader <https://github.com/KhronosGroup/OpenCL-ICD-Loader>`__,
140
- and it is packaged so that the OpenCL drivers that are registered in the OS
141
- using registry keys are automatically available.
142
-
143
-
144
- Installing from PyPI wheels
145
- ---------------------------
146
-
147
- PyOpenCL distributes wheels for most popular OSs and Python versions.
148
- To check available versions please visit `PyPI page for PyOpenCL
149
- <https://pypi.org/project/pyopencl/>`__.
150
-
151
-
152
- On Linux, the wheels come with `OCL-ICD <https://github.com/OCL-dev/ocl-icd>`__
153
- bundled and configured to use any OpenCL implementation supporting the ICD
154
- interface and listed in :file:`/etc/OpenCL/vendors`.
155
- Wheels for Windows and MacOS are built using the ICD Loader from the Khronos Group.
156
-
157
- To install, type::
158
-
159
- pip install pyopencl
160
-
161
-
162
- You can also install the following CPU based OpenCL implementation using pip
163
- shipped as binary wheels. Note that pyopencl has to be installed using a wheel
164
- for pyopencl to recognize these wheels.
165
-
166
- To install pyopencl with PoCL, a CPU based implementation do::
167
-
168
- pip install pyopencl[pocl]
169
-
170
- To install pyopencl with oclgrind, an OpenCL debugger do::
171
-
172
- pip install pyopencl[oclgrind]
173
-
174
- .. note::
175
-
176
- Avoid mixing components installed from Conda Forge and PyPI.
177
- For example, installing PyOpenCL from pip followed by OCL-ICD from Conda Forge can
178
- redirect the ICD loader, removing access to system-wide ICDs.
179
-
180
- Installing via Christoph Gohlke's binary wheels (Windows)
181
- ---------------------------------------------------------
182
-
183
- Christoph Gohlke distributes `binary wheels for PyOpenCL on Windows
184
- <https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyopencl>`__.
185
-
186
- Installing from source
187
- ----------------------
188
-
189
- Information on how to install PyOpenCL *from source* is still available on the
190
- `Former PyOpenCL Wiki <https://wiki.tiker.net/PyOpenCL/Installation>`__, but that should
191
- mostly not be necessary unless you have very specific needs or would like to modify
192
- PyOpenCL yourself.
193
-
194
- Tips
195
- ====
196
-
197
- Syntax highlighting
198
- -------------------
199
-
200
- You can obtain Vim syntax highlighting for OpenCL C inlined in Python by
201
- checking `this file
202
- <https://github.com/inducer/pyopencl/blob/main/contrib/pyopencl.vim>`__.
203
-
204
- Note that the triple-quoted strings containing the source must start with
205
- ``"""//CL// ..."""``.
206
-
207
- .. _ipython-integration:
208
-
209
- IPython integration
210
- -------------------
211
-
212
- PyOpenCL comes with IPython integration, which lets you seamlessly integrate
213
- PyOpenCL kernels into your IPython notebooks. Simply load the PyOpenCL
214
- IPython extension using::
215
-
216
- %load_ext pyopencl.ipython_ext
217
-
218
- and then use the ``%%cl_kernel`` 'cell-magic' command. See `this notebook
219
- <https://nbviewer.org/github/inducer/pyopencl/blob/main/examples/ipython-demo.ipynb>`__
220
- (which ships with PyOpenCL) for a demonstration.
221
-
222
- You can pass build options to be used for building the program executable by
223
- using the ``-o`` flag on the first line of the cell (next to the ``%%cl_kernel``
224
- directive). For example::
225
-
226
- %%cl_kernel -o "-cl-fast-relaxed-math"
227
-
228
- There are also line magics: ``cl_load_edit_kernel`` which will load a file into
229
- the next cell (adding ``cl_kernel`` to the first line) and ``cl_kernel_from_file``
230
- which will compile kernels from a file (as if you copy-and-pasted the contents of
231
- the file to a cell with ``cl_kernel``). Both of these magics take options ``-f``
232
- to specify the file and optionally ``-o`` for build options.
233
-
234
- .. versionadded:: 2014.1
235
-
236
- Guidelines
237
- ==========
238
-
239
- .. _api-compatibility:
240
-
241
- API Stability
242
- -------------
243
-
244
- I consider PyOpenCL's API "stable". That doesn't mean it can't
245
- change. But if it does, your code will generally continue to run. It
246
- may however start spewing warnings about things you need to change to
247
- stay compatible with future versions.
248
-
249
- Deprecation warnings will be around for a whole year, as identified by the
250
- first number in the release name. (the "2014" in "2014.1") I.e. a function
251
- that was deprecated in 2014.n will generally be removed in 2015.n (or perhaps
252
- later). Further, the stability promise applies for any code that's part of a
253
- released version. It doesn't apply to undocumented bits of the API, and it
254
- doesn't apply to unreleased code downloaded from git.
255
-
256
- .. _versus-c:
257
-
258
- Relation with OpenCL's C Bindings
259
- ---------------------------------
260
-
261
- We've tried to follow these guidelines when binding the OpenCL's
262
- C interface to Python:
263
-
264
- * Remove the ``cl_``, ``CL_`` and ``cl`` prefix from data types, macros and
265
- function names.
266
- * Follow :pep:`8`, i.e.
267
-
268
- * Make function names lowercase.
269
- * If a data type or function name is composed of more than one word,
270
- separate the words with a single underscore.
271
-
272
- * ``get_info`` functions become attributes.
273
- * Object creation is done by constructors, to the extent possible.
274
- (i.e. minimize use of "factory functions")
275
-
276
- * If an operation involves two or more "complex" objects (like e.g. a
277
- kernel enqueue involves a kernel and a queue), refuse the temptation
278
- to guess which one should get a method for the operation.
279
- Instead, simply leave that command to be a function.
280
-
281
- .. _interoperability:
282
-
283
- Interoperability with other OpenCL software
284
- -------------------------------------------
285
-
286
- Just about every object in :mod:`pyopencl` supports the following
287
- interface (here shown as an example for :class:`pyopencl.MemoryObject`,
288
- from which :class:`pyopencl.Buffer` and :class:`pyopencl.Image` inherit):
289
-
290
- * :meth:`pyopencl.MemoryObject.from_int_ptr`
291
- * :attr:`pyopencl.MemoryObject.int_ptr`
292
-
293
- This allows retrieving the C-level pointer to an OpenCL object as a Python
294
- integer, which may then be passed to other C libraries whose interfaces expose
295
- OpenCL objects. It also allows turning C-level OpenCL objects obtained from
296
- other software to be turned into the corresponding :mod:`pyopencl` objects.
297
-
298
- .. versionadded:: 2013.2
299
-
300
- User-visible Changes
301
- ====================
302
-
303
- Unreleased
304
- ----------
305
-
306
- .. note::
307
-
308
- This version is currently under development. You can get snapshots from
309
- PyOpenCL's `git repository <https://github.com/inducer/pyopencl>`__.
310
-
311
- Version 2022.2
312
- --------------
313
-
314
- - Added :ref:`opaque-style SVM <opaque-svm>` and :class:`pyopencl.SVMPointer`.
315
- - Added :class:`pyopencl.tools.SVMPool`.
316
- - Added automatic queue-synchronized deallocation of SVM.
317
-
318
- Version 2020.2
319
- --------------
320
-
321
- - Drop Python 2 support.
322
- - Add ``allow_empty_ndrange`` to kernel enqueue.
323
- - Bug fixes.
324
-
325
- Version 2018.2
326
- --------------
327
-
328
- * Use pybind11.
329
- * Many bug fixes.
330
- * Support arrays with offsets in scan kernels.
331
-
332
- Version 2018.1
333
- --------------
334
-
335
- * Introduce *eliminate_empty_output_lists* argument of
336
- :class:`pyopencl.algorithm.ListOfListsBuilder`.
337
- * Many bug fixes.
338
-
339
- Version 2017.2
340
- --------------
341
-
342
- * Many bug fixes.
343
-
344
- Version 2017.1
345
- --------------
346
-
347
- * Introduce :mod:`pyopencl.cltypes`
348
-
349
- Version 2016.2
350
- --------------
351
-
352
- * Deprecate RANLUXCL. It will be removed in the 2018.x series of PyOpenCL.
353
- * Introduce Random123 random number generators. See :mod:`pyopencl.clrandom`
354
- for more information.
355
- * Add support for **range** and **slice** kwargs and data-less reductions
356
- to :class:`pyopencl.reduction.ReductionKernel`.
357
- * Add support for SPIR-V. (See :class:`pyopencl.Program`.)
358
- * Add support for :ref:`svm`.
359
- * :class:`pyopencl.MemoryMap` is usable as a context manager.
360
-
361
- Version 2016.1
362
- --------------
363
-
364
- * The ``from_int_ptr`` methods now take a *retain* parameter for more convenient
365
- ownership management.
366
- * Kernel build options (if passed as a list) are now properly quoted.
367
- (This is a potentially compatibility-breaking change.)
368
- * Many bug fixes. (GL interop, Windows, event callbacks and more)
369
-
370
- Version 2015.2.4
371
- ----------------
372
-
373
- * Fix building on Windows, using mingwpy and VS 2015.
374
-
375
- Version 2015.2.3
376
- ----------------
377
-
378
- * Fix one more Ubuntu 14.x build issue.
379
-
380
- Version 2015.2.2
381
- ----------------
382
-
383
- * Fix compatibility with CL 1.1
384
- * Fix compatibility with Ubuntu 14.x.
385
- * Various bug fixes
386
-
387
- Version 2015.2.1
388
- ----------------
389
-
390
- * Fix global_offset kernel launch parameter
391
-
392
- Version 2015.2
393
- --------------
394
-
395
- * **[INCOMPATIBLE]** Changed PyOpenCL's complex numbers from ``float2`` and
396
- ``double2`` OpenCL vector types to custom ``struct``. This was changed
397
- because it very easily introduced bugs where
398
-
399
- * complex*complex
400
- * real+complex
401
-
402
- *look* like they may do the right thing, but silently do the wrong thing.
403
- * Rewrite of the wrapper layer to be based on CFFI
404
- * Pypy compatibility
405
- * Faster kernel invocation through Python launcher code generation
406
- * PoCL compatibility
407
-
408
- Version 2015.1
409
- --------------
410
-
411
- * Support for new-style buffer protocol
412
- * Numerous fixes
413
-
414
- Version 2014.1
415
- --------------
416
-
417
- * :ref:`ipython-integration`
418
- * Bug fixes
419
-
420
- Version 2013.2
421
- --------------
422
-
423
- * Add :meth:`pyopencl.array.Array.map_to_host`.
424
- * Support *strides* on :func:`pyopencl.enqueue_map_buffer` and
425
- :func:`pyopencl.enqueue_map_image`.
426
- * :class:`pyopencl.ImageFormat` was made comparable and hashable.
427
- * :mod:`pyopencl.reduction` supports slicing (contributed by Alex Nitz)
428
- * Added :ref:`interoperability`
429
- * Bug fixes
430
-
431
- Version 2013.1
432
- --------------
433
-
434
- * Vastly improved :ref:`custom-scan`.
435
- * Add :func:`pyopencl.tools.match_dtype_to_c_struct`,
436
- for better integration of the CL and :mod:`numpy` type systems.
437
- * More/improved Bessel functions.
438
- See `the source <https://github.com/inducer/pyopencl/tree/main/pyopencl/cl>`__.
439
- * Add :envvar:`PYOPENCL_NO_CACHE` environment variable to aid debugging.
440
- (e.g. with AMD's CPU implementation, see
441
- `their programming guide <https://developer.amd.com/wordpress/media/2013/07/AMD_Accelerated_Parallel_Processing_OpenCL_Programming_Guide-rev-2.7.pdf>`__)
442
- * Deprecated :func:`pyopencl.tools.register_dtype` in favor of
443
- :func:`pyopencl.tools.get_or_register_dtype`.
444
- * Clean up the :class:`pyopencl.array.Array` constructor interface.
445
- * Deprecate ``pyopencl.array.DefaultAllocator``.
446
- * Deprecate ``pyopencl.tools.CLAllocator``
447
- * Introduce :class:`pyopencl.tools.DeferredAllocator`,
448
- :class:`pyopencl.tools.ImmediateAllocator`.
449
- * Allow arrays whose beginning does not coincide with the beginning of their
450
- :attr:`pyopencl.array.Array.data` :class:`pyopencl.Buffer`.
451
- See :attr:`pyopencl.array.Array.base_data` and :attr:`pyopencl.array.Array.offset`.
452
- Note that not all functions in PyOpenCL support such arrays just yet. These
453
- will fail with :exc:`pyopencl.array.ArrayHasOffsetError`.
454
- * Add :meth:`pyopencl.array.Array.__getitem__` and
455
- :meth:`pyopencl.array.Array.__setitem__`, supporting generic slicing.
456
-
457
- It is *possible* to create non-contiguous arrays using this functionality.
458
- Most operations (elementwise etc.) will not work on such arrays.
459
-
460
- Note also that some operations (specifically, reductions and scans) on sliced
461
- arrays that start past the beginning of the original array will fail for now.
462
- This will be fixed in a future release.
463
-
464
- * :class:`pyopencl.CommandQueue` may be used as a context manager (in a
465
- ``with`` statement)
466
- * Add :func:`pyopencl.clmath.atan2`, :func:`pyopencl.clmath.atan2pi`.
467
- * Add :func:`pyopencl.array.concatenate`.
468
- * Add :meth:`pyopencl.Kernel.capture_call`.
469
-
470
- .. note::
471
-
472
- The addition of :meth:`pyopencl.array.Array.__getitem__` has an unintended
473
- consequence due to `numpy bug 3375
474
- <https://github.com/numpy/numpy/issues/3375>`__. For instance, this
475
- expression::
476
-
477
- numpy.float32(5) * some_pyopencl_array
478
-
479
- may take a very long time to execute. This is because :mod:`numpy` first
480
- builds an object array of (compute-device) scalars (!) before it decides that
481
- that's probably not such a bright idea and finally calls
482
- ``pyopencl.array.Array.__rmul__``.
483
-
484
- Note that only left arithmetic operations of :class:`pyopencl.array.Array`
485
- by :mod:`numpy` scalars are affected. Python's number types (:class:`float` etc.)
486
- are unaffected, as are right multiplications.
487
-
488
- If a program that used to run fast suddenly runs extremely slowly, it is
489
- likely that this bug is to blame.
490
-
491
- Here's what you can do:
492
-
493
- * Use Python scalars instead of :mod:`numpy` scalars.
494
- * Switch to right multiplications if possible.
495
- * Use a patched :mod:`numpy`. See the bug report linked above for a pull
496
- request with a fix.
497
- * Switch to a fixed version of :mod:`numpy` when available.
498
-
499
- Version 2012.1
500
- --------------
501
-
502
- * Support for complex numbers.
503
- * Support for Bessel functions. (experimental)
504
- * Numerous fixes.
505
-
506
- Version 2011.2
507
- --------------
508
-
509
- * Add :func:`pyopencl.enqueue_migrate_mem_objects`.
510
- * Add :func:`pyopencl.image_from_array`.
511
- * IMPORTANT BUGFIX: Kernel caching was broken for all the 2011.1.x releases, with
512
- severe consequences on the execution time of :class:`pyopencl.array.Array`
513
- operations. Henrik Andresen at a
514
- `PyOpenCL workshop at DTU <http://gpulab.compute.dtu.dk/courses.html>`__
515
- first noticed the strange timings.
516
- * All comparable PyOpenCL objects are now also hashable.
517
- * Add ``pyopencl.tools.context_dependent_memoize`` to the documented
518
- functionality.
519
- * Base :mod:`pyopencl.clrandom` on RANLUXCL
520
- (``https://bitbucket.org/ivarun/ranluxcl>``), add functionality.
521
- * Add :class:`pyopencl.NannyEvent` objects.
522
- * Add :mod:`pyopencl.characterize`.
523
- * Ensure compatibility with OS X Lion.
524
- * Add :func:`pyopencl.tools.register_dtype` to enable scan/reduction on struct types.
525
- * :func:`pyopencl.enqueue_migrate_mem_objects` was renamed
526
- ``pyopencl.enqueue_migrate_mem_objects_ext``.
527
- :func:`pyopencl.enqueue_migrate_mem_objects` now refers to the OpenCL 1.2 function
528
- of this name, if available.
529
- * :meth:`pyopencl.Device.create_sub_devices` was renamed
530
- ``pyopencl.Device.create_sub_devices_ext``.
531
- :meth:`pyopencl.Device.create_sub_devices` now refers to the OpenCL 1.2 function
532
- of this name, if available.
533
- * Alpha support for OpenCL 1.2.
534
-
535
- Version 2011.1.2
536
- ----------------
537
-
538
- * More bug fixes.
539
-
540
- Version 2011.1.1
541
- ----------------
542
-
543
- * Fixes for Python 3 compatibility. (with work by Christoph Gohlke)
544
-
545
- Version 2011.1
546
- --------------
547
-
548
- * All *is_blocking* parameters now default to *True* to avoid
549
- crashy-by-default behavior. (suggested by Jan Meinke)
550
- In particular, this change affects
551
- ``pyopencl.enqueue_read_buffer``,
552
- ``pyopencl.enqueue_write_buffer``,
553
- ``pyopencl.enqueue_read_buffer_rect``,
554
- ``pyopencl.enqueue_write_buffer_rect``,
555
- ``pyopencl.enqueue_read_image``,
556
- ``pyopencl.enqueue_write_image``,
557
- ``pyopencl.enqueue_map_buffer``,
558
- ``pyopencl.enqueue_map_image``.
559
- * Add :mod:`pyopencl.reduction`.
560
- * Add :ref:`reductions`.
561
- * Add :mod:`pyopencl.scan`.
562
- * Add :meth:`pyopencl.MemoryObject.get_host_array`.
563
- * Deprecate context arguments of
564
- :func:`pyopencl.array.to_device`,
565
- :func:`pyopencl.array.zeros`,
566
- :func:`pyopencl.array.arange`.
567
- * Make construction of :class:`pyopencl.array.Array` more flexible (*cqa* argument.)
568
- * Add :ref:`memory-pools`.
569
- * Add vector types, see :class:`pyopencl.array.vec`.
570
- * Add :attr:`pyopencl.array.Array.strides`, :attr:`pyopencl.array.Array.flags`.
571
- Allow the creation of arrays in C and Fortran order.
572
- * Add :func:`pyopencl.enqueue_copy`. Deprecate all other transfer functions.
573
- * Add support for numerous extensions, among them device fission.
574
- * Add a compiler cache.
575
- * Add the 'g_times_l' keyword arg to kernel execution.
576
-
577
- Version 0.92
578
- ------------
579
-
580
- * Add support for OpenCL 1.1.
581
- * Add support for the
582
- `cl_khr_gl_sharing <https://registry.khronos.org/OpenCL/sdk/1.2/docs/man/xhtml/cl_khr_gl_sharing.html>`__
583
- extension, leading to working GL interoperability.
584
- * Add :meth:`pyopencl.Kernel.set_args`.
585
- * The call signature of :meth:`pyopencl.Kernel.__call__` changed to
586
- emphasize the importance of *local_size*.
587
- * Add :meth:`pyopencl.Kernel.set_scalar_arg_dtypes`.
588
- * Add support for the
589
- `cl_nv_device_attribute_query <https://registry.khronos.org/OpenCL/extensions/nv/cl_nv_device_attribute_query.txt>`__
590
- extension.
591
- * Add :meth:`pyopencl.array.Array` and related functionality.
592
- * Make build not depend on Boost C++.
593
-
594
- Version 0.91.5
595
- --------------
596
-
597
- * Add :attr:`pyopencl.ImageFormat.channel_count`,
598
- :attr:`pyopencl.ImageFormat.dtype_size`,
599
- :attr:`pyopencl.ImageFormat.itemsize`.
600
- * Add missing ``pyopencl.enqueue_copy_buffer``.
601
- * Add :func:`pyopencl.create_some_context`.
602
- * Add :func:`pyopencl.enqueue_barrier`, which was previously missing.
603
-
604
- Version 0.91.4
605
- --------------
606
-
607
- A bugfix release. No user-visible changes.
608
-
609
- Version 0.91.3
610
- --------------
611
-
612
- * All parameters named *host_buffer* were renamed *hostbuf* for consistency
613
- with the :class:`pyopencl.Buffer` constructor introduced in 0.91.
614
- Compatibility code is in place.
615
- * The :class:`pyopencl.Image` constructor does not need a *shape* parameter if the
616
- given *hostbuf* has *hostbuf.shape*.
617
- * The :class:`pyopencl.Context` constructor can now be called without parameters.
618
-
619
- Version 0.91.2
620
- --------------
621
-
622
- * :meth:`pyopencl.Program.build` now captures build logs and adds them
623
- to the exception text.
624
- * Deprecate ``pyopencl.create_context_from_type`` in favor of second
625
- form of :class:`pyopencl.Context` constructor
626
- * Introduce :class:`pyopencl.LocalMemory`.
627
- * Document kernel invocation and :meth:`pyopencl.Kernel.set_arg`.
628
-
629
- Version 0.91.1
630
- --------------
631
-
632
- * Fixed a number of bugs, notably involving :class:`pyopencl.Sampler`.
633
- * :class:`pyopencl.Device`, :class:`pyopencl.Platform`,
634
- :class:`pyopencl.Context` now have nicer string representations.
635
- * Add :attr:`pyopencl.Image.shape`. (suggested by David Garcia)
636
-
637
- Version 0.91
638
- ------------
639
-
640
- * Add :ref:`gl-interop`.
641
- * Add a test suite.
642
- * Fix numerous ``get_info`` bugs. (reports by David Garcia and the test suite)
643
- * Add :meth:`pyopencl.ImageFormat.__repr__`.
644
- * Add :meth:`pyopencl.addressing_mode.to_string` and colleagues.
645
- * The ``pitch`` arguments to
646
- ``pyopencl.create_image_2d``,
647
- ``pyopencl.create_image_3d``,
648
- ``pyopencl.enqueue_read_image``, and
649
- ``pyopencl.enqueue_write_image``
650
- are now defaulted to zero. The argument order of ``enqueue_{read,write}_image``
651
- has changed for this reason.
652
- * Deprecate
653
- ``pyopencl.create_image_2d``,
654
- ``pyopencl.create_image_3d``
655
- in favor of the :class:`pyopencl.Image` constructor.
656
- * Deprecate
657
- ``pyopencl.create_program_with_source``,
658
- ``pyopencl.create_program_with_binary``
659
- in favor of the :class:`pyopencl.Program` constructor.
660
- * Deprecate
661
- ``pyopencl.create_buffer``,
662
- ``pyopencl.create_host_buffer``
663
- in favor of the :class:`pyopencl.Buffer` constructor.
664
- * :meth:`pyopencl.Image.get_image_info` now actually exists.
665
- * Add :attr:`pyopencl.Image.info`.
666
- * Fix API tracing.
667
- * Add constructor arguments to :class:`pyopencl.ImageFormat`.
668
- (suggested by David Garcia)
669
-
670
- Version 0.90.4
671
- --------------
672
-
673
- * Add build fixes for Windows and OS X.
674
-
675
- Version 0.90.3
676
- --------------
677
-
678
- * Fix a GNU-ism in the C++ code of the wrapper.
679
-
680
- Version 0.90.2
681
- --------------
682
-
683
- * Fix :meth:`pyopencl.Platform.get_info`.
684
- * Fix passing properties to :class:`pyopencl.CommandQueue`.
685
- Also fix related documentation.
686
-
687
- Version 0.90.1
688
- --------------
689
-
690
- * Fix building on the Mac.
691
-
692
- Version 0.90
693
- ------------
694
-
695
- * Initial release.
696
-
697
- .. _license:
698
-
699
- License
700
- =======
701
-
702
- .. include:: ../LICENSE
703
-
704
-
705
- Frequently Asked Questions
706
- ==========================
707
-
708
- The FAQ is maintained collaboratively on the
709
- `Wiki FAQ page <https://wiki.tiker.net/PyOpenCL/FrequentlyAskedQuestions>`__.
710
-
711
- Citing PyOpenCL
712
- ===============
713
-
714
- We are not asking you to gratuitously cite PyOpenCL in work that is otherwise
715
- unrelated to software. That said, if you do discuss some of the development
716
- aspects of your code and would like to highlight a few of the ideas behind
717
- PyOpenCL, feel free to cite `this article
718
- <https://doi.org/10.1016/j.parco.2011.09.001>`__:
719
-
720
- Andreas Klöckner, Nicolas Pinto, Yunsup Lee, Bryan Catanzaro, Paul Ivanov,
721
- Ahmed Fasih, PyCUDA and PyOpenCL: A scripting-based approach to GPU
722
- run-time code generation, Parallel Computing, Volume 38, Issue 3, March
723
- 2012, Pages 157-174.
724
-
725
- Here's a Bibtex entry for your convenience::
726
-
727
- @article{kloeckner_pycuda_2012,
728
- author = {{Kl{\"o}ckner}, Andreas
729
- and {Pinto}, Nicolas
730
- and {Lee}, Yunsup
731
- and {Catanzaro}, B.
732
- and {Ivanov}, Paul
733
- and {Fasih}, Ahmed },
734
- title = "{PyCUDA and PyOpenCL: A Scripting-Based Approach to GPU Run-Time Code Generation}",
735
- journal = "Parallel Computing",
736
- volume = "38",
737
- number = "3",
738
- pages = "157--174",
739
- year = "2012",
740
- issn = "0167-8191",
741
- doi = "10.1016/j.parco.2011.09.001",
742
- }
743
-
744
- Acknowledgments
745
- ===============
746
-
747
- Contributors
748
- ------------
749
-
750
- Too many to list. Please see the
751
- `commit log <https://github.com/inducer/pyopencl/commits/main>`__
752
- for detailed acknowledgments.
753
-
754
- Funding
755
- -------
756
-
757
- Work on pytential was supported in part by
758
-
759
- * the US National Science Foundation under grant numbers DMS-1418961,
760
- DMS-1654756, SHF-1911019, and OAC-1931577, and
761
- * the Department of Energy, National Nuclear Security Administration,
762
- under Award Number DE-NA0003963.
763
-
764
- AK also gratefully acknowledges a hardware gift from Nvidia Corporation.
765
-
766
- The views and opinions expressed herein do not necessarily reflect those of the
767
- funding agencies.
768
-
769
- Documentation Cross-References
770
- ==============================
771
-
772
- Numpy
773
- -----
774
- .. currentmodule:: numpy
775
-
776
- .. class:: int8
777
-
778
- See :class:`numpy.generic`.
779
-
780
- .. class:: int32
781
-
782
- See :class:`numpy.generic`.
783
-
784
- .. class:: float64
785
-
786
- See :class:`numpy.generic`.
787
-
788
- OpenCL Specification
789
- --------------------
790
- .. c:type:: cl_platform_id
791
-
792
- See the `CL specification <https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#opencl-platform-layer>`__.
793
-
794
- .. c:type:: cl_device_id
795
-
796
- See the `CL specification <https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#opencl-platform-layer>`__.
797
-
798
- .. c:type:: cl_context
799
-
800
- See the `CL specification <https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#_contexts>`__.
801
-
802
- .. c:type:: cl_command_queue
803
-
804
- See the `CL specification <https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#_command_queues>`__.
805
-
806
- .. c:type:: cl_mem
807
-
808
- See the `CL specification <https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#_memory_objects>`__.
809
-
810
- .. c:type:: cl_program
811
-
812
- See the `CL specification <https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#_program_objects>`__.
813
-
814
- .. c:type:: cl_kernel
815
-
816
- See the `CL specification <https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#_kernel_objects>`__.
817
-
818
- .. c:type:: cl_sampler
819
-
820
- See the `CL specification <https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#_sampler_objects>`__.
821
-
822
- .. c:type:: cl_event
823
-
824
- See the `CL specification <https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#event-objects>`__.
825
-
826
- .. c:function:: void clCreateCommandQueueWithProperties()
827
-
828
- See the `CL specification <https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#clCreateCommandQueueWithProperties>`__.
829
-
830
- .. c:function:: void clCreateSamplerWithProperties()
831
-
832
- See the `CL specification <https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#clCreateSamplerWithProperties>`__.
833
-
834
- .. c:function:: void clCreatePipe()
835
-
836
- See the `CL specification <https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#clCreatePipe>`__.
837
-
838
- Internal Types
839
- --------------
840
-
841
- .. currentmodule:: pyopencl._cl
842
-
843
- .. class:: Platform
844
-
845
- See :class:`pyopencl.Platform`.
846
-
847
- .. class:: Device
848
-
849
- See :class:`pyopencl.Device`.
850
-
851
- .. class:: CommandQueue
852
-
853
- See :class:`pyopencl.CommandQueue`.
854
-
855
- .. class:: Context
856
-
857
- See :class:`pyopencl.Context`.
858
-
859
- .. class:: Event
860
-
861
- See :class:`pyopencl.Event`.
862
-
863
- .. class:: SVMAllocation
864
-
865
- See :class:`pyopencl.SVMAllocation`.
866
-
867
- .. class:: MemoryMap
868
-
869
- See :class:`pyopencl.MemoryMap`.
870
-
871
- .. class:: Sampler
872
-
873
- See :class:`pyopencl.Sampler`.
874
-
875
- .. class:: Program
876
-
877
- See :class:`pyopencl.Program`.
878
-
879
- .. class:: _Program
880
-
881
- See :class:`pyopencl.Program`.
882
-
883
- .. class:: Kernel
884
-
885
- See :class:`pyopencl.Kernel`.