Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Mellisa
Beginner
91 Views

ippi and multithreading

Hello,

I'm using ipp 6.0.0 on a 4 core Linux machine. I'm trying to multithread some ippi functions.

First I found out that some sources say static linking doesn't support multithread, so I changed my makefile to dynamic linking and I got 20% performance improvement.

Then I used ippsetnumthreads(4) to start 4 threads, but I didn't see any time performance improvement.

So I checked ThreadedFunctionsList.txt in /doc, the function I want to multithread isn't there.

Does that mean if the function is not on the list, I won't be able to multithread it no matter what linking method I'm using and how many cores my machine has?

That 20% performance improvement is only because of the change from static linking to dynamic linking?

Any help would be appreciated.

Mellisa


0 Kudos
3 Replies
Vladimir_Dudnik
Employee
91 Views

Hi Melissa,


I guess some other IPP functions in your test case were threaded and got advantage of multi-core system as a result.

Note, you also may try to thread your code above IPP functions (meaning to call IPP functions in different threads, for example to process different parts of the same image or to process different images)

Regards,
Vladimir
Mellisa
Beginner
91 Views

Thank you, Vladimir.

I have another quick question.

For example I want to threshold an image using ippiCompareC function. However, that function isn'ton the threaded function list.

Like what you suggested, I'm trying to multithread the ippi function from outside. I was thinking using boost library to create multiplt threads to process different part of the image and in each thread I call the ippi functions. Is it doable?

Mellisa

Vladimir_Dudnik
Employee
91 Views

Hi Melissa,

yes, it should be doable. When you put threading on top of IPP it does not matter what threading API you will use. We just recommend you to set single thread mode in IPP by calling ippSetNumThreads(1) somewhere at the beginning of your program when you link with IPP DLLs or threaded static libraries. In case you link with IPP non threaded static libraries you are already in single thread mode and no additional care required.

Regards,
Vladimir
Reply