Intel® C++ Compiler XE 13.1 User and Reference Guides

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* OS and OS X*:

#pragma intel optimization_parameter target_arch=<CPU>

Windows* OS:

#pragma [intel] optimization_parameter target_arch=<CPU>

Arguments

target_arch=<CPU>

for the list of CPUs, see -m (/arch) option.

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) option, but applies only to the function before which it is placed.

Example

  1.  icc -mAVX foo.c

    The above command targets everything in foo.c for Intel® AVX processors.

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

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


Submit feedback on this help topic