Intel® C++ Compiler 16.0 User and Reference Guide

optimization_parameter

Tells the compiler to generate code specialized for a particular processor, at the function level, similar to the -m (/arch) options.

Syntax

Linux* and OS X*:

#pragma intel optimization_parameter target_arch=<CPU>

Windows*:

#pragma [intel] optimization_parameter target_arch=<CPU>

Arguments

target_arch=<CPU>

for the list of CPUs, see compiler options -m (/arch) and [Q]x.

Description

The intel optimization_parameter target_arch pragma controls the -m (/arch) option settings at the function level, overriding the option values specified at the command-line.

Place #pragma intel optimization_parameter target_arch=<CPU> at the head of a function to get the compiler to target that function for a specified instruction set. The pragma works like the -m (/arch) and [Q]x options, but applies only to the function before which it is placed.

Examples

Example: Targeting code for Intel® Advanced Vector Extensions (Intel® AVX) processors

 icc -mAVX foo.c   // on Linux* and OS X* with EDG compiler
 icl -mAVX foo.c   // on OS X*  with CLANG compiler

Example: Targeting a function for Intel® Advanced Vector Extensions (Intel® AVX) processors

#pragma intel optimization_parameter target_arch=AVX
void bar() { ... }

The following code targets just the function bar for Intel® AVX processors, regardless of the command line options used.

See Also