File: README.md

package info (click to toggle)
onetbb 2022.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,440 kB
  • sloc: cpp: 129,228; ansic: 9,745; python: 808; xml: 183; objc: 176; makefile: 66; sh: 66; awk: 41; javascript: 37
file content (31 lines) | stat: -rw-r--r-- 1,515 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Sub_string_finder sample
An example that uses the `parallel_for` template in a substring matching program. The [oneAPI Threading Building Blocks Get Started Guide](https://www.intel.com/content/www/us/en/docs/onetbb/get-started-guide/current/overview.html) 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).

## Building the example
```
cmake <path_to_example>
cmake --build .
```

### Predefined make targets
* `make sub_string_finder_simple` - builds the example as it appears in the Get Started Guide.
* `make sub_string_finder_extended` - builds the similar example with more attractive printing of the results.
* `make sub_string_finder_pretty` - builds the example extended with a sequential implementation.
* `make sub_string_finder` - builds all sample versions.

## Running the sample
### Predefined make targets
* `make run_sub_string_finder` - executes the example with predefined parameters.
* `make light_test_sub_string_finder` - executes the example with suggested parameters to reduce execution time.

### Application parameters
Usage:
```
sub_string_finder_simple
sub_string_finder_extended
sub_string_finder_pretty
```

The example does not requires application parameters.