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
- msvs
- Contains Microsoft* Visual Studio* 2005 workspace for building and running the
example (Windows* systems only).
- xcode
- Contains Xcode* IDE workspace for building and running the example (Mac OS* X
systems only).
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 -h
- Prints the help for command line options
- square [n-of-threads=value] [input-file=value] [output-file=value] [max-slice-size=value] [silent]
- square [n-of-threads [input-file [output-file [max-slice-size]]]] [silent]
- n-of-threads is the number of threads to use; a range of the form low[:high], where low and optional high are non-negative integers or 'auto' for the TBB default.
input-file is an input file name.
output-file is an output file name.
max-slice-size is the maximum number of characters in one slice.
silent - no output except elapsed time.
- 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® Parallel Inspector:
- 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 4 inputfile outputfile.
Up to parent directory
Copyright © 2005-2013 Intel Corporation. All Rights Reserved.
Intel is a registered trademark or trademark 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.