Intel® oneAPI DPC++/C++ Compiler Developer Guide and Reference

ID 767253
Date 6/24/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

vecabi, Qvecabi

Determines which vector function application binary interface (ABI) the compiler uses to create or call vector functions.

Syntax

Linux:

-vecabi=keyword

Windows:

/Qvecabi:keyword

Arguments

keyword

Specifies which vector function ABI to use. Possible values are:

cmdtarget

Tells the compiler to generate an extended set of vector functions. Vector variants are created for all targets specified by compiler options [Q]x and/or [Q]ax. No change needs to be made to the source code.

gcc

Tells the compiler to use the gcc vector function ABI.

Default

gcc

The compiler uses the gcc-compatible vector function ABI.

Description

This option determines which vector function application binary interface (ABI) the compiler uses to create or call vector functions.

All files in an application that define or use vector functions must make identical use of -vecabi=cmdtarget (and /Qvecabi:cmdtarget); otherwise, link-time or runtime errors may occur. For all files where -vecabi=cmdtarget (or /Qvecabi:cmdtarget) is specified, options [Q]x and/or [Q]ax must have identical values.

Similarly, link errors may occur if you attempt to link code compiled with -vecabi=cmdtarget (or /Qvecabi:cmdtarget) with libraries or other program modules/routines that contain vector function definitions that have not or cannot be recompiled.

When cmdtarget is specified, the additional vector function versions are created by copying each vector specification and changing target processor in the copy. The number of vector functions is determined by the settings specified in options [Q]x and/or [Q]ax.

For example, suppose we have the following function declaration:

#pragma omp declare simd (ompx_processor(core_2_duo_sse4_1)) int foo(int a);

and the following options are specified: -axAVX, CORE-AVX2.

The following table shows the different results for the above declaration and option specifications when setting gcc or setting cmdtarget is used:

gcc

cmdtarget

A vector version is created for each of the following targets:

  • Intel® SSE2

  • Intel® AVX

  • Intel® AVX2

  • Intel® AVX512

These variants are always created independently of target options.

A vector version is created for each of the following targets:

  • Intel® SSE2 (default because no -x option is used)

  • Intel® SSE4.1 (by vector function specification)

  • Intel® AVX2 (by the ax option value)

NOTE:

To avoid possible link-time and runtime errors, use identical [Q]vecabi settings when compiling all files in an application that define or use vector functions, including libraries. If setting cmdtarget is specified, options [Q]x and/or [Q]ax must have identical values.

For more information about the Intel®-compatible vector functions ABI, see the downloadable PDF titled Vector Function Application Binary Interface.

For more information about the GCC vector functions ABI, see the item Libmvec - vector math library document in the GLIBC wiki at sourceware.org.

Product and Performance Information

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.

Notice revision #20201201

IDE Equivalent

None

Alternate Options

None