Skip to content

Commit becc300

Browse files
Review comments
Co-authored-by: Rageking8 <[email protected]>
1 parent b1600d8 commit becc300

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

docs/standard-library/vectorized-stl-algorithms.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ helpviewer_keywords: ["_USE_STD_VECTOR_ALGORITHMS", "_USE_STD_VECTOR_FLOATING_AL
77
---
88
# Vectorized STL Algorithms
99

10-
Under certain conditions, STL algorithms execute not element-wise, but multiple element at once on a single CPU core. This is possible due to SIMD (single instruction, multiple data). The use of such approach instead of
11-
element-wise approach is called vectorization. An implementation that is not vectorized is called scalar.
10+
Under certain conditions, STL algorithms execute not element-wise, but multiple element at once on a single CPU core. This is possible due to SIMD (single instruction, multiple data). The use of such approach instead of element-wise approach is called vectorization. An implementation that is not vectorized is called scalar.
1211

1312
The conditions for vectorization are:
1413
- The container or range is contiguous. `array`, `vector`, and `basic_string` are contiguous containers, `span` and `basic_string_view` provide contiguous ranges.
@@ -52,7 +51,7 @@ The following algorithms have manual vectorization controlled via `_USE_STD_VECT
5251
- `reverse`
5352
- `reverse_copy`
5453
- `rotate`
55-
- `is_sorted`
54+
- `is_sorted`
5655
- `is_sorted_until`
5756
- `max_element`
5857
- `min_element`
@@ -76,7 +75,7 @@ In addition to algorithms, the macro controls the manual vectorization of:
7675
## Manually vectorized algorithms for floating point types
7776

7877
Vectorization of floating point types is connected with extra difficulties:
79-
- For floating point results, the order of operations may matter. Some reordering may yield a different result, whether more precise, or less precise. Vectotization may need operations reordering, so it may affect that.
78+
- For floating point results, the order of operations may matter. Some reordering may yield a different result, whether more precise, or less precise. Vectorization may need operations reordering, so it may affect that.
8079
- Floating point types may contain NaN values, which don't behave transitively while comparing.
8180
- Floating point operations may raise exceptions.
8281

@@ -86,7 +85,7 @@ The STL deals with the first two difficulties safely. Only `max_element`, `min_e
8685

8786
There's `_USE_STD_VECTOR_FLOATING_ALGORITHMS` to control the use of these vectorized algorithms for floating point types. Set it to 0 to disable the vectorization. The macro has no effect if `_USE_STD_VECTOR_ALGORITHMS` is set to 0.
8887

89-
`_USE_STD_VECTOR_FLOATING_ALGORITHMS` defaults to 0 when `/fp:except` option is set. This is to avoid problems with exceptions.
88+
`_USE_STD_VECTOR_FLOATING_ALGORITHMS` defaults to 0 when [`/fp:except`](../build/reference/fp-specify-floating-point-behavior.md#except) option is set. This is to avoid problems with exceptions.
9089

9190
## See also
9291

0 commit comments

Comments
 (0)