Overview
A simple example that uses the parallel_for template in a substring matching program. 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).
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. The two implementations are both timed, by using tick_count,
and the speedup of the parallel 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 example.
Directories
- vc7.1
- Contains Microsoft* Visual Studio* .NET 2003 workspace for building and running the example.
- vc8
- Contains Microsoft* Visual Studio* 2005 workspace for building and running the example.
- vc9
- Contains Microsoft* Visual Studio* 2008 workspace for building and running the example.
- xcode
- Contains Xcode* IDE workspace for building and running the example.
To Build
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_extended
- Runs the extended example with the added sequential implementation.
- sub_string_finder_pretty
- Runs the similar example with more attractive printing of the results.
- 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 directions).
Run it, e.g., sub_string_finder_pretty.
Up to parent directory
Copyright © 2005-2008 Intel Corporation. All Rights Reserved.
Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are
registered trademarks or trademarks of Intel Corporation or its
subsidiaries in the United States and other countries.
* Other names and brands may be claimed as the property of others.