Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Cumulative Sum

thorsan1
초급자
1,728 조회수
Hi

I need to compute the cumulative sum of a 1D signal. In C it would look like

for(int k=0;k...)
{
A += A[k-1];
}

How can this be done using intrinsics and/or IPP?

Thanks for any help
0 포인트
4 응답
Vladimir_Dudnik
1,728 조회수

Hello,

As I remember there was a similar question regarding 2D operation, you can see thread

http://softwareforums.intel.com/ids/board/message?board.id=IPP&message.id=980

regarding piece of code you shown, is it exactly what you mean? This code will read data from outside of available memory for k=0.

We do not have similar functions in IPP. You can take a look on ippsSum function family, which calculate sum of all elements in 1D vector

Regards,
Vladimir

0 포인트
Intel_C_Intel
직원
1,728 조회수

Hi!

IPP has function ippiIntegral that calculates the image integral on the rectangular area. If you call it for the image with 1 row you get the cumulative sum

Alexander

0 포인트
thorsan1
초급자
1,728 조회수
hi

thanks for the help.

ok. there was an error in the kode the loop should go from k=1...

Ill take a look at the integral function. but does anyone know how it is done?

thorsan
0 포인트
Intel_C_Intel
직원
1,728 조회수

Imageintegral function maps input NxM image to output (N+1)x(M+1) image. It calculates dst[n,m]=SUM(src[i,j]), i

For more details see IPP Manual Image processing

Alexander

0 포인트
응답