Intel Vectorization Toolkit:5. Implement GAP Advice, Other Suggestions

---------------------------------------------------------------------------------------
Back to the 6-step Process for Vectorization
---------------------------------------------------------------------------------------

Intel Vectorization Toolkit: 5. Implement GAP Advice and Other Suggestions (such as using elemental functions and/or array notations)

Now that you know the GAP report suggestions for your loop it is time to implement them if possible.

The report may suggest making a code change. Make sure the change would be "safe" to do. In other words make sure the change does not affect the semantics or safety of your loop.  One way to ensure that the loop has no dependencies that may be affected is to see if executing the loop in backwards order would change the results. Another is to think about the calculations in your loop being in a scrambled order. If the results would be changed, your loop has dependencies and vectorization would not be "safe".  You may still be able to vectorize by eliminating dependencies in this case.

Modify your source to give additional information to the Compiler or optimize your loop for better vectorization.

Example (based on code from step 4):

Vectorized!

Once you have determined the loop can be vectorized the GAP report may recommend using one of the following techniques. Click on the technique to get more information.

C/C++
Intel Cilk Plus (General information)
User-Mandated Vectorization (Pragma SIMD)
Array Notations
Elemental Functions

Fortran
DO CONCURRENT
cDEC$ SIMD

-------------------------------------------------
Additional Resources for this Step
-------------------------------------------------
View Webinar: Quickly Manipulate Data in Parallel Using Intel® Cilk™ Plus Array Notation/Elemental Functions - Recording or Slides
View Webinar: Using Intel® C++ Composer XE to Maximize Code Vectorization and Improve Application Performance - Recording or Slides
Read a Whitepaper: See Sections 7 & 8 (On applying GAP advice) of A Guide to Auto-Vectorization with Intel C++ Compilers
Read a Whitepaper: Using Cilk Plus Elemental Functions
Read a Whitepaper: Floating Point Consistency and how it is affected by various optimizations
Evaluate the Compiler: Intel Software Evaluation Center

Para obter informações mais completas sobre otimizações do compilador, consulte nosso aviso de otimização.