diff --git a/doc/source/array.rst b/doc/source/array.rst index 946a88ccada0bf487ae9fabf6ca6a7e2185f46d7..bec0365b18041981782a76223367c842038575f4 100644 --- a/doc/source/array.rst +++ b/doc/source/array.rst @@ -3,9 +3,17 @@ Multi-dimensional arrays on the Compute Device .. module:: pyopencl.array +The functionality in this module provides something of a work-alike for +:mod:`numpy` arrays, but with all operations executed on the CL compute device. + Data Types ---------- +PyOpenCL provides some amount of integration between the :mod:`numpy` +type system, as represented by :class:`numpy.dtype`, and the types +available in OpenCL. All the simple scalar types map straightforwardly +to their CL counterparts. + Vector Types ^^^^^^^^^^^^ @@ -36,6 +44,34 @@ about them using this function: .. versionadded: 2011.2 +.. function:: dtype_to_ctype(dtype) + + Returns a C name registered for *dtype*. + + .. versionadded: 2012.2 + +This function helps with producing C/OpenCL declarations for structured +:class:`numpy.dtype` instances: + +.. function:: dtype_to_c_struct(dtype) + + Return a C structure declaration for *dtype*. + + .. versionadded: 2012.2 + +This example explains its use:: + + >>> import pyopencl as cl + >>> import pyopencl.tools + >>> import numpy as np + >>> t = np.dtype([("id", np.uint32), ("value", np.float32)]) + >>> cl.tools.register_dtype(t, "id_val") + >>> print cl.tools.dtype_to_c_struct(t) + typedef struct { + unsigned id; + float value; + } id_val; + .. currentmodule:: pyopencl.array Complex Numbers @@ -96,11 +132,9 @@ The :class:`Array` Class carries out its computations by default. *allocator* is a callable that, upon being called with an argument of the number - of bytes to be allocated, returns an object that can be cast to an - :class:`int` representing the address of the newly allocated memory. + of bytes to be allocated, returns an :class:`pyopencl.Buffer` object. (See :class:`DefaultAllocator`.) - .. versionchanged:: 2011.1 Renamed *context* to *cqa*, made it general-purpose. @@ -283,15 +317,15 @@ Conditionals .. function:: if_positive(criterion, then_, else_, out=None, queue=None) Return an array like *then_*, which, for the element at index *i*, - contains *then_[i]* if *criterion[i]>0*, else *else_[i]*. (added in 0.94) + contains *then_[i]* if *criterion[i]>0*, else *else_[i]*. .. function:: maximum(a, b, out=None, queue=None) - Return the elementwise maximum of *a* and *b*. (added in 0.94) + Return the elementwise maximum of *a* and *b*. .. function:: minimum(a, b, out=None, queue=None) - Return the elementwise minimum of *a* and *b*. (added in 0.94) + Return the elementwise minimum of *a* and *b*. .. _reductions: @@ -640,6 +674,8 @@ Here's a usage example:: my_dot_prod = krnl(a, b).get() +.. _custom-scan: + Parallel Scan / Prefix Sum -------------------------- diff --git a/doc/source/misc.rst b/doc/source/misc.rst index d283707b55329dc7956a4c0cf8b9cb9cd34f8d24..0adf14c841101046bfa0529511d745a0dad428c7 100644 --- a/doc/source/misc.rst +++ b/doc/source/misc.rst @@ -37,11 +37,12 @@ change. But if it does, your code will generally continue to run. It may however start spewing warnings about things you need to change to stay compatible with future versions. -Deprecation warnings will be around for a whole release cycle, as -identified by the second number in the release name. (the "90" in -"0.90") Further, the stability promise applies for any code that's -part of a released version. It doesn't apply to undocumented bits of -the API, and it doesn't apply to unreleased code downloaded from git. +Deprecation warnings will be around for a whole year, as identified by the +first number in the release name. (the "2014" in "2014.1") I.e. a function +that was deprecated in 2014.n will generally be removed in 2015.n (or perhaps +later). Further, the stability promise applies for any code that's part of a +released version. It doesn't apply to undocumented bits of the API, and it +doesn't apply to unreleased code downloaded from git. .. _versus-c: @@ -76,7 +77,15 @@ Version 2012.2 .. note:: This version is currently under development. You can get snapshots from - PyOpenCL's git version control. + PyOpenCL's `git repository `_ + +* Vastly improved :ref:`custom-scan`. +* Add :func:`pyopencl.tools.dtype_to_c_struct`. +* More/improved Bessel functions. + See `the source `_. +* Add :envvar:`PYOPENCL_NO_CACHE` environment variable to aid debugging + (e.g. with AMD's CPU implementation, see + `their programming guide `_. Version 2012.1 -------------- diff --git a/pyopencl/version.py b/pyopencl/version.py index c354f98dc5b66fb4d39e64f9d5c89a5c2207ee56..dea8dc2ed0673abe3935926be6bee8acce922e88 100644 --- a/pyopencl/version.py +++ b/pyopencl/version.py @@ -1,4 +1,4 @@ -VERSION = (2012, 1) +VERSION = (2012, 2) VERSION_STATUS = "" VERSION_TEXT = ".".join(str(x) for x in VERSION) + VERSION_STATUS