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

ID 767253
Date 3/22/2024
Public
Document Table of Contents

Attributes

Attributes are a way to provide additional information to the compiler. The C2x attribute syntax is consistent with the C++11 standard.

Use Attributes

The compiler supports three ways to add attributes to your program:

  • GNU Syntax
    __attribute__((attribute_name(arguments)))
  • Microsoft Syntax
    __declspec(attribute_name(argument))
  • C++11 Standardized Attribute Syntax (part of the C++11 language standard)
    [[attribute_name(arguments)]]
    [[attribute-namespace :: attribute_name(arguments)]]

Some attributes are available for both Intel® microprocessors and non-Intel microprocessors but they may perform additional optimizations for Intel® microprocessors than they perform for non-Intel microprocessors. Refer to the individual attribute name for a detailed description.