Overview
Text filter that demonstrates class pipeline. Example program reads a file
containing decimal integers in text format, and changes each to its square.
Files
- square.cpp
- Source code for example.
- gen_input.cpp
- Source code for sample input generation.
- 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.
Two additional targets for this example:
- make gen_input
- Create an input generator program that prints out a sequence of integers.
- make input.txt
- Create an input file for the example (with help of gen_input).
Usage
- square inputfile outputfile N
- Run the example on the named inputfile (optional, default value is "input.txt") and produce the named outputfile (optional, default value is "output.txt").
N is the number of threads to be used (optional).
- gen_input [LN] > inputfile
- Generate a file named inputfile consisting of LN lines each containing one integer.
If not specified, LN is assumed to be 1000000.
- To run a short version of this example, e.g., for use with Intel® Threading Tools:
- Build a debug version of the example
(see the build directions).
Prepare an inputfile with about 5,000 lines of text (see the instruction above).
Run it with this inputfile and the desired number of threads,
e.g., square inputfile outputfile 4.
Up to parent directory
Copyright © 2005-2010 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.