[PyOpenCL] Learning OpenCL through PyOpenCL
Andreas Kloeckner
lists at informa.tiker.net
Sun Feb 20 06:52:57 PST 2011
Hi Patric, Keith, Simone, all,
first off, I just wanted to say that I love this community. :)
On Sun, 20 Feb 2011 12:48:27 +0100, Patric Holmvall <patric.hol at gmail.com> wrote:
> Thank you a lot for your answers Simone and Keith!
> A separate repository for examples would be very welcome. In fact, if
> I could get access to a large set of examples now somehow, I would be
> delighted. Especially examples based for AMD/ATI hardware. I find that
> I learn more when working with examples rigth now.
What we have is in the examples/ directory within PyOpenCL. PyCUDA, on
account of having been around longer, has a bunch more examples, here:
http://wiki.tiker.net/PyCuda/Examples
If you think that might be helpful to you, you can try and translate a
few of those to PyOpenCL as a start.
> Is it even possible to sum all the calculations of
> the independent work items to the same variable/element?
When done in parallel, that falls under the term 'reduction'
[1]. PyOpenCL has code to help you do this [2]. This is a tiny bit
harder to write than vector-vector stuff, but not much. See the source
[3].
[1]
https://secure.wikimedia.org/wikipedia/en/wiki/Fold_(higher-order_function)
[2]
http://documen.tician.de/pyopencl/array.html#module-pyopencl.reduction
[3] http://git.tiker.net/pyopencl.git/blob/HEAD:/pyopencl/reduction.py
Hope this helps,
Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.tiker.net/pipermail/pyopencl/attachments/20110220/9ab245c3/attachment.pgp>
More information about the PyOpenCL
mailing list