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

Not working multithreading in IPP library

Ildar_S_
Beginner
549 Views
Hi all!
 
I use the IPP library for signal processing. Recently I needed to build my app with IPP library and run multithreaded version of FFT.
After reading the documentation library, I saw that can be run by specifying the function of a ippSetAfiinity. After starting the program creates threads, but unfortunately they are not used, use only one thread.
 
To build the application I use IPP library v7.1 - x64 for linux.
 
Application sample http://pastebin.com/CUn8EJYY
0 Kudos
3 Replies
Igor_A_Intel
Employee
549 Views

Hi Ildar,

do you think the following sequence is correct:

 

according to the IPP manual (Volume 1, Signal Processing) you'll get wrong magnitude:

Arrangement of Forward Fourier Transform Results in Packed Formats - Even Length
Index 0 1 2 3 . . . N-2 N-1 N N+1
Pack R0 R1 I1 R2 . . . I(N-1)/2 RN/2

 So I guess you should perform a shift for pDstC & pDst to 1 point and calculate the first and last points in a special way (considering 0 for image part). Or the most correct way is to use "ppStatus ippsConjPack_32fc_I(Ipp32fc* pSrcDst, int lenDst);" function that expands Pack format to Complex.

Regarding multithreading - IPP FFT is threaded for the very limited number of cases: you CPU must have 2 cores only (with disabled HT)  and share cache - for example core-duo. 32f FFT is threaded for orders 13-19, 64f - for 12-18. All other configurations are not supported by multi-threaded version due to several reasons, the main of them is that we can't guarantee better performance in other possible cases. If you use rather big FFT orders and really need multithreded solution - it is better for you to take a look at MKL library that provides threading above IPP FFTs for big FFT orders (MKL provides its own API, but for FFTs uses IPP kernels internally).

regards, Igor

  1. status = ippsFFTFwd_RToPack_32f(pSrc.get(), pDst.get(), pFFTSpec, pBuffer.get());
  2.                 if(status != ippStsNoErr) throw std::runtime_error(ippGetStatusString(status));
  3.  
  4.                 Ipp32fc *pDstC = (Ipp32fc*)(pDst.get());
  5.                 Ipp32s realSz = fftSz/2;                  // Exclude zero part.        
  6.                 Ipp32s magSz = realSz/2;                  // Convert length to complex length.
  7.  
  8.                 // Extract magniutde from input signal.
  9.                 status = ippsMagnitude_32fc(pDstC, pDst.get(), realSz)
  10.  
0 Kudos
Igor_A_Intel
Employee
549 Views

sorry, forum editor reformatted message after submitting, your code example should start from the 3rd line of message...

0 Kudos
Ildar_S_
Beginner
549 Views

Igor Astakhov (Intel) wrote:

sorry, forum editor reformatted message after submitting, your code example should start from the 3rd line of message...

Well then, I better use MKL because I'll handle large data arrays. Thanks for the reply.
0 Kudos
Reply