pyopencl 2024.2.2__cp312-cp312-macosx_11_0_arm64.whl → 2024.2.5__cp312-cp312-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.
- pyopencl/__init__.py +16 -4
- pyopencl/_cl.cpython-312-darwin.so +0 -0
- pyopencl/algorithm.py +3 -1
- pyopencl/bitonic_sort.py +2 -0
- pyopencl/characterize/__init__.py +23 -0
- pyopencl/compyte/.git +1 -0
- pyopencl/compyte/.gitignore +21 -0
- pyopencl/compyte/ndarray/Makefile +31 -0
- pyopencl/compyte/ndarray/gpu_ndarray.h +35 -0
- pyopencl/compyte/ndarray/pygpu_language.h +207 -0
- pyopencl/compyte/ndarray/pygpu_language_cuda.cu +622 -0
- pyopencl/compyte/ndarray/pygpu_language_opencl.cpp +317 -0
- pyopencl/compyte/ndarray/pygpu_ndarray.cpp +1546 -0
- pyopencl/compyte/ndarray/pygpu_ndarray.h +71 -0
- pyopencl/compyte/ndarray/pygpu_ndarray_object.h +232 -0
- pyopencl/tools.py +60 -56
- pyopencl/version.py +9 -3
- {pyopencl-2024.2.2.dist-info → pyopencl-2024.2.5.dist-info}/METADATA +14 -14
- pyopencl-2024.2.5.dist-info/RECORD +56 -0
- {pyopencl-2024.2.2.dist-info → pyopencl-2024.2.5.dist-info}/WHEEL +1 -1
- pyopencl-2024.2.2.data/data/CITATION.cff +0 -74
- pyopencl-2024.2.2.data/data/CMakeLists.txt +0 -83
- pyopencl-2024.2.2.data/data/Makefile.in +0 -21
- pyopencl-2024.2.2.data/data/README.rst +0 -70
- pyopencl-2024.2.2.data/data/README_SETUP.txt +0 -34
- pyopencl-2024.2.2.data/data/aksetup_helper.py +0 -1013
- pyopencl-2024.2.2.data/data/configure.py +0 -6
- pyopencl-2024.2.2.data/data/contrib/cldis.py +0 -91
- pyopencl-2024.2.2.data/data/contrib/fortran-to-opencl/README +0 -29
- pyopencl-2024.2.2.data/data/contrib/fortran-to-opencl/translate.py +0 -1441
- pyopencl-2024.2.2.data/data/contrib/pyopencl.vim +0 -84
- pyopencl-2024.2.2.data/data/doc/Makefile +0 -23
- pyopencl-2024.2.2.data/data/doc/algorithm.rst +0 -214
- pyopencl-2024.2.2.data/data/doc/array.rst +0 -305
- pyopencl-2024.2.2.data/data/doc/conf.py +0 -26
- pyopencl-2024.2.2.data/data/doc/howto.rst +0 -105
- pyopencl-2024.2.2.data/data/doc/index.rst +0 -137
- pyopencl-2024.2.2.data/data/doc/make_constants.py +0 -561
- pyopencl-2024.2.2.data/data/doc/misc.rst +0 -885
- pyopencl-2024.2.2.data/data/doc/runtime.rst +0 -51
- pyopencl-2024.2.2.data/data/doc/runtime_const.rst +0 -30
- pyopencl-2024.2.2.data/data/doc/runtime_gl.rst +0 -78
- pyopencl-2024.2.2.data/data/doc/runtime_memory.rst +0 -527
- pyopencl-2024.2.2.data/data/doc/runtime_platform.rst +0 -184
- pyopencl-2024.2.2.data/data/doc/runtime_program.rst +0 -364
- pyopencl-2024.2.2.data/data/doc/runtime_queue.rst +0 -182
- pyopencl-2024.2.2.data/data/doc/subst.rst +0 -36
- pyopencl-2024.2.2.data/data/doc/tools.rst +0 -4
- pyopencl-2024.2.2.data/data/doc/types.rst +0 -42
- pyopencl-2024.2.2.data/data/examples/black-hole-accretion.py +0 -2227
- pyopencl-2024.2.2.data/data/examples/demo-struct-reduce.py +0 -75
- pyopencl-2024.2.2.data/data/examples/demo.py +0 -39
- pyopencl-2024.2.2.data/data/examples/demo_array.py +0 -32
- pyopencl-2024.2.2.data/data/examples/demo_array_svm.py +0 -37
- pyopencl-2024.2.2.data/data/examples/demo_elementwise.py +0 -34
- pyopencl-2024.2.2.data/data/examples/demo_elementwise_complex.py +0 -53
- pyopencl-2024.2.2.data/data/examples/demo_mandelbrot.py +0 -183
- pyopencl-2024.2.2.data/data/examples/demo_meta_codepy.py +0 -56
- pyopencl-2024.2.2.data/data/examples/demo_meta_template.py +0 -55
- pyopencl-2024.2.2.data/data/examples/dump-performance.py +0 -38
- pyopencl-2024.2.2.data/data/examples/dump-properties.py +0 -86
- pyopencl-2024.2.2.data/data/examples/gl_interop_demo.py +0 -84
- pyopencl-2024.2.2.data/data/examples/gl_particle_animation.py +0 -218
- pyopencl-2024.2.2.data/data/examples/ipython-demo.ipynb +0 -203
- pyopencl-2024.2.2.data/data/examples/median-filter.py +0 -99
- pyopencl-2024.2.2.data/data/examples/n-body.py +0 -1070
- pyopencl-2024.2.2.data/data/examples/narray.py +0 -37
- pyopencl-2024.2.2.data/data/examples/noisyImage.jpg +0 -0
- pyopencl-2024.2.2.data/data/examples/pi-monte-carlo.py +0 -1166
- pyopencl-2024.2.2.data/data/examples/svm.py +0 -82
- pyopencl-2024.2.2.data/data/examples/transpose.py +0 -229
- pyopencl-2024.2.2.data/data/pytest.ini +0 -3
- pyopencl-2024.2.2.data/data/src/bitlog.cpp +0 -51
- pyopencl-2024.2.2.data/data/src/bitlog.hpp +0 -83
- pyopencl-2024.2.2.data/data/src/clinfo_ext.h +0 -134
- pyopencl-2024.2.2.data/data/src/mempool.hpp +0 -444
- pyopencl-2024.2.2.data/data/src/pyopencl_ext.h +0 -77
- pyopencl-2024.2.2.data/data/src/tools.hpp +0 -90
- pyopencl-2024.2.2.data/data/src/wrap_cl.cpp +0 -61
- pyopencl-2024.2.2.data/data/src/wrap_cl.hpp +0 -5853
- pyopencl-2024.2.2.data/data/src/wrap_cl_part_1.cpp +0 -369
- pyopencl-2024.2.2.data/data/src/wrap_cl_part_2.cpp +0 -702
- pyopencl-2024.2.2.data/data/src/wrap_constants.cpp +0 -1274
- pyopencl-2024.2.2.data/data/src/wrap_helpers.hpp +0 -213
- pyopencl-2024.2.2.data/data/src/wrap_mempool.cpp +0 -738
- pyopencl-2024.2.2.data/data/test/add-vectors-32.spv +0 -0
- pyopencl-2024.2.2.data/data/test/add-vectors-64.spv +0 -0
- pyopencl-2024.2.2.data/data/test/empty-header.h +0 -1
- pyopencl-2024.2.2.data/data/test/test_algorithm.py +0 -1180
- pyopencl-2024.2.2.data/data/test/test_array.py +0 -2392
- pyopencl-2024.2.2.data/data/test/test_arrays_in_structs.py +0 -100
- pyopencl-2024.2.2.data/data/test/test_clmath.py +0 -529
- pyopencl-2024.2.2.data/data/test/test_clrandom.py +0 -75
- pyopencl-2024.2.2.data/data/test/test_enqueue_copy.py +0 -271
- pyopencl-2024.2.2.data/data/test/test_wrapper.py +0 -1565
- pyopencl-2024.2.2.dist-info/LICENSE +0 -282
- pyopencl-2024.2.2.dist-info/RECORD +0 -123
- pyopencl-2024.2.2.dist-info/top_level.txt +0 -1
- {pyopencl-2024.2.2.data/data → pyopencl-2024.2.5.dist-info/licenses}/LICENSE +0 -0
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
.. include:: subst.rst
|
|
2
|
-
|
|
3
|
-
OpenCL Runtime: Command Queues and Events
|
|
4
|
-
=========================================
|
|
5
|
-
|
|
6
|
-
.. currentmodule:: pyopencl
|
|
7
|
-
|
|
8
|
-
Command Queue
|
|
9
|
-
-------------
|
|
10
|
-
|
|
11
|
-
.. class:: CommandQueue(context, device=None, properties=None)
|
|
12
|
-
|
|
13
|
-
Create a new command queue. *properties* is a bit field
|
|
14
|
-
consisting of :class:`command_queue_properties` values.
|
|
15
|
-
|
|
16
|
-
If *device* is None, one of the devices in *context* is chosen
|
|
17
|
-
in an implementation-defined manner.
|
|
18
|
-
|
|
19
|
-
*properties* may be a bitwise combination of values from
|
|
20
|
-
:class:`queue_properties` (or *None* which is equivalent to
|
|
21
|
-
passing *0*). This is compatible with both OpenCL 1.x and 2.x.
|
|
22
|
-
|
|
23
|
-
For OpenCL 2.0 and above, *properties* may also be a sequence
|
|
24
|
-
of keys and values from :class:`queue_properties` as accepted
|
|
25
|
-
by :c:func:`clCreateCommandQueueWithProperties` (see the OpenCL
|
|
26
|
-
spec for details). The trailing *0* is added automatically
|
|
27
|
-
and does not need to be included.
|
|
28
|
-
|
|
29
|
-
A :class:`CommandQueue` may be used as a context manager, like this::
|
|
30
|
-
|
|
31
|
-
with cl.CommandQueue(self.cl_context) as queue:
|
|
32
|
-
enqueue_stuff(queue, ...)
|
|
33
|
-
|
|
34
|
-
:meth:`finish` is automatically called at the end of the ``with``-delimited
|
|
35
|
-
context, and further operations on the queue are considered an error.
|
|
36
|
-
|
|
37
|
-
.. versionadded:: 2013.1
|
|
38
|
-
|
|
39
|
-
Context manager capability.
|
|
40
|
-
|
|
41
|
-
.. versionchanged:: 2018.2
|
|
42
|
-
|
|
43
|
-
Added the sequence-of-properties interface for OpenCL 2.
|
|
44
|
-
|
|
45
|
-
.. versionchanged:: 2022.1.4
|
|
46
|
-
|
|
47
|
-
Use of a command queue after its context manager completes
|
|
48
|
-
is now considered an error. :mod:`pyopencl` will warn about this
|
|
49
|
-
for a transitionary period and will start raising an exception
|
|
50
|
-
in 2023.
|
|
51
|
-
|
|
52
|
-
.. attribute:: info
|
|
53
|
-
|
|
54
|
-
Lower case versions of the :class:`command_queue_info` constants
|
|
55
|
-
may be used as attributes on instances of this class
|
|
56
|
-
to directly query info attributes.
|
|
57
|
-
|
|
58
|
-
.. method:: get_info(param)
|
|
59
|
-
|
|
60
|
-
See :class:`command_queue_info` for values of *param*.
|
|
61
|
-
|
|
62
|
-
.. method:: set_property(prop, enable)
|
|
63
|
-
|
|
64
|
-
See :class:`command_queue_properties` for possible values of *prop*.
|
|
65
|
-
*enable* is a :class:`bool`.
|
|
66
|
-
|
|
67
|
-
Unavailable in OpenCL 1.1 and newer.
|
|
68
|
-
|
|
69
|
-
.. method:: flush()
|
|
70
|
-
.. method:: finish()
|
|
71
|
-
|
|
72
|
-
.. automethod:: from_int_ptr
|
|
73
|
-
.. autoattribute:: int_ptr
|
|
74
|
-
|
|
75
|
-
|comparable|
|
|
76
|
-
|
|
77
|
-
Event
|
|
78
|
-
-----
|
|
79
|
-
|
|
80
|
-
.. class:: Event
|
|
81
|
-
|
|
82
|
-
.. attribute:: info
|
|
83
|
-
|
|
84
|
-
Lower case versions of the :class:`event_info` constants
|
|
85
|
-
may be used as attributes on instances of this class
|
|
86
|
-
to directly query info attributes.
|
|
87
|
-
|
|
88
|
-
.. attribute:: profile
|
|
89
|
-
|
|
90
|
-
An instance of :class:`ProfilingInfoGetter`.
|
|
91
|
-
|
|
92
|
-
.. method:: get_info(param)
|
|
93
|
-
|
|
94
|
-
See :class:`event_info` for values of *param*.
|
|
95
|
-
|
|
96
|
-
.. method:: get_profiling_info(param)
|
|
97
|
-
|
|
98
|
-
See :class:`profiling_info` for values of *param*.
|
|
99
|
-
See :attr:`profile` for an easier way of obtaining
|
|
100
|
-
the same information.
|
|
101
|
-
|
|
102
|
-
.. method:: wait()
|
|
103
|
-
|
|
104
|
-
.. automethod:: from_int_ptr
|
|
105
|
-
.. autoattribute:: int_ptr
|
|
106
|
-
|
|
107
|
-
.. method:: set_callback(type, cb)
|
|
108
|
-
|
|
109
|
-
Add the callback *cb* with signature ``cb(status)`` to the callback
|
|
110
|
-
queue for the event status *type* (one of the values of
|
|
111
|
-
:class:`command_execution_status`, except :attr:`command_execution_status.QUEUED`).
|
|
112
|
-
|
|
113
|
-
See the OpenCL specification for restrictions on what *cb* may and may not do.
|
|
114
|
-
|
|
115
|
-
.. versionadded:: 2015.2
|
|
116
|
-
|
|
117
|
-
|comparable|
|
|
118
|
-
|
|
119
|
-
.. class:: ProfilingInfoGetter
|
|
120
|
-
|
|
121
|
-
.. attribute:: info
|
|
122
|
-
|
|
123
|
-
Lower case versions of the :class:`profiling_info` constants
|
|
124
|
-
may be used as attributes on the attribute ``profile`` of this
|
|
125
|
-
class to directly query profiling info.
|
|
126
|
-
|
|
127
|
-
For example, you may use *evt.profile.end* instead of
|
|
128
|
-
*evt.get_profiling_info(pyopencl.profiling_info.END)*.
|
|
129
|
-
|
|
130
|
-
Event Subclasses
|
|
131
|
-
----------------
|
|
132
|
-
|
|
133
|
-
.. class:: UserEvent(context)
|
|
134
|
-
|
|
135
|
-
A subclass of :class:`Event`. Only available with OpenCL 1.1 and newer.
|
|
136
|
-
|
|
137
|
-
.. versionadded:: 0.92
|
|
138
|
-
|
|
139
|
-
.. method:: set_status(status)
|
|
140
|
-
|
|
141
|
-
See :class:`command_execution_status` for possible values of *status*.
|
|
142
|
-
|
|
143
|
-
.. class:: NannyEvent
|
|
144
|
-
|
|
145
|
-
Transfers between host and device return events of this type. They hold
|
|
146
|
-
a reference to the host-side buffer and wait for the transfer to complete
|
|
147
|
-
when they are freed. Therefore, they can safely release the reference to
|
|
148
|
-
the object they're guarding upon destruction.
|
|
149
|
-
|
|
150
|
-
A subclass of :class:`Event`.
|
|
151
|
-
|
|
152
|
-
.. versionadded:: 2011.2
|
|
153
|
-
|
|
154
|
-
.. method:: get_ward()
|
|
155
|
-
|
|
156
|
-
.. method:: wait()
|
|
157
|
-
|
|
158
|
-
In addition to performing the same wait as :meth:`Event.wait()`, this
|
|
159
|
-
method also releases the reference to the guarded object.
|
|
160
|
-
|
|
161
|
-
Synchronization Functions
|
|
162
|
-
-------------------------
|
|
163
|
-
|
|
164
|
-
.. function:: wait_for_events(events)
|
|
165
|
-
|
|
166
|
-
.. function:: enqueue_barrier(queue, wait_for=None)
|
|
167
|
-
|
|
168
|
-
Enqueues a barrier operation. which ensures that all queued commands in
|
|
169
|
-
command_queue have finished execution. This command is a synchronization
|
|
170
|
-
point.
|
|
171
|
-
|
|
172
|
-
.. versionadded:: 0.91.5
|
|
173
|
-
.. versionchanged:: 2011.2
|
|
174
|
-
Takes *wait_for* and returns an :class:`Event`
|
|
175
|
-
|
|
176
|
-
.. function:: enqueue_marker(queue, wait_for=None)
|
|
177
|
-
|
|
178
|
-
Returns an :class:`Event`.
|
|
179
|
-
|
|
180
|
-
.. versionchanged:: 2011.2
|
|
181
|
-
Takes *wait_for*.
|
|
182
|
-
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
.. |comparable| replace:: Instances of this class are hashable, and two
|
|
2
|
-
instances of this class may be compared using *"=="* and *"!="*.
|
|
3
|
-
(Hashability was added in version 2011.2.) Two objects are considered
|
|
4
|
-
the same if the underlying OpenCL object is the same, as established
|
|
5
|
-
by C pointer equality.
|
|
6
|
-
|
|
7
|
-
.. |buf-iface| replace:: must implement the Python buffer interface.
|
|
8
|
-
(e.g. by being an :class:`numpy.ndarray`)
|
|
9
|
-
.. |explain-waitfor| replace:: *wait_for*
|
|
10
|
-
may either be *None* or a list of :class:`pyopencl.Event` instances for
|
|
11
|
-
whose completion this command waits before starting exeuction.
|
|
12
|
-
.. |std-enqueue-blurb| replace:: Returns a new :class:`pyopencl.Event`. |explain-waitfor|
|
|
13
|
-
|
|
14
|
-
.. |copy-depr| replace:: **Note:** This function is deprecated as of PyOpenCL 2011.1.
|
|
15
|
-
Use :func:`~pyopencl.enqueue_copy` instead.
|
|
16
|
-
|
|
17
|
-
.. |glsize| replace:: *global_size* and *local_size* are tuples of identical length, with
|
|
18
|
-
between one and three entries. *global_size* specifies the overall size
|
|
19
|
-
of the computational grid: one work item will be launched for every
|
|
20
|
-
integer point in the grid. *local_size* specifies the workgroup size,
|
|
21
|
-
which must evenly divide the *global_size* in a dimension-by-dimension
|
|
22
|
-
manner. *None* may be passed for local_size, in which case the
|
|
23
|
-
implementation will use an implementation-defined workgroup size.
|
|
24
|
-
If *g_times_l* is *True*, the global size will be multiplied by the
|
|
25
|
-
local size. (which makes the behavior more like Nvidia CUDA) In this case,
|
|
26
|
-
*global_size* and *local_size* also do not have to have the same number
|
|
27
|
-
of entries.
|
|
28
|
-
|
|
29
|
-
.. |empty-nd-range| replace:: *allow_empty_ndrange* is a :class:`bool` indicating
|
|
30
|
-
how an empty NDRange is to be treated, where "empty" means that one or more
|
|
31
|
-
entries of *global_size* or *local_size* are zero. OpenCL itself does not
|
|
32
|
-
allow enqueueing kernels over empty NDRanges. Setting this flag to *True*
|
|
33
|
-
enqueues a marker with a wait list (``clEnqueueMarkerWithWaitList``)
|
|
34
|
-
to obtain the synchronization effects that would have resulted from
|
|
35
|
-
the kernel enqueue.
|
|
36
|
-
Setting *allow_empty_ndrange* to *True* requires OpenCL 1.2 or newer.
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
OpenCL Type Mapping
|
|
2
|
-
===================
|
|
3
|
-
|
|
4
|
-
.. module:: pyopencl.cltypes
|
|
5
|
-
|
|
6
|
-
.. _type-mappings:
|
|
7
|
-
|
|
8
|
-
Scalar Types
|
|
9
|
-
------------
|
|
10
|
-
|
|
11
|
-
For ease of use, a the :mod:`pyopencl.cltypes` module provides convenient mapping
|
|
12
|
-
from OpenCL type names to their equivalent :mod:`numpy` types. This saves you
|
|
13
|
-
from referring back to the OpenCL spec to see that a ``cl_long`` is 64 bit
|
|
14
|
-
unsigned integer. Use the module as follows:
|
|
15
|
-
|
|
16
|
-
.. doctest::
|
|
17
|
-
|
|
18
|
-
>>> import numpy as np
|
|
19
|
-
>>> import pyopencl as cl
|
|
20
|
-
>>> import pyopencl.cltypes
|
|
21
|
-
>>> cl_uint = cl.cltypes.uint(42) # maps to numpy.uint32
|
|
22
|
-
>>> cl_long = cl.cltypes.long(1235) # maps to numpy.int64
|
|
23
|
-
>>> floats = np.empty((128,), dtype=cl.cltypes.float) # array of numpy.float32
|
|
24
|
-
|
|
25
|
-
.. note::
|
|
26
|
-
|
|
27
|
-
The OpenCL type ``bool`` does not have a corresponding :mod:`numpy` type
|
|
28
|
-
defined here, because OpenCL does not specify the in-memory representation
|
|
29
|
-
(or even the storage size) for this type.
|
|
30
|
-
|
|
31
|
-
Vector Types
|
|
32
|
-
------------
|
|
33
|
-
|
|
34
|
-
The corresponding vector types are also made available in the same package,
|
|
35
|
-
allowing you to easily create :mod:`numpy` arrays with the appropriate memory
|
|
36
|
-
layout.
|
|
37
|
-
|
|
38
|
-
.. doctest::
|
|
39
|
-
|
|
40
|
-
>>> import numpy as np
|
|
41
|
-
>>> array_of_float16 = np.empty((128,), dtype=cl.cltypes.float16) # array of float16
|
|
42
|
-
|