diff --git a/doc/source/array.rst b/doc/source/array.rst index 8df254c58275eadba9c07b298e063537dba05fcf..df551ca2e02d2c5fb7f98927b3752cf869e1d78e 100644 --- a/doc/source/array.rst +++ b/doc/source/array.rst @@ -3,8 +3,11 @@ Multi-dimensional arrays on the Compute Device .. module:: pyopencl.array +Data Types +---------- + Vector Types ------------- +^^^^^^^^^^^^ .. class :: vec @@ -16,6 +19,21 @@ Vector Types Python code. For each type, a `make_type` function is also provided (e.g. `make_float3(x,y,z)`). +Custom data types +^^^^^^^^^^^^^^^^^ + +If you would like to use your own (struct/union/whatever) data types in array +operations where you supply operation source code, define those types in the +*preamble* passed to :class:`pyopencl.elementwise.ElementwiseKernel`, +:class:`pyopencl.reduction.ReductionKernel` (or similar), and let PyOpenCL know +about them using this function: + +.. function:: pyopencl.tools.register_dtype(dtype, name) + + *dtype* is a :func:`numpy.dtype`. + + .. versionadded: 2011.2 + The :class:`Array` Class ------------------------ @@ -162,7 +180,7 @@ The :class:`Array` Class .. versionadded:: 2012.1 Constructing :class:`Array` Instances ----------------------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. function:: to_device(queue, ary, allocator=None, async=False) @@ -647,18 +665,6 @@ Here's a usage example:: assert (dev_data.get() == np.cumsum(host_data, axis=0)).all() -Custom data types in Reduction and Scan ---------------------------------------- - -If you would like to use your own (struct/union/whatever) data types in -scan and reduction, define those types in the *preamble* and let PyOpenCL -know about them using this function: - -.. function:: pyopencl.tools.register_dtype(dtype, name) - - *dtype* is a :func:`numpy.dtype`. - - .. versionadded: 2011.2 Fast Fourier Transforms ----------------------- diff --git a/doc/source/misc.rst b/doc/source/misc.rst index 6dda3f20d567abe0cf6bbd64cbf09357cc528204..37c62c8a898c35cf0126e14887c620a5a37bfb65 100644 --- a/doc/source/misc.rst +++ b/doc/source/misc.rst @@ -7,20 +7,22 @@ Installation information is maintained collaboratively on the Acknowledgments =============== -* James Snyder provided patches to make PyOpenCL work on OS X 10.6. -* Roger Pau Monné supplied the example :file:`examples/benchmark-all.py`. -* David Garcia contributed significantly to PyOpenCL's API design - and reported many bugs. -* Michal Januszewski sent a patch. -* Achim Gottinger submitted a fix for an example. -* Andrew Karpushin provided a fix for a whole class of crash bugs in - PyOpenCL. -* Paolo Simone Gasparello, Keith Brafford, and Ian Johnson provided much help - in getting OpenCL-OpenGL interoperability to work. -* Sean True allowed access to a test machine to ensure compatibility - with OS X Lion. -* Tomasz Rybak did many great things for PyOpenCL, not the least - of which is packaging for Debian and Ubuntu. +Too many to list. Please see the +`commit log <https://github.com/inducer/pyopencl/commits/master>`_ +for detailed acknowledgments. + +Tips +==== + +Syntax highlighting +------------------- + +You can obtain Vim syntax highlighting for OpenCL C inlined in Python by +checking `this file +<https://github.com/inducer/pyopencl/blob/master/contrib/pyopencl.vim>`_. + +Note that the triple-quoted strings containing the source must start with +`"""//CL// ..."""`. Guidelines ==========