Community
cancel
Showing results for 
Search instead for 
Did you mean: 
drd
Beginner
79 Views

ippIIROne_ defeating purpose.

I have a loop in my code which requires that I process one sample at a time using iir filters (set up as both arbitrary and biquad)...

for example:

// ipp32f *data, ftemp;

for (int i = 0; i < numSamples; i++)

{

ftemp = data;

ippsIIROne_32f(ftemp, &ftemp, pBQFilter1State);
ippsIIROne_32f(ftemp, &ftemp, pFilter2State);

// etc.

}

Now, I understand that because these are only opperating on one sample at a time, the performance is going to be poor, plus in this situation I imagine the overhead of the function call defeats the purpose of performance. vTune seems to verify this. Not only that, but since there are no branches / conditions in the loop, I imagine I could get the Intel compiler to vectorize this if I can replace the ipp calls with inline C.

Question is: are my assumptions correct here? I think the equivalent C code should be pretty straight forward, but if anyone has some fast C code for the IIR filters they can share, I'd appreciate it :)

Thanks.

P.S. is it just me or are the threads a chronological mess? How do I sort most recent first?
0 Kudos
1 Reply
drd
Beginner
79 Views


So my initial assumption was correct... in the sense that inline C would be faster than ipp in this case (like 2x!)... but getting it to vectorize has eluded me...

consider that pblock is a member pointer to a struct, and that the taps are set up correctly for these equations...

for the biquad filter:

1853: out = pblock->filter1.coeffsL[0] * ftemp
1854: + pblock->filter1.coeffsL[1] * pblock->filter1.indata[0]
1855: + pblock->filter1.coeffsL[2] * pblock->filter1.indata[1]
1856: + pblock->filter1.coeffsL[3] * pblock->filter1.indata[2]
1857: + pblock->filter1.coeffsL[4] * pblock->filter1.indata[3];
1858: pblock->filter1.indata[1] = pblock->filter1.indata[0];
1859: pblock->filter1.indata[0] = ftemp;
1860: pblock->filter1.indata[3] = pblock->filter1.indata[2];
1861: pblock->filter1.indata[2] = out;
1862: ftemp = out;

1>......srcFilterfilter.cpp(1861): (col. 3) remark: vector dependence: proven FLOW dependence between pblock line 1861, and pblock line 1853.
1>......srcFilterfilter.cpp(1853): (col. 3) remark: vector dependence: proven ANTI dependence between pblock line 1853, and pblock line 1861.
1>......srcFilterfilter.cpp(1861): (col. 3) remark: vector dependence: proven FLOW dependence between pblock line 1861, and pblock line 1860.
1>......srcFilterfilter.cpp(1860): (col. 3) remark: vector dependence: proven ANTI dependence between pblock line 1860, and pblock line 1861.
1>......srcFilterfilter.cpp(1860): (col. 3) remark: vector dependence: proven FLOW dependence between pblock line 1860, and pblock line 1853.
1>......srcFilterfilter.cpp(1853): (col. 3) remark: vector dependence: proven ANTI dependence between pblock line 1853, and pblock line 1860.
1>......srcFilterfilter.cpp(1860): (col. 3) remark: vector dependence: proven ANTI dependence between pblock line 1860, and pblock line 1861.
1>......srcFilterfilter.cpp(1861): (col. 3) remark: vector dependence: proven FLOW dependence between pblock line 1861, and pblock line 1860.
1>......srcFilterfilter.cpp(1859): (col. 3) remark: vector dependence: proven FLOW dependence between pblock line 1859, and pblock line 1853.
1>......srcFilterfilter.cpp(1853): (col. 3) remark: vector dependence: proven ANTI dependence between pblock line 1853, and pblock line 1859.
1>......srcFilterfilter.cpp(1859): (col. 3) remark: vector dependence: proven FLOW dependence between pblock line 1859, and pblock line 1858.
1>......srcFilterfilter.cpp(1858): (col. 3) remark: vector dependence: proven ANTI dependence between pblock line 1858, and pblock line 1859.
1>......srcFilterfilter.cpp(1858): (col. 3) remark: vector dependence: proven FLOW dependence between pblock line 1858, and pblock line 1853.
1>......srcFilterfilter.cpp(1853): (col. 3) remark: vector dependence: proven ANTI dependence between pblock line 1853, and pblock line 1858.
1>......srcFilterfilter.cpp(1858): (col. 3) remark: vector dependence: proven ANTI dependence between pblock line 1858, and pblock line 1859.
1>......srcFilterfilter.cpp(1859): (col. 3) remark: vector dependence: proven FLOW dependence between pblock line 1859, and pblock line 1858.
1>......srcFilterfilter.cpp(1853): (col. 3) remark: vector dependence: proven ANTI dependence between pblock line 1853, and pblock line 1859.
1>......srcFilterfilter.cpp(1859): (col. 3) remark: vector dependence: proven FLOW dependence between pblock line 1859, and pblock line 1853.
1>......srcFilterfilter.cpp(1853): (col. 3) remark: vector dependence: proven ANTI dependence between pblock line 1853, and pblock line 1858.
1>......srcFilterfilter.cpp(1858): (col. 3) remark: vector dependence: proven FLOW dependence between pblock line 1858, and pblock line 1853.
1>......srcFilterfilter.cpp(1853): (col. 3) remark: vector dependence: proven ANTI dependence between pblock line 1853, and pblock line 1861.
1>......srcFilterfilter.cpp(1861): (col. 3) remark: vector dependence: proven FLOW dependence between pblock line 1861, and pblock line 1853.
1>......srcFilterfilter.cpp(1853): (col. 3) remark: vector dependence: proven ANTI dependence between pblock line 1853, and pblock line 1860.
1>......srcFilterfilter.cpp(1860): (col. 3) remark: vector dependence: proven FLOW dependence between pblock line 1860, and pblock line 1853.


for the first order IIR:

1871: temp1 = pblock->filter2.coeffsL[0] * ftemp;
1872: temp2 = pblock->filter2.coeffsL[1] * ftemp;
1873: ftemp = temp1 + pblock->filter2.buff[0];
1874: pblock->filter2.buff[0] = (ftemp * pblock->filter2.coeffsL[2]) + temp2;

1>......srcFilterfilter.cpp(1874): (col. 3) remark: vector dependence: proven FLOW dependence between pblock line 1874, and pblock line 1873.
1>......srcFilterfilter.cpp(1873): (col. 3) remark: vector dependence: proven ANTI dependence between pblock line 1873, and pblock line 1874.
1>......srcFilterfilter.cpp(1873): (col. 3) remark: vector dependence: proven ANTI dependence between pblock line 1873, and pblock line 1874.
1>......srcFilterfilter.cpp(1874): (col. 3) remark: vector dependence: proven FLOW dependence between pblock line 1874, and pblock line 1873.

What does it all mean? Is there a good doc that explains what these errors mean and how to fix them?

Reply