Hi Lewis,

On Tue, 20 Dec 2011 21:17:34 -0800, Lewis Anderson <[email protected]> 
wrote:
> I'm a student at UCSD, and I'm using PyOpenCL for a neural network
> project. I love it. It is very easy to use. My only problem so far is
> that the documentation on many of the array functions is lacking. I
> think I want to use the pyopencl.array.subset_max() function, but I
> can't find any documentation describing what it does. The only thing I
> could find is the declaration:
> 
> pyopencl.array.subset_max(subset, a, queue=None)ΒΆ
> 
> at http://documen.tician.de/pyopencl/array.html#pyopencl.array.subset_max
> 
> So, my question: What does this mysterious function do?

If subset is a set of integer indices, it should the CL Array equivalent
of

numpy.max(a[subset])


> What I want to do is find the kth biggest value in a PyOpenCL
> Array. Do any of you know any good ways to do that?

How big is k? Half the array size, or "five"? If the latter, a custom
reduction on a small struct (of the biggest five) might be the way to
go. In the former case, you might need a full sort, which PyOpenCL
doesn't provide yet. (but contributions are welcome)

HTH,
Andreas

Attachment: pgpnqmBLfs1nG.pgp
Description: PGP signature

_______________________________________________
PyOpenCL mailing list
[email protected]
http://lists.tiker.net/listinfo/pyopencl

Reply via email to