Community
cancel
Showing results for 
Search instead for 
Did you mean: 
pascott1
Beginner
88 Views

IPP Convolution Problem

We are currentlyperforming convolution usingthe product of two DFTs and passing that into an inverse DFT. However, the last value in the output vector is zero casuing a later divide by zero. The input vectors are fairly small and we suspect the IFFT is underflowing but the FP utility is not picking it up. The calculation of the last output has the inputs at 1.0f and 0.9e-09. When we do this long hand with a non IPP function it works fine. Could the IPP calls be flushing the underflow and setting it to zero? If so how do we turn this off?

We also tried using the convolve IPP call and got the same result so does the convolve function work the same way under the hood as the method we are using?

0 Kudos
5 Replies
Chao_Y_Intel
Employee
88 Views

IPP provided two functins for denomal data:
ippSetFlushToZero();
ippSetDenormAreZeros();

Can this be helpful? You can check the ippsman for these two functions.

Thanks,
Chao


pascott1
Beginner
88 Views

Hi Chao,

We noticed these functions at the weekend and gave them a go. We disabled them both by setting them to 1 but this didn't seem to have an effect as the output still contained zeros. We put floating point exception handlers around the call as well and these were not triggered.

When we investigated using matlab we did the convolve long hand and found that the smallest value in the whole calculation was 9.5e-9. We are usingsingle precision (float32) so we think we should be well within the precision bounds (1.18e-38). However, we are a little confused about sub normal numbers. Epsilon of 0.0 is 1.18-38 which is what the calculation sould be using so we don't think the calculation should be underflowing or using sub normal numbers.

The dataviews we have are one dimensional. One is 996 values and then padded to 4096 with zeros. The values range from 1 to 10. The second dataview is 1600 values padded to 4096 with zeros. The values are from 0.95e-9 to 1.

So in conclusion we have disabled denorm to zero and flush to zero (even though we don't think the calculation should trigger these) and don't get floating point exceptions but still see zeros in our convolution output. When performed using a non ipp call we don't see any zeros. We are using ipp 5.3 with version 10 of the intelcompiler.

Are there any other reasons why we could be seeing zeros? I will check to see if I can send the input values to replicate our problem.

Thanks
Chao_Y_Intel
Employee
88 Views


Yes, the input values and the test code will be very helpful to root the problem..

Thanks,
Chao

pascott1
Beginner
88 Views

We are calling the IPPInvDFT32CtoC function with a plan size of 4096. We are getting zeros in the output with Denorm to zero and flush to zero both off.The input vector is attached.
Chao_Y_Intel
Employee
88 Views

Quoting - pascott1
We are calling the IPPInvDFT32CtoC function with a plan size of 4096. We are getting zeros in the output with Denorm to zero and flush to zero both off.The input vector is attached.


Hi,

Just tested the data with the following code. The output is very close to 0, but not 0.
are these the result you expected?

3.6954880e-006 0.00000000
6.6777798e-006 3.7308549e-008
8.1331855e-006 -4.9276043e-008
1.1082059e-005 -3.1710805e-008
1.4743879e-005 -5.1793156e-009
....


Thanks,
Chao


void main()

{
Ipp32f x[4096*2], y[4096*2];
int n;
FILE * fp,*fpout;
IppStatus status;

IppsDFTSpec_C_32fc* spec;
fp=fopen("vector_in.txt","r");
fpout=fopen("vector_out.txt","w");

for(int i=0;i<4096;i++) {
fscanf(fp,"%f %f",&x[2*i],&x[2*i+1]);
}

status =ippsDFTInitAlloc_C_32fc(&spec,4096,IPP_FFT_DIV_INV_BY_N, ippAlgHintNone);

ippsDFTInv_CToC_32fc((Ipp32fc *)x,(Ipp32fc *)y,spec, NULL);

ippsDFTFree_C_32fc( spec );

return ;
}

Reply