[PyOpenCL] 2d array row-wise and column-wise reduction and scan in pyopencl

wrb wrb at autistici.org
Wed Mar 21 05:26:20 PDT 2012


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.

Thanks,
Jake



More information about the PyOpenCL mailing list