Community
cancel
Showing results for 
Search instead for 
Did you mean: 
harald85
Beginner
127 Views

Processor support

Hello

I am using the Intel IPP for decoding and encoding of an rtp stream with G729 and GSM. How can I check that it use the best processor support for my processor. At the beginning I call ippInitStatic(). I use it on an Xeon but also on an Core2Duo. Is it possible that the program find out which processor is used during the start and uses then the optimized Code from the IPP?

Harald
0 Kudos
10 Replies
pvonkaenel
New Contributor III
127 Views

Quoting - harald85
Hello

I am using the Intel IPP for decoding and encoding of an rtp stream with G729 and GSM. How can I check that it use the best processor support for my processor. At the beginning I call ippInitStatic(). I use it on an Xeon but also on an Core2Duo. Is it possible that the program find out which processor is used during the start and uses then the optimized Code from the IPP?

Harald

From my understanding, if you are statically linking with the IPP library, then calling ippStaticInit() is all you need to do. If you are dynamically linking, then you don't need to make any special initialization call. One of the really nice things about IPP is that the dispatcher should automatically call the correct for the processor the application is running on.

If you are statically linking then you can test by timing your code both with and without the ippStaticInit() call and see the difference: if you leave out the call to ippStaticInit(), you should see performance drop off. Also, if you are calling statically linked IPP routines from multiple modules (DLLs and EXEs), then I think you need to put a call to ippStaticInit() in each module: I have the call in my DLLMain() for DLLs that use IPP.

Peter
harald85
Beginner
127 Views

Quoting - pvonkaenel

From my understanding, if you are statically linking with the IPP library, then calling ippStaticInit() is all you need to do. If you are dynamically linking, then you don't need to make any special initialization call. One of the really nice things about IPP is that the dispatcher should automatically call the correct for the processor the application is running on.

If you are statically linking then you can test by timing your code both with and without the ippStaticInit() call and see the difference: if you leave out the call to ippStaticInit(), you should see performance drop off. Also, if you are calling statically linked IPP routines from multiple modules (DLLs and EXEs), then I think you need to put a call to ippStaticInit() in each module: I have the call in my DLLMain() for DLLs that use IPP.

Peter
When i now use an statically linking and i compile the software on an core2duo but then i run it on an xeon it use the core2duo or Xeon optimized code?!

Harald
Ying_S_Intel
Employee
127 Views


Few easy toolsyou canuse help verifying the right CPU dispatcher for your targeted CPUs:
1. Check this FAQ at IPP http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-understan... to understand the CPU code used for IPP.

2. Run one of executable files from IPP directory toolsperfsys and find out first several output lines where include the appropriate CPU code used by Intel IPP for your targeted CPU.

3. Or you can IPP sample folder in ipp-samplesadvanced-usagecpuinfo , build and run it to find its results , where also includes recommended CPU code used for Intel IPP.

4. If you are advanced user, you can also check another IPP Knowledge Article at: http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-is-there-... for more information.

Hope this helps.
Thanks,
Ying
Ying_S_Intel
Employee
127 Views

Additional comments:

As you may know, the Intel IPP libraires via either static linkage or dynamic linkage offer automatic dispatcher method to ensure the best optimized IPP libraires loaded for your target CPUs at run time, but you can always try some easy tools listed below to help verifying the right CPU dispatcher for your targeted CPUs:

Thanks,
Ying


Quoting - YING S (Intel)

Few easy toolsyou canuse help verifying the right CPU dispatcher for your targeted CPUs:
1. Check this FAQ at IPP http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-understan... to understand the CPU code used for IPP.

2. Run one of executable files from IPP directory toolsperfsys and find out first several output lines where include the appropriate CPU code used by Intel IPP for your targeted CPU.

3. Or you can IPP sample folder in ipp-samplesadvanced-usagecpuinfo , build and run it to find its results , where also includes recommended CPU code used for Intel IPP.

4. If you are advanced user, you can also check another IPP Knowledge Article at: http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-is-there-... for more information.

Hope this helps.
Thanks,
Ying

