Overview
The Intel® IPP is organized by 3 types of library files:
| Library types |
Description |
Folder location |
Example |
| Dynamic |
Include both processor dispatchers and function implementations. |
ia32\stublib ia32\bin |
ipps.lib ipps.dll, ippst7.dll |
| Static Emerged |
Contains only processor dispatchers for all functions. |
ia32\lib |
ippsemerged.lib |
| Static Merged |
Contains only function implementations for all supported processor types. |
ia32\lib |
ippsmerged.lib | |
These libraries offer various linkage models for different needs. The following are the four linkage models supported by the Intel IPP:
- Dynamic linkage
- Custom dynamic linkage
- Single processor static linkage
- Static linkage with dispatching
Steps to quickly demonstrate each linkage model are listed below. This code is used to illustrate the different linkage models:
#include "ipp.h"
int main( ) { const int SIZE = 256; Ipp8u pSrc[SIZE],pDst[SIZE]; int i;
for (i=0; i<SIZE; i++) pSrc[i] = (Ipp8u)i;
ippsCopy_8u(pSrc, pDst, SIZE); return 0; }
Dynamic linkage
- Include ipp.h or corresponding domain include files in your code.
- Link to ipps.lib from directory \stublib .
- Before executing the .exe file, ensure the path environment is set correctly. Please run the ippenv.bat from directory \tools\env or run the Runtime Installer from directory \tools\runtime\installer to ensure this application built with Intel IPP dynamic libraries will load the appropriate processor-specific DLL.
Custom dynamic linkage
- Copy the function names of all Intel IPP functions used from the Intel IPP files into the file export.def. For our code example the content of this file is:
EXPORTS ippsCopy_8u
- Write a DLL initialization function called DllMain in mydll.c, and call the function ippStaticInit inside of DllMain to initialize the dispatching mechanism
- Compile mydll.c as a dynamic link library and link it against ippsemerged.lib , ippsmerged.lib and ippcorel.lib . The import library mydll.lib will be generated automatically.
//=========== mydll.c====================== #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <ipp.h>
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { switch( fdwReason ) { case DLL_PROCESS_ATTACH: ippStaticInit(); break; default: hinstDLL; lpvReserved; break; } return TRUE; }
There is another way to create a custom DLL that allows more customization. You can define CPU specific code for your targeted processor. For example “w7” code is for Intel® Pentium® 4 processor. Please refer the latest updated customdll samples from Intel IPP samples directory: \ipp-samples\advanced-usage\linkage\customdll
Single Processor Static Linkage
In this example, our target system processor is an Intel Pentium 4 processor:
- Add the file ippsmerged.lib to your project and its source tree.
- Include ipp_w7.h for Intel Pentium 4 processor, this inclusion must be before the other Intel IPP header files.
- Add the file ippcorel.lib to your project and its source tree.
- Include ipp.h as normal, after the header ipp_w7.h.
- Call Intel IPP functions normally from your application.
Static linkage with dispatching
- Include ipp.h or corresponding domain include files. It is recommended to include ipp.h instead of any particular domain header file due to dependencies.
- Before calling any Intel® IPP functions, initialize the static dispatcher by calling ippStaticInit , which will perform the complete dispatching process. Without calling this function, you will run “px” code libraries instead of the optimized version of the code.
- Link the ippsmerged.lib, ippsemerged.lib and ippcorel.lib from directory \lib.
- Execute the .exe file; it will execute the appropriate processor code.
Quick comparison of the four linkage models
| Features |
Dynamic linkage |
Custom dynamic linkage |
Single processor static linkage |
Static linkage with dispatching |
| Processor update |
Automatic |
Recompile and redistribute |
Release new processor-specific application |
Recompile and redistribute |
| Optimization |
All processors |
All processors |
One processors |
All processors |
| Build |
Link to stub dispatch libraries |
Build separate DLL |
Link to processor-specific libraries |
Link to static libraries & dispatching static libs |
| Calling |
Regular names |
Regular names |
Regular names |
Regular names |
| Distribution |
Provided run-time installer |
Distribute custom DLLs |
No extra distribution |
No extra distribution |
| Total Binary Size |
Large |
Small |
Small |
Small |
| Executable Size |
Smallest |
Smallest |
Small |
Small |
| Kernel Mode |
No |
No |
Yes |
Yes |
| Multi-Threading Support |
Yes |
No |
No |
No | |
For more information about the above linkage models, please refer to the Intel® IPP white paper Choosing the best Intel® IPP Linkage Models for Your Applications.
Operating System:
| Windows* XP Professional x64 Edition, Windows Server* 2003 Standard x64 Edition, Windows Server* 2003 Enterprise x64 Edition, Mac OS*, Windows* XP 64-Bit Edition, Windows* XP Professional, Windows* XP Home Edition, Red Hat* Linux 8.0, Red Hat* Linux Advanced Server 2.x, Windows Server* 2003, Red Hat* Linux 9.0, Red Hat* Enterprise Linux 3.0, SUSE* Linux* 8.2, Windows Server* 2003 Standard Edition, Red Hat* Linux Advanced Server 3.x, Windows* XP 64-Bit Edition Version 2003 |
This applies to:
|