Intel® Integrated Performance Primitives 9.0 Update 4 Developer Guide

Building Intel® IPP Applications

The code example below represents a short application to help you get started with Intel® IPP:

This application consists of three sections:

  1. Initialize the Intel IPP library. This stage is required to take advantage of full Intel IPP optimization. The ippInit() function detects the processor type and sets the dispatcher to use the processor-specific code of the Intel® IPP library corresponding to the instruction set capabilities available. If your application runs without ippInit(), the Intel IPP library is auto-initialized with the first call of the Intel IPP function from any domain that is different from ippCore.

    In certain debugging scenarios, it is helpful to force a specific implementation layer using ippSetCpuFeatures(), instead of the best as chosen by the dispatcher.

  2. Get the library layer name and version. You can also get the version information using the ippversion.h file located in the /include directory.

  3. Show the hardware optimizations used by the selected library layer and supported by CPU.

Building the First Example with Microsoft Visual Studio* Integration on Windows* OS

On Windows* OS, Intel IPP applications are significantly easier to build with Microsoft* Visual Studio*. To build the code example above, follow the steps:

  1. Start Microsoft Visual Studio* and create an empty C++ project.

  2. Add a new c file and paste the code into it.

  3. Set the include directories and the linking model as described in Automatically Linking Your Microsoft* Visual Studio* Project with Intel IPP.

  4. Compile and run the application.

If you did not install the integration plug-in, configure your Microsoft* Visual Studio* IDE to build Intel IPP applications following the instructions provided in Configuring the Microsoft Visual Studio* IDE to Link with Intel® IPP.

Building the First Example on Linux* OS

To build the code example above on Linux* OS, follow the steps:

  1. Paste the code into the editor of your choice.

  2. Make sure the compiler and Intel IPP variables are set in your shell. For information on how to set environment variables see Setting Environment Variables.

  3. Compile with the following command: icc ipptest.cpp -o ipptest -I $IPPROOT/include -L $IPPROOT/lib/<arch> -lippi -lipps -lippcore. For more information about which Intel IPP libraries you need to link to, see Library Dependencies by Domain and Linking Options.

    For offload compilation on Intel® Xeon Phi™ Coprocessors, use the following command: icc -qoption,link,"--no-undefined" $< -o application test.o -qoffload-option,mic,link," -L$(IPPROOT)/lib/mic -lippi -lipps -lippcore". For more information on how to use Intel IPP on Intel® Xeon Phi™ Coprocessors, refer to the Multi-threading Example for Intel® Xeon Phi™ Coprocessor (ipp_thread_mic) and respective documentation (ipp-examples.html) available in the ipp-examples.zip archive at the <ipp directory>/examples/ subdirectory.

  4. Run the application.

Building the First Example on OS X*

To build the code example above on OS X*, follow the steps:

  1. Paste the code into the editor of your choice.

  2. Make sure the compiler and Intel IPP variables are set in your shell. For information on how to set environment variables see Setting Environment Variables.

  3. Compile with the following command: icc ipptest.cpp -o ipptest -I $IPPROOT/include -L $IPPROOT/lib/ -lippi -lipps -lippcore. For more information about which Intel IPP libraries you need to link to, see Library Dependencies by Domain and Linking Options.

  4. Run the application.

See Also