A simple example that uses the parallel_for template in a substring matching program. The Intel® Threading Building Blocks Getting Started Guide describes this example.

For each position in a string, the program displays the length of the largest matching substring elsewhere in the string. The program also displays the location of a largest match for each position. Consider the string "babba" as an example. Starting at position 0, "ba" is the largest substring with a match elsewhere in the string (position 3).

The code located in the sub_string_finder_extended.cpp file demonstrates offload programming for Intel® Many Integrated Core (Intel® MIC) Architecture (see build instructions).

System Requirements

For the most up to date system requirements, see the release notes.

Files
sub_string_finder.cpp
The example as it appears in the Getting Started Guide.
sub_string_finder_extended.cpp
An example similar to the one in the Getting Started Guide, but with an added sequential implementation, and with an offload region added that can be executed on Intel® MIC Architecture based coprocessor. The three implementations are timed, by using tick_count, and the speedup of the parallel version and the speedup of the parallel version and, if applicable, the offload version is calculated and displayed.
sub_string_finder_pretty.cpp
An example similar to the one in the Getting Started Guide, but with more attractive printing of the results.
Makefile
Makefile for building the example.
Directories
msvs
Contains Microsoft* Visual Studio* workspace for building and running the example (Windows* systems only).
xcode
Contains Xcode* IDE workspace for building and running the example (macOS* systems only).

For information about the minimum supported version of IDE, see release notes.

Build instructions

General build directions can be found here.

Usage
sub_string_finder
Runs the example as it appears in the Getting Started Guide.
sub_string_finder_pretty
Runs the similar example with more attractive printing of the results.
sub_string_finder_extended
Runs the example extended with a sequential implementation and an offload region that can be executed on Intel® MIC Architecture based coprocessor.
To run a short version of this example, e.g., for use with Intel® Threading Tools:
Build a debug version of the sub_string_finder_pretty example (see the build instructions).
Run it, e.g., sub_string_finder_pretty.

Up to parent directory
Legal Information

Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries.
* Other names and brands may be claimed as the property of others.
© 2019, Intel Corporation