<#part sign=pgpmime> On Wed, 21 Mar 2012 13:26:20 +0100, wrb <[email protected]> wrote: > Hi all, > > I'd like to ask one thing. Is there a way to "nicely" do row-wise and > column-wise reduction or scan in pyopencl? What do I mean by that is, > that I have > > 1 1 1 > 1 1 1 > 1 1 1 > > then row-wise scan would return > 1 2 3 > 1 2 3 > 1 2 3 > > and column one > 1 1 1 > 2 2 2 > 3 3 3 > > Is there a way to do this? I can of course implement it with my own > kernel (though I have a feeling that my implementation is in no way > efficient), but I need this for a project I wanted to use as a showcase > of pyopencl's abilities, so I want as simple and "canonical" way to do > this as possible.
For a row-major matrix, row-wise scan is effectively segmented scan, which is a tiny change to the existing scan code that's been on my todo list for a long while. I'll try to get to that soon. And I'd be very surprised if the optimal way to do column-wise scan weren't transpose, row-wise scan, transpose. :) Andreas _______________________________________________ PyOpenCL mailing list [email protected] http://lists.tiker.net/listinfo/pyopencl
