Hi Andreas,
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?
Igor

On Fri, May 25, 2012 at 2:55 AM, Andreas Kloeckner
<kloeck...@cims.nyu.edu> wrote:
> On Thu, 24 May 2012 22:46:16 +1200, Igor <rych...@gmail.com> wrote:
>> 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.)
>
> https://github.com/inducer/pycuda/blob/master/test/test_gpuarray.py#L765
>
> Andreas
>
> --
> Andreas Kloeckner
> Room 1105A (Warren Weaver Hall), Courant Institute, NYU
> http://www.cims.nyu.edu/~kloeckner/
> +1-401-648-0599

Attachment: max_element_pycuda_thrust_ctypes.py
Description: Binary data

_______________________________________________
PyCUDA mailing list
PyCUDA@tiker.net
http://lists.tiker.net/listinfo/pycuda

Reply via email to