I'm attaching an example for your wiki demonstrating how to find a max
element position both using ReductionKernel and thrust-nvcc-ctypes.
The latter doesn't quite work on windows yet. Should work if you're on
a linux, just change the FOLDER. There is a live version published on
my sage server (http://dev.math.canterbury.ac.nz/home/pub/26/
there all work and show a discouraging 5-fold slowdown of
ReductionKernel as compared to thrust (run twice, as the .so file is
loaded lazily?). Could you take a look and edit it if necessary?
On Fri, May 25, 2012 at 2:55 AM, Andreas Kloeckner
On Thu, 24 May 2012 22:46:16 +1200, Igor <rychphd(a)gmail.com>
> A better programme would be to port all the algorithms and interfaces
> of Thrust to PyCUDA. The only reason I need thrust for example, is
> that it can find me the extremum element's _location_ which I still
> don't know how to do in PyCUDA.
Agreed, although thrust's sorting capability won't be matched by PyCUDA
in a while. (There's some home for thrust's scan trickeries.)
But your specific concern is fortunately already doable. :) It should be
fairly easy to modify this test to do what you want. (Simply store the
index in the initial 'map' stage.)
Room 1105A (Warren Weaver Hall), Courant Institute, NYU