Intel® C++ Compiler 16.0 User and Reference Guide

qoffload-attribute-target, Qoffload-attribute-target

Causes the compiler to flag file-scope functions and data objects in the source file with the offload attribute target(mic) or target(gfx). This option only applies to Intel® MIC Architecture and Intel® Graphics Technology. Option -qoffload-attribute-target is the replacement option for -offload-attribute-target, which is deprecated.

Architecture Restrictions

Only available on Intel® 64 architecture targeting Intel® MIC Architecture, on IA-32 architecture targeting Intel® Graphics Technology, or on Intel® 64 architecture targeting Intel® Graphics Technology

Syntax

Linux:

-qoffload-attribute-target=target-name

OS X:

None

Windows:

/Qoffload-attribute-target:target-name

Arguments

target-name

Is a specific target or application. The supported values for this argument are:

  • mic for Intel® MIC Architecture

  • gfx for Intel® Graphics Technology

Default

OFF

The compiler does not flag file-scope functions and data objects in the source file with the offload attribute target(mic) or target(gfx).

Description

This option causes the compiler to flag file-scope functions and data objects in the source file with the offload attribute target(mic) or target(gfx).

This option is similar to using the pragma offload_attribute target(mic) to set the attribute target(mic), or offload_attribute target(gfx) to set the attribute target(gfx), for all functions and data objects in the file scope.

Target declspecs/attributes on individual declarations take precedence over any offload_attribute pragma in effect, and declspecs, attributes, and pragmas all take precedence over this option.

IDE Equivalent

None

Alternate Options

None

Example

Consider the following individual source files:

subr.c
======
void subr()
{
}

main.c
======
int main()
{
  #pragma offload target(mic)
  subr();
}

If you compile them as follows, it will properly place an instance of subr in the host (CPU) and target binaries:

icc -c -qoffload-attribute-target=mic subr.c
icc subr.o main.c

See Also