diff --git a/README.rst b/README.rst index d8cfc3cfdd2372fdccb99eb0db94323eca5224c9..0b1b9528206cf64089f390b6ea12ba57b886060a 100644 --- a/README.rst +++ b/README.rst @@ -28,9 +28,17 @@ spirit of its sister project `PyCUDA <http://mathema.tician.de/software/pycuda>` * Broad support. PyOpenCL was tested and works with Apple's, AMD's, and Nvidia's CL implementations. -.. image:: https://badge.fury.io/py/pyopencl.png - :target: http://pypi.python.org/pypi/pyopencl - To use PyOpenCL, you just need `numpy <http://numpy.org>`_ and an OpenCL implementation. (See this `howto <http://wiki.tiker.net/OpenCLHowTo>`_ for how to get one.) + +Web resources for PyOpenCL: + +* Python package index (download releases) + + .. image:: https://badge.fury.io/py/pyopencl.png + :target: http://pypi.python.org/pypi/pyopencl +* `C. Gohlke's Windows binaries <http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyopencl>`_ (download Windows binaries) +* `Github <http://github.com/pyopencl/pyopencl>`_ (get latest source code, file bugs) +* `Documetnation <http://documen.tician.de>`_ (get latest source code, file bugs) +* `Wiki <http://wiki.tiker.net/PyOpenCL>`_ (get latest source code, file bugs) diff --git a/doc/algorithm.rst b/doc/algorithm.rst index 13b4c8b5f03d260de0381d7b1922f80e709ba539..25396c4c55163c8c85eabe3d9de2fbf540fcdd33 100644 --- a/doc/algorithm.rst +++ b/doc/algorithm.rst @@ -185,7 +185,7 @@ in PyOpenCL: * Segmented scans * Access to the previous item in *input_expr* (e.g. for comparisons) - See the `implementation <https://github.com/inducer/pyopencl/blob/master/pyopencl/scan.py#L1353>`_ of :func:`unique` for an example. + See the `implementation <https://github.com/pyopencl/pyopencl/blob/master/pyopencl/scan.py#L1353>`_ of :func:`unique` for an example. Making Custom Scan Kernels ^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/doc/misc.rst b/doc/misc.rst index 5e21c3fc59218560437572b8646d5762dceb59ec..077c2f403b490c2caa56a04aab9771ce10c39ad4 100644 --- a/doc/misc.rst +++ b/doc/misc.rst @@ -8,7 +8,7 @@ Acknowledgments =============== Too many to list. Please see the -`commit log <https://github.com/inducer/pyopencl/commits/master>`_ +`commit log <https://github.com/pyopencl/pyopencl/commits/master>`_ for detailed acknowledgments. Tips @@ -19,7 +19,7 @@ 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>`_. +<https://github.com/pyopencl/pyopencl/blob/master/contrib/pyopencl.vim>`_. Note that the triple-quoted strings containing the source must start with `"""//CL// ..."""`. @@ -96,7 +96,7 @@ Version 2013.3 .. note:: This version is currently under development. You can get snapshots from - PyOpenCL's `git repository <https://github.com/inducer/pyopencl>`_ + PyOpenCL's `git repository <https://github.com/pyopencl/pyopencl>`_ Version 2013.2 -------------- @@ -116,7 +116,7 @@ Version 2013.1 * Add :func:`pyopencl.tools.match_dtype_to_c_struct`, for better integration of the CL and :mod:`numpy` type systems. * More/improved Bessel functions. - See `the source <https://github.com/inducer/pyopencl/tree/master/src/cl>`_. + See `the source <https://github.com/pyopencl/pyopencl/tree/master/src/cl>`_. * Add :envvar:`PYOPENCL_NO_CACHE` environment variable to aid debugging. (e.g. with AMD's CPU implementation, see `their programming guide <http://developer.amd.com/sdks/AMDAPPSDK/assets/AMD_Accelerated_Parallel_Processing_OpenCL_Programming_Guide.pdf>`_) diff --git a/pyopencl/array.py b/pyopencl/array.py index 41c0535bcd3ad121fe40535904535afc02574f73..61ad4f83ace8a4fdf8f0546451fac3fa622ed2f6 100644 --- a/pyopencl/array.py +++ b/pyopencl/array.py @@ -416,15 +416,21 @@ class Array(object): raise TypeError("may not pass a context and a queue " "(just pass the queue)") if allocator is not None: - raise TypeError("may not pass a context and an allocator " - "(just pass the queue)") + # "is" would be wrong because two Python objects are allowed + # to hold handles to the same context. + + # FIXME It would be nice to check this. But it would require + # changing the allocator interface. Trust the user for now. + + #assert allocator.context == context + pass else: # cqa is assumed to be an allocator warn("Passing an allocator for the 'cqa' parameter is deprecated. " "This usage will be continue to be accepted throughout " "the 2013.[0-6] versions of PyOpenCL.", - DeprecationWarning, 2) + DeprecationWarning, stacklevel=2) if allocator is not None: raise TypeError("can't specify allocator in 'cqa' and " "'allocator' arguments") @@ -546,14 +552,10 @@ class Array(object): return Array(queue, shape, dtype, allocator=self.allocator, strides=strides, data=data, offset=offset, events=self.events) - elif self.allocator is not None: - return Array(self.allocator, shape, dtype, queue=queue, - strides=strides, data=data, offset=offset, - events=self.events) else: - return Array(self.context, shape, dtype, + return Array(self.context, shape, dtype, queue=queue, strides=strides, data=data, offset=offset, - events=self.events) + events=self.events, allocator=self.allocator) def with_queue(self, queue): """Return a copy of *self* with the default queue set to *queue*. diff --git a/pyopencl/clrandom.py b/pyopencl/clrandom.py index 03d5494f3be4afd129fec775767fce50f926a0f5..635369671c1a563f8abfd7a6991f3a1488e4b97c 100644 --- a/pyopencl/clrandom.py +++ b/pyopencl/clrandom.py @@ -35,7 +35,7 @@ available in any piece of code compiled through PyOpenCL by:: #include <pyopencl-ranluxcl.cl> See the `source -<https://github.com/inducer/pyopencl/blob/master/src/cl/pyopencl-ranluxcl.cl>`_ +<https://github.com/pyopencl/pyopencl/blob/master/src/cl/pyopencl-ranluxcl.cl>`_ for some documentation if you're planning on using RANLUXCL directly. The RANLUX generator is described in the following two articles. If you use the