Intel® C++ Compiler XE 13.1 User and Reference Guides
Tells the compiler to generate code specialized for a particular processor, at the function level, similar to the -m (/arch) options.
Linux* OS and OS X*:
#pragma intel optimization_parameter target_arch=<CPU> |
Windows* OS:
#pragma [intel] optimization_parameter target_arch=<CPU> |
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.
icc -mAVX foo.c
The above command targets everything in foo.c for Intel® AVX processors.
#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.