Overview: Using Intel(R) C++ Compiler Pragmas

Pragmas are directives that provide instructions to the compiler for use in specific cases. For example, you can use the novector pragma to specify that a loop should never be vectorized. The keyword #pragma is standard in the C++ language, but individual pragmas are machine-specific or operating system-specific, and vary by compiler.

Some pragmas provide the same functionality as do compiler options. Pragmas override behavior specified by compiler options.

Using Pragmas

You enter pragmas into your C++ source code using the following syntax:

#pragma <pragma name>  

Example

The vector always directive instructs the compiler to override any efficiency heuristic during the decision to vectorize or not, and will vectorize non-unit strides or very unaligned memory accesses.

Example of the vector always directive

#pragma vector always

for(i=0; i<=N; i++)

{

  a[32*i]=b[99*i];

}