If you target a specific process do you still need ippInit or ippInitCpu?

If you target a specific process do you still need ippInit or ippInitCpu?

Hi,

I want to static link to only a specific cpu support routine via the ipp_xx.h header file placed before ipp.h. The question I have is do I still need to call ippInit or ippInitCpu (or would those end up linking everything when I just want one processor)? If I want to check a processor support, I'd imagine I must then need to use a different function?

TIA!!

7 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi DF

Right, you don't need to call ippInit() or ippInitCpu() when you just want creat a exe which for one processor.The ippInit and ippInitCPU() is for dispatch thecpu-specific optimized code automatically for all supported cpus.

Here is the steps for creating singel-processor exe.

Intel Integrated Performance Primitives
Creating Single-Processor ExecutablesIntroduction

The Intel Integrated Performance Primitives(IntelIPP) Merged Static Libraries are provided for those applications that require the small footprint advantages of static linking. The merged static libraries ipp*_t.lib or ipp*_l.lib each contain a version of each function for each processor (for Generic IA-32, Streaming SIMD Extensions 3 (SSE3), Intel Core2 Duo and Intel Core i7 processors). In the unusual case in which an application or driver needs to be tied to a particular processor, it is also possible to repurpose these and link to one processor-version of IntelIPP only.

Static linking to IntelIPP Functions for One Processor

  1. Add the files ipp*_t.lib or ipp*_l.lib to your project and its source tree.
  2. Include exactly one of the following files, located in this directory: ipp_mx.h, ipp_u8.h or ipp_y8.h. See the table below for header choices. This inclusion must be before the other IntelIPP header files.
  3. Add the file ippcore_t.lib or ippcore_l.lib to your project and its source tree.
  4. Include IntelIPP header file(s) as normal, after the above conversion header.
  5. Call IntelIPP functions normally from your application.

Now the correct processor-specific version of each function you specify will be called from the static libraries. It is important to insure that both processor and operating system supports the full capabilities of the target processor.

Not sure if i understandyou correctly about "If I want to check a processor support, I'd imagine I must then need to use a different function?".

When you create asingel-processor exe, that assume that you have known your targeted processor type. Which means, you should check the processor support before create the exe. thereare many ways to checkt the processor supports. for example, by ippiDemo.exe=> help menu or external cpu detect tools like cpuz (www.cpuid.com). etc.

Best Regards,
Ying

Ying - It would really be helpful to have an example of linking IPP statically (with and without dispatching.)  The above explanation does not explain the difference between ipp*_t.lib and ipp*_l.lib.  I have followed these instructions and am still unable to link statically with 7.1.1.119 version of the IPP libraries.  

Bob Davies

Ying - I have found another page describing static linking and it is at odds with what you have provided.  Why didn't you provide a link?  Is your info out of date? 

http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-intel-ipp-linkage-models-quick-reference-guide

Single Processor Static Linkage

  1. Include ipp.h , after the header ipp_w7.h (In case of Pentium® 4).
  2. Add the file ippsmerged.lib to your project and its source tree.
  3. Include ipp_w7.h for Intel Pentium 4 processor, this inclusion must be before the other Intel IPP header files.
  4. Add the file ippcorel.lib to your project and its source tree.
  5. Call Intel IPP functions normally from your application.

The problem I am having is that there is no ippsmerged.lib in the 7.1.1.119 distribution.  Your directions at least get further but after including the "ipp_u8.h" file in my code, I cannot locate the "n8_ippsMulC_32f_l" function.  And where can I identify the different include files with the different architectures?  There is no "table below for header choices" as you indicate.  Any help would be appreciated.

Bob Davies

OK.  I got this to work by making sure that the ipp_u8.h file was ahead of the ipp.h include. I was statically linking the library using Visual Studio 2012 (Windows 7) and didn't need to change the list of libraries included so I didn't need to know about ipp*.t.lib or ipp*.l.lib.  Not sure what that difference is.  It might be useful to find out when I build a Linux version.

Bob Davies

OK.  I got this to work by making sure that the ipp_u8.h file was ahead of the ipp.h include. I was statically linking the library using Visual Studio 2012 (Windows 7) and didn't need to change the list of libraries included so I didn't need to know about ipp*.t.lib or ipp*.l.lib.  Not sure what that difference is.  It might be useful to find out when I build a Linux version.

Bob Davies

Hi Bob, *t.lib are multi-threaded static libraries and *l.lib are single-threaded libraries. "merged" suffix is related to previous IPP versions (6.1 and older) - since that we've changed libraries naming. As you link to the code that is specific for some particular CPU - any calls to Init or InitCPU are useless as your application is linked with 1 single code version that can't be changed/dispatched. It is your responsibility now to check if CPU supports instruction set that is used by directly linked specific library.

regards, Igor

Leave a Comment

Please sign in to add a comment. Not a member? Join today