A Tool for Listing the Intel IPP Functions used by Your Application

20 sep 2011 – article update – the ZIP file has been updated to include a missing DLL and it also now contains both AWK and GAWK executables. If you already have the necessary UNIX utilities on your Windows system (e.g., Cygwin or MinGW) you may not need the contents of the ZIP file. In any case please download the "ipp-fn-survey.awk" script file, it is required regardless of the UNIX utilities you use to run the script! On Windows, this AWK script has only been verified against the old GnuWin32 utils provided here. The GnuWin32 utils distributed in the attached ZIP file can be found here: http://gnuwin32.sourceforge.net/packages.html.

In the interest of developing a list of "most frequently used" functions by customers of the Intel IPP library, we have created a simple AWK script that can be used on either a Windows or Linux system to extract the names of the Intel IPP functions used in your application, without having to reveal any of your application source.

The number of Intel IPP functions present in the library is quite large; as a result, optimizing the entire library for new SIMD architectures must be performed in phases. In general, we would like to optimize first those functions that are most popular and relevant to our customers, in order to insure that your applications receive the maximum benefit as new SIMD architectures and/or extensions to those architectures are introduced.

Attached to this KB article please find:

The AWK script scans C/C++ source code to identify any function that conforms to the standard naming scheme used by the Intel IPP library. This AWK script is provided in source format, so you can inspect the script to determine exactly what it does.

In essence, this script:

  1. removes /* */ and // style comments to avoid false detects within comments
  2. removes " " string constants to avoid false detects within strings
  3. searches for and lists the names of all Intel IPP "core" functions
  4. searches for and lists the names of all Intel IPP "administrative" functions

The script is not perfect and may miss a few Intel IPP functions. Please see the comments inside the AWK script for more details on known or suspected issues.

If the source tree you scan includes the IPP header files (ippac.h, ippcc.h, ippch.h, etc.) be sure to exclude those files from the search; otherwise, you will include every IPP function listed in those headers, even if you are not using them in your source code.

 

Basic Operation:

To run this script on a Linux machine you will need the standard Gnu AWK, find, sort, uniq and xargs utilities that are normally present on your Linux system. Use the following command line:

$find src_dir -iregex ".+\.[ch]p*" | xargs ./ipp-fn-survey.awk | sort | uniq >ipp-survey.txt

where "src_dir" is the root of the directory you wish to scan source for names of IPP functions -- simplest way to do this is to copy this AWK file to the "src_dir" and type:

$find . -regextype posix-awk -iregex ".+\.[ch]p*" | xargs ./ipp-fn-survey.awk | sort | uniq >ipp-survey.txt

Note: GAWK on some Linux systems may not honor IGNORECASE -- resulting in a few false finds. Also, make sure the "executable" bits are set properly on the AWK script.

If you used the command line above, the results of the scan will be found in the file named "ipp-survey.txt" in the starting directory.

On some Linux systems you may not have gawk but awk installed on your system. The first line of the ipp-fun-survey.awk file references /usr/bin/gawk as the script interpreter. If your system instead only contains /usr/bin/awk you need to change that first line. To determine which application is on your system type "which gawk" at a command prompt. If nothing is returned type "which awk" at the command line. If your system only contains awk, or the application is located someplace other than /usr/bin, you will have to edit the first line of the ipp-fn-survey.awk script.

 

For Windows:

The easiest way to run the script is in a Cygwin environment (http://www.cygwin.com/) where the Linux instructions will work.

To run this script on a Windows machine without Cygwin you will need a copy of the GnuWin32 GAWK application (or a compatible AWK). In order to build a concise and sorted list of the Intel IPP functions used within your application it is also helpful to utilize the UNIX-compatible find, sort and uniq functions. These utilities can be found here: http://gnuwin32.sourceforge.net/packages.html.

For your convenience all of these functions are provided in the GnuWin32-utils zip bundle. With the GnuWin32 applications installed on your Windows system, use the following command line:

>find src_dir -regex ".+\.[ch]p*" -exec gawk -f ipp-fn-survey.awk {} ; | sort | uniq >ipp-survey.txt

where "src_dir" is the root of the directory you wish to scan source for names of IPP functions -- simplest way to do this is to copy the AWK file and the contents of the ZIP file (GnuWin32-utils-zip) to "src_dir" and type:

>find . -regex ".+\.[ch]p*" -exec gawk -f ipp-fn-survey.awk {} ; | sort | uniq >ipp-survey.txt

Note: on a Windows system "find" needs to be a UNIX compatible version of find, not the Microsoft find. To avoid name conflicts with the Microsoft find.exe you might need to rename the GnuWin32 "find.exe" file to "uxfind.exe" and then run the samples above by referencing "uxfind" rather than "find" at the beginning of each script execution command.

If you used the command line above, the results of the scan will be found in the file named "ipp-survey.txt" in the starting directory.

 

Terms and Conditions

This script will not reveal any source code or parameter names, only the names of the IPP functions referenced in the source code that it scans.

Note that this script is being provided under the terms and conditions of the Intel IPP EULA. Please insure you agree to those terms before using the script to provide us with a list of the Intel IPP primitives you are using.

If you are able to run this script (or something similar) on your application source code and generate a list of IPP functions that you would like to share with us, please reply to this posting (using the private option, if you prefer) with some information about your company and your application, as well as the list of Intel IPP functions created by the script or an email address you may use to contact you directly. Your input is very valuable for the prioritization of future optimizations within the Intel IPP library.

附件尺寸
下载 ipp-fn-survey.awk5.06 KB
下载 GnuWin32-utils_0.zip375.55 KB
如需更全面地了解编译器优化,请参阅优化注意事项