diff --git a/doc/algorithm.rst b/doc/algorithm.rst index cbaf1e9305c61d0e8928bbd46da2bdb6fd2aef83..2ff63e07ef24e46ef8e1e3c63ae290d5663a8f3e 100644 --- a/doc/algorithm.rst +++ b/doc/algorithm.rst @@ -19,7 +19,7 @@ evaluate multi-stage expressions on one or several operands in a single pass. .. method:: __call__(*args, wait_for=None) Invoke the generated scalar kernel. The arguments may either be scalars or - :class:`GPUArray` instances. + :class:`pyopencl.array.Array` instances. |std-enqueue-blurb| @@ -110,7 +110,7 @@ Prefix Sums ("scan") or include statements. A prefix sum is a running sum of an array, as provided by -e.g. :mod:`numpy.cumsum`:: +e.g. :func:`numpy.cumsum`:: >>> import numpy as np >>> a = [1,1,1,1,1,2,2,2,2,2] @@ -169,7 +169,8 @@ in PyOpenCL: * Segmented scans * Access to the previous item in *input_expr* (e.g. for comparisons) - See the `implementation `_ of :func:`unique` for an example. + See the `implementation `_ + of :func:`pyopencl.algorithm.unique` for an example. Making Custom Scan Kernels ^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/doc/conf.py b/doc/conf.py index 7c3707fd55061faa25503d18422c545192a55aed..07353a2ad70c857bbe9fbe597a2180cd43d62b22 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -123,7 +123,7 @@ html_sidebars = { # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +#html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. @@ -192,9 +192,9 @@ latex_documents = [ #latex_use_modindex = True intersphinx_mapping = { - 'http://docs.python.org/dev': None, - 'http://docs.scipy.org/doc/numpy/': None, - 'http://docs.makotemplates.org/en/latest/': None, + 'https://docs.python.org/dev': None, + 'https://numpy.org/doc/stable/': None, + 'https://docs.makotemplates.org/en/latest/': None, } autoclass_content = "both" diff --git a/doc/misc.rst b/doc/misc.rst index bc1160eafd0074ec6ca17df20c001703527e67c0..b8d5c22e2477b1e9d9f2e2ca53a992702592dbb2 100644 --- a/doc/misc.rst +++ b/doc/misc.rst @@ -381,8 +381,8 @@ Version 2013.1 * Deprecated :func:`pyopencl.tools.register_dtype` in favor of :func:`pyopencl.tools.get_or_register_dtype`. * Clean up the :class:`pyopencl.array.Array` constructor interface. -* Deprecate :class:`pyopencl.array.DefaultAllocator`. -* Deprecate :class:`pyopencl.tools.CLAllocator`. +* Deprecate ``pyopencl.array.DefaultAllocator``. +* Deprecate ``pyopencl.tools.CLAllocator`` * Introduce :class:`pyopencl.tools.DeferredAllocator`, :class:`pyopencl.tools.ImmediateAllocator`. * Allow arrays whose beginning does not coincide with the beginning of their :attr:`pyopencl.array.Array.data` :class:`pyopencl.Buffer`. @@ -416,7 +416,7 @@ Version 2013.1 may take a very long time to execute. This is because :mod:`numpy` first builds an object array of (compute-device) scalars (!) before it decides that that's probably not such a bright idea and finally calls - :meth:`pyopencl.array.Array.__rmul__`. + ``pyopencl.array.Array.__rmul__``. Note that only left arithmetic operations of :class:`pyopencl.array.Array` by :mod:`numpy` scalars are affected. Python's number types (:class:`float` etc.) @@ -443,7 +443,7 @@ Version 2012.1 Version 2011.2 -------------- -* Add :func:`pyopencl.enqueue_migrate_mem_object`. +* Add :func:`pyopencl.enqueue_migrate_mem_objects`. * Add :func:`pyopencl.image_from_array`. * IMPORTANT BUGFIX: Kernel caching was broken for all the 2011.1.x releases, with severe consequences on the execution time of :class:`pyopencl.array.Array` @@ -451,7 +451,7 @@ Version 2011.2 Henrik Andresen at a `PyOpenCL workshop at DTU `_ first noticed the strange timings. * All comparable PyOpenCL objects are now also hashable. -* Add :func:`pyopencl.tools.context_dependent_memoize` to the documented +* Add ``pyopencl.tools.context_dependent_memoize`` to the documented functionality. * Base :mod:`pyopencl.clrandom` on `RANLUXCL `_, add functionality. @@ -459,13 +459,13 @@ Version 2011.2 * Add :mod:`pyopencl.characterize`. * Ensure compatibility with OS X Lion. * Add :func:`pyopencl.tools.register_dtype` to enable scan/reduction on struct types. -* :func:`pyopencl.enqueue_migrate_mem_object` was renamed - :func:`pyopencl.enqueue_migrate_mem_object_ext`. - :func:`pyopencl.enqueue_migrate_mem_object` now refers to the OpenCL 1.2 function +* :func:``pyopencl.enqueue_migrate_mem_objects`` was renamed + ``pyopencl.enqueue_migrate_mem_objects_ext``. + :func:`pyopencl.enqueue_migrate_mem_objects` now refers to the OpenCL 1.2 function of this name, if available. -* :func:`pyopencl.create_sub_devices` was renamed - :func:`pyopencl.create_sub_devices_ext`. - :func:`pyopencl.create_sub_devices` now refers to the OpenCL 1.2 function +* :meth:`pyopencl.Device.create_sub_devices` was renamed + ``pyopencl.Device.create_sub_devices_ext``. + :meth:`pyopencl.Device.create_sub_devices` now refers to the OpenCL 1.2 function of this name, if available. * Alpha support for OpenCL 1.2. @@ -485,14 +485,14 @@ Version 2011.1 * All *is_blocking* parameters now default to *True* to avoid crashy-by-default behavior. (suggested by Jan Meinke) In particular, this change affects - :func:`pyopencl.enqueue_read_buffer`, - :func:`pyopencl.enqueue_write_buffer`, - :func:`pyopencl.enqueue_read_buffer_rect`, - :func:`pyopencl.enqueue_write_buffer_rect`, - :func:`pyopencl.enqueue_read_image`, - :func:`pyopencl.enqueue_write_image`, - :func:`pyopencl.enqueue_map_buffer`, - :func:`pyopencl.enqueue_map_image`. + ``pyopencl.enqueue_read_buffer``, + ``pyopencl.enqueue_write_buffer``, + ``pyopencl.enqueue_read_buffer_rect``, + ``pyopencl.enqueue_write_buffer_rect``, + ``pyopencl.enqueue_read_image``, + ``pyopencl.enqueue_write_image``, + ``pyopencl.enqueue_map_buffer``, + ``pyopencl.enqueue_map_image``. * Add :mod:`pyopencl.reduction`. * Add :ref:`reductions`. * Add :mod:`pyopencl.scan`. @@ -534,7 +534,7 @@ Version 0.91.5 * Add :attr:`pyopencl.ImageFormat.channel_count`, :attr:`pyopencl.ImageFormat.dtype_size`, :attr:`pyopencl.ImageFormat.itemsize`. -* Add missing :func:`pyopencl.enqueue_copy_buffer`. +* Add missing ``pyopencl.enqueue_copy_buffer``. * Add :func:`pyopencl.create_some_context`. * Add :func:`pyopencl.enqueue_barrier`, which was previously missing. @@ -558,7 +558,7 @@ Version 0.91.2 * :meth:`pyopencl.Program.build` now captures build logs and adds them to the exception text. -* Deprecate :func:`pyopencl.create_context_from_type` in favor of second +* Deprecate ``pyopencl.create_context_from_type`` in favor of second form of :class:`pyopencl.Context` constructor * Introduce :class:`pyopencl.LocalMemory`. * Document kernel invocation and :meth:`pyopencl.Kernel.set_arg`. @@ -569,7 +569,7 @@ Version 0.91.1 * Fixed a number of bugs, notably involving :class:`pyopencl.Sampler`. * :class:`pyopencl.Device`, :class:`pyopencl.Platform`, :class:`pyopencl.Context` now have nicer string representations. -* Add :attr:`Image.shape`. (suggested by David Garcia) +* Add :attr:`pyopencl.Image.shape`. (suggested by David Garcia) Version 0.91 ------------ @@ -580,26 +580,26 @@ Version 0.91 * Add :meth:`pyopencl.ImageFormat.__repr__`. * Add :meth:`pyopencl.addressing_mode.to_string` and colleagues. * The `pitch` arguments to - :func:`pyopencl.create_image_2d`, - :func:`pyopencl.create_image_3d`, - :func:`pyopencl.enqueue_read_image`, and - :func:`pyopencl.enqueue_write_image` + ``pyopencl.create_image_2d``, + ``pyopencl.create_image_3d``, + ``pyopencl.enqueue_read_image``, and + ``pyopencl.enqueue_write_image`` are now defaulted to zero. The argument order of `enqueue_{read,write}_image` has changed for this reason. * Deprecate - :func:`pyopencl.create_image_2d`, - :func:`pyopencl.create_image_3d` + ``pyopencl.create_image_2d``, + ``pyopencl.create_image_3d`` in favor of the :class:`pyopencl.Image` constructor. * Deprecate - :func:`pyopencl.create_program_with_source`, - :func:`pyopencl.create_program_with_binary` + ``pyopencl.create_program_with_source``, + ``pyopencl.create_program_with_binary`` in favor of the :class:`pyopencl.Program` constructor. * Deprecate - :func:`pyopencl.create_buffer`, - :func:`pyopencl.create_host_buffer` + ``pyopencl.create_buffer``, + ``pyopencl.create_host_buffer`` in favor of the :class:`pyopencl.Buffer` constructor. -* :meth:`pyopencl.MemoryObject.get_image_info` now actually exists. -* Add :attr:`pyopencl.MemoryObject.image.info`. +* :meth:`pyopencl.Image.get_image_info` now actually exists. +* Add :attr:`pyopencl.Image.info`. * Fix API tracing. * Add constructor arguments to :class:`pyopencl.ImageFormat`. (suggested by David Garcia) @@ -698,3 +698,117 @@ Andreas Klöckner's work on :mod:`pyopencl` was supported in part by AK also gratefully acknowledges a hardware gift from Nvidia Corporation. The views and opinions expressed herein do not necessarily reflect those of the funding agencies. + +Documentation Cross-References +============================== + +Numpy +----- +.. currentmodule:: numpy + +.. class:: int8 + + See :class:`numpy.generic`. + +.. class:: int32 + + See :class:`numpy.generic`. + +.. class:: float64 + + See :class:`numpy.generic`. + +OpenCL Specification +-------------------- +.. c:type:: cl_platform_id + + See the `CL specification `__. + +.. c:type:: cl_device_id + + See the `CL specification `__. + +.. c:type:: cl_context + + See the `CL specification `__. + +.. c:type:: cl_command_queue + + See the `CL specification `__. + +.. c:type:: cl_mem + + See the `CL specification `__. + +.. c:type:: cl_program + + See the `CL specification `__. + +.. c:type:: cl_kernel + + See the `CL specification `__. + +.. c:type:: cl_sampler + + See the `CL specification `__. + +.. c:type:: cl_event + + See the `CL specification `__. + +.. c:function:: void clCreateCommandQueueWithProperties() + + See the `CL specification `__. + +.. c:function:: void clCreateSamplerWithProperties() + + See the `CL specification `__. + +Internal Types +-------------- + +.. currentmodule:: pyopencl._cl + +.. class:: Platform + + See :class:`pyopencl.Platform`. + +.. class:: Device + + See :class:`pyopencl.Device`. + +.. class:: CommandQueue + + See :class:`pyopencl.CommandQueue`. + +.. class:: Context + + See :class:`pyopencl.Context`. + +.. class:: Event + + See :class:`pyopencl.Event`. + +.. class:: SVMAllocation + + See :class:`pyopencl.SVMAllocation`. + +.. class:: MemoryMap + + See :class:`pyopencl.MemoryMap`. + +.. class:: Sampler + + See :class:`pyopencl.Sampler`. + +.. class:: Program + + See :class:`pyopencl.Program`. + +.. class:: _Program + + See :class:`pyopencl.Program`. + +.. class:: Kernel + + See :class:`pyopencl.Kernel`. diff --git a/doc/runtime_const.rst b/doc/runtime_const.rst index 3001cc1143ef19a2e5caac182f2a4359b2d1f572..53ebf1fe96fa60a12598a3f776095f94244a7dcf 100644 --- a/doc/runtime_const.rst +++ b/doc/runtime_const.rst @@ -1,4 +1,6 @@ OpenCL Runtime: Constants ========================= +.. currentmodule:: pyopencl + .. include:: constants.inc diff --git a/doc/runtime_gl.rst b/doc/runtime_gl.rst index a391c173c8f7eb46aef2d5b1a8d8d32217615868..ecc3891d88e701ad6e56272b5518df032bec1bab 100644 --- a/doc/runtime_gl.rst +++ b/doc/runtime_gl.rst @@ -51,7 +51,7 @@ with GL support. See :func:`have_gl`. .. method:: get_gl_texture_info(param) - See :class:`gl_texture_info` for values of *param*. Only available when PyOpenCL is compiled with GL support. See :func:`have_gl`. + See ``gl_texture_info`` for values of *param*. Only available when PyOpenCL is compiled with GL support. See :func:`have_gl`. .. function:: enqueue_acquire_gl_objects(queue, mem_objects, wait_for=None) diff --git a/doc/runtime_memory.rst b/doc/runtime_memory.rst index f92f13cd67f91329073d948f3f15e487b724d3e0..ce2ee2227a1311ada8b3074c4bf3ea1d095d9151 100644 --- a/doc/runtime_memory.rst +++ b/doc/runtime_memory.rst @@ -191,7 +191,7 @@ Image See :class:`mem_flags` for possible values of *flags* and :class:`mem_object_type` for possible values of *image_type*. -.. class:: Image(context, flags, format, shape=None, pitches=None, hostbuf=None, is_array=False, buffer=None): +.. class:: Image(context, flags, format, shape=None, pitches=None, hostbuf=None, is_array=False, buffer=None) See :class:`mem_flags` for values of *flags*. *shape* is a 2- or 3-tuple. *format* is an instance of :class:`ImageFormat`. @@ -206,7 +206,7 @@ Image .. note:: - If you want to load images from :mod:`numpy.ndarray` instances or read images + If you want to load images from :class:`numpy.ndarray` instances or read images back into them, be aware that OpenCL images expect the *x* dimension to vary fastest, whereas in the default (C) order of :mod:`numpy` arrays, the last index varies fastest. If your array is arranged in the wrong order in memory, @@ -344,7 +344,6 @@ Samplers .. class:: Sampler - .. method:: __init__(context, normalized_coords, addressing_mode, filter_mode) *normalized_coords* is a :class:`bool` indicating whether @@ -353,7 +352,7 @@ Samplers See :class:`addressing_mode` and :class:`filter_mode` for possible argument values. - .. method:: __init__(context, properties) + Also supports an alternate signature ``(context, properties)``. :arg properties: a sequence of keys and values from :class:`sampler_properties` as accepted @@ -361,9 +360,11 @@ Samplers spec for details). The trailing *0* is added automatically and does not need to be included. - Requires OpenCL 2 or newer. + This signature Requires OpenCL 2 or newer. + + .. versionchanged:: 2018.2 - .. versionadded:: 2018.2 + The properties-based signature was added. .. attribute:: info diff --git a/doc/runtime_platform.rst b/doc/runtime_platform.rst index 77ceafbf3c7166ef691cd4e3adc651bbdf3c8910..51eecdba8710dc9688dd40ec3fc6e04286768b11 100644 --- a/doc/runtime_platform.rst +++ b/doc/runtime_platform.rst @@ -135,12 +135,12 @@ Context .. note:: For - :attr:`context_properties.CL_GL_CONTEXT_KHR`, - :attr:`context_properties.CL_EGL_DISPLAY_KHR`, - :attr:`context_properties.CL_GLX_DISPLAY_KHR`, - :attr:`context_properties.CL_WGL_HDC_KHR`, and - :attr:`context_properties.CL_CGL_SHAREGROUP_KHR` - :attr:`context_properties.CL_CGL_SHAREGROUP_APPLE` + ``context_properties.CL_GL_CONTEXT_KHR``, + ``context_properties.CL_EGL_DISPLAY_KHR``, + ``context_properties.CL_GLX_DISPLAY_KHR``, + ``context_properties.CL_WGL_HDC_KHR``, and + ``context_properties.CL_CGL_SHAREGROUP_KHR`` + ``context_properties.CL_CGL_SHAREGROUP_APPLE`` the value in the key-value pair is a PyOpenGL context or display instance. diff --git a/doc/runtime_program.rst b/doc/runtime_program.rst index 77a495914219517b991b972a3a14ed9cb6ad8b83..18d831eb88ac6d3971651242aeb6367220dc3d9a 100644 --- a/doc/runtime_program.rst +++ b/doc/runtime_program.rst @@ -8,6 +8,21 @@ OpenCL Runtime: Programs and Kernels Program ------- +.. envvar:: PYOPENCL_NO_CACHE + + By setting the environment variable :envvar:`PYOPENCL_NO_CACHE` to any + non-empty value, this caching is suppressed. + + .. versionadded:: 2013.1 + +.. envvar:: PYOPENCL_BUILD_OPTIONS + + Any options found in the environment variable + :envvar:`PYOPENCL_BUILD_OPTIONS` will be appended to *options* + in :meth:`Program.build`. + + .. versionadded:: 2013.1 + .. class:: Program(context, src) Program(context, devices, binaries) @@ -47,17 +62,13 @@ Program If passed *cache_dir* is None and context was created with None cache_dir: built binaries will be cached in an on-disk cache called :file:`pyopencl-compiler-cache-vN-uidNAME-pyVERSION` in the directory - returned by :func:`tempfile.gettempdir`. By setting the environment - variable :envvar:`PYOPENCL_NO_CACHE` to any non-empty value, this - caching is suppressed. Any options found in the environment variable - :envvar:`PYOPENCL_BUILD_OPTIONS` will be appended to *options*. + returned by :func:`tempfile.gettempdir`. + + See also :envvar:`PYOPENCL_NO_CACHE`, :envvar:`PYOPENCL_BUILD_OPTIONS`. .. versionchanged:: 2011.1 - *options* may now also be a :class:`list` of :class:`str`. - .. versionchanged:: 2013.1 - Added :envvar:`PYOPENCL_NO_CACHE`. - Added :envvar:`PYOPENCL_BUILD_OPTIONS`. + *options* may now also be a :class:`list` of :class:`str`. .. method:: compile(self, options=[], devices=None, headers=[]) diff --git a/doc/runtime_queue.rst b/doc/runtime_queue.rst index c0b42897d151cd95c1289665e4f5a00d801fc078..f120c61edaa3b1b876e1f482a55bc6a2be49369c 100644 --- a/doc/runtime_queue.rst +++ b/doc/runtime_queue.rst @@ -78,14 +78,9 @@ Event may be used as attributes on instances of this class to directly query info attributes. - .. attribute:: profile.info + .. attribute:: profile - Lower case versions of the :class:`profiling_info` constants - may be used as attributes on the attribute `profile` of this - class to directly query profiling info. - - For example, you may use *evt.profile.end* instead of - *evt.get_profiling_info(pyopencl.profiling_info.END)*. + An instance of :class:`ProfilingInfoGetter`. .. method:: get_info(param) @@ -114,6 +109,17 @@ Event |comparable| +.. class:: ProfilingInfoGetter + + .. attribute:: info + + Lower case versions of the :class:`profiling_info` constants + may be used as attributes on the attribute `profile` of this + class to directly query profiling info. + + For example, you may use *evt.profile.end* instead of + *evt.get_profiling_info(pyopencl.profiling_info.END)*. + Event Subclasses ---------------- diff --git a/doc/tools.rst b/doc/tools.rst index 7260add22ffbd1bff227b6cd7641cc7e4f5b3ac8..74a303f104a9710e807659c78ef0629993416c87 100644 --- a/doc/tools.rst +++ b/doc/tools.rst @@ -15,7 +15,7 @@ fresh memory area is allocated for each intermediate result. Memory pools are a remedy for this problem based on the observation that often many of the block allocations are of the same sizes as previously used ones. -Then, instead of fully returning the memory to the system and incurring the +Then, instead of fully returning the memory to the system and incurring the associated reallocation overhead, the pool holds on to the memory and uses it to satisfy future allocations of similarly-sized blocks. The pool reacts appropriately to out-of-memory conditions as long as all memory allocations @@ -36,6 +36,15 @@ not complicated:: memory is returned to the pool. This supports the same interface as :class:`pyopencl.Buffer`. +.. class:: AllocatorInterface + + An interface implemented by various memory allocation functions + in :mod:`pyopencl`. + + .. method:: __call__(size) + + Allocate and return a :class:`pyopencl.Buffer` of the given *size*. + .. class:: DeferredAllocator(context, mem_flags=pyopencl.mem_flags.READ_WRITE) *mem_flags* takes its values from :class:`pyopencl.mem_flags` and corresponds @@ -46,9 +55,11 @@ not complicated:: bound to contexts, not devices, and memory availability depends on which device the buffer is used with.) + Implements :class:`AllocatorInterface`. + .. versionchanged :: 2013.1 - :class:`CLAllocator` was deprecated and replaced + ``CLAllocator`` was deprecated and replaced by :class:`DeferredAllocator`. .. method:: __call__(size) @@ -68,6 +79,8 @@ not complicated:: allocated memory is actually available. If no memory is available, an out-of-memory error is reported at allocation time. + Implements :class:`AllocatorInterface`. + .. versionadded:: 2013.1 .. method:: __call__(size) @@ -87,6 +100,8 @@ not complicated:: by the allocator immediately, and not in the OpenCL-typical deferred manner. + Implements :class:`AllocatorInterface`. + .. note:: The current implementation of the memory pool will retain allocated @@ -125,7 +140,7 @@ not complicated:: .. method:: __call__(size) - Synonym for :meth:`allocate` to match :class:`CLAllocator` interface. + Synonym for :meth:`allocate` to match the :class:`AllocatorInterface`. .. versionadded: 2011.2 diff --git a/doc/types.rst b/doc/types.rst index bc571394ccaec78ecf88d3657b60aeda9175e4f5..dbd9794947c9188c008742e0d93b3324abcdf66b 100644 --- a/doc/types.rst +++ b/doc/types.rst @@ -1,7 +1,7 @@ OpenCL Type Mapping =================== -.. module:: pyopencl.types +.. module:: pyopencl.cltypes .. _type-mappings: diff --git a/pyopencl/__init__.py b/pyopencl/__init__.py index 9a8bc755c713c7a909c334014e9db6c59bd000fd..013cc6031d8922ded3230647e22881b4be0d1102 100644 --- a/pyopencl/__init__.py +++ b/pyopencl/__init__.py @@ -87,6 +87,7 @@ from pyopencl._cl import ( # noqa addressing_mode, filter_mode, sampler_info, + sampler_properties, map_flags, program_info, program_build_info, @@ -1135,8 +1136,9 @@ def _add_functionality(): # {{{ SVM if get_cl_header_version() >= (2, 0): - SVM.__doc__ = """Tags an object exhibiting the Python buffer interface (such as a - :class:`numpy.ndarray`) as referring to shared virtual memory. + SVM.__doc__ = """Tags an object exhibiting the Python buffer interface + (such as a :class:`numpy.ndarray`) as referring to shared virtual + memory. Depending on the features of the OpenCL implementation, the following types of objects may be passed to/wrapped in this type: @@ -1191,7 +1193,7 @@ def _add_functionality(): This object merely serves as a 'tag' that changes the behavior of functions to which it is passed. It has no special management relationship to the memory it tags. For example, it is permissible - to grab a :mod:`numpy.array` out of :attr:`SVM.mem` of one + to grab a :class:`numpy.ndarray` out of :attr:`SVM.mem` of one :class:`SVM` instance and use the array to construct another. Neither of the tags need to be kept alive. diff --git a/pyopencl/algorithm.py b/pyopencl/algorithm.py index 4b0e293cf6f616767dd9b6c626080768fe0cfc1f..8390b3dfb5bfa932dae7af93755f6a9c383ed58a 100644 --- a/pyopencl/algorithm.py +++ b/pyopencl/algorithm.py @@ -425,7 +425,7 @@ class RadixSort(object): """Provides a general `radix sort `_ on the compute device. - .. seealso:: :class:`pyopencl.algorithm.BitonicSort` + .. seealso:: :class:`pyopencl.bitonic_sort.BitonicSort` .. versionadded:: 2013.1 """ diff --git a/pyopencl/array.py b/pyopencl/array.py index 7d349444913395c4f36c8cd6ef10c89f3148cfa2..9bb90d611ed643477b0c6259f1410defde81412e 100644 --- a/pyopencl/array.py +++ b/pyopencl/array.py @@ -212,12 +212,12 @@ class Array(object): as in :mod:`numpy`. Arithmetic methods in :class:`Array` support the broadcasting of scalars. (e.g. `array+5`) - *cq* must be a :class:`pyopencl.CommandQueue` or a :class:`pyopencl.Context`. + *cq* must be a :class:`~pyopencl.CommandQueue` or a :class:`~pyopencl.Context`. If it is a queue, *cq* specifies the queue in which the array carries out its computations by default. If a default queue (and thereby overloaded operators and many other niceties) are not desired, pass a - :class:`Context`. + :class:`~pyopencl.Context`. *allocator* may be `None` or a callable that, upon being called with an argument of the number of bytes to be allocated, returns an @@ -691,7 +691,7 @@ class Array(object): def get(self, queue=None, ary=None, async_=None, **kwargs): """Transfer the contents of *self* into *ary* or a newly allocated - :mod:`numpy.ndarray`. If *ary* is given, it must have the same + :class:`numpy.ndarray`. If *ary* is given, it must have the same shape and dtype. .. versionchanged:: 2019.1.2 @@ -739,7 +739,7 @@ class Array(object): def copy(self, queue=_copy_queue): """ - :arg queue: The :class:`CommandQueue` for the returned array. + :arg queue: The :class:`~pyopencl.CommandQueue` for the returned array. .. versionchanged:: 2017.1.2 Updates the queue of the returned array. @@ -1958,7 +1958,7 @@ def to_device(queue, ary, allocator=None, async_=None, """Return a :class:`Array` that is an exact copy of the :class:`numpy.ndarray` instance *ary*. - :arg array_queue: The :class:`CommandQueue` which will + :arg array_queue: The :class:`~pyopencl.CommandQueue` which will be stored in the resulting array. Useful to make sure there is no implicit queue associated with the array by passing *None*. diff --git a/src/wrap_cl_part_1.cpp b/src/wrap_cl_part_1.cpp index 541201e38bde65625ffe527ebd225d466e4025c8..9079d058b8b6cf2f835613584b991ede77c66798 100644 --- a/src/wrap_cl_part_1.cpp +++ b/src/wrap_cl_part_1.cpp @@ -221,7 +221,7 @@ void pyopencl_expose_part_1(py::module &m) .def_static("from_int_ptr", memory_object_from_int, "(static method) Return a new Python object referencing the C-level " ":c:type:`cl_mem` object at the location pointed to " - "by *int_ptr_value*. The relevant :c:func:`clRetain*` function " + "by *int_ptr_value*. The relevant ``clRetain*`` function " "will be called if *retain* is True." "If the previous owner of the object will *not* release the reference, " "*retain* should be set to *False*, to effectively transfer ownership to " diff --git a/src/wrap_constants.cpp b/src/wrap_constants.cpp index 258df2781283a4ee3834aa72b68b011402ac93f9..2420be38b9849a32a46c135735b163aa4daec974 100644 --- a/src/wrap_constants.cpp +++ b/src/wrap_constants.cpp @@ -61,6 +61,7 @@ namespace class addressing_mode { }; class filter_mode { }; class sampler_info { }; + class sampler_properties { }; class map_flags { }; class program_info { }; class program_build_info { }; @@ -762,6 +763,13 @@ void pyopencl_expose_constants(py::module &m) #endif } + { + py::class_ cls(m, "sampler_properties"); + ADD_ATTR(SAMPLER_, NORMALIZED_COORDS); + ADD_ATTR(SAMPLER_, ADDRESSING_MODE); + ADD_ATTR(SAMPLER_, FILTER_MODE); + } + { py::class_ cls(m, "map_flags"); ADD_ATTR(MAP_, READ); diff --git a/src/wrap_helpers.hpp b/src/wrap_helpers.hpp index bf6853ea919509b679f799d7937c109bffbba8ad..4799244ff72c583a73a9d92d43229a171be4ee9c 100644 --- a/src/wrap_helpers.hpp +++ b/src/wrap_helpers.hpp @@ -173,7 +173,7 @@ namespace py::arg("retain")=true, \ "(static method) Return a new Python object referencing the C-level " \ ":c:type:`" #CL_TYPENAME "` object at the location pointed to " \ - "by *int_ptr_value*. The relevant :c:func:`clRetain*` function " \ + "by *int_ptr_value*. The relevant ``clRetain*`` function " \ "will be called if *retain* is True." \ "If the previous owner of the object will *not* release the reference, " \ "*retain* should be set to *False*, to effectively transfer ownership to " \