Community
cancel
Showing results for 
Search instead for 
Did you mean: 
coolsandyforyou
Beginner
78 Views

can we run the ipp routines in multiple threads?

i have a doubt ...whether i can run ipp routines in multiple threads?i have an application developed with the help of ipps,now i want to improve its performance by multithreading...(in multicore environment) is this possible?

i checked my application with intel parallel analyser ..and found that its using single core,but my system is core 2 duo,i want to exploit the 2 processors simulteneously..

can i do that?

suggest me..
0 Kudos
6 Replies
Sergey_K_Intel
Employee
78 Views

Hi,

First of all, look into $IPPROOTdocThreadedFunctionsList.txt file to determine if your functions are internally threaded, or not.
Supposing they're threaded, you need to use either dynamic linking to IPP dynamic libraries, or use static linking to libraries with suffix "_t". Only these kinds of linking provide function threading.

Regards,
Sergey

coolsandyforyou
Beginner
78 Views

Hi,

First of all, look into $IPPROOTdocThreadedFunctionsList.txt file to determine if your functions are internally threaded, or not.
Supposing they're threaded, you need to use either dynamic linking to IPP dynamic libraries, or use static linking to libraries with suffix "_t". Only these kinds of linking provide function threading.

Regards,
Sergey

i have used dynamic linking to the library,and the functions that i have used are not supporting internal threading...can i run those functions in multiple threads...?
mmdev
Beginner
78 Views

Hello,

This is similar to the question I asked yesterday.

I believe this is the case, but I'd like for someone to please verify ....

If the function is not on the Threaded Functions list, then that function does not take advantage of multiple threads. However, you should still be able to call the non-threaded IPP functions from your multiple threads ... the functions themselvesshould be thread-safe, just not multi-threaded. This suggests that these functions will block, thus perhaps reducing any gains realized from multithreading in your application (depending on your design).

For example, I'm calling the IPP alpha compositing function from separate threads. The function works correctly, but each call blocks, thus serializing my threads.

Vladimir_Dudnik
Employee
78 Views

Hello,

IPP functions are desinged to be thread safe, so you can run IPP functions in parallel in different threads in your application. And of courseIPP functions itself do not block your threads.

Regards,
Vladimir

mmdev
Beginner
78 Views

Vladimir,

Thanks for clarifying. Are you certain the non-threaded IPP functions do not block? Do some of them not protect system resources with mutexes or semaphores?

I have a simple test application with mutliple threads spanning multiple processor cores, accessing a single non-threaded IPP function, and my test data suggests that the function call disallows parallel execution across these multiple threads/cores. Perhaps the problem is in my thread creation or data creation in relation to the Intel IPP model?

Any guidance is most appreciated.

Thanks.

Vladimir_Dudnik
Employee
78 Views

Good point about system resources. Some (very small number) of IPP functions do internal memory allocation, so there will be implicit sync point at malloc call but not for a whole function. It is ippiResize function which is deprecated and we do recommend to use ippiResizeSqrPixel instead, it is also some of ippiFilter functions. But not AlhaComp which is quite simple function.

Vladimir
Reply