You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/cplusplus_compilers_flags/4.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -141,25 +141,24 @@ For a more manageable overview, you can enable basic optimization information (`
141
141
142
142
First, to see what part of our source code was optimised between levels 1 and 2 we can run the following commands to see if our vectorisable loop was indeed vectorised.
Conversely, the `-O2` flag enables our loop to be vectorised as can be seen from the output below.
154
+
This time the `-O2` flag enables our loop to be vectorised as can be seen from the output below.
156
155
157
156
```output
158
157
vectorizable_loop.cpp:13:30: optimized: loop vectorized using 16 byte vectors
159
158
/usr/include/c++/13/bits/stl_algobase.h:930:22: optimized: loop vectorized using 16 byte vectors
160
159
```
161
160
162
-
Second, to see what optimisations were performed and missed between level 2 and level 3, we can direct the terminal output from all optimisations (`-fopt-info`) to a text file with the commands below.
161
+
To see what optimisations were performed and missed between level 2 and level 3, we could direct the terminal output from all optimisations (`-fopt-info`) to a text file with the commands below.
163
162
164
163
```bash
165
164
g++ -O2 vectorizable_loop.cpp -o level_2 -fopt-info 2>&1| tee level2.txt
0 commit comments