Repository navigation
Running finite sum #548
|
Any idea about using GenericScanKernel to make a running sum of the preceding N terms, i.e. S(k) = Sum(i = k - N, k)input[i] instead of S(k) = Sum(i = 0, k)input[i] (e.g. for a window averaging) ? |
Replies: 4 comments 3 replies
|
Isn't that just ? (with appropriate handling of the left boundary of course) |
|
The problem is to deal with the loss of resolution you get when accumulating millions of values (all GPU cards do not accept double precision). Of course you are right (simply subtracting two scans once they are done), but it gets more and more noisy towards the end of the scans. My question was: can this be handled within the GenericScanKernel mechanism... |
|
To overcome this, I am trying to use a segmented scan. However, I can see nowhere any simple working example. I have seen issue #411 and your comment, which is hard to understand (what does ' the scan expression must act as if the How should I modify the following code ? |
|
Here is a working example: |


Here is a working example: