Calculating integral images / cumulative add
Stefan Reich
stefan.reich.maker.of.eye at googlemail.com
Tue Jan 5 01:51:59 UTC 2021
Oh I just saw this in the presentation
<http://cr.openjdk.java.net/~jrose/pres/201907-Vectors.pdf>:
▪ Segmented scan (reduce with partials and mask-driven reset)
That's probably what I want... so it's not there yet?
On Tue, 5 Jan 2021 at 02:31, Stefan Reich <
stefan.reich.maker.of.eye at googlemail.com> wrote:
> Hi,
>
> I am trying to vectorize my routine that constructs an integral image / "summed-area
> table" <https://en.wikipedia.org/wiki/Summed-area_table>.
>
> int i = 0;
> for (int y = 0; y < h; y++) {
> int sum = 0;
> for (int x = 0; x < w; x++) {
> sum += image[i];
> data[i] = y > 0 ? sum + data[i-w] : sum;
> i++;
> }
> }
>
> In order to use the Vector API, I'd need an operation that does a
> cumulative summing over the lanes, e.g. for a 4-component vector:
>
> b[0] = a[0]
> b[1] = a[0]+a[1]
> b[2] = a[0]+a[1]+a[2]
> b[3] = a[0]+a[1]+a[2]+a[3]
>
> I don't think this is available in the current Vector API, is it?
>
> Thanks,
> Stefan
>
> --
> Stefan Reich
> BotCompany.de // Java-based operating systems
>
--
Stefan Reich
BotCompany.de // Java-based operating systems
More information about the panama-dev
mailing list