harald85
Beginner
127 Views

Quoting - harald85
Hello

I am using the Intel IPP for decoding and encoding of an rtp stream with G729 and GSM. How can I check that it use the best processor support for my processor. At the beginning I call ippInitStatic(). I use it on an Xeon but also on an Core2Duo. Is it possible that the program find out which processor is used during the start and uses then the optimized Code from the IPP?

Harald

Hallo
I use my Program on an Intel Xeon X3320 (Yorkfield) but when i run the program he uses the code for px(optimized for all intel 32bit processors). Is it possible to link the optimized lib for my processor to my program static?

Harald
pvonkaenel
New Contributor III
127 Views

Quoting - harald85
When i now use an statically linking and i compile the software on an core2duo but then i run it on an xeon it use the core2duo or Xeon optimized code?!

Harald

The quick answer is that no matter what CPU you built on, the code will be optimized for the CPU it is run on. So in your case, when you build on core2 and run on Xeon, the Xeon optimized code will be run. This works since the static linking includes versions of the IPP routines for all available platforms and runs the correct one at run-time based on the current CPU (not the CPU the app was built on).

Peter
harald85
Beginner
127 Views

Hi

I write a driver for windows which uses the IPP for encoding and decoding(GSM and G729). WhenI tested the driver with the tool intel Vtune I saw that it uses the px functions for add and sub and so on. Normally it schould use the p8 functions because whenI call ippGetCpuType()I get 23 (Penryn). I linked to my driver the e-merged, the merged and the core libs and I call the ippStaticInit function in the driverentry routine. I also tried to call the function ippStaticInitCpuType(Type). But it always uses the px functions. Did somebody know what could be the problem? Is it enough to call the Init function once or mustI call it in every function whereI use an ipp function?

Harald

Ying_S_Intel
Employee
127 Views

Quoting - harald85

Hi

I write a driver for windows which uses the IPP for encoding and decoding(GSM and G729). WhenI tested the driver with the tool intel Vtune I saw that it uses the px functions for add and sub and so on. Normally it schould use the p8 functions because whenI call ippGetCpuType()I get 23 (Penryn). I linked to my driver the e-merged, the merged and the core libs and I call the ippStaticInit function in the driverentry routine. I also tried to call the function ippStaticInitCpuType(Type). But it always uses the px functions. Did somebody know what could be the problem? Is it enough to call the Init function once or mustI call it in every function whereI use an ipp function?

Harald


You need to call ippStaticInit() to use Intel IPP e-merged static libraires.
You may call ippGetCpuFeature() the new one introduced in IPP 6.0 to verify the return value.

Thanks,
Ying
harald85
Beginner
127 Views

Quoting - YING S (Intel)

You need to call ippStaticInit() to use Intel IPP e-merged static libraires.
You may call ippGetCpuFeature() the new one introduced in IPP 6.0 to verify the return value.

Thanks,
Ying

Hi

Thanks for your answer but when I call ippStaticInit() the driver dont use the optimized functions. When I dont link the merged libs i got many errors during the compilation where I see the px and the p8 functions (only for an control). But when I include all e-merged and merged libs why did the driver dont use the p8 functions?

I also have a testprogram where I encode and decode. I linked there the merged and e-merged libs an call the function ippStaticInit once in the main function and he uses the P8 functions. Should this also work in a driver?

Harald
pvonkaenel
New Contributor III
127 Views

Quoting - harald85

Hi

Thanks for your answer but when I call ippStaticInit() the driver dont use the optimized functions. When I dont link the merged libs i got many errors during the compilation where I see the px and the p8 functions (only for an control). But when I include all e-merged and merged libs why did the driver dont use the p8 functions?

I also have a testprogram where I encode and decode. I linked there the merged and e-merged libs an call the function ippStaticInit once in the main function and he uses the P8 functions. Should this also work in a driver?

Harald

I seem to remember reading somehwere in the users guide that ring 0 device drivers should use static linking without dispatching. If you're using the emerged libs then you are dispatching. You might want to look into using static linking without dispatching.

Peter
Reply