From b7f58977da911a80b571b3508a9d31f62d781ea4 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Fri, 29 Jul 2011 12:14:34 -0400 Subject: [PATCH] Document image_from_array(). --- doc/source/misc.rst | 3 ++- doc/source/runtime.rst | 24 +++++++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/doc/source/misc.rst b/doc/source/misc.rst index 58167ded..903749b6 100644 --- a/doc/source/misc.rst +++ b/doc/source/misc.rst @@ -73,7 +73,8 @@ Version 2011.2 This version is currently under development. You can get snapshots from PyOpenCL's git version control. -* Add :func:`enqueue_migrate_mem_object`. +* Add :func:`pyopencl.enqueue_migrate_mem_object`. +* Add :func:`pyopencl.image_from_array`. Version 2011.1.2 ---------------- diff --git a/doc/source/runtime.rst b/doc/source/runtime.rst index 0bc66004..7bcd5628 100644 --- a/doc/source/runtime.rst +++ b/doc/source/runtime.rst @@ -241,14 +241,13 @@ Command Queues and Events |comparable| .. function:: wait_for_events(events) + .. function:: enqueue_marker(queue) Returns an :class:`Event`. .. function:: enqueue_wait_for_events(queue, events) - Returns an :class:`Event`. - .. function:: enqueue_barrier(queue) Enqueues a barrier operation. which ensures that all queued commands in @@ -298,7 +297,7 @@ Memory :param flags: from :class:`migrate_mem_object_flags_ext` - ..versionadded:: 2011.2 + .. versionadded:: 2011.2 Only available with the `cl_ext_migrate_memobject` extension. @@ -496,6 +495,25 @@ Images |comparable| +.. function:: image_from_array(ctx, ary, num_channels, mode="r", norm_int=False) + + Build a 2D or 3D :class:`Image` from the :class:`numpy.ndarray` *ary*. If + *num_channels* is greater than one, the last dimension of *ary* must be + identical to *num_channels*. *ary* must be in C order. + + The :class:`ImageFormat` is chosen as the first *num_channels* components + of "RGBA". + + :param mode: "r" or "w" for read/write + + .. note:: + + When reading from the image object, the indices passed to `read_imagef` are + in the reverse order from what they would be when accessing *ary* from + Python. + + .. versionadded:: 2011.2 + .. function:: enqueue_read_image(queue, mem, origin, region, hostbuf, row_pitch=0, slice_pitch=0, wait_for=None, is_blocking=True) |copy-depr| -- GitLab