Nvidia PTX Attributes (Using the GNU Compiler Collection (GCC))

#### 6.4.2.21 Nvidia PTX Attributes ¶

These attributes are supported by the Nvidia PTX back end:

`kernel` ¶

  This attribute applies to functions.

  It indicates that the corresponding function should be compiled as a kernel function, which can be invoked from the host via the CUDA RT library. By default functions are only callable only from other PTX functions.

  Kernel functions must have `void` return type.

`shared` ¶

  This attribute applies to variables.

  Use it to place a variable in the `.shared` memory space. This memory space is private to each cooperative thread array; only threads within one thread block refer to the same instance of the variable. The runtime does not initialize variables in this memory space.