logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Authors

TheKhronosGroup

Description

       This section describes the syntax with which __attribute__ may be used, and the constructs to which
       attribute specifiers bind.

       An attribute specifier is of the form __attribute__((attribute-list)).

       This syntax is taken directly from GCC but unlike GCC, which allows attributes to be applied only to
       functions, types, and variables, OpenCL attributes can be associated with:

       •   attributes-types(3clc)

       •   functionQualifiers(3clc)

       •   attributes-variables(3clc)

       •   attributes-blocksAndControlFlow(3clc)

       •   attributes-blocksAndControlFlow(3clc)

       In general, the rules for how an attribute binds for a given context are non-trivial and the reader is
       pointed to GCC's documentation and Maurer and Wong's paper (See the "References" section in the OpenCLspecification[1] for details.)

Name

       __attribute__

       __attribute__ ((attribute-list))

       attribute-list: attribute<sub>opt</sub> attribute-list,
       attribute<sub>opt</sub>

       attribute: attribute-token
       attribute-argument-clause<sub>opt</sub>

       attribute-token: identifier

       attribute-argument-clause: ( attribute-argument-list )

       attribute-argument-list: attribute-argument
       attribute-argument-list, attribute-argument

       attribute-argument: assignment-expression

Notes

        1. OpenCL specification
           page 355, section 11 - References (to Wong paper)

        2. OpenCL Specification
           page 236, section 6.11. - Attribute Qualifiers

The Khronos Group                                  11/18/2024                                __ATTRIBUTE__(3clc)

See Also

attributes-types(3clc), attributes-variables(3clc), attributes-blocksAndControlFlow(3clc),
       functionQualifiers(3clc)

Specification

OpenCLSpecification[2]

See Also