User Tools

Site Tools


vectorization

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
vectorization [2017/06/26 10:29]
meesters [Which code can be auto-vectorized?]
vectorization [2017/06/26 10:33]
meesters [Compiler Flags]
Line 52: Line 52:
 A list of loop constructs which can be auto-vectorized [[https://​twiki.cern.ch/​twiki/​bin/​view/​CMSPublic/​WorkBookWritingAutovectorizableCode|can be found here.]] A list of loop constructs which can be auto-vectorized [[https://​twiki.cern.ch/​twiki/​bin/​view/​CMSPublic/​WorkBookWritingAutovectorizableCode|can be found here.]]
  
-Once you compile your code with the option ''​-fopt-info-vec-missed[=logfile]''​ GCC will give you a detailed report of all loops in your program and the reason why vectorization failed. In contrast,''​-fopt-info-loop-optimized=[logfile]''​ sums the number of vectorized loops and their positions. Both options are mutually exclusive.+Once you compile your code with the option ''​-fopt-info-vec-missed[=logfile]''​ GCC will give you a detailed report of all loops in your program and the reason why vectorization failed ​or why it has been sub-optimal. In contrast,''​-fopt-info-loop-optimized=[logfile]''​ sums the number of vectorized loops and their positions. Both options are mutually exclusive.
  
 ===== Getting GCC to auto-vectorize your code ===== ===== Getting GCC to auto-vectorize your code =====
Line 63: Line 63:
  
 **This option is implicitly enabled if you compile with the optimization level ''​-O3''​ or more.** **This option is implicitly enabled if you compile with the optimization level ''​-O3''​ or more.**
- 
-To get a report which loops have been auto-vectorized and which failed and why, you can increase the verbosity of the vectorization using 
- 
-''​-ftree-vectorizer-verbose=7''​ 
- 
-On how to read this output, have a look at the Real-World code examples section below. 
  
 Some loop constructs ( e.g. reduction of float values ) can only be vectorized if the compiler is allowed to change the order of mathematical operations. To allow this, use the flag Some loop constructs ( e.g. reduction of float values ) can only be vectorized if the compiler is allowed to change the order of mathematical operations. To allow this, use the flag
vectorization.txt · Last modified: 2017/06/26 10:33 by meesters