4 Replies Latest reply on Oct 5, 2009 4:01 PM by dinaharchery

    Sum within a Output Stream

    dinaharchery
      Custom Reduce

      Hello All,

      I got a quick question I hope someone can help with regarding summing values. I could use a reduction kernel but since the reduction factor would be so small (~3 - 7) the overhead would not be worth it.

      I have a single Stream made up of the following values (y,x):

      4, 4, 2, 16, 56, 0, 9, 5

      I would like to sum the Stream as the following:

      4    56 ----> 60

      4    0 -------> 4

      2    9 -------> 11

      16    5 ------> 21

      Can this be done? As you can see, using the standard reduction would become an overload.

      Thanks.